-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
30 lines (30 loc) · 1002 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>PacMan fiddle</title>
<script type='text/javascript' src='pacman.js'></script>
<link rel="stylesheet" type="text/css" href="pacman.css">
<script type="text/javascript">//<![CDATA[
var spritesheet = new Image();
spritesheet.src = "http://lynxysscz.github.io/PacMan.js/img/full-sprites_big.png";
spritesheet.onload = function() {
// Prepare the game area
var gameArea = document.getElementById("game-area");
gameArea.style.visibility = "hidden";
// Pass it to the engine
var PacMan = new Game.Engine(16, 80, 40, gameArea);
// Init engine with specific spritesheet
PacMan.init(new Array(Game.Level01) ,spritesheet);
// Start the game itself, this call unlocks the handbrake on the engine and binds input
PacMan.start();
// Show the completed game area
gameArea.style.visibility = "visible";
}
//]]>
</script>
</head>
<body>
<div id="game-area"></div>
</body>
</html>