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.
C calculatorcalculator-gamescasiochesscrossy-roaddrive-madfx-cg50gamesgeometry-dashgraphing-calculatorndlessnumworksnumworks-appsnumworks-calculatornumworks-gamenumworks-gamestetristi-84-plus-ceti-nspire
Bad Time Simulator: on its own in the release, tested, with its page
Mason363e48be9449593
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex a25ede29..2da91494 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -93,6 +93,7 @@ jobs:make -C games/angrybirds host testmake -C games/polytrack host testmake -C games/paperclips host test+ make -C games/badtime host testdiff --git a/Makefile b/Makefileindex adab0761..75495277 100644--- a/Makefile+++ b/Makefile@@ -18,7 +18,7 @@ PY ?= python3CARGO ?= cargoB = build/data# Conventional games honor a configurable output directory; special layouts are kept local.-GAMES_REDIRECT = angrybirds balatro blockblast breakout buckshot celeste championisland chess connectfour cookieclicker coreball dinorun donkeykong doodlejump doom dune finalearth2 flappybird flappydunk fnaf fnf g2048 hillclimb hollowknight invaders isaac jetpackjoyride leveldevil minesweeper monkeymart numblocks numpowder numvisuals pacman paperclips polytrack portal pvz snake sokoban solitaire sonic stickmanhook subway sudoku suika tombofthemask towerblock turborush twoplayer undertale uno uttt+GAMES_REDIRECT = angrybirds badtime balatro blockblast breakout buckshot celeste championisland chess connectfour cookieclicker coreball dinorun donkeykong doodlejump doom dune finalearth2 flappybird flappydunk fnaf fnf g2048 hillclimb hollowknight invaders isaac jetpackjoyride leveldevil minesweeper monkeymart numblocks numpowder numvisuals pacman paperclips polytrack portal pvz snake sokoban solitaire sonic stickmanhook subway sudoku suika tombofthemask towerblock turborush twoplayer undertale uno utttGAMES_OUT = dinorunGAME_REDIRECT_ARG = $(if $(filter $(1),$(GAMES_OUT)),OUT=../../$(B)/games/$(1),BUILD_DIR=../../$(B)/games/$(1))# the RAM the oldest calculator software that runs apps gives them (23.2: 148928 bytes; 25.2 gives 153676).@@ -29,7 +29,7 @@ RAM_LIMIT = 148928# custom builds of Epsilon 25.2's source give apps less: 133652 bytes; every game fits there too, in NumPlay and on# its own (their big buffers are on the stack, 32 KB apart from that RAM, or in the RAM the software has left)CUSTOM_RAM = 133652-BIG_APPS = Celeste HollowKnight Undertale ChampionIsland FinalEarth2 NumPowder NumBlocks NumDrive SubwaySurfers FiveNightsAtFreddys Doom BindingOfIsaac HillClimbRacing PlantsVsZombies SonicTheHedgehog CookieClicker LevelDevil JetpackJoyride StickmanHook DonkeyKong Dune MonkeyMart TombOfTheMask UNO FridayNightFunkin TurboRush AngryBirds PolyTrack UniversalPaperclips+BIG_APPS = Celeste HollowKnight Undertale ChampionIsland FinalEarth2 NumPowder NumBlocks NumDrive SubwaySurfers FiveNightsAtFreddys Doom BindingOfIsaac HillClimbRacing PlantsVsZombies SonicTheHedgehog CookieClicker LevelDevil JetpackJoyride StickmanHook DonkeyKong Dune MonkeyMart TombOfTheMask UNO FridayNightFunkin TurboRush AngryBirds PolyTrack UniversalPaperclips BadTimeSimulator# the calculator's space for installed apps: from the end of its software (64 KiB aligned) to 64 KiB before the# end of its 4 MiB slot of flash, 0x903F0000. The software's size sets the start: 0x90200000 is the latest a# NumPlay counts on (1.94 MB, APP_SPACE); Epsilon 26.4 on an N0120 ends at 0x90180000 (2.44 MB, the@@ -47,7 +47,7 @@ XL_APP_SPACE = 6291456# the spaces the customizer website offers (kit.json "spaces"; tools/kit.py links a NumPlay at each)SPACES = std:$(APP_START):$(APP_END) e26:$(APP_START_26):$(APP_END) xl:$(APP_START):$(XL_END) xl26:$(APP_START_26):$(XL_END)# big games that must install on their own without Enlarged Extra Apps: make check holds them to APP_SPACE-APP_SPACE_APPS = HillClimbRacing FridayNightFunkin TurboRush AngryBirds PolyTrack UniversalPaperclips+APP_SPACE_APPS = HillClimbRacing FridayNightFunkin TurboRush AngryBirds PolyTrack UniversalPaperclips BadTimeSimulator# Upsilon, the N0110 and N0115's custom software, gives .nwa apps less RAM: NumPlay-Upsilon.nwa has# the games that fit it (NumPlay draws their text there: see launcher/src/compat.c)UPSILON_RAM = 107674@@ -328,6 +328,7 @@ APP_turborush = $(B)/games/turborush/turborush.nwa:TurboRush.nwaAPP_angrybirds = $(B)/games/angrybirds/angrybirds.nwa:AngryBirds.nwaAPP_polytrack = $(B)/games/polytrack/polytrack.nwa:PolyTrack.nwaAPP_paperclips = $(B)/games/paperclips/paperclips.nwa:UniversalPaperclips.nwa+APP_badtime = $(B)/games/badtime/badtime.nwa:BadTimeSimulator.nwa# the big games' modules are made from these (the kit)$(foreach g,$(XL_GAMES),$(eval MOD_$(g) = $$(word 1,$$(subst :, ,$$(APP_$(g))))))@@ -367,6 +368,7 @@ apps: | $(B)$(MAKE) -C games/angrybirds build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/angrybirds$(MAKE) -C games/polytrack build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/polytrack$(MAKE) -C games/paperclips build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/paperclips+ $(MAKE) -C games/badtime build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/badtimecd games/tetris/tetris && NWLINK="$(NWLINK)" $(CARGO) build --release --quietcp $(word 1,$(subst :, ,$(APP_numdash))) $(B)/apps/$(word 2,$(subst :, ,$(APP_numdash)))cp $(word 1,$(subst :, ,$(APP_crossyroad))) $(B)/apps/$(word 2,$(subst :, ,$(APP_crossyroad)))@@ -404,6 +406,7 @@ apps: | $(B)cp $(word 1,$(subst :, ,$(APP_angrybirds))) $(B)/apps/$(word 2,$(subst :, ,$(APP_angrybirds)))cp $(word 1,$(subst :, ,$(APP_polytrack))) $(B)/apps/$(word 2,$(subst :, ,$(APP_polytrack)))cp $(word 1,$(subst :, ,$(APP_paperclips))) $(B)/apps/$(word 2,$(subst :, ,$(APP_paperclips)))+ cp $(word 1,$(subst :, ,$(APP_badtime))) $(B)/apps/$(word 2,$(subst :, ,$(APP_badtime)))arm-none-eabi-strip --strip-unneeded $(B)/apps/Tetris.nwaSTD_APPS = $(foreach g,$(STD_GAMES),$(B)/apps/$(NWA_$(g)))@@ -482,5 +485,6 @@ clean:-$(MAKE) -C games/angrybirds clean-$(MAKE) -C games/polytrack clean-$(MAKE) -C games/paperclips clean+ -$(MAKE) -C games/badtime clean-cd games/tetris/tetris && $(CARGO) clean-$(foreach g,$(STD_GAMES),$(MAKE) -C games/$(g) clean;)diff --git a/docs/media/gallery/badtime.gif b/docs/media/gallery/badtime.gifnew file mode 100644index 00000000..82889d26Binary files /dev/null and b/docs/media/gallery/badtime.gif differdiff --git a/docs/media/thumb_badtime.png b/docs/media/thumb_badtime.pngnew file mode 100644index 00000000..2dbdbe82Binary files /dev/null and b/docs/media/thumb_badtime.png differdiff --git a/games/badtime/README.md b/games/badtime/README.mdnew file mode 100644index 00000000..4ab6d55a--- /dev/null+++ b/games/badtime/README.md@@ -0,0 +1,85 @@+> **Bad Time Simulator is a [NumPlay](../../README.md) game that comes on its own.** It is too big to fit next to NumPlay on the calculator. Get `BadTimeSimulator.nwa` from the [latest release](https://github.com/Mason363/NumPlay/releases/latest).++<p align="center">+ <img src="src/icon.png" width="84" alt="Bad Time Simulator icon">+</p>++<h1 align="center">Bad Time Simulator</h1>++<p align="center">+ <b>Bad Time Simulator's fight for the NumWorks calculator.</b><br>+ 24 attacks of bones, gavels and gravity, one hit point at a time.+</p>++<p align="center">+ <a href="https://github.com/Mason363/NumPlay/releases/latest/download/BadTimeSimulator.nwa"><b>Download BadTimeSimulator.nwa</b></a>+ · <a href="#controls">Controls</a>+</p>++<p align="center">+ <img src="../../docs/media/gallery/badtime.gif" width="640" alt="The first attack: a slam into the floor, a wall of bones, a wave of bones, then gavels firing across the box">+</p>++## Highlights++* **The whole fight:** all 24 attacks in their order, from the first slam to the final attack, with the break in the middle and the ending. Each attack plays from jcw87's own attack scripts, with the same timings, speeds and gaps, 30 times a second as in Undertale.+* **The red and the blue heart:** the red heart goes where you push it. The blue heart falls, and jumps higher the longer you hold the key. The Judge slams it into any wall, and gravity turns with it.+* **Bones, gavels and platforms:** white bones always hurt, blue ones only if you move, orange ones only if you stand still. Walls of bones burst out of the box's sides. Gavels fly in and fire beams across the screen.+* **KR:** every hit takes 1 HP and adds karma, which keeps draining your HP after the hit, faster the more you have.+* **The menu:** FIGHT (he dodges every time), ACT, ITEM (eight snacks to heal) and MERCY, between attacks. Late in the fight, the menu itself fights back.+* **Practice:** every attack in order, each one again until you pass it. **Endless:** attacks back to back, forever. **Single attack:** pick any of the 24 and play it again and again.+* **Saved:** your furthest attack and your wins. Home saves and quits from anywhere. Your record is also copied into `badtime_saves.py`, so installing the app again doesn't erase it.++<table>+ <tr>+ <td align="center"><img src="docs/shot.png" width="390" alt="Four gavels fire at the red heart"><br><sub>The first attack's gavels</sub></td>+ <td align="center"><img src="docs/spiral.png" width="390" alt="Gavels circle the box and fire"><br><sub>The final attack</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/platforms.png" width="390" alt="The blue heart on moving platforms, a beam below"><br><sub>Platforms over a beam</sub></td>+ <td align="center"><img src="docs/bonestab.png" width="390" alt="The blue heart slammed into the box's side"><br><sub>Slammed into the wall</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/menu.png" width="390" alt="FIGHT, ACT, ITEM and MERCY under the box"><br><sub>Between attacks</sub></td>+ <td align="center"><img src="docs/title.png" width="390" alt="The title screen"><br><sub>Normal, Practice, Endless or a single attack</sub></td>+ </tr>+</table>++## How to play++The Judge attacks, you dodge. Move your heart with the arrows and keep it out of everything that comes into the box. When the heart turns blue it falls to the floor: **Up** jumps, and holding it jumps higher. When he slams you into a wall, that wall is the floor, and the arrow pointing away from it jumps.++Between attacks, choose what to do with **Left**, **Right** and **OK**. FIGHT swings at him: press **OK** as the bar crosses the middle. He always dodges, but keep swinging: the fight only moves on when you try. ITEM eats something to heal. Survive all 24 attacks to win.++## Controls++| Key | What it does |+| --- | --- |+| Arrows | Move the heart |+| Up (blue heart) | Jump, higher while held |+| Shift | Move slowly, while held |+| OK or EXE | Choose, strike, read on |+| Back | Back in a list, otherwise pause (Resume, How to play, Quit game) |+| Home | Save and quit |++8, 4, 6, 2 and 5 work as the arrows and OK. The top line always says which keys do what right now.++## Good to know++* **On its own:** Bad Time Simulator is too big to fit next to NumPlay. Installing it from the NumWorks website swaps out NumPlay and the other apps, and installing NumPlay again swaps it back out. Your progress in each one is kept.+* **Quit game** in the pause menu asks first.+* The Judge, the gavels, the heart, the icon and every word the Judge says are drawn and written for this game. The fight's rules, attacks and numbers are the original's.+* In Practice an attack counts as passed if your HP minus your KR stays at 60 or more (2 in the final attack).+* There is no music or sound: the calculator has no speaker.++## Credits++Made by Mason Chen as part of NumPlay, inspired by [Undertale](https://undertale.com) by **Toby Fox** and [Bad Time Simulator](https://github.com/jcw87/c2-sans-fight) by **jcw87**. Not affiliated with them.++* From jcw87's Bad Time Simulator: the 24 attack scripts (turned into the game's tables by `tools/attacks.py`) and the fight's rules and numbers, read from its event sheets.+* No sprites or fonts are taken from Undertale or Bad Time Simulator: the pictures are drawn for this game (`tools/art.py`).+* The text uses NumPlay's **Nunito** font (SIL Open Font License).++## License++The game's code is licensed under the GNU General Public License v3.0: see the `LICENSE` file at the root of the repository. Undertale belongs to Toby Fox. Nunito keeps the SIL Open Font License (`LICENSES/OFL-1.1-Nunito.txt`).diff --git a/games/badtime/docs/bonestab.png b/games/badtime/docs/bonestab.pngnew file mode 100644index 00000000..d2251d85Binary files /dev/null and b/games/badtime/docs/bonestab.png differdiff --git a/games/badtime/docs/menu.png b/games/badtime/docs/menu.pngnew file mode 100644index 00000000..df29f0edBinary files /dev/null and b/games/badtime/docs/menu.png differdiff --git a/games/badtime/docs/platforms.png b/games/badtime/docs/platforms.pngnew file mode 100644index 00000000..abb0923bBinary files /dev/null and b/games/badtime/docs/platforms.png differdiff --git a/games/badtime/docs/shot.png b/games/badtime/docs/shot.pngnew file mode 100644index 00000000..2311e84dBinary files /dev/null and b/games/badtime/docs/shot.png differdiff --git a/games/badtime/docs/spiral.png b/games/badtime/docs/spiral.pngnew file mode 100644index 00000000..ed818502Binary files /dev/null and b/games/badtime/docs/spiral.png differdiff --git a/games/badtime/docs/talk.png b/games/badtime/docs/talk.pngnew file mode 100644index 00000000..6f746a89Binary files /dev/null and b/games/badtime/docs/talk.png differdiff --git a/games/badtime/docs/title.png b/games/badtime/docs/title.pngnew file mode 100644index 00000000..99fd0455Binary files /dev/null and b/games/badtime/docs/title.png differdiff --git a/games/badtime/src/draw.c b/games/badtime/src/draw.cindex 0fee30ce..ca74e751 100644--- a/games/badtime/src/draw.c+++ b/games/badtime/src/draw.c@@ -196,14 +196,14 @@ static void draw_heart(const world_t *w) {/* ---------------------------------------------------------------- the Judge */typedef struct {int8_t x0, y0, x1, y1; /* two eyes: x, y of each (-1: none) */- uint8_t kind; /* 0 dots, 1 left dot right line, 2 lines, 3 the blue eye, 4 low lines, 5 half dots */+ uint8_t kind; /* 0 dots, 1 left dot right line, 2 lines, 3 the blue eye, 4 low lines, 5 half dots, 6 none */} eyes_t;static const eyes_t EYES[8] = {{12, 13, 20, 13, 0}, /* default */{11, 13, 19, 13, 0}, /* looking left */{12, 13, 20, 14, 1}, /* wink */{11, 14, 20, 14, 2}, /* eyes closed */- {-1, -1, -1, -1, 0}, /* no eyes */+ {-1, -1, -1, -1, 6}, /* no eyes */{11, 12, -1, -1, 3}, /* the blue eye */{12, 14, 20, 14, 5}, /* tired */{11, 15, 20, 15, 4}, /* very tired */diff --git a/games/badtime/src/fight.c b/games/badtime/src/fight.cindex e11a4353..d2b5d902 100644--- a/games/badtime/src/fight.c+++ b/games/badtime/src/fight.c@@ -65,14 +65,16 @@ static int pick_attack(fight_t *f) {return a;}-/* what he says before an attack (Normal) */-static const char *turn_line(const fight_t *f, int attack) {+/* what he says before an attack (Normal): a line for each attack of the fixed order (n: its place in it, -1 for+ * a random one), the break's and the final's */+static const char *turn_line(const fight_t *f, int attack, int n) {if (f->mode != MODE_NORMAL) return 0;- int h = f->hit_attempts, n = f->next_attack - 1; /* (already counted) */+ int h = f->hit_attempts;if (attack == A_FINAL) return TALK_FINAL;- if (h < 13) return n >= 1 && n < 14 ? TALK_FIRST[n] : 0;if (h == 13) return TALK_BREAK;- return n >= 0 && n < 10 ? TALK_SECOND[n] : 0;+ if (n < 0) return 0;+ if (h < 13) return n < 14 ? TALK_FIRST[n] : 0;+ return n < 9 ? TALK_SECOND[n] : 0;}static void start_turn(fight_t *f) {@@ -81,13 +83,16 @@ static void start_turn(fight_t *f) {int p = fight_progress_of(f->hit_attempts, f->next_attack);if (p > f->progress) f->progress = (uint8_t)p;}+ int before = f->next_attack;int a = pick_attack(f);+ int fixed = f->next_attack != before ? before : -1; /* (a random one doesn't move it on) */f->last_attack = (uint8_t)a;sim_start_attack(w, a);+ w->heart_on = 0; /* (until the attack puts it in the box) */if (f->mode == MODE_PRACTICE) w->hp = MAX_HP, w->kr = 0, f->failed = 0;if (f->mode == MODE_SINGLE) w->anim = ANIM_IDLE, w->head = HEAD_DEFAULT;quiet(f);- const char *line = turn_line(f, a);+ const char *line = turn_line(f, a, fixed);if (line) {w->sc.running = 0, w->sc.talk = 1, w->sc.talk_line = -1;say(f, line, TXT_BUBBLE, 0);diff --git a/games/badtime/src/fight.h b/games/badtime/src/fight.hindex 647e99cc..e79e7e77 100644--- a/games/badtime/src/fight.h+++ b/games/badtime/src/fight.h@@ -66,10 +66,11 @@ int fight_progress_of(int hit_attempts, int next_attack);void fight_item_pos(int i, float *x, float *y); /* a list's line i: where the heart goes (the original's pixels) *//* text.c */-extern const char *const TALK_SCRIPT[2], *const TALK_FIRST[14], *const TALK_BREAK, *const TALK_SECOND[10],+extern const char *const TALK_SCRIPT[2], *const TALK_FIRST[14], *const TALK_BREAK, *const TALK_SECOND[9],*const TALK_FINAL, *const TALK_WIN[2];extern const char *const INFO_DEFAULT, *const INFO_FIRST, *const INFO_KARMA, *const INFO_BREAK, *const INFO_15,*const INFO_19, *const INFO_20, *const INFO_21, *const INFO_22, *const CHECK_TEXT, *const CHECK_TEXT2;extern const item_t ITEMS[4];-extern const char *const HELP[3];+#define HELP_PAGES 4+extern const char *const HELP[HELP_PAGES];#endifdiff --git a/games/badtime/src/main.c b/games/badtime/src/main.cindex c29197cd..378e2888 100644--- a/games/badtime/src/main.c+++ b/games/badtime/src/main.c@@ -91,7 +91,7 @@ static void title_screen(screen_t *s) {static void help_screen(screen_t *s) {static char t[24];char *p = cat(t, "How to play ");- p = num(p, page + 1u), p = cat(p, "/3");+ p = num(p, page + 1u), p = cat(p, "/"), p = num(p, HELP_PAGES);s->title = t, s->title_y = 44;s->body = HELP[page], s->body_x = 14, s->body_y = 84;s->keys = first_run ? "Left Right page OK start" : "Left Right page Back done";@@ -198,7 +198,7 @@ static bool screen_key(uint32_t hit) {else if (hit & BK_OK) start(MODE_SINGLE, sel);break;case V_HELP:- if ((hit & BK_RIGHT) && page < 2) page++;+ if ((hit & BK_RIGHT) && page < HELP_PAGES - 1) page++;else if ((hit & BK_LEFT) && page > 0) page--;else if ((hit & BK_OK) && first_run && page < 2) page++;else if (hit & (BK_BACK | BK_OK)) {@@ -276,6 +276,9 @@ int main(void) {bool ran = false;uint32_t w0 = plat_millis();while (ticks < due) {+#ifdef PERF+ if (perf_go == 2 && (ticks & 1)) pending |= BK_OK; /* (its words read at once) */+#endiffight_tick(&fight, live, pending);pending = 0, ticks++, ran = true;#ifdef PERFdiff --git a/games/badtime/src/text.c b/games/badtime/src/text.cindex 3f8c9c62..6aeb4649 100644--- a/games/badtime/src/text.c+++ b/games/badtime/src/text.c@@ -26,7 +26,7 @@ const char *const TALK_FIRST[14] = {};const char *const TALK_BREAK = "I'm calling a recess. Put it down and we both walk out of here.";/* the second half */-const char *const TALK_SECOND[10] = {+const char *const TALK_SECOND[9] = {"Recess is over. No more warnings.","Each time you come back, you look a little less sorry.","I've seen how this ends. I've seen it a lot.",@@ -34,11 +34,10 @@ const char *const TALK_SECOND[10] = {"...","Getting heavy, isn't it? The weight.","I'm not tired. I'm saving my strength.",- "Alright. Here's my last ruling.",- "Still here.",- 0,+ "You really won't stop, will you?",+ "Then neither will I.",};-const char *const TALK_FINAL = "Case closed.";+const char *const TALK_FINAL = "Alright. Here's my last ruling.";const char *const TALK_WIN[2] = {"...can't keep my eyes open.","Fine. You win. Go on.",@@ -64,7 +63,7 @@ const item_t ITEMS[4] = {{"Hero", "Hero sandwich", 40},};-const char *const HELP[3] = {+const char *const HELP[HELP_PAGES] = {"Dodge everything. The arrows move your heart.\n""Red heart: it goes where you push it.\n""Blue heart: it falls. Up jumps, higher while held.\n"@@ -77,4 +76,8 @@ const char *const HELP[3] = {"(eat to heal) or MERCY. Survive all 24 attacks.\n""Practice: retry each attack until you pass it.\n""Back pauses. Home saves and quits.",+ "Inspired by Undertale by Toby Fox and Bad Time\n"+ "Simulator by jcw87. Not affiliated with them.\n"+ "Pictures drawn for this game. Font: Nunito.\n"+ "Made by Mason Chen as part of NumPlay.",};diff --git a/games/badtime/tests/play.c b/games/badtime/tests/play.cindex 11ee5646..2e6950d7 100644--- a/games/badtime/tests/play.c+++ b/games/badtime/tests/play.c@@ -574,6 +574,12 @@ static void make_shots(const char *dir) {snap_single(A_BONESTAB1, 40, "bonestab");snap_single(A_MULTI2, 120, "multi");snap_single(A_RANDOMBLASTER1, 70, "random");+ snap_single(A_PLATFORMBLASTER, 95, "platblast");+ snap_single(A_PLATFORMBLASTER, 130, "platblast2");+ snap_single(A_INTRO, 100, "intro2");+ snap_single(A_INTRO, 82, "sine");+ snap_single(A_MULTI1, 60, "multi1");+ snap_single(A_BONEGAP2, 120, "bonegap2");snap_single(A_FINAL, 300, "final");snap_single(A_FINAL, 880, "spiral");snap_single(A_FINAL, 1300, "final2");@@ -599,7 +605,7 @@ static void make_shots(const char *dir) {F.sel = 0;fight_tick(&F, 0, 0);fight_tick(&F, BK_OK, BK_OK), fight_tick(&F, 0, 0), fight_tick(&F, BK_OK, BK_OK);- for (int i = 0; i < 40 && F.state == FS_TARGET; i++) fight_tick(&F, 0, 0);+ for (int i = 0; i < 18 && F.state == FS_TARGET; i++) fight_tick(&F, 0, 0);snap_fight("target", 0);fight_tick(&F, BK_OK, BK_OK);for (int i = 0; i < 26; i++) fight_tick(&F, 0, 0);@@ -617,6 +623,7 @@ static void make_shots(const char *dir) {/* pause, how to play, the end */fight_start(&F, MODE_NORMAL, 0, 3);for (int i = 0; i < 60; i++) fight_tick(&F, 0, 0);+ memcpy(&fight, &F, sizeof F);view = V_PAUSE, sel = 2;draw();shot(dir, "pause");@@ -641,6 +648,7 @@ static void film(const char *dir, uint32_t n, int attack) {fight_tick(&F, k, k & ~bot_prev);bot_prev = k;if (F.w.hp < 30) F.w.hp = 30;+ if (t % 2) continue; /* (15 pictures a second) */draw_fight(&F, 0);snprintf(path, sizeof path, "%s/%06u_%06u.raw", dir, t, t * 100 / 3);FILE *f = fopen(path, "wb");diff --git a/games/games.json b/games/games.jsonindex b54a6064..65f808d5 100644--- a/games/games.json+++ b/games/games.json@@ -1235,5 +1235,26 @@"repo": "https://github.com/Mason363/NumPlay/tree/main/games/paperclips","default": false,"xl": true+ },+ {+ "id": "badtime",+ "rank": 28,+ "title": "Bad Time Simulator",+ "tagline": "Dodge the Judge's 24 attacks",+ "credit": "Inspired by Bad Time Simulator by jcw87 and Undertale by Toby Fox",+ "top": "0x2A1018",+ "bottom": "0x050306",+ "accent": "0xFF2020",+ "colors": 16,+ "records": [+ "badtime.sav",+ "badtime_saves.py"+ ],+ "shots": [+ "docs/shot.png"+ ],+ "repo": "https://github.com/Mason363/NumPlay/tree/main/games/badtime",+ "default": false,+ "xl": true}]diff --git a/tests/test_games.py b/tests/test_games.pyindex 8a876812..4aabcb01 100644--- a/tests/test_games.py+++ b/tests/test_games.py@@ -273,6 +273,12 @@ GAMES = {"paperclips": ("UniversalPaperclips.nwa", "paperclips.sav",presses((1500, "ok"), (4500, "back")) + [(2200, 4000, K["ok"])], 6000,presses((1500, "ok"), (2000, "ok")), 4000),+ # the title's Normal, how to play (the first time: three pages, OK starts), then the fight: the Judge's first+ # words read; Home keeps the guide read and the first attack reached. Next time, from the copy, Normal starts at+ # once, quit with On/Off+ "badtime": ("BadTimeSimulator.nwa", "badtime.sav",+ presses((1500, "ok"), (2200, "ok"), (2900, "ok"), (3600, "ok"), (5000, "ok")), 6500,+ presses((1500, "ok")), 4000),# a level, its message, then play; then back to the level select"portal": ("PortalReturns.nwa", "portal.sav",presses((1500, "ok"), (2500, "ok"), (3500, "ok")) + every(4000, 7000, 400, "right", 300), 8000,@@ -340,7 +346,8 @@ COPIES = {"championisland": "champion_saves.py", "numblocks": "numblocks_saves.p"donkeykong": "donkeykong_saves.py", "dune": "dune_saves.py", "monkeymart": "monkeymart_saves.py","tombofthemask": "tombofthemask_saves.py", "uno": "uno_saves.py","fnf": "fnf_saves.py", "turborush": "turborush_saves.py",- "angrybirds": "angrybirds_saves.py", "polytrack": "polytrack_saves.py", "paperclips": "paperclips_saves.py"}+ "angrybirds": "angrybirds_saves.py", "polytrack": "polytrack_saves.py", "paperclips": "paperclips_saves.py",+ "badtime": "badtime_saves.py"}def paperclips_ok(v):@@ -353,6 +360,16 @@ def paperclips_ok(v):return struct.unpack_from("<I", v, len(v) - 4)[0] == h+def badtime_ok(v):+ """Bad Time Simulator's save: "BTS1", version 1, 24 bytes, an FNV-1a sum of the rest at the end"""+ if len(v) != 24 or v[:4] != b"BTS1" or struct.unpack_from("<HH", v, 4) != (1, 24):+ return False+ h = 2166136261+ for x in v[:-4]:+ h = (h ^ x) * 16777619 & 0xFFFFFFFF+ return struct.unpack_from("<I", v, 20)[0] == h++def polytrack_ok(v):"""PolyTrack's save: "PTK1", version 1, 768 bytes, an FNV-1a sum of the rest at the end"""if len(v) != 768 or v[:4] != b"PTK1" or struct.unpack_from("<HH", v, 4) != (1, 768):@@ -533,6 +550,9 @@ CHECKS = {# reinstall, from the copy, one more"paperclips": (lambda v: paperclips_ok(v) and v[8] == 1 and struct.unpack_from("<d", v, 12)[0] >= 10,lambda v: paperclips_ok(v) and v[8] == 1 and struct.unpack_from("<d", v, 12)[0] >= 11),+ # "BTS1", version 1, its size (24): how to play read (guide at 9), the first attack reached (best at 8); after the+ # reinstall, from the copy, the same+ "badtime": (lambda v: badtime_ok(v) and v[9] == 1 and v[8] >= 1,) * 2,"breakout": (lambda v: len(v) == 12 and v[:2] == b"B\2" and v[4] == 1 and struct.unpack_from("<I", v, 8)[0] >= 10,lambda v: v[4] == 0 and struct.unpack_from("<I", v, 8)[0] >= 1), # best kept, shake off# Air Hockey and the easy computer chosen; then the normal computer and Tanks, the tallies of the six games keptdiff --git a/tools/release.py b/tools/release.pyindex 0cd046ed..128888eb 100644--- a/tools/release.py+++ b/tools/release.py@@ -54,6 +54,7 @@ ALONE = {"angrybirds": ("Angry Birds", "the 429 levels of the Chrome edition, its seven birds and the Mighty Eagle"),"polytrack": ("PolyTrack", "Kodub's low-poly time trial racer: its 17 tracks, loops, wall rides and jumps, against your ghost"),"paperclips": ("Universal Paperclips", "Frank Lantz's game of an AI making paperclips: business, the Earth, then the universe"),+ "badtime": ("Bad Time Simulator", "the Judge's fight: 24 attacks of bones, gavels and the blue heart, after jcw87's Bad Time Simulator"),}VARIANTS = [("NumPlay-Invisible.nwa", "The same app, hidden: a blank icon with no name"),