diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/cetris.c | 6 | ||||
| -rw-r--r-- | lib/cetris.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/cetris.c b/lib/cetris.c index ea53576..14c3a45 100644 --- a/lib/cetris.c +++ b/lib/cetris.c @@ -167,7 +167,7 @@ static void move_current(cetris_game *g, uint8_t move) { g->current.pos.x += basic_movements[move].x; int check = check_matrix(g, &g->current.m); - if (check > 0 && move != DOWN) g->move_event++; + if (check > 0) g->move_event++; if (check <= 0) { g->current.pos.y -= basic_movements[move].y; g->current.pos.x -= basic_movements[move].x; @@ -393,10 +393,11 @@ void update_board(cetris_game *g) { g->lines += lines_cleared; if (lines_cleared > 0) { + g->line_event = lines_cleared; if (lines_cleared == 4) { g->tetris_event++; } else { - g->line_event++; + g->combo_event++; } g->line_combo++; } @@ -531,7 +532,6 @@ CETRIS_EXPORT bool update_game_tick(cetris_game *g) { bool did_move = false; if (g->next_drop_tick && g->tick >= g->next_drop_tick) { - if (g->held_moves[DOWN]) g->move_event++; move_current(g, DOWN); g->next_drop_tick = 0; did_move = true; diff --git a/lib/cetris.h b/lib/cetris.h index 1c3d8f0..3db7d37 100644 --- a/lib/cetris.h +++ b/lib/cetris.h @@ -147,6 +147,7 @@ struct cetris_game { // events uint8_t move_event; uint8_t line_event; + uint8_t combo_event; uint8_t lock_event; uint8_t tetris_event; |