Files
2048/game.h
T
SnailMan eb8834324e Split the game core and ui code into their respective modules
Game state struct ends the variable mess in main.c
2026-03-06 15:24:33 +01:00

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);