-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
32 lines (30 loc) · 1.37 KB
/
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
31
32
<html>
<head>
<title>Awesome Asteroids</title>
<script src="lib/movingObject.js"></script>
<script src="lib/utils.js"></script>
<script src="lib/asteroid.js"></script>
<script src="lib/game.js"></script>
<script src="lib/gameView.js"></script>
<script src="lib/ship.js"></script>
<script src="lib/bullet.js"></script>
<script src="lib/keymaster.js"></script>
</head>
<body style="background: black">
<section style="position: relative; height: 100%; width: 100%;text-align: center;">
<canvas id="game-canvas" style="height:80%;width:80%;margin:auto;display:block;"></canvas>
<p style="color:white; display:inline-block;">Help Shuma-Gorath repel interdimensional energy parasites from his domain!</p>
<br>
<p style="color:white; display:inline-block;">Press left/right arrow keys to rotate. Up/down to move. Space to fire</p>
</section>
<script>
var canvasEl = document.getElementById("game-canvas");
canvasEl.height = Asteroids.Game.DIM_Y;
canvasEl.width = Asteroids.Game.DIM_X;
var ctx = canvasEl.getContext("2d");
var game = new Asteroids.Game(); //game is defined in the script, make sure no undefined things run yet!
var gameView = new Asteroids.GameView(game, ctx); //these are delegated to the window
gameView.start(); //will need to be reset
</script>
</body>
</html>