From 0a96dc5bd5d13b250e11e80d3ed260b74b85c548 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 29 Oct 2019 16:52:55 -0400 Subject: change up sounds and add lock_event --- lib/cetris.c | 3 ++- lib/cetris.h | 5 ++++- lib/rules.c | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'lib') 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 #include @@ -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, -- cgit v1.2.3-101-g0448