This commit is contained in:
2019-11-20 19:10:35 +01:00
commit b8cdce07af
6 changed files with 2010 additions and 0 deletions

16
mttt.nim Normal file
View File

@@ -0,0 +1,16 @@
import dom, jsconsole, sugar
import src/game
const
canvasId = "game_canvas"
proc onTick(game: Game, time: float) =
discard window.requestAnimationFrame((time: float) => onTick(game, time))
game.nextFrame(time)
proc onLoad(event: Event) {.exportc.} =
var game = newGame(canvasId, window.innerWidth, window.innerHeight)
onTick(game, 60)
window.onload = onLoad