Game state is now preserved in a file

This commit is contained in:
2026-03-06 19:03:55 +01:00
parent 4c21d309e9
commit 016b1eafb5
5 changed files with 27 additions and 6 deletions
+4 -3
View File
@@ -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);