Initial
This commit is contained in:
16
mttt.nim
Normal file
16
mttt.nim
Normal 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
|
||||
Reference in New Issue
Block a user