Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

NumBlocks: jump on shift, sneak on alpha

Mason Chenc0bac625b82b
diff --git a/docs/play.md b/docs/play.md
index 9ca05709..50ca3283 100644
--- a/docs/play.md
+++ b/docs/play.md
@@ -106,8 +106,8 @@ Shooting yourself with a blank keeps your turn.
| --- | --- |
| **Arrows** | Look around |
| **,** / **π** / **√** / **x²** | Walk forward / left / back / right (like W, A, S, D) |
-| **xʸ** | Jump (twice in Creative: fly) |
-| **i** | Sneak |
+| **shift** | Jump (twice in Creative: fly) |
+| **alpha** | Sneak |
| **⌫** | Sprint (or press forward twice) |
| **Back** | Mine and attack (hold it to mine) |
| **OK** or **EXE** | Place a block, use, eat |
@@ -117,7 +117,7 @@ Shooting yourself with a blank keeps your turn.
| **Toolbox** | Pause |
| **Home** | Save and quit |
-The left thumb looks with the arrows, the right one walks. The first time you open NumBlocks it shows these keys, and Options, then Controls, shows them again. In NumBlocks, Back mines, so **Toolbox** pauses. In the inventory, the arrows move between slots, **OK** picks up or puts down a stack, **EXE** one item, and **shift** with **OK** sends a stack to the other side. To spread a stack, hold **OK** and move over the slots: it splits evenly when you let go (hold **EXE** instead to drop one in each). Your world saves as you play and when you quit.
+The left thumb looks with the arrows (shift and alpha are just under them), the right one walks. The first time you open NumBlocks it shows these keys, and Options, then Controls, shows them again. In NumBlocks, Back mines, so **Toolbox** pauses. In the inventory, the arrows move between slots, **OK** picks up or puts down a stack, **EXE** one item, and **shift** with **OK** sends a stack to the other side. To spread a stack, hold **OK** and move over the slots: it splits evenly when you let go (hold **EXE** instead to drop one in each). Your world saves as you play and when you quit.
<br clear="right">
diff --git a/games/numblocks/README.md b/games/numblocks/README.md
index f53e999a..9a998ec4 100644
--- a/games/numblocks/README.md
+++ b/games/numblocks/README.md
@@ -19,8 +19,8 @@ Mine, craft and survive on your NumWorks calculator, in a world like Minecraft 1
| --- | --- |
| Arrows | Look around |
| , π √ x² | Walk forward, left, back, right (like W, A, S, D) |
-| xʸ | Jump (twice in Creative: fly) |
-| i | Sneak |
+| shift | Jump (twice in Creative: fly) |
+| alpha | Sneak |
| ⌫ | Sprint (or press forward twice) |
| Back | Mine, attack |
| OK | Place, use, eat |
diff --git a/games/numblocks/src/gui.c b/games/numblocks/src/gui.c
index 991e193d..c2a1657c 100644
--- a/games/numblocks/src/gui.c
+++ b/games/numblocks/src/gui.c
@@ -897,7 +897,7 @@ static void press(int id) {
break;
case B_CONTROLS: gui_menu(GUI_CONTROLS); break;
case B_CONTROLS_DONE:
- if (!opt.keys_seen) opt.keys_seen = 1, save_options();
+ if (opt.keys_seen != KEY_SHEET) opt.keys_seen = KEY_SHEET, save_options();
gui_menu(controls_from);
break;
case B_BACK_GAME: gui = GUI_NONE; break;
@@ -1062,8 +1062,8 @@ static void key_sheet(void) {
static const char *const caps[3][6] = {{"shift", "alpha", "x,n,t", "var", "toolbox", "\3"},
{"e^x", "ln", "log", "i", ",", "x^y"},
{"sin", "cos", "tan", "\1", "\2", "x^2"}};
- static const char *const acts[3][6] = {{0, 0, "Drop", "Inventory", "Pause", "Sprint"},
- {0, 0, 0, "Sneak", "Forward", "Jump"},
+ static const char *const acts[3][6] = {{"Jump", "Sneak", "Drop", "Inventory", "Pause", "Sprint"},
+ {0, 0, 0, 0, "Forward", 0},
{0, 0, 0, "Left", "Backward", "Right"}};
for (int r = 0; r < 3; r++)
for (int c = 0; c < 6; c++)
diff --git a/games/numblocks/src/main.c b/games/numblocks/src/main.c
index 292d665d..1956c33e 100644
--- a/games/numblocks/src/main.c
+++ b/games/numblocks/src/main.c
@@ -77,7 +77,7 @@ void game_init(void) {
return;
}
title();
- if (!opt.keys_seen) gui_menu(GUI_CONTROLS); /* the first time: the keys */
+ if (opt.keys_seen != KEY_SHEET) gui_menu(GUI_CONTROLS); /* the first time, or new keys: the keys */
}
/* one frame: input, the ticks due, the picture; false once the player quits */
diff --git a/games/numblocks/src/nb.h b/games/numblocks/src/nb.h
index 496af0e7..891ad7ee 100644
--- a/games/numblocks/src/nb.h
+++ b/games/numblocks/src/nb.h
@@ -19,12 +19,12 @@
enum {
K_LEFT = 1 << 0, K_RIGHT = 1 << 1, K_UP = 1 << 2, K_DOWN = 1 << 3, /* arrows: look */
K_FWD = 1 << 4, K_BACKW = 1 << 5, K_STRAFE_L = 1 << 6, K_STRAFE_R = 1 << 7, /* comma, sqrt, pi, x^2 */
- K_JUMP = 1 << 8, K_USE = 1 << 9, K_ATTACK = 1 << 10, K_INV = 1 << 11, /* x^y, OK, Back, var */
- K_HOME = 1 << 12, K_SNEAK = 1 << 13, K_PAUSE = 1 << 14, K_DROP = 1 << 15, /* Home, i, Toolbox, x,n,t */
+ K_JUMP = 1 << 8, K_USE = 1 << 9, K_ATTACK = 1 << 10, K_INV = 1 << 11, /* shift, OK, Back, var */
+ K_HOME = 1 << 12, K_SNEAK = 1 << 13, K_PAUSE = 1 << 14, K_DROP = 1 << 15, /* Home, alpha, Toolbox, x,n,t */
K_SLOT1 = 1 << 16, /* K_SLOT1 << n: digit n + 1 */
K_SPRINT = 1 << 25, /* backspace (also deletes, typing a seed) */
K_EXE = 1 << 26, /* EXE alone (OK and EXE both give K_USE): right click in screens */
- K_SHIFT = 1 << 27, /* shift: shift click in screens */
+ K_SHIFT = 1 << 27, /* shift (also K_JUMP): shift click in screens */
K_BACK = 1 << 28, /* Back alone: closes screens */
K_OK = 1 << 29, /* OK alone */
K_ZERO = 1 << 30, /* 0 (typing a seed) */
@@ -250,8 +250,9 @@ typedef struct {
uint8_t fancy; /* graphics: 0 fast (solid leaves), 1 fancy */
uint8_t look; /* look speed, % */
uint8_t clouds, bobbing;
- uint8_t keys_seen; /* the key sheet has been shown (it opens the first time) */
+ uint8_t keys_seen; /* the key sheet's version last shown (it opens when the keys change) */
} Options;
+#define KEY_SHEET 2 /* (2: jump and sneak on shift and alpha) */
extern Options opt;
extern int64_t world_seed;
bool save_world(void);
diff --git a/games/numblocks/src/plat_eadk.c b/games/numblocks/src/plat_eadk.c
index 9d5e1647..0dfaf72f 100644
--- a/games/numblocks/src/plat_eadk.c
+++ b/games/numblocks/src/plat_eadk.c
@@ -2,10 +2,10 @@
*
* Keys, Minecraft's on the calculator's keyboard: the left thumb looks around
* with the arrows, the right one walks with the keys under OK and Back, laid
- * out like W, A, S and D: comma, pi, square root and x squared. Next to them,
- * x^y jumps, i sneaks and backspace sprints. OK uses and places, Back mines
- * and hits; 1-9 pick the hotbar slot; var opens the inventory; x,n,t drops;
- * Toolbox pauses; Home saves and quits. */
+ * out like W, A, S and D: comma, pi, square root and x squared; backspace
+ * sprints. Under the arrows, shift jumps and alpha sneaks. OK uses and places,
+ * Back mines and hits; 1-9 pick the hotbar slot; var opens the inventory;
+ * x,n,t drops; Toolbox pauses; Home saves and quits. */
#include <eadk.h>
#include "../../common/epsilon_app.h"
#include "../../common/epsilon_files.h"
@@ -24,7 +24,7 @@ uint32_t plat_keys(void) {
if (k & KEY(eadk_key_sqrt)) r |= K_BACKW;
if (k & KEY(eadk_key_pi)) r |= K_STRAFE_L;
if (k & KEY(eadk_key_square)) r |= K_STRAFE_R;
- if (k & KEY(eadk_key_power)) r |= K_JUMP;
+ if (k & KEY(eadk_key_shift)) r |= K_JUMP;
if (k & (KEY(eadk_key_ok) | KEY(eadk_key_exe))) r |= K_USE;
if (k & KEY(eadk_key_ok)) r |= K_OK;
if (k & KEY(eadk_key_exe)) r |= K_EXE;
@@ -35,7 +35,7 @@ uint32_t plat_keys(void) {
if (k & KEY(eadk_key_back)) r |= K_ATTACK;
if (k & KEY(eadk_key_var)) r |= K_INV;
if (k & (KEY(eadk_key_home) | KEY(eadk_key_on_off))) r |= K_HOME;
- if (k & KEY(eadk_key_imaginary)) r |= K_SNEAK;
+ if (k & KEY(eadk_key_alpha)) r |= K_SNEAK;
if (k & KEY(eadk_key_backspace)) r |= K_SPRINT;
if (k & KEY(eadk_key_toolbox)) r |= K_PAUSE;
if (k & KEY(eadk_key_xnt)) r |= K_DROP;