diff --git a/island.ts b/island.ts index d7a3b95..3bb9c40 100644 --- a/island.ts +++ b/island.ts @@ -195,6 +195,13 @@ function renderIslands(islands: IslandGrid, cx: CanvasRenderingContext2D) { } export function IslandApplet() { + // STATE + + let timerId: number; + let islands = new IslandGrid(WIDTH, HEIGHT, DEFAULT_SEED); + + // UI + const [canvas, cx] = canvas2d({ width: WIDTH * BLOWUP, height: HEIGHT * BLOWUP, @@ -203,14 +210,6 @@ export function IslandApplet() { const seedInput = h("input", { type: "number", valueAsNumber: DEFAULT_SEED }); const seedLabel = h("label", {}, "Seed:", seedInput); - - // STATE - - let timerId: number; - let islands = new IslandGrid(WIDTH, HEIGHT, DEFAULT_SEED); - - // CONTROLS - const generateButton = h( "button", {