mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 05:55:46 +01:00
store selected shape id in game data
This commit is contained in:
@@ -3,16 +3,25 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "../window/colour.h"
|
#include "../window/colour.h"
|
||||||
|
#include "tetromino/shapes.h"
|
||||||
|
|
||||||
// stores the data used in the game
|
// stores the data used in the game
|
||||||
#define COLUMNS ((uint8_t)16)
|
#define COLUMNS ((uint8_t)16)
|
||||||
#define ROWS ((uint8_t)(COLUMNS * 2))
|
#define ROWS ((uint8_t)(COLUMNS * 2))
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
ShapeId id;
|
||||||
|
uint8_t x;
|
||||||
|
uint8_t y;
|
||||||
|
} SelectedShape;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Colour columns[COLUMNS];
|
Colour columns[COLUMNS];
|
||||||
} Row;
|
} Row;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
SelectedShape selected;
|
||||||
Row row[ROWS];
|
Row row[ROWS];
|
||||||
} GameData;
|
} GameData;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user