add some options and loading logic

This commit is contained in:
2025-04-23 16:49:30 +02:00
parent aee02e3293
commit 7ed37afdc5
3 changed files with 60 additions and 0 deletions

View File

@@ -9,9 +9,12 @@
#include <string.h>
#include <time.h>
#include "../error.h"
#include "../window/audio.h"
#include "./tetromino/shapes.h"
#include "gametime.h"
#include "opts.h"
#include "paths.h"
#include "tetromino/placing.h"
// shuffle the array using a FisherYates shuffle
@@ -78,6 +81,8 @@ void game_init(gamedata* const dat) {
dat->curr_idx = -1; // set the current index to the max so it becomes zero after increasement
next_shape(dat); // select the next shape (shuffle should not be triggered)
shuffle(TETROMINO_COUNT, dat->nxt); // manually trigger a shuffle
load_opts();
}
// updates the gametime