eb8834324e
Game state struct ends the variable mess in main.c
20 lines
407 B
C
20 lines
407 B
C
#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);
|