Skip to content
This repository was archived by the owner on Sep 11, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/frontend/app.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import Game from './utilities/Game.js';
import Player from './utilities/Player.js';

const canvas = document.querySelector('canvas');
const foregroundCanvas = document.getElementById('foreground-layer');
const playerCanvas = document.getElementById('player-layer');

const movementKeys = ['w', 'a', 's', 'd', 'ArrowUp', 'ArrowLeft', 'ArrowDown', 'ArrowRight'];

const game = new Game(canvas);
const game = new Game(foregroundCanvas, playerCanvas);
const player = new Player();

await game.loadGameBoard('./maps/dev.json'); // load the gameboard/map from json file
await game.loadGameBoard('./assets/map.json'); // load the gameboard/map from json file

game.addPlayer(player);
game.start();
Expand Down
Loading