-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
37 lines (31 loc) · 947 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
31
32
33
34
35
36
37
<!doctype html>
<head>
<style>
html, body {margin: 0; padding: 0; overflow: hidden;}
#canvas {background: #000;}
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<script src="libs/easeljs-0.8.2.min.js"></script>
<script src="utils/toRadians.js"></script>
<script src="utils/getDistance.js"></script>
<script src="utils/getRandomNumberInRange.js"></script>
<script src="Game.js"></script>
<script src="Asteroid.js"></script>
<script src="Ship.js"></script>
<script src="Laser.js"></script>
<script>
window.onload = () => {
window.addEventListener('resize', onResize);
onResize();
const canvas = document.getElementById('canvas');
const stage = new createjs.Stage(canvas);
stage.addChild(new Game());
};
function onResize() {
canvas.setAttribute('width', window.innerWidth);
canvas.setAttribute('height', window.innerHeight);
}
</script>
</body>