From 7064baa135947cb0321db111ad510ba832966d68 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Sun, 6 Apr 2025 18:53:05 +0100 Subject: only allow placing stuff available in the level --- src/types.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/types.c') diff --git a/src/types.c b/src/types.c index fdb9aa0..b2f1ee6 100644 --- a/src/types.c +++ b/src/types.c @@ -101,19 +101,20 @@ typedef struct { } Button; typedef struct { - int grid[GRIDWIDTH * GRIDHEIGHT]; + char grid[GRIDWIDTH * GRIDHEIGHT]; int goalx, goaly; - int placeableCells[MAX_PLACEABLE_CELLS]; // Color + char placeableCells[MAX_PLACEABLE_CELLS]; // Color } Level; typedef struct { uint64_t lastTick; char playing; - int grid[GRIDWIDTH * GRIDHEIGHT]; + char levelComplete; + char grid[GRIDWIDTH * GRIDHEIGHT]; int goalx, goaly; ButtonState buttonStates[N_BUTTONS]; int currentLevel; - int placedCells[MAX_PLACEABLE_CELLS]; // indices into Level placeableCells + char placeableCells[MAX_PLACEABLE_CELLS]; } State; // Mirror these in src/index.html.in -- cgit v1.2.3