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
Cat Ninja: on its own, with its README and How to play
Mason3634223656f839e
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex c651be51..20fef40f 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -102,6 +102,7 @@ jobs:make -C games/templerun host testmake -C games/fnaf2 host testmake -C games/famidash host test+ make -C games/catninja host testdiff --git a/Makefile b/Makefileindex f59a887b..7b137f68 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 badtime balatro blockblast breakout buckshot celeste championisland chess connectfour cookieclicker coreball dinorun donkeykong doodlejump doom dune famidash finalearth2 flappybird flappydunk fnaf fnaf2 fnaf3 fnaf4 fnf g2048 hillclimb hollowknight invaders isaac jetpackjoyride leveldevil mahjong meowdoku minesweeper monkeymart numblocks numpowder numvisuals pacman paperclips polytrack portal pvz rider snake snowrider sokoban solitaire sonic stickmanhook subway sudoku suika templerun tombofthemask towerblock turborush twoplayer undertale uno uttt+GAMES_REDIRECT = angrybirds badtime balatro blockblast breakout buckshot catninja celeste championisland chess connectfour cookieclicker coreball dinorun donkeykong doodlejump doom dune famidash finalearth2 flappybird flappydunk fnaf fnaf2 fnaf3 fnaf4 fnf g2048 hillclimb hollowknight invaders isaac jetpackjoyride leveldevil mahjong meowdoku minesweeper monkeymart numblocks numpowder numvisuals pacman paperclips polytrack portal pvz rider snake snowrider sokoban solitaire sonic stickmanhook subway sudoku suika templerun 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 BadTimeSimulator Mahjong Rider SnowRider3D TempleRun FiveNightsAtFreddys2 FiveNightsAtFreddys3 FiveNightsAtFreddys4 Famidash UniversalPaperclips-French+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 Mahjong Rider SnowRider3D TempleRun FiveNightsAtFreddys2 FiveNightsAtFreddys3 FiveNightsAtFreddys4 Famidash CatNinja UniversalPaperclips-French# 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 UniversalPaperclips-French BadTimeSimulator Mahjong SnowRider3D TempleRun Famidash+APP_SPACE_APPS = HillClimbRacing FridayNightFunkin TurboRush AngryBirds PolyTrack UniversalPaperclips UniversalPaperclips-French BadTimeSimulator Mahjong SnowRider3D TempleRun Famidash CatNinja# 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@@ -337,6 +337,7 @@ APP_fnaf2 = $(B)/games/fnaf2/fnaf2.nwa:FiveNightsAtFreddys2.nwaAPP_fnaf3 = $(B)/games/fnaf3/fnaf3.nwa:FiveNightsAtFreddys3.nwaAPP_fnaf4 = $(B)/games/fnaf4/fnaf4.nwa:FiveNightsAtFreddys4.nwaAPP_famidash = $(B)/games/famidash/famidash.nwa:Famidash.nwa+APP_catninja = $(B)/games/catninja/catninja.nwa:CatNinja.nwa# the big games' modules are made from these (the kit)$(foreach g,$(XL_GAMES),$(eval MOD_$(g) = $$(word 1,$$(subst :, ,$$(APP_$(g))))))@@ -385,6 +386,7 @@ apps: | $(B)$(MAKE) -C games/fnaf3 build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/fnaf3$(MAKE) -C games/fnaf4 build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/fnaf4$(MAKE) -C games/famidash build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/famidash+ $(MAKE) -C games/catninja build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/catninjacd 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)))@@ -432,6 +434,7 @@ apps: | $(B)cp $(word 1,$(subst :, ,$(APP_fnaf3))) $(B)/apps/$(word 2,$(subst :, ,$(APP_fnaf3)))cp $(word 1,$(subst :, ,$(APP_fnaf4))) $(B)/apps/$(word 2,$(subst :, ,$(APP_fnaf4)))cp $(word 1,$(subst :, ,$(APP_famidash))) $(B)/apps/$(word 2,$(subst :, ,$(APP_famidash)))+ cp $(word 1,$(subst :, ,$(APP_catninja))) $(B)/apps/$(word 2,$(subst :, ,$(APP_catninja)))arm-none-eabi-strip --strip-unneeded $(B)/apps/Tetris.nwaSTD_APPS = $(foreach g,$(STD_GAMES),$(B)/apps/$(NWA_$(g)))@@ -519,5 +522,6 @@ clean:-$(MAKE) -C games/fnaf3 clean-$(MAKE) -C games/fnaf4 clean-$(MAKE) -C games/famidash clean+ -$(MAKE) -C games/catninja clean-cd games/tetris/tetris && $(CARGO) clean-$(foreach g,$(STD_GAMES),$(MAKE) -C games/$(g) clean;)diff --git a/docs/play.md b/docs/play.mdindex 5a02d196..8665a8b5 100644--- a/docs/play.md+++ b/docs/play.md@@ -807,6 +807,26 @@ Your icon moves on by itself: jump over the spikes and reach the end. Hold the b<br clear="right">+## Cat Ninja++<img src="../games/catninja/docs/shot.png" width="320" align="right" alt="Cat Ninja: the cat wall jumps up a shaft in level 2">++Cat Ninja comes as its own app, `CatNinja.nwa`: install it on its own.++| Key | What it does |+| --- | --- |+| **Left / Right** (or 4 / 6) | Run |+| **Up**, **OK** or **EXE** (or 8) | Jump; again in the air: double jump; against a wall: wall jump |+| **Down** (or 2) | Roll (hold it and run); in the air: slam |+| **Shift** | Jetpack on or off |+| **⌫** (backspace) | Back to the last checkpoint |+| **Back** | Pause: Resume, Retry, Title, How to play, Quit game |+| **Home** | Save and quit |++Walk right from the title map. Each level leads into the next: get through its spikes, lasers, mines and shooters, and grab the crystals on the way. Jump from wall to wall to climb (not on the sticky green walls). A slam breaks glass and presses red buttons. Gravity changers turn the whole world round. Die and you go back to the last checkpoint. Collect more than 20 of the 50 crystals before the end to save the world.++<br clear="right">+## Portal Returns<img src="media/portal.gif" width="320" align="right" alt="Portal Returns: falling through a portal and flying across a test chamber">diff --git a/games/catninja/README.md b/games/catninja/README.mdnew file mode 100644index 00000000..4651a970--- /dev/null+++ b/games/catninja/README.md@@ -0,0 +1,45 @@+# Cat Ninja++Save the world, or something: collect the energy crystals. Richman Stewart's Flash platformer on the NumWorks calculator, with the game's own levels, traps and pictures: all 30 levels, the boss and the big crystal at the end.++<img src="docs/shot.png" width="320" alt="Level 2: the cat wall jumps up the shaft, Programming and Artwork by Richman Stewart sliding in">++- **The whole game, in its order:** the title map, then 30 levels that lead into each other, with the game's own branches (the Crossroads, the teleporters, the paths that loop back). Its TV screens talk to you, and mock you when you die.+- **The cat as the game moves it:** its run, jump and double jump, wall jumps on plain walls (not on the sticky green ones), the roll, the slam that breaks glass and presses buttons, the slide down walls. The same numbers, frame by frame, at the game's 60 frames a second.+- **Every trap:** spikes, lasers on timers, mines that blink before they blow, shooters and homing shooters, falling spikes, sun spikes that crawl along walls, dirt that crumbles, crates, springs, boosts, magnets, gravity changers that turn the whole world round, gravity blocks that don't, teleporters, the jetpack, the speed pill and the hallucination pill that makes the world wobble.+- **Checkpoints** as the game has them (die before the next one and you go back, even to the level before), the deaths and crystals counted at the top, the boss of level 29 and the ending: collect more than 20 of the 50 crystals to save the world.+- **Its pictures and fonts, all of them the game's,** with the map slowly changing colour as in the original. The world is drawn at half size, so a bit less of it shows than in the browser; the TV screens are drawn bigger so their words can be read.+- **Saves:** Home or Quit game keeps the level and the place you reached, your checkpoint, deaths and crystals. Next time the title map's way right takes you back there. A copy goes into `catninja_saves.py`, so installing the app again doesn't erase it.++<img src="docs/title.png" width="240" alt="The title map: CAT NINJA, the search for the magical energy crystals, and the cat"> <img src="docs/gravity.png" width="240" alt="Level 5: the world turning over after a gravity changer"> <img src="docs/pill.png" width="240" alt="Level 24: after the hallucination pill, the world tilts and grows">++## Controls++| Key | Action |+| --- | --- |+| Left, Right (or 4, 6) | Run |+| Up, OK or EXE (or 8) | Jump; again in the air: double jump; against a wall: wall jump. With the jetpack on: fly up |+| Down (or 2) | Roll (hold it and run); in the air: slam. With the jetpack on: fly down |+| Shift | Jetpack on or off, once you have one |+| Backspace | Back to the last checkpoint |+| Back | Pause: Resume, Retry, Title, How to play, Quit game (it asks first) |+| Home | Save and quit |++## Good to know++- The original's keys were the arrows, space for the jetpack and R to go back to the checkpoint: here Shift and Backspace, and the two TV screens that name those keys say so.+- There's no music or sound, and the pause bar's buttons for them are gone; its pause and exit are the pause's Resume and Title.+- Like the original, the game starts in the dark and the title map slowly lights up. Walk right to play.+- After a quit, the crystals you took stay taken; buttons pressed and lit checkpoints in a level you left start over.++## Credits++[Cat Ninja: The Quest for the Magical Energy Crystals](https://jayisgames.com/review/cat-ninja.php) is **Richman Stewart**'s game (2013), published by **TrackMill**. This version is written in C for the calculator from the game's own ActionScript, read from `CatNinja.swf` (BlueMaxima's Flashpoint keeps it) with JPEXS: the cat, the map and its tiles, every trap, the scripts of the levels, the boss and the ending follow its code, number for number. What it shows is the original's: [tools/data.py](tools/data.py) takes the 30 levels and the title map, their scripts and texts, the game's pictures (shrunk to half size) and its two fonts, "square" and "cubic", from the files JPEXS takes out of the game, and packs them into `src/data.c`. [tools/icon.py](tools/icon.py) makes the icon from the cat and its floor. The title cards credit the game's music by BunnyMajs and Eric Skiff, which isn't played here.++Not affiliated with Richman Stewart or TrackMill.++`make test` checks the cat's physics against the game's numbers, plays the title map and the first two levels with a little player that wall jumps, runs every level on random keys, checks the saves and runs the whole app on random keys. `build/play docs DIR` and `build/play gif DIR` draw the pictures above and the frames of the gallery's GIF.++It comes as its own app, `CatNinja.nwa`, from the [latest release](https://github.com/Mason363/NumPlay/releases/latest).++Build: `make` (needs `arm-none-eabi-gcc` and Node.js for nwlink). `make data` packs the levels and pictures again (Python 3 with Pillow and NumPy, and the files taken out of the game in `GAMESRC`).diff --git a/games/catninja/src/cn.h b/games/catninja/src/cn.hindex 7de4adda..be2e3679 100644--- a/games/catninja/src/cn.h+++ b/games/catninja/src/cn.h@@ -117,14 +117,14 @@ typedef struct {bool on;} bomb_t;enum { TR_PIC, TR_CIRCLE_RED, TR_DOT }; /* a trail: a picture, the jetpack's red circle, a bullet's dot */-typedef struct {- double x, y, sx, sy, scale, alpha, fade, rot;+typedef struct { /* (only drawn: floats) */+ float x, y, sx, sy, scale, alpha, fade, rot;int kind, pic, color, tint; /* tint: 0 none, 1 the map's, 2 the cat's (as it was) */float r; /* a circle's radius */uint8_t tr, tg, tb; /* (the cat's tint when it was made, in 32nds) */} trail_t;-typedef struct {- double x, y, speedx, gravity, alpha, rot;+typedef struct { /* (only drawn: floats) */+ float x, y, speedx, gravity, alpha, rot;int type, size, delayrate, delaytimer, pic, px0, py0, pw, ph; /* type 0: a piece of the cat (pic, its part) */bool onground;} particle_t;diff --git a/games/games.json b/games/games.jsonindex b7116273..06e18903 100644--- a/games/games.json+++ b/games/games.json@@ -1449,5 +1449,26 @@"repo": "https://github.com/Mason363/NumPlay/tree/main/games/famidash","default": false,"xl": true+ },+ {+ "id": "catninja",+ "rank": 37,+ "title": "Cat Ninja",+ "tagline": "Wall jumps, traps and 50 crystals",+ "credit": "Based on Cat Ninja by Richman Stewart",+ "top": "0x7B3FC4",+ "bottom": "0x2A1450",+ "accent": "0xE473EE",+ "colors": 16,+ "records": [+ "catninja.sav",+ "catninja_saves.py"+ ],+ "shots": [+ "docs/shot.png"+ ],+ "repo": "https://github.com/Mason363/NumPlay/tree/main/games/catninja",+ "default": false,+ "xl": true}]diff --git a/tests/test_games.py b/tests/test_games.pyindex 749ec92d..f0a72276 100644--- a/tests/test_games.py+++ b/tests/test_games.py@@ -316,6 +316,11 @@ GAMES = {presses((1500, "ok"), (2200, "ok"), (3000, "ok"), (4000, "ok"), (8000, "back"))+ [(5000, 7000, K["ok"])], 9000,presses((1500, "ok"), (2500, "ok")) + [(3500, 5500, K["ok"])], 6500),+ # how to play (the first time), then right through the title map into level 1, Back to pause; Home keeps it.+ # Next time, from the copy, right again: the title map's way back to level 1+ "catninja": ("CatNinja.nwa", "catninja.sav",+ presses((1500, "ok"), (9500, "back")) + [(2500, 9000, K["right"])], 10000,+ [(1500, 6000, K["right"])], 6500),# 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,@@ -386,7 +391,8 @@ COPIES = {"championisland": "champion_saves.py", "numblocks": "numblocks_saves.p"angrybirds": "angrybirds_saves.py", "polytrack": "polytrack_saves.py", "paperclips": "paperclips_saves.py","badtime": "badtime_saves.py", "mahjong": "mahjong_saves.py","rider": "rider_saves.py", "snowrider": "snowrider_saves.py", "templerun": "templerun_saves.py",- "fnaf2": "fnaf2_saves.py", "fnaf3": "fnaf3_saves.py", "fnaf4": "fnaf4_saves.py", "famidash": "famidash_saves.py"}+ "fnaf2": "fnaf2_saves.py", "fnaf3": "fnaf3_saves.py", "fnaf4": "fnaf4_saves.py", "famidash": "famidash_saves.py",+ "catninja": "catninja_saves.py"}def paperclips_ok(v):@@ -419,6 +425,16 @@ def famidash_ok(v):return struct.unpack_from("<I", v, len(v) - 4)[0] == h+def catninja_ok(v):+ """Cat Ninja's save: "CTN1", version 1, 40 bytes, an FNV-1a sum of the rest at the end"""+ if len(v) != 40 or v[:4] != b"CTN1" or v[4] != 1:+ return False+ h = 2166136261+ for x in v[:-4]:+ h = (h ^ x) * 16777619 & 0xFFFFFFFF+ 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):@@ -653,6 +669,9 @@ CHECKS = {# "FMD1", version 1: how to play read (flags at 5), time played (564); after the reinstall, from the copy, more"famidash": (lambda v: famidash_ok(v) and v[5] & 1 and struct.unpack_from("<I", v, 2100)[0] >= 7000,lambda v: famidash_ok(v) and v[5] & 1 and struct.unpack_from("<I", v, 2100)[0] >= 12000),+ # "CTN1", version 1: how to play read (flags at 5), in level 1 (the level at 9); after the reinstall, from the+ # copy, still there+ "catninja": (lambda v: catninja_ok(v) and v[5] & 1 and v[9] == 0, lambda v: catninja_ok(v) and v[5] & 1 and v[9] == 0),"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 c930fa8d..24ca3edd 100644--- a/tools/release.py+++ b/tools/release.py@@ -64,6 +64,7 @@ ALONE = {"fnaf3": ("Five Nights at Freddy's 3", "Fazbear's Fright's six nights with Springtrap and the phantoms: the lure, the vents, the maintenance panel"),"fnaf4": ("Five Nights at Freddy's 4", "the bedroom's nights with the Nightmares: listen at the doors, the closet, the bed, Fun with Plushtrap"),"famidash": ("Famidash", "TFDSoft's Geometry Dash for the NES, made for the calculator: the 173 levels of Famidash HUGE, every mode, practice mode"),+ "catninja": ("Cat Ninja", "Richman Stewart's Flash platformer: its 30 levels of wall jumps and traps, the boss and the crystals"),}VARIANTS = [("NumPlay-Invisible.nwa", "The same app, hidden: a blank icon with no name"),