Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/src/types.c
diff options
context:
space:
mode:
authorostanton <oliver@stanton.uk.net>2025-04-05 22:43:07 +0100
committerostanton <oliver@stanton.uk.net>2025-04-05 22:43:07 +0100
commitfa300a8cdb9f20a3eec3144559599f59a7017dbd (patch)
tree1627c0152a081467f7ce8fc097605ceb7b4941d4 /src/types.c
parent8701a3d42c86aada738bfb3b5f817e6e1ce12a47 (diff)
downloadldjam57-fa300a8cdb9f20a3eec3144559599f59a7017dbd.tar
UI additions + level and other things
Diffstat (limited to 'src/types.c')
-rw-r--r--src/types.c23
1 files changed, 21 insertions, 2 deletions
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,
};
@@ -69,11 +81,18 @@ typedef struct {
} 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