Added win and loss conditions along with their respective screens
This commit is contained in:
@@ -5,15 +5,17 @@
|
||||
#define BOARD_HEIGHT 4
|
||||
#define STARTING_TILES 3
|
||||
|
||||
typedef enum { UP = 0, DOWN, LEFT, RIGHT } MOVE_DIRECTION;
|
||||
typedef enum { UP, DOWN, LEFT, RIGHT } move_direction_t;
|
||||
typedef enum { PLAYING, WON, LOST } game_status_t;
|
||||
|
||||
typedef struct{
|
||||
int board[BOARD_HEIGHT][BOARD_WIDTH];
|
||||
int score;
|
||||
int moves_made;
|
||||
typedef struct {
|
||||
int board[BOARD_HEIGHT][BOARD_WIDTH];
|
||||
game_status_t status;
|
||||
int score;
|
||||
int moves_made;
|
||||
} GameState_t;
|
||||
|
||||
|
||||
void move(GameState_t *state, MOVE_DIRECTION direction);
|
||||
void move(GameState_t *state, move_direction_t direction);
|
||||
void reset_board(GameState_t *state);
|
||||
bool spawn_tile(GameState_t *state);
|
||||
bool can_move(GameState_t *state);
|
||||
|
||||
Reference in New Issue
Block a user