diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/cetris.c | 3 | ||||
| -rw-r--r-- | lib/cetris.h | 5 | ||||
| -rw-r--r-- | lib/rules.c | 3 |
3 files changed, 9 insertions, 2 deletions
diff --git a/lib/cetris.c b/lib/cetris.c index 3bff1f1..ffffd2a 100644 --- a/lib/cetris.c +++ b/lib/cetris.c @@ -212,7 +212,6 @@ static void next_piece(cetris_game *g) { } static void lock_current(cetris_game *g) { - g->current.locked = true; for (int y = 0; y < 4; y++) { for (int x = 0; x < 4; x++) { if ((g->current.m[y]>>(3 - x))&1) { @@ -226,6 +225,8 @@ static void lock_current(cetris_game *g) { g->highest_line = g->current.pos.y; } + g->current.locked = true; + g->lock_event = true; update_board(g); } diff --git a/lib/cetris.h b/lib/cetris.h index 3a71999..22723b0 100644 --- a/lib/cetris.h +++ b/lib/cetris.h @@ -141,9 +141,12 @@ struct cetris_game { uint8_t level; uint8_t lines; uint8_t line_combo; - bool line_event; bool game_over; + // events + bool line_event; + bool lock_event; + // scoring flags bool tspin; bool mini_tspin; diff --git a/lib/rules.c b/lib/rules.c index ce06d83..a905b79 100644 --- a/lib/rules.c +++ b/lib/rules.c @@ -1,3 +1,5 @@ +// collection of win conditions, rulesets, and gameplay settings from various tetris games + #include <cetris.h> #include <rules.h> @@ -15,6 +17,7 @@ bool marathon(cetris_game *g) { return false; } +// https://tetris.fandom.com/wiki/Tetris_DS cetris_config tetris_ds_config = { .board_x = 10, .board_y = 43, |