summaryrefslogtreecommitdiff
path: root/sirtet.c
diff options
context:
space:
mode:
Diffstat (limited to 'sirtet.c')
-rw-r--r--sirtet.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sirtet.c b/sirtet.c
index 9e9d0b2..3dc76f3 100644
--- a/sirtet.c
+++ b/sirtet.c
@@ -95,6 +95,7 @@ void sirtet() {
clear();
printrect(0, 0, H, W);
printmap(map, 1, 1, H, W);
+ printhelp(3, 2 * W + 8);
// display game stats
mvprintw(1, 2 * W + 8, "Points: %d", points);
@@ -133,15 +134,23 @@ void sirtet() {
break;
// arrow keys: move piece on map
case KEY_LEFT:
+ case 'a':
+ case 'h':
if (col > 0) col--;
break;
case KEY_RIGHT:
+ case 'd':
+ case 'l':
if (col + pc->w < W) col++;
break;
case KEY_UP:
+ case 'w':
+ case 'k':
if (row > 0) row--;
break;
case KEY_DOWN:
+ case 's':
+ case 'j':
if (row + pc->h < H) row++;
break;
// [ and ]: switch pieces
@@ -165,6 +174,11 @@ void sirtet() {
}
}
break;
+ // q: quit
+ case 'q':
+ confirmed = true;
+ over = true;
+ break;
}
}
@@ -203,8 +217,8 @@ void sirtet() {
}
if (!has_placeable) {
// game over
- mvprintw(3, 2 * W + 8, "Game over");
- mvprintw(4, 2 * W + 8, "Press any key to exit");
+ mvprintw(7, 2 * W + 8, "Game over");
+ mvprintw(8, 2 * W + 8, "Press any key to exit");
refresh();
while (getch() == 0);
over = true;