mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 14:05:45 +01:00
rework random shape selection
This commit is contained in:
@@ -9,22 +9,18 @@
|
||||
#define COLUMNS ((int8_t)10)
|
||||
#define ROWS ((int8_t)(COLUMNS * 2))
|
||||
|
||||
typedef struct {
|
||||
ShapeId id;
|
||||
int8_t x;
|
||||
int8_t y;
|
||||
} SelectedShape;
|
||||
|
||||
typedef const Colour* CRow;
|
||||
typedef Colour* Row;
|
||||
|
||||
typedef struct {
|
||||
Row rows[ROWS];
|
||||
SelectedShape selected;
|
||||
ShapeId next_shape;
|
||||
ShapeId nxt[7]; // the order of the shape ids that they should appear in
|
||||
uint8_t curr_idx; // current shape index
|
||||
int8_t sel_x; // selected shape x position
|
||||
int8_t sel_y; // selected shape y position
|
||||
} GameData;
|
||||
|
||||
void set_next_shape(GameData* game_data);
|
||||
void next_shape(GameData* game_data);
|
||||
void game_init(GameData* game_data); // initializes the game
|
||||
void game_update(GameData* game_data, const uint8_t* keys); // updates the game's state
|
||||
void game_free(GameData* game_data); // free all data stored with the game
|
||||
|
||||
Reference in New Issue
Block a user