Split the game core and ui code into their respective modules

Game state struct ends the variable mess in main.c
This commit is contained in:
2026-03-06 15:24:33 +01:00
parent 2301914b02
commit eb8834324e
6 changed files with 287 additions and 255 deletions
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <raylib.h>
#define BOARD_WIDTH 4
#define BOARD_HEIGHT 4
#define STARTING_TILES 3
typedef enum { UP = 0, DOWN, LEFT, RIGHT } MOVE_DIRECTION;
typedef struct{
int board[BOARD_HEIGHT][BOARD_WIDTH];
int score;
int moves_made;
} GameState_t;
void move(GameState_t *state, MOVE_DIRECTION direction);
void reset_board(GameState_t *state);
bool spawn_tile(GameState_t *state);