fix: not initializing rand properly

This commit is contained in:
2025-01-29 16:02:59 +01:00
parent 9b3d745274
commit accfa715e5

View File

@@ -25,12 +25,12 @@ void game_init(GameData* const game_data) {
for (uint8_t i = 0; i < ROWS; i++) for (uint8_t i = 0; i < ROWS; i++)
game_data->row[i] = game_data->row_raw[i]; game_data->row[i] = game_data->row_raw[i];
// set a random seed using the system clock
srand(time(NULL));
set_next_shape(game_data); set_next_shape(game_data);
game_data->selected = (SelectedShape){game_data->next_shape, 0, 0}; game_data->selected = (SelectedShape){game_data->next_shape, 0, 0};
set_next_shape(game_data); set_next_shape(game_data);
// set a random seed using the system clock
srand(time(NULL));
} }
// called every time the game's state is updated // called every time the game's state is updated