fuzzyworld

herd / files / src / main.ts

main.ts

Blame: the commit that last changed each line · file · history

2eda845e 2026-05-17 Pavel Safronov1import { Canvas } from './game/Canvas.ts'
2import { GameLoop } from './game/GameLoop.ts'
3import { GameState } from './game/GameState.ts'
82e8c064 2026-05-18 Pavel Safronov4import { UI } from './game/UI.ts'
2eda845e 2026-05-17 Pavel Safronov5
6const canvas = new Canvas('game')
7const state = new GameState(canvas)
82e8c064 2026-05-18 Pavel Safronov8const ui = new UI(state, canvas.el)
9
2eda845e 2026-05-17 Pavel Safronov10const loop = new GameLoop(
11 (dt) => state.update(dt),
82e8c064 2026-05-18 Pavel Safronov12 (alpha) => { canvas.clear(); state.render(alpha); ui.update() },
2eda845e 2026-05-17 Pavel Safronov13)
14
15loop.start()