1
0
Fork 0
Browse Source

feat: make app query DOM for reference to canvas

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
combat-scorched-earth-from-outer-space
André Jaenisch 10 months ago
parent
commit
ef91dc696c
Signed by: ryuno-ki
GPG Key ID: 5A668E771F1ED854
  1. BIN
      js13kgames.zip
  2. 14
      src/js/app.js
  3. 5
      types/app.d.ts

BIN
js13kgames.zip

Binary file not shown.

14
src/js/app.js

@ -1,3 +1,15 @@
/**
* Entry point into the game.
*
* @returns {void}
*/
export function app () {
console.log('Hello world')
const game = document.getElementById('game')
if (!game) {
console.error('Could not start game!')
return
}
const context = /** @type {HTMLCanvasElement} */(game).getContext('2d')
console.log('Painting onto', context)
}

5
types/app.d.ts vendored

@ -1 +1,6 @@
/**
* Entry point into the game.
*
* @returns {void}
*/
export function app(): void;

Loading…
Cancel
Save