summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2019-10-29 16:52:55 -0400
committerAndrew Opalach <andrew@akon.city> 2019-10-29 16:52:55 -0400
commit0a96dc5bd5d13b250e11e80d3ed260b74b85c548 (patch)
treedd6efb14631f77586300d269b24a3bc087c38d34 /lib
parentd61ff7c27060c1fe099042a4b88260db7e6df510 (diff)
downloadcetris-0a96dc5bd5d13b250e11e80d3ed260b74b85c548.tar.gz
cetris-0a96dc5bd5d13b250e11e80d3ed260b74b85c548.tar.bz2
cetris-0a96dc5bd5d13b250e11e80d3ed260b74b85c548.zip
change up sounds and add lock_event
Diffstat (limited to 'lib')
-rw-r--r--lib/cetris.c3
-rw-r--r--lib/cetris.h5
-rw-r--r--lib/rules.c3
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,