-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathzelda.js
28 lines (21 loc) · 806 Bytes
/
zelda.js
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
import Game from './src/game'
const menuCanvas = document.getElementById('menu-canvas');
const hudCtx = menuCanvas.getContext('2d');
menuCanvas.width = 768
menuCanvas.height = 696
const spriteCanvas = document.getElementById('sprite-canvas');
const spriteCtx = spriteCanvas.getContext('2d');
spriteCanvas.width = 768
spriteCanvas.height = 696
const mapCanvas = document.getElementById('map-canvas');
const boardCtx = mapCanvas.getContext('2d')
mapCanvas.width = 768
mapCanvas.height = 696
const collisionCanvas = document.getElementById('collision-canvas');
const collisionCtx = collisionCanvas.getContext('2d')
collisionCanvas.width = 768
collisionCanvas.height = 696
const game = new Game(hudCtx, spriteCtx, boardCtx, collisionCtx)
window.addEventListener('load',() => {
game.init();
}, false);