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:
@@ -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);
|
||||
Reference in New Issue
Block a user