From fa300a8cdb9f20a3eec3144559599f59a7017dbd Mon Sep 17 00:00:00 2001 From: ostanton Date: Sat, 5 Apr 2025 22:43:07 +0100 Subject: UI additions + level and other things --- src/types.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/types.c') diff --git a/src/types.c b/src/types.c index bfe0d7d..4c7a3cb 100644 --- a/src/types.c +++ b/src/types.c @@ -8,6 +8,7 @@ #define GRIDHEIGHT 16 #define TICK_LENGTH 200 #define GRID_OFFSET_X 64 +#define MAX_PLACEABLE_CELLS 16 typedef struct { unsigned char r, g, b, a; @@ -48,9 +49,20 @@ enum { }; enum { - BUTTON_CONTINUE, - BUTTON_RETRY, + IMAGE_NULL, + IMAGE_CONTINUE, + IMAGE_EXIT, + IMAGE_PAUSE, + IMAGE_PLAY, + IMAGE_RETRY, + N_IMAGES, +}; + +enum { BUTTON_BACK, + BUTTON_RETRY, + BUTTON_PLAY, + BUTTON_CONTINUE, N_BUTTONS, }; @@ -68,12 +80,19 @@ typedef struct { int x, y, w, h; } Button; +typedef struct { + int grid[GRIDWIDTH * GRIDHEIGHT]; + int goalx, goaly; + int placeableCells[MAX_PLACEABLE_CELLS]; // Color +} Level; + typedef struct { uint64_t lastTick; char playing; int grid[GRIDWIDTH * GRIDHEIGHT]; int goalx, goaly; ButtonState buttonStates[N_BUTTONS]; + int currentLevel; } State; // Mirror these in src/index.html.in -- cgit v1.2.3