Game state is now preserved in a file
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <raylib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define BOARD_WIDTH 4
|
||||
#define BOARD_HEIGHT 4
|
||||
@@ -9,10 +10,10 @@ 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];
|
||||
unsigned int board[BOARD_HEIGHT][BOARD_WIDTH];
|
||||
game_status_t status;
|
||||
int score;
|
||||
int moves_made;
|
||||
unsigned int score;
|
||||
unsigned int moves_made;
|
||||
} GameState_t;
|
||||
|
||||
void move(GameState_t *state, move_direction_t direction);
|
||||
|
||||
Reference in New Issue
Block a user