fuzzyworld

herd / files / src / main.ts

main.ts

416 B · history · blame

1import { Canvas } from './game/Canvas.ts'
2import { GameLoop } from './game/GameLoop.ts'
3import { GameState } from './game/GameState.ts'
4import { UI } from './game/UI.ts'
5
6const canvas = new Canvas('game')
7const state = new GameState(canvas)
8const ui = new UI(state, canvas.el)
9
10const loop = new GameLoop(
11 (dt) => state.update(dt),
12 (alpha) => { canvas.clear(); state.render(alpha); ui.update() },
13)
14
15loop.start()