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
Level Devil: the game's own rooms, as its own app
Mason36303ca9b5f911d
diff --git a/Makefile b/Makefileindex e58d68e2..a48165a6 100644--- a/Makefile+++ b/Makefile@@ -24,7 +24,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+BIG_APPS = Celeste HollowKnight Undertale ChampionIsland FinalEarth2 NumPowder NumBlocks NumDrive SubwaySurfers FiveNightsAtFreddys Doom BindingOfIsaac HillClimbRacing PlantsVsZombies SonicTheHedgehog CookieClicker LevelDevil# the calculator's space for installed apps (0x90200000 to 0x903F0000 in its flash)APP_SPACE = 2031616# Upsilon, the N0110 and N0115's custom software, gives .nwa apps less RAM: NumPlay-Upsilon.nwa has@@ -216,6 +216,7 @@ APP_isaac = games/isaac/output/isaac.nwa:BindingOfIsaac.nwaAPP_pvz = games/pvz/output/pvz.nwa:PlantsVsZombies.nwaAPP_sonic = games/sonic/output/sonic.nwa:SonicTheHedgehog.nwaAPP_cookieclicker = games/cookieclicker/output/cookieclicker.nwa:CookieClicker.nwa+APP_leveldevil = games/leveldevil/output/leveldevil.nwa:LevelDevil.nwaapps: | $(B)$(MAKE) -C games/numdash build NWLINK="node node_modules/nwlink/bin/nwlink"@@ -240,6 +241,7 @@ apps: | $(B)$(MAKE) -C games/pvz build NWLINK="$(NWLINK)"$(MAKE) -C games/sonic build NWLINK="$(NWLINK)"$(MAKE) -C games/cookieclicker build NWLINK="$(NWLINK)"+ $(MAKE) -C games/leveldevil build NWLINK="$(NWLINK)"cd 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)))@@ -264,6 +266,7 @@ apps: | $(B)cp $(word 1,$(subst :, ,$(APP_pvz))) $(B)/apps/$(word 2,$(subst :, ,$(APP_pvz)))cp $(word 1,$(subst :, ,$(APP_sonic))) $(B)/apps/$(word 2,$(subst :, ,$(APP_sonic)))cp $(word 1,$(subst :, ,$(APP_cookieclicker))) $(B)/apps/$(word 2,$(subst :, ,$(APP_cookieclicker)))+ cp $(word 1,$(subst :, ,$(APP_leveldevil))) $(B)/apps/$(word 2,$(subst :, ,$(APP_leveldevil)))arm-none-eabi-strip --strip-unneeded $(B)/apps/Tetris.nwaSTD_APPS = $(foreach g,$(STD_GAMES),$(B)/apps/$(NWA_$(g)))@@ -329,5 +332,6 @@ clean:-$(MAKE) -C games/pvz clean-$(MAKE) -C games/sonic clean-$(MAKE) -C games/cookieclicker clean+ -$(MAKE) -C games/leveldevil clean-cd games/tetris/tetris && $(CARGO) clean-$(foreach g,$(STD_GAMES),$(MAKE) -C games/$(g) clean;)diff --git a/games/leveldevil/Makefile b/games/leveldevil/Makefileindex 83025cc8..5fa5ee0d 100644--- a/games/leveldevil/Makefile+++ b/games/leveldevil/Makefile@@ -4,10 +4,9 @@# make test every room played through on a computer with its solution (tests/play.c,# tests/solutions.txt)#-# The rooms are written in tools/rooms.py, which packs them into output/rooms.inc (Python 3).-# In NumPlay the game draws with the launcher's strips, shapes and fonts, saves through its file-# functions and unpacks its rooms with its inflater (module.o leaves them to the launcher); on its-# own it brings them along.+# The rooms are the game's own: tools/scenes.json has their tiles and actors (tools/fetch.py takes+# them from the game's web build) and tools/rooms.py their scripts, which it packs into+# output/rooms.inc (Python 3). The game draws with the launcher's strips, shapes and fonts.Q ?= @CC = arm-none-eabi-gccNWLINK ?= npx --yes -- [email protected]@@ -15,10 +14,10 @@ BUILD_DIR = outputSRC = src/main.cROOMS = $(BUILD_DIR)/rooms.incHEADERS = ../common/epsilon_app.h ../common/epsilon_files.h ../common/np_text.h ../../launcher/src/gfx.h \- ../../launcher/src/np.h ../../launcher/src/font.h ../../launcher/src/inflate.h+ ../../launcher/src/np.h ../../launcher/src/font.hCFLAGS = -std=c11 $(shell $(NWLINK) eadk-cflags-device) -I$(BUILD_DIR)-CFLAGS += -Os -Wall -Wextra -Wno-unused-parameter -fno-math-errno -fsingle-precision-constant+CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter -fno-math-errno -fsingle-precision-constantCFLAGS += -fno-tree-loop-distribute-patterns -flto -fno-fat-lto-objects -fwhole-program -fvisibility=internalLDFLAGS = -Wl,--relocatable -nostartfiles --specs=nano.specsLDFLAGS += -Wl,-e,main -Wl,-u,eadk_app_name -Wl,-u,eadk_app_icon -Wl,-u,eadk_api_level@@ -27,11 +26,12 @@ LDFLAGS += -Wl,--gc-sections -flinker-output=nolto-rel.PHONY: build check clean host testbuild: $(BUILD_DIR)/leveldevil.nwa+# apps get 133652 bytes of RAM on custom builds of Epsilon 25.2 (148928 or more on official ones)check: $(BUILD_DIR)/leveldevil.nwa- $(Q) $(NWLINK) nwa-bin $< $(BUILD_DIR)/leveldevil.bin+ $(Q) $(NWLINK) nwa-bin --ram-length 133652 $< $(BUILD_DIR)/leveldevil.bin@echo "BIN $(BUILD_DIR)/leveldevil.bin: $$(wc -c < $(BUILD_DIR)/leveldevil.bin) bytes"-$(ROOMS): tools/rooms.py | $(BUILD_DIR)+$(ROOMS): tools/rooms.py tools/scenes.json | $(BUILD_DIR)$(Q) python3 tools/rooms.py $(BUILD_DIR)# compiled, then linked (the link options would upset the compiler)@@ -44,11 +44,9 @@ $(BUILD_DIR)/font_data.o: ../../launcher/src/font_data.c ../../launcher/src/font$(Q) $(CC) $(CFLAGS) -c $< -o $@$(BUILD_DIR)/xfont.o: ../../launcher/src/xfont.c ../../launcher/src/np_xfont.h $(HEADERS) | $(BUILD_DIR)$(Q) $(CC) $(CFLAGS) -c $< -o $@-$(BUILD_DIR)/inflate.o: ../../launcher/src/inflate.c ../../launcher/src/inflate.h | $(BUILD_DIR)- $(Q) $(CC) $(CFLAGS) -c $< -o $@$(BUILD_DIR)/leveldevil.nwa: $(BUILD_DIR)/main.o $(BUILD_DIR)/gfx.o $(BUILD_DIR)/font_data.o $(BUILD_DIR)/xfont.o \- $(BUILD_DIR)/inflate.o $(BUILD_DIR)/icon.o+ $(BUILD_DIR)/icon.o@echo "LD $@"$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@$(Q) arm-none-eabi-strip --strip-unneeded $@@@ -70,23 +68,7 @@ host: build/playbuild/play: $(SRC) $(ROOMS) tests/play.c $(HEADERS)$(Q) mkdir -p build$(Q) cc $(HOST_FLAGS) tests/play.c ../../launcher/src/gfx.c ../../launcher/src/font_data.c \- ../../launcher/src/xfont.c ../../launcher/src/inflate.c -lm -o $@+ ../../launcher/src/xfont.c -lm -o $@@echo "HOST $@"test: build/playbuild/play solve--# NumPlay launcher: the app as a module (see ../../tools/npmodule.py) for the-# calculator, and as a relocatable object for the simulator build.-.PHONY: module sim-module-module: $(BUILD_DIR)/module.o-$(BUILD_DIR)/module-main.o: $(SRC) $(ROOMS) $(HEADERS) | $(BUILD_DIR)- $(Q) $(CC) $(CFLAGS) -DNP_MODULE=1 -c $(SRC) -o $@-$(BUILD_DIR)/module.o: $(BUILD_DIR)/module-main.o- $(Q) $(CC) $(CFLAGS) -Wl,--relocatable -nostartfiles -nostdlib -Wl,-e,main -flinker-output=nolto-rel $< -o $@--sim-module: $(BUILD_DIR)/sim-module.o-$(BUILD_DIR)/sim-module.o: $(SRC) $(ROOMS) $(HEADERS) | $(BUILD_DIR)- $(Q) mkdir -p $(BUILD_DIR)/sim- $(Q) cc -std=c11 -O2 -fPIC $(shell $(NWLINK) eadk-cflags-simulator) -I$(BUILD_DIR) -DNP_MODULE=1 \- -Dmain=np_leveldevil_main -c $(SRC) -o $(BUILD_DIR)/sim/main.o- $(Q) ld -r $(BUILD_DIR)/sim/main.o -exported_symbol _np_leveldevil_main -o $@diff --git a/games/leveldevil/README.md b/games/leveldevil/README.mdindex 36e60529..5dd1f0f4 100644--- a/games/leveldevil/README.md+++ b/games/leveldevil/README.md@@ -1,34 +1,33 @@# Level Devil-Run to the door. The level has other plans. Unept's troll platformer on the NumWorks calculator: its flat colours, its tiny black runner, and rooms that change the moment you trust them.+Run to the door. The level has other plans. Unept's troll platformer on the NumWorks calculator, with the game's own rooms: all sixteen worlds of five rooms, their tiles, their traps and their timing, in the game's flat colours with its tiny black runner.-<img src="docs/shot.png" width="320" alt="The runner jumps over spikes that just came up in front of the door">+<img src="docs/shot.png" width="320" alt="Pits, the first world: the runner on its way to the door">-- **16 levels of 5 rooms**, each level in its own colours, picked on a map of doors. Clear a level to open the next one; the last door has horns.-- **Traps that wait for you:** the floor drops away, spikes pop up in front of the door, walls slide out, the ceiling comes down, the door runs off or turns out to be fake, the keys turn round, gravity flips, saws give chase...-- **Rooms that change after you die in them**, like the original's: the trap you just learned isn't always the one waiting next time.-- **A theme a level:** falling floors, spikes, walls, the door, backwards, fake ground, springs, warps, crushers, saws, chases, jumps in the air, gravity, ice, the edges of the room, and the Devil's own level, which mixes them.-- **Tight controls:** hold jump to jump higher, a moment's grace after running off an edge, and back on your feet the moment you die.-- **Deaths counted,** for the level and in all, with your best (the fewest deaths) for each level. The game remembers the room you reached, so you can stop any time.+- **The 80 rooms of the game, in its order:** Pits, Spikes, Push, Coins, Controls, Platforms, Springs, Warps, Scale, Doors, Saws, Flappy, Gravity, Movement, Wraparound and the Boss, each in its own colours. Clear a world's five rooms to open the next one.+- **The game's traps, as it times them:** floors that drop or slide away, spikes that pop up in waves, walls that push you into pits, coins over fake ground, controls that turn round, platforms that sink under you, springs and warps that send you the wrong way, a runner that grows and shrinks, doors that run off or swap places with you, saws that chase you, gravity that flips, rooms where you fly, slide, float or wrap round the screen, and the Devil's giant saw.+- **Its feel:** the runner's speed, jump and gravity, its five-step grace after running off an edge, springs, ice and moving platforms that carry you.+- **Its look:** the black runner and its running and jumping pictures, the doors, spikes, saws, springs, warps, buttons and coins, the five squares of the world's rooms at the top, the shards of the runner when it dies, and the retry button: press any key to try again.+- **Deaths counted,** for the world and in all, with your best (the fewest deaths) for each one. The game remembers the room you reached, so you can stop any time, and keeps a copy of its save in `leveldevil_saves.py`, so installing the app again doesn't erase it.## Controls| Key | Action || --- | --- || Left, Right (or 4, 6) | Run |-| Up, OK or EXE (or 8, 5) | Jump; hold it to jump higher |-| Arrows, OK | Pick a door on the map |-| Back | Pause: Resume, Restart the room, Levels, How to play, Quit game |+| Up, OK or EXE (or 8, 5) | Jump (in Gravity: turn gravity round; in Flappy: flap) |+| Down (or 2) | Jump, in the room that says so |+| Any key, once dead | Try again |+| Arrows, OK | Pick a world on the map |+| Back | Pause: Resume, Restart the room, Levels, Quit game || Home | Quit |## Credits-[Level Devil - NOT A Troll Game](https://store.steampowered.com/app/3242750/) is **Unept**'s game (2023). This version is written in C for NumPlay, with no code or art from the original: its look and its traps follow the game, and its rooms are made for the calculator's screen in the spirit of the original's.+[Level Devil - NOT A Troll Game](https://store.steampowered.com/app/3242750/) is **Unept**'s game (2023). This version is written in C for the calculator, with no code of the original. Its rooms are the original's: [tools/fetch.py](tools/fetch.py) takes each room's tiles and actors (where each one is, its type, size and turn) from the game's web build and keeps them in [tools/scenes.json](tools/scenes.json), and [tools/rooms.py](tools/rooms.py) has what each room's script does (what each trigger sets off, after how long, how far and how fast), written out from the game's scene scripts. The runner's speeds and jump, the gravity of each room and the colours of each world are the game's; its pictures are drawn from the game's sprites.-The rooms are written in [tools/rooms.py](tools/rooms.py), which packs them into a little over 1 KB. `make test` plays every room through on a computer, as it starts and after a death or more, with the keys in [tests/solutions.txt](tests/solutions.txt), so each one can be cleared.+`make test` plays every room through on a computer with the keys in [tests/solutions.txt](tests/solutions.txt) (found by a search, `build/play search`), so each one can be cleared.-Inside NumPlay it draws with the launcher's shapes and fonts, saves through its file functions and unpacks its rooms with its inflater, so the game itself is about 10 KB.--It comes inside [NumPlay](https://github.com/Mason363/NumPlay), or on its own as `LevelDevil.nwa` from the [latest release](https://github.com/Mason363/NumPlay/releases/latest).+It comes as its own app, `LevelDevil.nwa`, from the [latest release](https://github.com/Mason363/NumPlay/releases/latest).Build: `make` (needs `arm-none-eabi-gcc`, Python 3 and Node.js for nwlink).diff --git a/games/leveldevil/lang/fr.txt b/games/leveldevil/lang/fr.txtdeleted file mode 100644index 96ed8270..00000000--- a/games/leveldevil/lang/fr.txt+++ /dev/null@@ -1,28 +0,0 @@-# Level Devil in French: the English text as in the source, a tab, the translation (see tools/lang.py).-Resume Reprendre-Restart Recommencer-Levels Niveaux-How to play Comment jouer-Quit game Quitter le jeu-Quit game? Quitter le jeu ?-No Non-Yes Oui-Paused Pause-Play Jouer-OK OK-Left Right Gauche Droite-run courir-Up, OK, EXE Haut, OK, EXE-jump (hold: higher) sauter (maintenir : plus haut)-Back Retour-pause pause-Reach the door. The level has other plans: trust nothing. Atteins la porte. Le niveau a d'autres projets : ne te fie à rien.-You beat the Devil! Tu as vaincu le Diable !-Every door of Level Devil is open behind you. Toutes les portes de Level Devil sont ouvertes derrière toi.-Deaths in all: Morts en tout :-Level Niveau-Level cleared! Deaths: Niveau réussi ! Morts :-Locked Verrouillé-Cleared. Fewest deaths: Réussi. Le moins de morts :-Not cleared yet Pas encore réussi-Deaths Mortsdiff --git a/games/leveldevil/lang/zh.txt b/games/leveldevil/lang/zh.txtdeleted file mode 100644index 39cc3c25..00000000--- a/games/leveldevil/lang/zh.txt+++ /dev/null@@ -1,28 +0,0 @@-# Level Devil in Chinese: the English text as in the source, a tab, the translation (see tools/lang.py).-Resume 继续-Restart 重来-Levels 关卡-How to play 玩法-Quit game 退出游戏-Quit game? 退出游戏?-No 否-Yes 是-Paused 暂停-Play 开始-OK OK-Left Right 左 右-run 跑-Up, OK, EXE 上、OK、EXE-jump (hold: higher) 跳(按住跳得更高)-Back 返回-pause 暂停-Reach the door. The level has other plans: trust nothing. 走到门口。关卡另有打算:什么都别相信。-You beat the Devil! 你打败了恶魔!-Every door of Level Devil is open behind you. Level Devil 的每一扇门都已在你身后打开。-Deaths in all: 总死亡次数:-Level 第-Level cleared! Deaths: 过关!死亡次数:-Locked 未解锁-Cleared. Fewest deaths: 已通过。最少死亡:-Not cleared yet 尚未通过-Deaths 死亡diff --git a/games/leveldevil/src/main.c b/games/leveldevil/src/main.cindex 68c646b1..b49e5cf1 100644--- a/games/leveldevil/src/main.c+++ b/games/leveldevil/src/main.c@@ -1,100 +1,86 @@/* Level Devil: run to the door. The level has other plans.*- * Unept's troll platformer (2023), its first world: sixteen doors of five short rooms in flat- * colours, with its tiny black runner. Floors drop away under you, spikes pop up in front of the- * door, walls slide out, the door runs off, the controls turn round, gravity flips... Every trap- * waits for the runner to reach its spot, so a room catches you the first time and is easy once- * you know it; some rooms change again after you die in them.+ * Unept's troll platformer (2023): sixteen worlds of five short rooms in flat colours, with a tiny+ * black runner. Floors drop away under you, spikes pop up, walls push, the door runs off, the+ * controls turn round, gravity flips... The rooms are the game's own: their tiles, their actors and+ * what their scripts do (tools/rooms.py, from tools/scenes.json).*- * A room is a list of objects (blocks, spikes, saws, springs, warps, switches and the door), each- * with an optional trap: what sets it off (the runner crossing a line, touching it, the trap- * before it, the room starting), after how many deaths it is there, and what it does (slide,- * loop, chase, fall, appear or vanish). The rooms are written in tools/rooms.py, which packs them- * (DEFLATE); they are unpacked into RAM when the game starts. The game steps 60 times a second- * and only the rows that change are drawn again, in the launcher's strips (launcher/src/gfx.c).- * Inside NumPlay it uses the launcher's shapes, fonts, files and inflater; on its own it brings- * them along. */+ * A room: its ground (tiles of 16 pixels, 33 x 15), its objects (blocks, spikes, saws, springs,+ * doors, triggers, coins, warps, buttons...) and its script: steps, each set off by an event (the+ * room starting, the runner touching a trigger, a key) after so many 60ths of a second, that move,+ * grow, show or hide objects, or change the runner (its speed, its jump, its size, gravity). The+ * game steps 60 times a second, in the scene's pixels; it is drawn at 3/4 (the screen shows x 50+ * to 477 of the 528 pixels, all 240 high), in the launcher's strips (launcher/src/gfx.c). */#include <eadk.h>#include "../../../launcher/src/gfx.h"-#include "../../../launcher/src/inflate.h"#include "../../common/np_text.h"--#if NP_MODULE /* (np_file_read and np_file_write: NumPlay's, launcher/src/np.h) */-#define np_app_begin()-#define np_app_end() 0-#else#include "../../common/epsilon_app.h"#include "../../common/epsilon_files.h"-#define np_file_read ef_read-#define np_file_write ef_write+const char eadk_app_name[] __attribute__((section(".rodata.eadk_app_name"))) = "Level Devil";const uint32_t eadk_api_level __attribute__((section(".rodata.eadk_api_level"))) = 0;void np_push(int x, int y, int w, int h, const color_t *px) {eadk_display_push_rect((eadk_rect_t){(uint16_t)x, (uint16_t)y, (uint16_t)w, (uint16_t)h}, px);}-#endif#define KEY(k) (1ull << (k))-#define G 2 /* screen pixels to a pixel of the game, each way */-#define FW 160 /* the room, in the game's pixels */-#define FH 120-#define TOP 10 /* the ceiling: the band with the level, its rooms and the deaths */-#define WALL 4-#define PW 5 /* the runner's box */-#define PH 7-#define DW 11 /* the door */-#define DH 20#define ROOMS 5#define LEVELS 16-/* A room (tools/rooms.py): its modes (R_*), where the runner starts (x, and the y of its feet), how- * many objects, then the objects. An object: its kind and flags, then x, y, w and h in pixels of the- * game (a door: h 1 when it hangs from the ceiling; a warp: its two ends, w and h the second one's- * x and y; a switch or a button: dx the modes it toggles). With F_TRAP, five more bytes, its trap: what- * sets it off (T_* and a value: the line the runner crosses, how near it comes, the object whose- * trap goes first), how many deaths in the room it waits for (1-3: there from that death on; 5-7:- * there until death 1-3), how it moves (M_*), by how much (dx, dy, signed), how fast (speeds[]),- * and after how many 4ths of 16 steps. */-enum { K_BLOCK, K_SECRET, K_SPIKE_U, K_SPIKE_D, K_SPIKE_L, K_SPIKE_R, K_DOOR, K_SAW, K_SPRING, K_WARP, K_SWITCH, K_BUTTON };-#define F_HIDDEN 0x10 /* not there until its trap goes off */-#define F_VANISH 0x20 /* gone when its trap goes off */-#define F_GHOST 0x40 /* drawn, but nothing to stand on (a fake block), or a fake door */-#define F_TRAP 0x80-enum { T_START, T_RIGHT, T_LEFT, T_UP, T_DOWN, T_TOUCH, T_AFTER, T_NEAR };-enum { M_ONCE, M_LOOP, M_CHASE, M_FALL };-/* the modes of a room, which switches and buttons toggle (their dx) */-#define R_BACK 1 /* left and right swapped */-#define R_ICE 2 /* the floor is slippery */-#define R_AIR 4 /* jump in the air as often as you like */-#define R_FLIP 8 /* gravity upwards */-#define R_WRAP 16 /* no side walls: out one side, in at the other */-#include "rooms.inc" /* rooms_z, ROOM_BYTES */-static uint8_t rooms[ROOM_BYTES];--/* each level's background and ground */-static const color_t colors[LEVELS][2] = {- {HEX(0xF49F7E), HEX(0x634D40)}, {HEX(0xF68048), HEX(0xB8461E)}, {HEX(0xF2BD48), HEX(0xA9690A)},- {HEX(0xA5CF55), HEX(0x2E5A45)}, {HEX(0x84C9E6), HEX(0x274F6E)}, {HEX(0xB9A3DE), HEX(0x46356B)},- {HEX(0x8FD9B6), HEX(0x285C49)}, {HEX(0xF29BB5), HEX(0x7A2E4A)}, {HEX(0xE6CF9C), HEX(0x6B5235)},- {HEX(0x6CC7C2), HEX(0x1D5052)}, {HEX(0xF7B58B), HEX(0x8A4B2A)}, {HEX(0xA3B5F0), HEX(0x2F3D7A)},- {HEX(0xCDB2E8), HEX(0x5B2F73)}, {HEX(0xD3ECF4), HEX(0x3A6A82)}, {HEX(0xF07C6C), HEX(0x5E2420)},- {HEX(0xC8452A), HEX(0x2A0A06)},+/* the packed rooms (tools/rooms.py), column by column: 80 rooms' modes and runners, their ground+ (33 columns of 15 bits), how many spans each has, the spans' fields, how many steps, the steps' */+#include "rooms.inc" /* data, ROOM_BYTES, SPANS, STEPS */+#define D_GROUND (5 * 80)+#define D_NSPAN (D_GROUND + 66 * 80)+#define D_KIND (D_NSPAN + 80)+#define D_FLAG (D_KIND + SPANS)+#define D_EV (D_FLAG + SPANS)+#define D_X (D_EV + SPANS)+#define D_Y (D_X + 2 * SPANS)+#define D_W (D_Y + 2 * SPANS)+#define D_H (D_W + SPANS)+#define D_N (D_H + SPANS)+#define D_NSTEP (D_N + SPANS)+#define D_SEV (D_NSTEP + 80)+#define D_ST (D_SEV + STEPS)+#define D_CODE (D_ST + 2 * STEPS)+#define D_OBJ (D_CODE + STEPS)+#define D_SN (D_OBJ + STEPS)+#define D_COND (D_SN + STEPS)+#define D_A (D_COND + STEPS)+#define D_B (D_A + 2 * STEPS)+#define D_C (D_B + 2 * STEPS)+#define D_K (D_C + 2 * STEPS)++enum { K_BLOCK, K_SPIKE, K_SAW, K_SPRING, K_DOOR, K_TRIG, K_COIN, K_BAD, K_WARP, K_BUTTON, K_THRU, K_GSPIKE, K_DEATH };+#define F_HIDE 1+#define F_GHOST 2 /* nothing to stand on */+#define F_OFF 4 /* not there (yet, or any more) */+#define F_BIG 8 /* a saw's second picture, twice as big */+#define F_USED 16 /* a trigger gone off, a coin taken, a button pressed */+#define F_ICE 32+#define F_HOP 64 /* thrown up, falling back */+enum { R_WRAP = 1, R_WRAPY = 2, R_SWAP = 4, R_FLAPPY = 16, R_GRAVITY = 32 };+enum { O_VEL, O_MOVE, O_SET, O_GROW, O_FLAG, O_SPAWN, O_WARP, O_HERO, O_GRAV, O_HGROW, O_SHAKE, O_FIRE, O_REARM,+ O_TOWARD, O_RULE, O_ACCEL, O_HOP, O_KEY };+enum { H_RUN, H_JUMP, H_MAXUP, H_MAXDOWN, H_BACK, H_DOWNJUMP, H_DIR, H_SLIDE, H_PUSHX };+enum { U_NONE, U_PATROL, U_FOLLOW, U_STOPX, U_WRAPX };+#define EV_KEY 9+#define EV_MOVE 10+#define EVENTS 11++/* the colours of the sixteen worlds: background, ground */+static const uint32_t colors[LEVELS][2] = {+ {0xFEB854, 0x996B07}, {0xF5B13A, 0xBE7708}, {0xF8C750, 0xCD8507}, {0xF8C750, 0xE37B07},+ {0xE4C448, 0xE36821}, {0xFD8E57, 0xD65C2C}, {0xFECB30, 0xD34F2B}, {0xED9970, 0xB44D2A},+ {0xCDB67D, 0xA24829}, {0xF48B7C, 0x844934}, {0xFFBC73, 0x754E39}, {0xF49E7C, 0x624C40},+ {0xEA7851, 0x4A3B35}, {0xCD7647, 0x40312A}, {0xAB7050, 0x401D0D}, {0xCD7647, 0x2F1509},};--/* the runner, 256ths of a pixel a step (60 a second) */-#define RUN 280-#define GRAV 56-#define JUMP 770-#define FALL 900-#define SPRING 1180--#define WHITE 0xFFFF#define BLACK 0+#define WHITE 0xFFFF#define GREY HEX(0xC8C8C8)-#define HUB_BG HEX(0xF2BD48)-#define HUB_FG HEX(0xC47A0A)-#define RED HEX(0xD9512C)-#define DARK_RED HEX(0x6E1A0E)+#define DARK HEX(0x6D1102) /* the game's dark red: its transitions, its buttons */+#define YELLOW HEX(0xFCF965)/* leveldevil.sav */static struct {@@ -106,31 +92,48 @@ static struct {uint16_t best[LEVELS]; /* the fewest deaths each level was cleared with */} sv;#define SAVE_NAME "leveldevil.sav"+#define COPY_NAME "leveldevil_saves.py"typedef struct {- const uint8_t *r; /* its record */- int16_t x, y, v; /* where it is, in 16ths of a pixel; its speed falling */- uint8_t i, st, t, on; /* its place in the room; its trap's state and delay left; there or not */+ int32_t x, y, tx, ty; /* its centre, and where a move takes it (256ths of a pixel) */+ int16_t w, h, gw, gh; /* half its size, and what it grows to (16ths of a pixel) */+ int16_t vx, vy, ax, ay; /* 256ths of a pixel a step; and a step each step */+ int16_t rest; /* thrown up: the y it comes down to (pixels) */+ uint16_t ml, gl; /* steps left of its move, of its growing */+ uint8_t kind, f, ev, t; /* kind (and its turn, 90 degrees a step, in bits 4 and 5); flags; t: a spring's push */} obj_t;-enum { S_WAIT, S_DELAY, S_GO, S_DONE };-static obj_t ob[28];-static int no;+typedef struct {+ uint16_t t;+ uint8_t ev, cond, code, o, done;+ int16_t a, b, c;+} step_t;+static obj_t ob[120];+static step_t st[240];+static struct {+ uint8_t o, type;+ int16_t p, q;+} rule[12];+static int no, ns, nr;+static uint16_t gcol[33];static color_t strip[SCREEN_W * STRIP_H];-static const uint8_t *room;-static int level, rnum, tries, mode, scr, ov, sel, banner, dlo, dhi, full;-static int32_t px, py, vx, vy; /* the runner: its box's top-left and its speed, in 256ths of a pixel */-static int face = 1, ground, coyote, buffer, held_in, anim, dead, won, warped, curtain, sprung;-static uint32_t found, seed, banner_t, now;-static const obj_t *skip_ob; /* left out of collisions (a block pushing the runner) */+static int level, rnum, ri, scr, ov, sel, banner, full, tries, modes, frame, shake, shake_n;+static uint8_t cnt[EVENTS];+static uint16_t at_[EVENTS];+/* the runner: its box's corner and its speed (256ths of a pixel, a step), its size (pixels) */+static int32_t hx, hy, vx, vy;+static int hw, hh, hsx, hsy, tsx, tsy, hgl;+static int run, jumpv, maxup, maxdown, back, downjump, dir, slide, pushx, gx, gy, keyev;+static int face, ground, coyote, jumping, anim, dead, won, frozen, born, started, flapped, held_in, fade, waiting;+static uint32_t seed, banner_t, now;static color_t bg, fg;static struct {- int16_t x, y;- int8_t vx, vy;-} bits[14]; /* the runner, in pieces */+ int32_t x, y;+ int16_t vx, vy;+} bits[8]; /* the runner, in pieces */enum { SC_HUB, SC_PLAY };enum { OV_NONE, OV_PAUSE, OV_HELP, OV_QUIT, OV_END };-enum { I_LEFT = 1, I_RIGHT = 2, I_JUMP = 4 };+enum { I_LEFT = 1, I_RIGHT = 2, I_UP = 4, I_DOWN = 8 };static uint32_t rnd(void) {seed ^= seed << 13;@@ -140,12 +143,14 @@ static uint32_t rnd(void) {static int imin(int a, int b) { return a < b ? a : b; }static int imax(int a, int b) { return a > b ? a : b; }static int clampi(int v, int a, int b) { return v < a ? a : v > b ? b : v; }-static char *cat(char *o, const char *s) { /* s at o; returns its end */+static int iabs(int v) { return v < 0 ? -v : v; }+static int rd16(int at) { return (int16_t)(data[at] | data[at + 1] << 8); }+static char *cat(char *o, const char *s) {while (*s) *o++ = *s++;*o = 0;return o;}-static char *num(char *o, uint32_t v) { /* v at o; returns its end */+static char *num(char *o, uint32_t v) {char t[10];int n = 0;do t[n++] = (char)('0' + v % 10); while (v /= 10);@@ -153,461 +158,642 @@ static char *num(char *o, uint32_t v) { /* v at o; returns its end */*o = 0;return o;}-static char *label(char *o, const char *s, uint32_t v) { /* a text, then a number; returns o */+static char *label(char *o, const char *s, uint32_t v) {num(cat(o, s), v);return o;}+/* The save, and a copy of it in a Python script: installing apps from the NumWorks website keeps only+ Python scripts, so the save comes back from the copy when the file itself is gone. The copy is a+ comment line "#>leveldevil.sav:base64" (the way NumPlay and the big games keep theirs). */+static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";+static const char copy_head[] = "# Level Devil keeps a copy of your progress here, so that\n"+ "# reinstalling it doesn't erase it. If you delete this\n"+ "# file, the game writes it again.\n#>" SAVE_NAME ":";static void save(void) {+ static char copy[sizeof copy_head + 72];+ const uint8_t *d = (const uint8_t *)&sv;+ char *p = copy;sv.magic = 'L', sv.version = 1;- np_file_write(SAVE_NAME, &sv, sizeof sv);+ ef_write(SAVE_NAME, &sv, sizeof sv);+ *p++ = 0; /* (the script's status byte) */+ for (const char *h = copy_head; *h;) *p++ = *h++;+ for (unsigned i = 0; i < sizeof sv; i += 3) { /* (48 bytes: no padding) */+ uint32_t v = (uint32_t)d[i] << 16 | d[i + 1] << 8 | d[i + 2];+ for (int k = 18; k >= 0; k -= 6) *p++ = b64[v >> k & 63];+ }+ *p++ = '\n', *p++ = 0;+ ef_write(COPY_NAME, copy, (uint32_t)(p - copy));+}+/* the save back from the copy, if only the copy is left */+static void restore(void) {+ uint32_t len, n = sizeof copy_head;+ const uint8_t *c = ef_read(COPY_NAME, &len);+ uint8_t out[sizeof sv];+ if (ef_read(SAVE_NAME, &len) || !(c = ef_read(COPY_NAME, &len)) || len < n + 64) return;+ for (uint32_t i = 0; i < n - 1; i++)+ if (c[1 + i] != (uint8_t)copy_head[i]) return;+ for (unsigned i = 0, j = n; i < sizeof sv; i += 3, j += 4) {+ uint32_t v = 0;+ for (int k = 0; k < 4; k++) {+ int x = 0;+ while (x < 64 && (uint8_t)b64[x] != c[j + k]) x++;+ if (x == 64) return;+ v = v << 6 | (uint32_t)x;+ }+ out[i] = (uint8_t)(v >> 16), out[i + 1] = (uint8_t)(v >> 8), out[i + 2] = (uint8_t)v;+ }+ ef_write(SAVE_NAME, out, sizeof out);}+#define PS(v) ((v) * 64 / 15) /* pixels a second: 256ths of a pixel a step */+#define PS2(v) ((v) * 64 / 900) /* pixels a second, each second: 256ths a step, each step *//* ------------------------------------------------------------ the room */-static const uint8_t *next_room(const uint8_t *p) {- int n = p[3];- for (p += 4; n--;) p += *p & F_TRAP ? 10 : 5;- return p;-}-/* the box of an object, in pixels */-static void box(const obj_t *o, int *b) {- const uint8_t *r = o->r;- int k = r[0] & 15;- b[0] = o->x >> 4, b[1] = o->y >> 4, b[2] = r[3], b[3] = r[4];- if (k == K_DOOR) b[2] = DW, b[3] = DH;- if (k == K_WARP) b[2] = 8, b[3] = 12;-}-static bool overlap(int x, int y, int w, int h, const int *b) {- return x < b[0] + b[2] && b[0] < x + w && y < b[1] + b[3] && b[1] < y + h;-}-static bool solid(const obj_t *o) {- int k = o->r[0] & 15;- return o->on && (k == K_SECRET || (k == K_BLOCK && !(o->r[0] & F_GHOST)));-}-/* What the runner's box would hit at (x, y): a solid object, the walls (ob itself), or nothing. */-static const obj_t *blocked(int x, int y) {+static int cell(int tx, int ty) { return tx >= 0 && tx < 33 && ty >= 0 && ty < 15 && gcol[tx] >> ty & 1; }+/* any ground in the pixels [x0, x1) x [y0, y1)? */+static int ground_in(int x0, int y0, int x1, int y1) {+ for (int tx = x0 >> 4; tx <= (x1 - 1) >> 4; tx++)+ for (int ty = y0 >> 4; ty <= (y1 - 1) >> 4; ty++)+ if (cell(tx, ty)) return 1;+ return 0;+}+static void box(const obj_t *o, int *b) { /* its box in pixels: x0, y0, x1, y1 */+ int w = o->w >> 4, h = o->h >> 4;+ b[0] = (o->x >> 8) - w, b[1] = (o->y >> 8) - h, b[2] = (o->x >> 8) + w, b[3] = (o->y >> 8) + h;+}+static int hit(const int *b, int x0, int y0, int x1, int y1) { return x0 < b[2] && b[0] < x1 && y0 < b[3] && b[1] < y1; }+static int there(const obj_t *o) { return !(o->f & F_OFF); }+static int solid(const obj_t *o) { return (o->kind & 15) == K_BLOCK && !(o->f & (F_GHOST | F_OFF)) && o->w >= 8 && o->h >= 8; }++/* what the runner's box would hit at (x, y): the ground, a block, the top of a one-way tile it is+ above (feet: where its feet were, or -1); 0 for nothing, 1 for the ground, else 2 + the object */+static int blocked(int x, int y, int feet) {int b[4];- if (y < TOP || (!(mode & R_WRAP) && (x < WALL || x + PW > FW - WALL))) return ob;+ if (ground_in(x, y, x + hw, y + hh)) return 1;for (int k = 0; k < no; k++) {obj_t *o = &ob[k];- if (o == skip_ob || !solid(o)) continue;box(o, b);- if (overlap(x, y, PW, PH, b)) {- found |= 1u << o->i; /* a secret block, found by bumping into it */- return o;- }+ if (solid(o) || ((o->kind & 15) == K_THRU && there(o) && feet >= 0 && feet <= b[1]))+ if (hit(b, x, y, x + hw, y + hh)) return 2 + k;}return 0;}-/* Moves the runner along one axis, a pixel at a time; true when something stopped it. */-static bool move(int32_t *p, int32_t d, int axis) {- int a = *p >> 8, b = (*p + d) >> 8, s = b > a ? 1 : -1;- for (; a != b; a += s)- if (axis ? blocked(px >> 8, a + s) : blocked(a + s, py >> 8)) {+/* moves the runner d along an axis, a pixel at a time; what stopped it, or 0 */+static int step_axis(int32_t *p, int32_t d, int axis) {+ int a = *p >> 8, e = (*p + d) >> 8, s = e > a ? 1 : -1, w;+ for (; a != e; a += s)+ if ((w = axis ? blocked(hx >> 8, a + s, s > 0 ? a + hh : -1) : blocked(a + s, hy >> 8, -1))) {*p = a * 256 + (s > 0 ? 255 : 0);- return true;+ return w;}*p += d;- return false;-}-/* the runner's box, a pixel bigger all round, against an object */-static bool touching(const obj_t *o) {- int b[4];- box(o, b);- return overlap((px >> 8) - 1, (py >> 8) - 1, PW + 2, PH + 2, b);+ return 0;}--static void mark(int y, int h) { /* rows y to y + h (game pixels) to draw again */- dlo = imin(dlo, clampi(y * G - 2, 0, SCREEN_H)), dhi = imax(dhi, clampi((y + h) * G + 2, 0, SCREEN_H));+/* out of what it is in, a pixel at a time, the nearest way; false when it cannot get out */+static int unstick(void) {+ for (int d = 0; d < 64; d++)+ for (int i = 0; i < 4; i++) {+ int x = (hx >> 8) + (i == 2 ? -d : i == 3 ? d : 0), y = (hy >> 8) + (i == 0 ? -d : i == 1 ? d : 0);+ if (!blocked(x, y, -1)) {+ hx = x * 256 + (hx & 255), hy = y * 256 + (hy & 255);+ return 1;+ }+ }+ return 0;}-static void reset(void) { /* the room as it starts, the runner at the start */- const uint8_t *p = room;- mode = p[0], px = p[1] * 256, py = (p[2] - PH) * 256, vx = vy = 0;- ground = coyote = buffer = dead = won = warped = sprung = 0, face = 1;- int n = p[3];- no = 0, p += 4;- for (int i = 0; i < n; i++) {- const uint8_t *r = p;- p += *r & F_TRAP ? 10 : 5;- if (*r & F_TRAP) { /* there only after (or before) so many deaths */- int d = r[5] >> 3 & 7;- if ((d && d < 4 && tries < d) || (d > 4 && tries >= d - 4)) continue;+static void fire(int e) {+ cnt[e]++, at_[e] = (uint16_t)frame;+ for (int i = 0; i < ns; i++)+ if (st[i].ev == e) st[i].done = 0;+}++static void size_hero(void) { /* its box from its scale, about its centre */+ int w = imax(1, 5 * hsx / 100), h = imax(1, 13 * hsy / 100);+ hx -= (w - hw) * 128, hy -= (h - hh) * 128, hw = w, hh = h;+}++static void reset(void) { /* the room as it starts */+ int s0 = 0, r0 = 0;+ for (int i = 0; i < ri; i++) s0 += data[D_NSPAN + i], r0 += data[D_NSTEP + i];+ const uint8_t *h = data + ri * 5;+ modes = h[0];+ hsx = hsy = tsx = tsy = 100, hgl = 0, hw = 5, hh = 13;+ hx = (rd16(ri * 5 + 1) + 5) * 256, hy = (rd16(ri * 5 + 3) + 3) * 256, vx = vy = 0;+ for (int i = 0; i < 33; i++) gcol[i] = (uint16_t)rd16(D_GROUND + ri * 66 + 2 * i);+ no = nr = 0;+ for (int s = s0; s < s0 + data[D_NSPAN + ri]; s++) {+ int k = data[D_KIND + s];+ for (int i = 0; i < data[D_N + s]; i++) {+ obj_t *o = &ob[no++], z = {0};+ *o = z;+ o->kind = (uint8_t)(k & 63), o->f = data[D_FLAG + s], o->ev = data[D_EV + s];+ o->x = o->tx = (rd16(D_X + 2 * s) + (k & 64 ? 0 : 16 * i)) * 256;+ o->y = o->ty = (rd16(D_Y + 2 * s) + (k & 64 ? 16 * i : 0)) * 256;+ o->w = o->gw = (int16_t)(data[D_W + s] * 16), o->h = o->gh = (int16_t)(data[D_H + s] * 16);}- obj_t *o = &ob[no++];- o->r = r, o->i = (uint8_t)i, o->x = (int16_t)(r[1] << 4), o->y = (int16_t)(r[2] << 4), o->v = 0;- o->st = *r & F_TRAP ? S_WAIT : S_DONE, o->on = !(*r & F_HIDDEN), o->t = 0;}- ground = blocked(px >> 8, (py >> 8) + 1) != 0, full = 1;-}-static void enter(void) { /* the room rnum of the level */- room = rooms;- for (int i = level * ROOMS + rnum; i--;) room = next_room(room);- bg = colors[level][0], fg = colors[level][1];- found = 0, tries = 0;+ ns = 0;+ for (int r = r0; r < r0 + data[D_NSTEP + ri]; r++) {+ int o0 = data[D_OBJ + r], k = rd16(D_K + 2 * r);+ for (int i = 0; i < data[D_SN + r]; i++) {+ step_t *p = &st[ns++];+ p->ev = data[D_SEV + r], p->cond = data[D_COND + r], p->code = data[D_CODE + r];+ p->o = (uint8_t)(o0 == 255 ? 255 : o0 + i), p->done = 1;+ p->t = (uint16_t)(rd16(D_ST + 2 * r) + (k ? ((ob[o0 + i].x - ob[o0].x) >> 8) * k / 256 : 0));+ p->a = (int16_t)rd16(D_A + 2 * r), p->b = (int16_t)rd16(D_B + 2 * r), p->c = (int16_t)rd16(D_C + 2 * r);+ }+ }+ for (int e = 0; e < EVENTS; e++) cnt[e] = 0;+ int fl = modes & R_FLAPPY;+ run = PS(fl ? 70 : 80), jumpv = PS(fl ? 251 : 188), maxup = PS(fl ? 9999 : 300), maxdown = PS(fl ? 300 : 200);+ gx = 0, gy = PS2(fl ? 1200 : 800), back = downjump = slide = pushx = 0, dir = 1, keyev = -1;+ face = 1, ground = coyote = jumping = dead = won = frozen = started = flapped = waiting = 0, born = 18;+ frame = 0, shake = 0, full = 1;+ fire(0);+}+static void enter(void) { /* room rnum of the level */+ ri = level * ROOMS + rnum;+ bg = gfx_rgb(colors[level][0]), fg = gfx_rgb(colors[level][1]);+ tries = 0;reset();}static void die(void) {- dead = 1;+ if (dead || won) return;+ dead = 1, shake = 5, shake_n = 30;sv.deaths++, sv.run++;- for (int i = 0; i < 14; i++) {- bits[i].x = (int16_t)((px >> 4) + 32), bits[i].y = (int16_t)((py >> 4) + 48);- bits[i].vx = (int8_t)((int)(rnd() % 41) - 20), bits[i].vy = (int8_t)(-(int)(rnd() % 36) - 6);+ for (int i = 0; i < 8; i++) {+ bits[i].x = hx + hw * 128, bits[i].y = hy + hh * 128;+ bits[i].vx = (int16_t)PS((int)(rnd() % 361) - 180), bits[i].vy = (int16_t)-PS(300 + (int)(rnd() % 100));}save();}-/* has the trap of o gone off? */-static bool fired(const obj_t *o) {- const uint8_t *r = o->r;- int v = r[6], x = px >> 8, y = py >> 8, c;- switch (r[5] & 7) {- case T_START: return true;- case T_RIGHT: return x + PW > v;- case T_LEFT: return x < v;- case T_UP: return y < v;- case T_DOWN: return y + PH > v;- case T_TOUCH: return touching(o);- case T_AFTER:- for (int k = 0; k < no; k++)- if (ob[k].i == v) return ob[k].st >= S_GO;- return false;- default: /* T_NEAR */- c = (o->x >> 4) + r[3] / 2 - x - PW / 2;- return c < v && c > -v;+/* a step of the script */+static void exec(const step_t *p) {+ obj_t *o = &ob[p->o == 255 ? 0 : p->o];+ int a = p->a, b = p->b, c = p->c, big = o->f & F_BIG ? 2 : 1;+ switch (p->code) {+ case O_VEL: o->vx = (int16_t)PS(a), o->vy = (int16_t)PS(b), o->ml = 0; break;+ case O_MOVE:+ o->tx = o->x + a * 256, o->ty = o->y + b * 256, o->ml = (uint16_t)c;+ if (!c) o->x = o->tx, o->y = o->ty;+ break;+ case O_SET:+ if (c & 1) o->x = o->tx = a * 256;+ if (c & 2) o->y = o->ty = b * 256;+ break;+ case O_GROW:+ o->gw = (int16_t)(a * 16 * big), o->gh = (int16_t)(b * 16 * big), o->gl = (uint16_t)c;+ if (!c) o->w = o->gw, o->h = o->gh;+ break;+ case O_FLAG:+ if (a & ~o->f & F_BIG) o->w *= 2, o->h *= 2, o->gw *= 2, o->gh *= 2;+ o->f = (uint8_t)((o->f | a) & ~b);+ break;+ case O_SPAWN:+ o->f &= ~F_OFF;+ if (a != 255) o->x = o->tx = ob[a].x + b * 256, o->y = o->ty = ob[a].y + c * 256;+ break;+ case O_WARP: hx = (a + 5) * 256, hy = (b + 3) * 256, vx = vy = 0, frozen = 45; break;+ case O_HERO:+ if (a == H_RUN) run = PS(b);+ if (a == H_JUMP) jumpv = PS(b);+ if (a == H_MAXUP) maxup = PS(b);+ if (a == H_MAXDOWN) maxdown = PS(b);+ if (a == H_BACK) back = b;+ if (a == H_DOWNJUMP) downjump = b;+ if (a == H_DIR) dir = b;+ if (a == H_SLIDE) slide = b;+ if (a == H_PUSHX) pushx = PS(b), run = PS(300);+ break;+ case O_GRAV: gx = PS2(a), gy = PS2(b); break;+ case O_HGROW: tsx = a, tsy = b, hgl = c ? c : 1; break;+ case O_SHAKE: shake = a, shake_n = b; break;+ case O_FIRE: fire(a); break;+ case O_REARM: o->f &= ~F_USED; break;+ case O_TOWARD: o->vx = (int16_t)PS(hx < o->x ? -a : a); break;+ case O_RULE:+ if (a == U_NONE) {+ for (int i = 0; i < nr; i++)+ if (rule[i].o == p->o && (!b || rule[i].type == b)) rule[i] = rule[--nr], i--;+ } else if (nr < 12) {+ rule[nr].o = p->o, rule[nr].type = (uint8_t)a, rule[nr].p = (int16_t)b, rule[nr++].q = (int16_t)c;+ }+ break;+ case O_ACCEL: o->ax = (int16_t)PS2(a), o->ay = (int16_t)PS2(b); break;+ case O_HOP:+ if (!(o->f & F_HOP)) o->f |= F_HOP, o->rest = (int16_t)(o->y >> 8), o->vy = (int16_t)-PS(a);+ break;+ default: keyev = a; /* O_KEY */+ }+}++static void script(void) {+ for (int i = 0; i < ns; i++) {+ step_t *p = &st[i];+ int c = p->cond;+ if (p->done || !cnt[p->ev] || (uint16_t)(frame - at_[p->ev]) < p->t) continue;+ p->done = 1;+ if (!c || (c < 16 ? cnt[p->ev] == c : c < 32 ? cnt[c & 15] : !cnt[c & 15])) exec(p);}}-/* Moves o to (x, y) (16ths), carrying the runner standing on it and pushing it when it runs- into it; the runner crushed against something else dies. */-static void shift(obj_t *o, int x, int y) {- int b[4], g = mode & R_FLIP ? -1 : 1, rx = px >> 8, ry = py >> 8;- box(o, b);- int ox = b[0], oy = b[1];- bool on_it = solid(o) && (o->r[5] >> 6) != M_FALL && rx < b[0] + b[2] && b[0] < rx + PW &&- (g > 0 ? ry + PH == b[1] : ry == b[1] + b[3]);- mark(b[1], b[3]);- o->x = (int16_t)x, o->y = (int16_t)y;+/* the runner pushed out of the way of a block that moved by (dx, dy) pixels into it */+static void shove(obj_t *o, int dx, int dy) {+ int b[4];box(o, b);- mark(b[1], b[3]);- int dx = b[0] - ox, dy = b[1] - oy;- if ((!dx && !dy) || dead) return;- skip_ob = o;- if (on_it) move(&px, dx * 256, 0), move(&py, dy * 256, 1);- if (solid(o) && overlap(px >> 8, py >> 8, PW, PH, b)) {- if (dx) move(&px, (dx > 0 ? b[0] + b[2] - (px >> 8) : b[0] - PW - (px >> 8)) * 256, 0);- if (dy) move(&py, (dy > 0 ? b[1] + b[3] - (py >> 8) : b[1] - PH - (py >> 8)) * 256, 1);- if (overlap(px >> 8, py >> 8, PW, PH, b)) die();- }- skip_ob = 0;+ if (!hit(b, hx >> 8, hy >> 8, (hx >> 8) + hw, (hy >> 8) + hh)) return;+ int32_t px = hx, py = hy;+ o->f |= F_GHOST; /* (the block left out while the runner moves out of it) */+ if (dy) step_axis(&hy, (dy < 0 ? b[1] - hh - (hy >> 8) : b[3] - (hy >> 8)) * 256, 1);+ else if (dx) step_axis(&hx, (dx < 0 ? b[0] - hw - (hx >> 8) : b[2] - (hx >> 8)) * 256, 0);+ o->f &= ~F_GHOST;+ if (hit(b, hx >> 8, hy >> 8, (hx >> 8) + hw, (hy >> 8) + hh) || (px == hx && py == hy && !unstick())) die();}-static const uint8_t speeds[16] = {0, 2, 4, 6, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128};-static void traps(void) {+static void objects(void) {+ int b[4];for (int k = 0; k < no; k++) {obj_t *o = &ob[k];- const uint8_t *r = o->r;- int kind = r[0] & 15, b[4];- if (kind == K_SAW || o->t > 200) mark((o->y >> 4) - 1, r[4] + 2); /* turning, springing */- if (kind == K_SPRING && o->t > 200) o->t++; /* (springing back, to 0) */- if (kind == K_BUTTON && o->st == S_DONE && !touching(o)) o->st = S_WAIT, mark(o->y >> 4, r[4]);- if (o->st == S_WAIT && !dead && !won && fired(o)) o->st = S_DELAY, o->t = (uint8_t)((r[9] >> 4) * 4);- if (o->st == S_DELAY && !(o->t && o->t--)) {- o->st = S_GO;- box(o, b);- mark(b[1], b[3]);- if (*r & F_HIDDEN) o->on = 1;- if (*r & F_VANISH) o->on = 0, o->st = S_DONE;- if (kind == K_SWITCH || kind == K_BUTTON) mode ^= r[7], o->st = S_DONE, full = 1;- if (o->on && solid(o) && overlap(px >> 8, py >> 8, PW, PH, b)) die(); /* a block appears on the runner */- }- if (o->st != S_GO) continue;- int m = r[5] >> 6, s = speeds[r[9] & 15], tx = (r[1] + (int8_t)r[7]) * 16, ty = (r[2] + (int8_t)r[8]) * 16;- if (!s) s = 4096;- if (m == M_FALL) {- o->v = (int16_t)imin(o->v + 4, 80);- shift(o, o->x, o->y + o->v);- if (o->y >> 4 > FH) o->on = 0, o->st = S_DONE;- continue;+ int kind = o->kind & 15;+ if (!there(o)) continue;+ int32_t ox = o->x, oy = o->y;+ if (o->gl) o->w += (o->gw - o->w) / o->gl, o->h += (o->gh - o->h) / o->gl, o->gl--;+ if (o->ml) o->x += (o->tx - o->x) / o->ml, o->y += (o->ty - o->y) / o->ml, o->ml--;+ if (o->f & F_HOP || kind == K_GSPIKE) o->vy = (int16_t)clampi(o->vy + gy, -PS(300), PS(300));+ o->vx += o->ax, o->vy += o->ay;+ o->x += o->vx;+ box(o, b);+ if ((o->ax || kind == K_GSPIKE) && ground_in(b[0], b[1], b[2], b[3])) o->x -= o->vx, o->vx = 0;+ o->y += o->vy;+ box(o, b);+ if (kind == K_GSPIKE) { /* falling with gravity, onto the ground and the blocks */+ int c[4], stop = ground_in(b[0], b[1], b[2], b[3]);+ for (int j = 0; j < no; j++)+ if (solid(&ob[j])) box(&ob[j], c), stop |= hit(c, b[0], b[1], b[2], b[3]);+ if (stop) o->y -= o->vy, o->vy = 0;}- if (m == M_CHASE) /* towards the runner, along the axes it moves on */- tx = r[7] ? (int)(px >> 4) + PW * 8 - r[3] * 8 : o->x, ty = r[8] ? (int)(py >> 4) + PH * 8 - r[4] * 8 : o->y;- if (m == M_LOOP && o->v) tx = r[1] << 4, ty = r[2] << 4; /* on the way back */- shift(o, o->x + clampi(tx - o->x, -s, s), o->y + clampi(ty - o->y, -s, s));- if (o->x == tx && o->y == ty && m != M_CHASE) {- if (m == M_LOOP) o->v = !o->v;- else o->st = S_DONE;+ if (o->f & F_HOP && o->y >> 8 >= o->rest) o->y = o->rest * 256, o->vy = 0, o->f &= ~F_HOP;+ if (solid(o) && !dead) shove(o, (o->x >> 8) - (ox >> 8), (o->y >> 8) - (oy >> 8));+ if (kind == K_SPRING && o->t) o->t--;+ }+ for (int i = 0; i < nr; i++) {+ obj_t *o = &ob[rule[i].o];+ int x = o->x >> 8, p = rule[i].p, q = rule[i].q;+ switch (rule[i].type) {+ case U_PATROL:+ if (x <= p) o->vx = (int16_t)PS(70);+ if (x >= q) o->vx = (int16_t)-PS(70);+ break;+ case U_FOLLOW: o->x = ob[p].x + q * 256; break;+ case U_STOPX:+ if ((o->vx > 0 && x >= p) || (o->vx < 0 && x <= p)) o->vx = 0, o->x = q * 256;+ break;+ case U_WRAPX:+ if (o->vx < 0 && x < p) o->x = q * 256;+ if (o->vx > 0 && x > q) o->x = p * 256;}}}-/* what the runner touches: springs, warps, the door, what kills */+/* what the runner touches */static void contacts(void) {- int x = px >> 8, y = py >> 8, b[4], g = mode & R_FLIP ? -1 : 1, in_warp = 0;- if (y > FH + 2 || y < -PH - 2) die();- for (int k = 0; k < no && !dead; k++) {+ int x = hx >> 8, y = hy >> 8, b[4];+ for (int k = 0; k < no && !dead && !won; k++) {obj_t *o = &ob[k];- int kind = o->r[0] & 15;- if (!o->on) continue;+ int kind = o->kind & 15, t = o->kind >> 4 & 3, w = o->w >> 4, h = o->h >> 4;+ if (!there(o)) continue;box(o, b);- if (kind >= K_SPIKE_U && kind <= K_SPIKE_R) { /* the points, a little inside the teeth */- int vert = kind <= K_SPIKE_D, hb[4] = {b[0] + (vert ? 1 : 2 * (kind == K_SPIKE_L)),- b[1] + (vert ? 2 * (kind == K_SPIKE_U) : 1), b[2] - 2, b[3] - 2};- if (overlap(x, y, PW, PH, hb)) die();- } else if (kind == K_SAW) { /* the nearest point of the box to the middle of the saw */- int c = b[2] / 2, cx = b[0] + c, cy = b[1] + c, dx = cx - clampi(cx, x, x + PW - 1), dy = cy - clampi(cy, y, y + PH - 1);- if (dx * dx + dy * dy < (c - 1) * (c - 1)) die();- } else if (kind == K_SPRING) {- if (overlap(x, y + PH - 1, PW, 2, b) && vy * g >= 0) vy = -g * SPRING, o->t = 236, ground = 0, sprung = 1;- } else if (kind == K_WARP) {- int e[4] = {o->r[3], o->r[4], 8, 12}, a = overlap(x, y, PW, PH, b), z = overlap(x, y, PW, PH, e);- if ((a || z) && !warped) {- mark(y, PH);- px = ((z ? b[0] : e[0]) + 2) * 256, py = ((z ? b[1] : e[1]) + 12 - PH) * 256;- mark(py >> 8, PH);- }- in_warp |= a | z;- } else if (kind == K_DOOR && !(o->r[0] & F_GHOST)) {- int in[4] = {b[0] + 3, b[1] + 4, DW - 6, DH - 4};- if (overlap(x, y, PW, PH, in)) won = 1, mark(b[1], DH);+ if (kind == K_SPIKE) { /* the teeth: the 5 pixels of 16 they stand in, turned with it */+ if (t == 0) b[1] = b[3] - h * 5 / 8;+ if (t == 2) b[3] = b[1] + h * 5 / 8;+ if (t == 1) b[2] = b[0] + w * 5 / 8;+ if (t == 3) b[0] = b[2] - w * 5 / 8;+ }+ if (kind == K_COIN || kind == K_BAD || kind == K_DEATH) b[0] += w / 3, b[1] += h / 3, b[2] -= w / 3, b[3] -= h / 3;+ if (kind == K_SPRING) b[1] = b[3] - h * 3 / 8;+ if (kind == K_DOOR) b[0] += w / 4, b[2] -= w / 4, b[1] += h / 4;+ if (!hit(b, x, y, x + hw, y + hh)) continue;+ if (kind == K_SAW) { /* round: the nearest point of the box to its middle */+ int cx = o->x >> 8, cy = o->y >> 8, dx = cx - clampi(cx, x, x + hw - 1), dy = cy - clampi(cy, y, y + hh - 1);+ if (dx * dx + dy * dy < (w - 1) * (w - 1)) die();+ } else if (kind == K_SPIKE || kind == K_BAD || kind == K_GSPIKE || kind == K_DEATH) {+ die();+ } else if (kind == K_SPRING && !o->t) {+ vy = -maxup, jumping = 1, o->t = 18;+ } else if (kind == K_TRIG && !(o->f & F_USED)) {+ o->f |= F_USED, fire(o->ev);+ } else if (kind == K_COIN) {+ o->f |= F_OFF;+ } else if (kind == K_BUTTON) {+ o->f |= F_USED;+ } else if (kind == K_DOOR) {+ won = 1;}}- warped = in_warp;}+static void hero(int in) {+ int down = gy < 0 ? -1 : 1, b[4];+ if (hgl) { /* growing or shrinking, out of what it grows into */+ hsx += (tsx - hsx) / hgl, hsy += (tsy - hsy) / hgl, hgl--;+ size_hero();+ if (blocked(hx >> 8, hy >> 8, -1) && !unstick()) die();+ }+ int m = !!(in & I_RIGHT) - !!(in & I_LEFT), jump = (downjump ? I_DOWN : I_UP) & in & ~held_in;+ if (back) m = -m;+ if (m) face = m;+ if (modes & R_FLAPPY) {+ if (!started && in & ~held_in && frame > 30) started = 1;+ if (started) vx = clampi(vx + dir * PS(52), -run, run);+ if (started && in & I_UP & ~held_in) vy = -jumpv, flapped = 8;+ if (vy > maxdown) vy = maxdown;+ } else {+ int under = blocked(hx >> 8, (hy >> 8) + down, down > 0 ? (hy >> 8) + hh - 1 : -1);+ if (pushx) vx = pushx;+ else if (m) vx = m * run;+ else if (ground) {+ obj_t *o = under > 1 ? &ob[under - 2] : 0;+ if (o && (o->vx || o->vy)) vx = o->vx, vy = o->vy; /* carried by what it stands on */+ else if (!(o && o->f & F_ICE)) vx = iabs(vx) <= iabs(gy) ? 0 : vx - (vx > 0 ? 1 : -1) * iabs(gy);+ } else if (!slide) {+ vx = iabs(vx) > PS(10) ? vx * 4 / 5 : 0;+ }+ if (modes & R_GRAVITY) {+ if (in & I_UP & ~held_in && started && (ground || blocked(hx >> 8, (hy >> 8) - down, -1))) gy = -gy, ground = 0;+ } else if (jump && (ground || (coyote < 5 && !jumping))) {+ vy = -down * jumpv, jumping = 1;+ }+ }+ vx += gx, vy += gy;+ if (vy >= maxdown) vy = maxdown;+ if (vy <= -maxup) vy = -maxup;+ if (!pushx) vx = clampi(vx, -run, run);+ if (step_axis(&hx, vx, 0)) vx = 0;+ if (step_axis(&hy, vy, 1)) vy = 0;+ /* where its picture is on the screen (the game's camera: x 50 to 477) */+ int ax = (hx >> 8) - 55, ay = (hy >> 8) - 3;+ if (modes & R_WRAP) { /* off one side of the screen, back in at the other */+ if (ax < -6) hx += 424 * 256;+ if (ax > 419) hx -= 424 * 256;+ if (ay > 234) hy -= 242 * 256;+ if (modes & R_WRAPY && ay < -9) hy += 239 * 256;+ ax = (hx >> 8) - 55, ay = (hy >> 8) - 3;+ }+ if (ay < -16 || ay > 240 || ax < -8 || ax > 421) die();+ ground = blocked(hx >> 8, (hy >> 8) + down, down > 0 ? (hy >> 8) + hh - 1 : -1) != 0;+ if (ground) coyote = 0, jumping &= vy * down < 0;+ else coyote++;+ if (frame == 30) started = 1;+ (void)b;+ contacts();+}++static int sdx, sdy; /* the screen shaking (pixels of the screen) */static void step(int in) {- anim++;+ frame++, anim++;+ if (shake_n) shake_n--;+ sdx = shake_n ? ((int)(rnd() % 3) - 1) * (1 + shake / 4) : 0, sdy = shake_n ? ((int)(rnd() % 3) - 1) * (1 + shake / 4) : 0;if (dead) {- for (int i = 0; i < 14; i++) {- mark(bits[i].y >> 4, 2);- bits[i].x += bits[i].vx, bits[i].y += bits[i].vy, bits[i].vy = (int8_t)imin(bits[i].vy + 3, 60);- mark(bits[i].y >> 4, 2);- }- if (++dead > 42) tries++, reset();+ for (int i = 0; i < 8; i++) bits[i].x += bits[i].vx, bits[i].y += bits[i].vy, bits[i].vy += PS2(800);+ if (++dead == 30) waiting = 1;return;}- if (won) return;- int g = mode & R_FLIP ? -1 : 1;- mark((py >> 8) - 1, PH + 2);- traps();- if (dead) return;- int dir = !!(in & I_RIGHT) - !!(in & I_LEFT);- if (mode & R_BACK) dir = -dir;- if (in & I_JUMP & ~held_in) buffer = 7;- held_in = in;- int ice = mode & R_ICE && ground, acc = ground ? (ice ? 5 : 60) : 40, dec = ground ? (ice ? 3 : 90) : 20;- if (dir) vx = clampi(vx + dir * acc, -RUN, RUN), face = dir;- else vx = vx > dec ? vx - dec : vx < -dec ? vx + dec : 0;- if (buffer) { /* jump asked for a moment ago, on the ground or just off it (or anywhere in R_AIR) */- buffer--;- if (coyote || mode & R_AIR) vy = -g * JUMP, buffer = coyote = 0;+ if (won) {+ won++;+ return;}- sprung &= vy * g < 0; /* (a spring's lift isn't cut short like a jump let go) */- vy += g * (vy * g < 0 && !(in & I_JUMP) && !sprung ? 3 * GRAV : GRAV);- if (vy * g > FALL) vy = g * FALL;- if (move(&px, vx, 0)) vx = 0;- if (move(&py, vy, 1)) vy = 0;- if (mode & R_WRAP) px = (px + (FW << 8) + (PW << 7)) % (FW << 8) - (PW << 7); /* out one side, in at the other */- ground = blocked(px >> 8, (py >> 8) + g) != 0;- coyote = ground ? 6 : coyote ? coyote - 1 : 0;- contacts();- mark((py >> 8) - 1, PH + 2);+ script();+ objects();+ if (born) born--;+ else if (frozen) frozen--;+ else if (!dead) hero(in);+ if ((in & (I_LEFT | I_RIGHT)) && !cnt[EV_MOVE]) fire(EV_MOVE);+ if (keyev >= 0 && in & I_UP & ~held_in) fire(keyev);+ held_in = in;}/* ------------------------------------------------------------ drawing */-static void fillg(int x, int y, int w, int h, color_t c) { gfx_fill(x * G, y * G, w * G, h * G, c); }--/* a picture of w x n pixels (a byte a row, its first pixel the top bit), s screen pixels each,- turned round left to right and upside down as asked */-static void bitmap(const uint8_t *rows, int n, int w, int x, int y, int s, color_t c, int fx, int fy) {- for (int j = 0; j < n; j++)- for (int i = 0, v = rows[fy ? n - 1 - j : j]; i < w; i++)- if (v >> (7 - (fx ? w - 1 - i : i)) & 1) gfx_fill(x + i * s, y + j * s, s, s, c);-}-/* the runner: standing, two steps running, jumping (6 x 7) */-static const uint8_t runner[4][7] = {- {0x30, 0x30, 0x78, 0x78, 0x78, 0x48, 0x48},- {0x30, 0x30, 0x78, 0x78, 0xF8, 0x8C, 0x04},- {0x30, 0x30, 0x78, 0x78, 0x78, 0x30, 0x30},- {0x18, 0x18, 0x78, 0x7C, 0x78, 0xCC, 0x80},+static int sxp(int32_t x) { return (int)((x * 3 >> 10) - 38) + sdx; } /* 256ths of a scene pixel: the screen's */+static int syp(int32_t y) { return (int)((y * 3 >> 10) + 30) + sdy; }+static void put(int x, int y, color_t c) {+ if (x >= 0 && x < SCREEN_W && y >= gfx_y0 && y < gfx_y1) gfx_buf[(y - gfx_y0) * SCREEN_W + x] = c;+}++/* pictures: 16 rows of 16 bits (the first pixel the lowest) */+static const uint16_t spike_px[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x318C, 0x318C, 0x7BDE, 0x7BDE, 0xFFFF};+static const uint16_t button_px[2][16] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x7E0, 0xFF0, 0xFF0, 0xFF0, 0xFF0, 0x1FF8},+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF0, 0x1FF8}};+/* the runner (columns 3 to 11, rows 2 to 15): standing, jumping, running (four) */+static const uint16_t hero_px[6][14] = {+ {0, 0x1C0, 0x1C0, 0x1C0, 0x3E0, 0x3E0, 0x3E0, 0x3E0, 0x3E0, 0x3E0, 0x3E0, 0x360, 0x360, 0x360},+ {0, 0x1C0, 0x1C0, 0x1C0, 0x7E0, 0x7E0, 0x7E0, 0x7E0, 0x3E0, 0x3F8, 0xFF8, 0xF18, 0, 0},+ {0, 0, 0x1C0, 0x1C0, 0x1C0, 0x3E0, 0x3E0, 0x3E0, 0x3E0, 0x3E0, 0x3F0, 0x3F0, 0x330, 0x630},+ {0x1C0, 0x1C0, 0x1C0, 0x7E0, 0x7E0, 0x7E0, 0x3E0, 0x3E0, 0xFE0, 0xFF8, 0xF18, 0, 0, 0},+ {0, 0x1C0, 0x1C0, 0x1C0, 0x3E0, 0x3E0, 0x3E0, 0x3E0, 0x3E0, 0x3E0, 0x7E0, 0x7E0, 0x660, 0xC60},+ {0x1C0, 0x1C0, 0x3F0, 0x3F0, 0x3F0, 0x3E0, 0x3E0, 0xFE0, 0xFF8, 0xF18, 0, 0, 0, 0},};-static const uint8_t skull[5] = {0x70, 0xF8, 0xA8, 0xF8, 0x50};-static const uint8_t horns[3] = {0x81, 0xC3, 0x66};--static void draw_runner(int x, int y, int f, int flip) {- bitmap(runner[f], 7, 6, x - (face < 0) * G, y, G, BLACK, face < 0, flip);-}--/* a door, s screen pixels a pixel of the game; its window in w */-static void door(int x, int y, int s, color_t frame, color_t w, int up) {- gfx_fill(x + s, y, 9 * s, s, frame);- gfx_fill(x, y + s, 11 * s, 19 * s, frame);- if (up) y += 10 * s; /* (hanging from the ceiling: the window at the bottom) */- gfx_fill(x + 2 * s, y + s, 7 * s, 9 * s, w);- gfx_fill(x + s, y + 2 * s, 9 * s, 7 * s, w);-}--static void spikes(int kind, int x, int y, int w, int h) {- int n = (kind < K_SPIKE_L ? w : h) / 5;- for (int t = 0; t < n; t++)- for (int j = 0; j < 3; j++) { /* the three steps of a tooth, from its point */- int a = 2 - j, l = 1 + 2 * j, d = j ? 2 * j - 1 : 0, e = j ? 2 : 1, u = t * 5 + a;- if (kind == K_SPIKE_U) fillg(x + u, y + d, l, e, fg);- if (kind == K_SPIKE_D) fillg(x + u, y + h - d - e, l, e, fg);- if (kind == K_SPIKE_L) fillg(x + d, y + u, e, l, fg);- if (kind == K_SPIKE_R) fillg(x + w - d - e, y + u, e, l, fg);++/* a picture over the box (x0, y0)-(x1, y1) of the screen, turned t quarters, upside down if fy */+static void picture(const uint16_t *px, int rows, int x0, int y0, int x1, int y1, int t, int fx, int fy, color_t c) {+ int w = x1 - x0, h = y1 - y0;+ if (w <= 0 || h <= 0 || y1 <= gfx_y0 || y0 >= gfx_y1) return;+ for (int y = imax(y0, gfx_y0); y < imin(y1, gfx_y1); y++)+ for (int x = x0; x < x1; x++) {+ int u = (x - x0) * 16 / w, v = (y - y0) * 16 / h, s;+ if (fx) u = 15 - u;+ if (fy) v = 15 - v;+ if (t & 1) s = u, u = v, v = 15 - s;+ if (t & 2) u = 15 - u, v = 15 - v;+ v -= 16 - rows;+ if (v >= 0 && px[v] >> u & 1) put(x, y, c);}}-static void draw_object(const obj_t *o, int blocks) {- const uint8_t *r = o->r;- int kind = r[0] & 15, b[4];- if (!o->on || (kind == K_BLOCK || kind == K_SECRET) != blocks) return;+static void draw_hero(int32_t x, int32_t y, int w, int h, int flip, int f) {+ /* its picture is 16 x 16 about the 5 x 13 box, the box at (5, 3) */+ int32_t px = x - w * 256, py = y - h * 3 * 256 / 13, pw = w * 16 * 256 / 5, ph = h * 16 * 256 / 13;+ if (flip) py = y + h * 256 - ph + h * 3 * 256 / 13; /* (upside down: the box at the picture's top) */+ picture(hero_px[f], 14, sxp(px), syp(py), sxp(px + pw), syp(py + ph), 0, face < 0, flip, BLACK);+}++static void draw_door(int x0, int y0, int x1, int y1, int shut) {+ int w = x1 - x0, h = y1 - y0, e = imax(1, w / 8);+ gfx_rrect(x0, y0, w, h + e, e * 2, fg, 256);+ gfx_fill(x0 + e, y0 + e, w - 2 * e, h - e, GREY);+ if (shut) gfx_fill(x0 + e, y0 + e, w - 2 * e, (h - e) * imin(shut, 12) / 12, fg);+}++static void draw_object(obj_t *o) {+ int kind = o->kind & 15, t = o->kind >> 4 & 3, b[4];+ if (o->f & (F_HIDE | F_OFF) || kind == K_TRIG || o->w <= 0 || o->h <= 0) return;box(o, b);- if (b[1] * G >= gfx_y1 || (b[1] + b[3]) * G <= gfx_y0) {- if (kind != K_WARP) return;- }- int x = b[0], y = b[1], w = b[2], h = b[3];- if (kind == K_BLOCK) fillg(x, y, w, h, fg);- else if (kind == K_SECRET) {- if (found >> o->i & 1) fillg(x, y, w, h, fg);- } else if (kind <= K_SPIKE_R) spikes(kind, x, y, w, h);- else if (kind == K_DOOR) door(x * G, y * G, G, fg, won && !(r[0] & F_GHOST) ? fg : GREY, r[4] == 1);- else if (kind == K_SAW) { /* a disc with eight teeth, turning */- int c = w / 2, a = anim >> 1;- gfx_circle((x + c) * G, (y + c) * G, c * G - 2, fg, 256);- for (int t = 0; t < 8; t++) {- static const int8_t sx[8] = {0, 7, 10, 7, 0, -7, -10, -7};- int q = (t + a) & 7, z = c * G - 1;- gfx_fill((x + c) * G + sx[q] * z / 10 - 2, (y + c) * G + sx[(q + 6) & 7] * z / 10 - 2, 4, 4, fg);+ int x0 = sxp(b[0] * 256), y0 = syp(b[1] * 256), x1 = sxp(b[2] * 256), y1 = syp(b[3] * 256), w = x1 - x0, h = y1 - y0;+ if (y1 < gfx_y0 - 4 || y0 > gfx_y1 + 4) return;+ if (kind == K_BLOCK && b[1] <= 0) y0 = 0, h = y1; /* (on through the margins, as the ground) */+ if (kind == K_BLOCK && b[3] >= 240) h = SCREEN_H - y0;+ if (kind == K_BLOCK || kind == K_GSPIKE) {+ int s = kind == K_GSPIKE ? h * 5 / 26 : 0;+ gfx_fill(x0, y0 + s, w, h - 2 * s, fg);+ if (s) picture(spike_px, 5, x0, y0 - h * 11 / 26, x1, y0 + s, 0, 0, 0, fg), picture(spike_px, 5, x0, y1 - s, x1, y1 + h * 11 / 26, 2, 0, 0, fg);+ } else if (kind == K_SPIKE) {+ picture(spike_px, 5, x0, y0, x1, y1, t, 0, 0, fg);+ } else if (kind == K_SAW) {+ int r = w / 2;+ gfx_circle(x0 + r, y0 + r, r, fg, 256);+ gfx_fill(x0 + r - imax(1, r / 8), y0 + r - imax(1, r / 8), imax(2, r / 4), imax(2, r / 4), bg);+ } else if (kind == K_SPRING) { /* its plate, up on its stem while it pushes */+ int up = o->t ? 8 : 0;+ gfx_fill(x0, y0 + h * (13 - up) / 16, w, imax(1, h / 16), fg);+ gfx_fill(x0 + w * 6 / 16, y0 + h * (14 - up) / 16, w / 4, h * (2 + up) / 16, fg);+ } else if (kind == K_DOOR) {+ if (modes & R_SWAP) draw_hero(o->x - 5 * 128 + 256, o->y - 128, 5, 13, 0, 0);+ else draw_door(x0, y0, x1, y1, won ? won : 0);+ } else if (kind == K_COIN || kind == K_BAD) {+ gfx_rrect(x0 + w * 5 / 16, y0 + h * 5 / 16, w * 6 / 16, h * 6 / 16, 1, fg, 256);+ } else if (kind == K_WARP) { /* rings of squares, turning */+ for (int i = (anim >> 3 & 1); i < 7; i += 2) {+ int d = w * (i + 1) / 16;+ gfx_fill(x0 + d, y0 + d, w - 2 * d, imax(1, w / 16), fg), gfx_fill(x0 + d, y1 - d - 1, w - 2 * d, imax(1, w / 16), fg);+ gfx_fill(x0 + d, y0 + d, imax(1, w / 16), h - 2 * d, fg), gfx_fill(x1 - d - 1, y0 + d, imax(1, w / 16), h - 2 * d, fg);}- gfx_circle((x + c) * G, (y + c) * G, 3, bg, 256);- } else if (kind == K_SPRING) {- int up = o->t > 200 && o->t < 248 ? 1 : 2;- fillg(x, y + 2, w, 1, fg);- fillg(x + 1, y + 2 - up, 1, up, fg), fillg(x + w - 2, y + 2 - up, 1, up, fg);- fillg(x, y + 1 - up, w, 1, fg);- } else if (kind == K_WARP) { /* both of its ends: rings */- for (int e = 0; e < 2; e++) {- int ex = (e ? r[3] : x) * G + 8, ey = (e ? r[4] : y) * G + 12;- gfx_rrect(ex - 8, ey - 12, 16, 24, 8, WHITE, 256);- gfx_rrect(ex - 5, ey - 9, 10, 18, 5, bg, 256);+ } else if (kind == K_BUTTON) {+ picture(button_px[!!(o->f & F_USED)], 6, x0, y0, x1, y1, t, 0, 0, fg);+ } else if (kind == K_THRU) {+ for (int i = 0; i < 3; i++) gfx_fill(x0 + w * (1 + 5 * i) / 16, y0, w / 4, imax(1, h / 8), fg);+ }+}++static void ground_draw(void) {+ for (int ty = 0; ty < 15; ty++) {+ int y0 = syp(ty * 4096), y1 = syp(ty * 4096 + 4096);+ if (ty == 0) y0 = 0;+ if (ty == 14) y1 = SCREEN_H;+ if (y1 <= gfx_y0 || y0 >= gfx_y1) continue;+ for (int tx = 3; tx < 30; tx++) {+ if (!cell(tx, ty)) continue;+ int e = tx;+ while (e < 29 && cell(e + 1, ty)) e++;+ gfx_fill(imax(0, sxp(tx * 4096)), y0, sxp(e * 4096 + 4096) - imax(0, sxp(tx * 4096)), y1 - y0, fg);+ tx = e;}- } else if (kind == K_BUTTON) { /* (a ghost one: on a ceiling) */- int down = touching(o), up = r[0] & F_GHOST;- fillg(x + 1, y + (up ? 0 : down), w - 2, h - down, RED);- fillg(x, up ? y : y + h - 1, w, 1, fg);}}-static void say(const np_font_t *f, int cx, int base, const char *s, color_t c, color_t shade) {- gfx_text_center(f, cx + 1, base + 2, s, shade, 256);- gfx_text_center(f, cx, base, s, c, 256);+static void say(int cx, int base, const char *s) {+ gfx_text_center(&np_font_title, cx + 1, base + 2, s, BLACK, 256);+ gfx_text_center(&np_font_title, cx, base, s, YELLOW, 256);}-static void button(int y, const char *s, bool on, color_t a, color_t b) {- if (on) gfx_rrect(96, y, 128, 24, 12, a, 256);- gfx_text_center(&np_font_body, 160, y + 17, s, on ? b : a, 256);+static void button(int y, const char *s, bool on) {+ if (on) gfx_rrect(96, y, 128, 24, 12, YELLOW, 256);+ gfx_text_center(&np_font_body, 160, y + 17, s, on ? DARK : WHITE, 256);}-static const char *const pause_items[] = {T("Resume"), T("Restart"), T("Levels"), T("How to play"), T("Quit game")};+static const char *const pause_items[] = {T("Resume"), T("Restart"), T("Levels"), T("Quit game")};static void overlay(void) {- color_t a = scr == SC_HUB ? HUB_BG : bg, b = scr == SC_HUB ? HUB_FG : fg;char s[24];gfx_fill_alpha(0, 0, SCREEN_W, SCREEN_H, BLACK, 100);+ gfx_rrect(56, 36, 208, 168, 12, DARK, 256);if (ov == OV_PAUSE) {- gfx_rrect(72, 28, 176, 190, 12, b, 256);- gfx_text_center(&np_font_title, 160, 60, T("Paused"), a, 256);- for (int i = 0; i < 5; i++) button(72 + 28 * i, pause_items[i], sel == i, a, b);+ say(160, 68, T("Paused"));+ for (int i = 0; i < 4; i++) button(84 + 28 * i, pause_items[i], sel == i);} else if (ov == OV_QUIT) {- gfx_rrect(72, 76, 176, 96, 12, b, 256);- gfx_text_center(&np_font_title, 160, 110, T("Quit game?"), a, 256);+ say(160, 100, T("Quit game?"));for (int i = 0; i < 2; i++) {- if (sel == i) gfx_rrect(92 + 72 * i, 128, 64, 24, 12, a, 256);- gfx_text_center(&np_font_body, 124 + 72 * i, 145, i ? T("Yes") : T("No"), sel == i ? b : a, 256);+ if (sel == i) gfx_rrect(92 + 72 * i, 128, 64, 24, 12, YELLOW, 256);+ gfx_text_center(&np_font_body, 124 + 72 * i, 145, i ? T("Yes") : T("No"), sel == i ? DARK : WHITE, 256);}} else if (ov == OV_HELP) {- static const char *const keys[][2] = {{T("Left Right"), T("run")}, {T("Up, OK, EXE"), T("jump (hold: higher)")},- {T("Back"), T("pause")}};- gfx_rrect(40, 30, 240, 180, 12, b, 256);- gfx_text_center(&np_font_title, 160, 62, T("How to play"), a, 256);- gfx_paragraph(&np_font_body, 160, 86, 208, 15, T("Reach the door. The level has other plans: trust nothing."), a,+ static const char *const keys[][2] = {{T("Left Right"), T("run")}, {T("Up, OK, EXE"), T("jump")}, {T("Back"), T("pause")}};+ say(160, 66, T("How to play"));+ gfx_paragraph(&np_font_body, 160, 88, 192, 15, T("Reach the door. The level has other plans: trust nothing."), WHITE,256);for (int i = 0; i < 3; i++) {- gfx_text_right(&np_font_body, 136, 136 + 18 * i, keys[i][0], WHITE, 256);- gfx_text(&np_font_body, 146, 136 + 18 * i, keys[i][1], a, 256);+ gfx_text_right(&np_font_body, 136, 136 + 16 * i, keys[i][0], YELLOW, 256);+ gfx_text(&np_font_body, 146, 136 + 16 * i, keys[i][1], WHITE, 256);}- button(176, T("Play"), true, a, b);+ button(172, T("Play"), true);} else { /* OV_END: the Devil beaten */- gfx_rrect(40, 40, 240, 160, 12, RED, 256);- say(&np_font_title, 160, 82, T("You beat the Devil!"), WHITE, DARK_RED);- gfx_paragraph(&np_font_body, 160, 108, 200, 15, T("Every door of Level Devil is open behind you."), WHITE, 256);- gfx_text_center(&np_font_body, 160, 152, label(s, T("Deaths in all: "), sv.deaths), WHITE, 256);- button(164, T("OK"), true, WHITE, RED);+ say(160, 80, T("You beat the Devil!"));+ gfx_paragraph(&np_font_body, 160, 106, 184, 15, T("Every door of Level Devil is open behind you."), WHITE, 256);+ gfx_text_center(&np_font_body, 160, 150, label(s, T("Deaths in all: "), sv.deaths), WHITE, 256);+ button(164, T("OK"), true);}}-static void hud(void) {- char s[16];- fillg(0, 0, FW, TOP, fg);- gfx_text(&np_font_small, 10, 14, label(s, T("Level "), (uint32_t)level + 1), bg, 256);- for (int i = 0; i < ROOMS; i++) /* the rooms of the level: done, this one, still to come */- gfx_circle(136 + 12 * i, 10, i == rnum ? 4 : 3, i <= rnum ? bg : gfx_mix(fg, bg, 12), 256);- num(s, sv.run);- gfx_text_right(&np_font_small, 310, 14, s, bg, 256);- bitmap(skull, 5, 5, 298 - gfx_text_width(&np_font_small, s), 5, 2, bg, 0, 0);-}-static void play_scene(void *ctx) {- fillg(0, TOP, FW, FH - TOP, bg);- for (int pass = 0; pass < 2; pass++)- for (int k = 0; k < no; k++) draw_object(&ob[k], pass);- if (!(mode & R_WRAP)) fillg(0, 0, WALL, FH, fg), fillg(FW - WALL, 0, WALL, FH, fg);- if (dead)- for (int i = 0; i < 14; i++) gfx_fill((bits[i].x >> 4) * G, (bits[i].y >> 4) * G, G, G, BLACK);- else if (!won) {- int x = (px >> 8) * G, y = (py >> 8) * G, f = !ground ? 3 : vx ? 1 + (anim >> 3 & 1) : 0, flip = mode & R_FLIP;- draw_runner(x, y, f, flip);- if (mode & R_WRAP) draw_runner(x + (x < FW ? FW * G : -FW * G), y, f, flip);+ char s[16];+ gfx_fill(0, 0, SCREEN_W, SCREEN_H, bg);+ for (int k = 0; k < no; k++) draw_object(&ob[k]);+ ground_draw();+ if (dead) {+ for (int i = 0; i < 8; i++) gfx_fill(sxp(bits[i].x), syp(bits[i].y), 3, 2, BLACK);+ } else if (!won && !born && !(frozen && frozen < 45)) {+ int f = !ground && !(modes & R_FLAPPY) ? 1 : vx ? 2 + (anim >> 2 & 3) : 0;+ if (modes & R_SWAP) {+ int b[4] = {(hx >> 8) - 6, (hy >> 8) - 3, (hx >> 8) + 11, (hy >> 8) + 13};+ draw_door(sxp(b[0] * 256), syp(b[1] * 256), sxp(b[2] * 256), syp(b[3] * 256), 0);+ } else {+ draw_hero(hx, hy, hw, hh, gy < 0, f);+ }}- hud();- if (curtain) fillg(0, TOP, FW, (FH - TOP) * curtain / 16, fg);+ if (born) /* coming together */+ for (int i = 0; i < 8; i++) {+ int d = born * born / 6;+ gfx_fill(sxp(hx + hw * 128 + (i & 3) * d * 64 - d * 96), syp(hy + hh * 128 + (i >> 2) * d * 128 - d * 64), 3, 2, BLACK);+ }+ for (int i = 0; i < ROOMS; i++) { /* the rooms of the level, as the game shows them */+ int x = 136 + 10 * i;+ gfx_fill(x, 6, 9, 8, BLACK);+ if (i > rnum || (i == rnum && frame < 45)) gfx_fill(x + 1, 7, 7, 6, gfx_mix(BLACK, fg, 20));+ }+ if (waiting) { /* the game's retry button */+ gfx_rrect(134, 104, 52, 30, 4, DARK, 256);+ gfx_circle(160, 119, 9, YELLOW, 256), gfx_circle(160, 119, 6, DARK, 256);+ gfx_fill(146, 110, 14, 9, DARK), gfx_fill(152, 106, 4, 13, YELLOW);+ gfx_text_center(&np_font_body, 160, 96, T("Press any key"), WHITE, 256);+ }+ (void)s;+ if (fade) gfx_fill_alpha(0, 0, SCREEN_W, SCREEN_H, DARK, fade * 16);if (ov) overlay();}-/* the doors to the levels: two rows of eight, on two floors */static void hub_door(int i, int *x, int *y) { *x = 13 + 38 * (i & 7), *y = 70 + 80 * (i >> 3); }static void hub_scene(void *ctx) {char s[48];- int sel_ = sv.sel, best = sv.best[sel_];- gfx_fill(0, 0, SCREEN_W, SCREEN_H, HUB_BG);- gfx_fill(0, 0, SCREEN_W, 44, RED);- if (banner) say(&np_font_title, 160, 32, label(s, T("Level cleared! Deaths: "), (uint32_t)banner - 1), WHITE, DARK_RED);- else say(&np_font_title, 160, 32, "LEVEL DEVIL", DARK_RED, HEX(0xA33219));+ int sel_ = sv.sel;+ bg = gfx_rgb(colors[0][0]);+ gfx_fill(0, 0, SCREEN_W, SCREEN_H, bg);+ gfx_fill(0, 0, SCREEN_W, 44, DARK);+ if (banner) say(160, 32, label(s, T("Level cleared! Deaths: "), (uint32_t)banner - 1));+ else say(160, 32, "LEVEL DEVIL");for (int i = 0; i < LEVELS; i++) {int x, y, open = i < sv.open;hub_door(i, &x, &y);- if (!(i & 7)) gfx_fill(0, y + 40, SCREEN_W, 8, HUB_FG);- color_t frame = i == 15 ? RED : open ? HUB_FG : gfx_mix(HUB_FG, HUB_BG, 18);- if (i == 15) bitmap(horns, 3, 8, x + 3, y - 5, 2, RED, 0, 0);- door(x, y, 2, frame, sv.done >> i & 1 ? colors[i][0] : open ? GREY : frame, 0);+ fg = gfx_rgb(colors[i][1]);+ if (!(i & 7)) gfx_fill(0, y + 40, SCREEN_W, 8, gfx_rgb(colors[0][1]));+ if (!open) fg = gfx_mix(fg, bg, 20);+ draw_door(x, y, x + 22, y + 40, sv.done >> i & 1 ? 12 : 0);num(s, (uint32_t)i + 1);- gfx_text_center(&np_font_small, x + 11, y - 7 - 5 * (i == 15), s, frame, 256);- if (i == sel_) draw_runner(x - 12, y + 26, 0, 0);+ gfx_text_center(&np_font_small, x + 11, y - 6, s, fg, 256);+ if (i == sel_) picture(hero_px[0], 14, x - 22, y + 8, x - 2, y + 40, 0, 0, 0, BLACK);}- gfx_fill(0, 214, SCREEN_W, 26, HUB_FG);+ fg = gfx_rgb(colors[0][1]);+ gfx_fill(0, 214, SCREEN_W, 26, fg);if (sel_ >= sv.open) cat(s, T("Locked"));- else if (sv.done >> sel_ & 1) label(s, T("Cleared. Fewest deaths: "), best);+ else if (sv.done >> sel_ & 1) label(s, T("Cleared. Fewest deaths: "), sv.best[sel_]);else cat(s, T("Not cleared yet"));- gfx_text(&np_font_body, 8, 232, s, HUB_BG, 256);- gfx_text_right(&np_font_body, 312, 232, label(s, T("Deaths "), sv.deaths), HUB_BG, 256);+ gfx_text(&np_font_body, 8, 232, s, bg, 256);+ gfx_text_right(&np_font_body, 312, 232, label(s, T("Deaths "), sv.deaths), bg, 256);if (ov) overlay();}/* ------------------------------------------------------------ the levels */-static void open_room(void) { /* the room rnum, behind a curtain that lifts */+static void open_room(void) { /* room rnum, coming out of the game's dark red */enter();- curtain = 16;+ fade = 15;}static void start_level(int l) {if (l != sv.level || sv.room >= ROOMS) sv.room = 0, sv.run = 0;@@ -628,17 +814,18 @@ static void level_done(void) {save();}-/* a step of the room: the curtain, the door reached, or the runner */+/* a step of the room: the fade, the door reached (it shuts), or the runner */static void tick(int in) {- if (curtain && !won) {- curtain--, full = 1;+ full = 1;+ if (fade && !won) {+ fade--;return;}- if (won && ++won > 10) curtain = imin(won - 10, 16), full = 1;- if (won > 28) {- won = 0;+ if (won > 30) fade = imin(won - 30, 15);+ if (won > 46) {+ won = 0, fade = 15;if (++rnum == ROOMS) level_done();- else sv.room = (uint8_t)rnum, save(), open_room();+ else sv.room = (uint8_t)rnum, save(), enter();return;}step(in);@@ -646,7 +833,8 @@ static void tick(int in) {static void load(void) {uint32_t len = 0;- const uint8_t *d = np_file_read(SAVE_NAME, &len);+ restore();+ const uint8_t *d = ef_read(SAVE_NAME, &len);uint8_t *v = (uint8_t *)&sv;bool ok = d && len == sizeof sv && d[0] == 'L' && d[1] == 1;for (uint32_t i = 0; i < sizeof sv; i++) v[i] = ok ? d[i] : 0;@@ -661,60 +849,58 @@ int main(void) {now = (uint32_t)eadk_timing_millis();seed = eadk_random() ^ now;if (!seed) seed = 1;- np_inflate(rooms, ROOM_BYTES, rooms_z, sizeof rooms_z, (np_inflate_tables_t *)(void *)strip);load();if (!(sv.flags & 1)) ov = OV_HELP;- full = 1, dlo = SCREEN_H;+ full = 1;const uint64_t left = KEY(eadk_key_left) | KEY(eadk_key_four), right = KEY(eadk_key_right) | KEY(eadk_key_six);const uint64_t up = KEY(eadk_key_up) | KEY(eadk_key_eight), down = KEY(eadk_key_down) | KEY(eadk_key_two);- const uint64_t ok = KEY(eadk_key_ok) | KEY(eadk_key_exe) | KEY(eadk_key_five), back = KEY(eadk_key_back);+ const uint64_t ok = KEY(eadk_key_ok) | KEY(eadk_key_exe) | KEY(eadk_key_five), back_k = KEY(eadk_key_back);uint64_t held = eadk_keyboard_scan(), stale = held; /* keys still down from the launcher wait to be let go */uint32_t last = now, acc = 0;for (;;) {now = (uint32_t)eadk_timing_millis();- uint64_t k = eadk_keyboard_scan(), hit = k & ~held;- stale &= k, held = k, k &= ~stale;+ uint64_t k = eadk_keyboard_scan(), hitk = k & ~held;+ stale &= k, held = k, k &= ~stale, hitk &= ~stale;if (k & (KEY(eadk_key_home) | KEY(eadk_key_on_off))) break;- int dx = !!(hit & right) - !!(hit & left), dy = !!(hit & down) - !!(hit & up), quit = 0;- if (hit) full |= scr == SC_HUB || ov;+ int dx = !!(hitk & right) - !!(hitk & left), dy = !!(hitk & down) - !!(hitk & up), quit = 0;+ if (hitk) full |= scr == SC_HUB || ov;if (ov) {- if (ov == OV_PAUSE) sel = (sel + dy + 5) % 5;+ if (ov == OV_PAUSE) sel = (sel + dy + 4) % 4;if (ov == OV_QUIT) sel ^= dx != 0;- if (hit & ok) {- if (ov == OV_PAUSE && sel == 1) { /* Restart: the runner bursts, as when it dies */- ov = OV_NONE;- if (!dead && !won) die();- }- else if (ov == OV_PAUSE && sel) ov = sel == 2 ? (scr = SC_HUB, save(), OV_NONE) : sel == 3 ? OV_HELP : OV_QUIT, sel = 0;+ if (hitk & ok) {+ if (ov == OV_PAUSE && sel == 1) ov = OV_NONE, reset(); /* Restart */+ else if (ov == OV_PAUSE && sel) ov = sel == 2 ? (scr = SC_HUB, save(), OV_NONE) : OV_QUIT, sel = 0;else if (ov == OV_QUIT && sel) quit = 1;- else ov = ov == OV_QUIT && scr == SC_PLAY ? (sel = 4, OV_PAUSE) : OV_NONE;+ else ov = ov == OV_QUIT && scr == SC_PLAY ? (sel = 3, OV_PAUSE) : OV_NONE;if (!(sv.flags & 1)) sv.flags |= 1, save();- } else if (hit & back) {- ov = ov == OV_QUIT && scr == SC_PLAY ? (sel = 4, OV_PAUSE) : OV_NONE;+ } else if (hitk & back_k) {+ ov = ov == OV_QUIT && scr == SC_PLAY ? (sel = 3, OV_PAUSE) : OV_NONE;}} else if (scr == SC_HUB) {sv.sel = (uint16_t)clampi(sv.sel + dx + 8 * dy, 0, LEVELS - 1);- if (hit & ok && sv.sel < sv.open) start_level(sv.sel);- if (hit & back) ov = OV_QUIT, sel = 0;- } else if (hit & back) {+ if (hitk & ok && sv.sel < sv.open) start_level(sv.sel);+ if (hitk & back_k) ov = OV_QUIT, sel = 0;+ } else if (hitk & back_k) {ov = OV_PAUSE, sel = 0, full = 1;save();+ } else if (waiting && hitk) { /* the game's retry: any key */+ tries++, reset();+ hitk = 0;}if (quit) break;if (banner && now - banner_t > 2600) banner = 0, full = 1;acc += (now - last) * 3, last = now;if (scr == SC_PLAY && !ov) {- int in = (k & left ? I_LEFT : 0) | (k & right ? I_RIGHT : 0) | (k & (up | ok) ? I_JUMP : 0);+ int in = (k & left ? I_LEFT : 0) | (k & right ? I_RIGHT : 0) | (k & (up | ok) ? I_UP : 0) | (k & down ? I_DOWN : 0);for (int n = 0; acc >= 50 && n < 4; acc -= 50, n++) tick(in);if (acc >= 50) acc = 0; /* (too far behind: let it go) */} else {acc = 0;}- if (full || dlo < dhi) {+ if (full) {eadk_display_wait_for_vblank();- if (full) dlo = 0, dhi = SCREEN_H;- gfx_render(scr == SC_HUB ? hub_scene : play_scene, 0, dlo & ~1, dhi);- full = 0, dlo = SCREEN_H, dhi = 0;+ gfx_render(scr == SC_HUB ? hub_scene : play_scene, 0, 0, SCREEN_H);+ full = 0;} else {eadk_timing_msleep(8);}diff --git a/games/leveldevil/tests/play.c b/games/leveldevil/tests/play.cindex 06b4c9cc..2484be9a 100644--- a/games/leveldevil/tests/play.c+++ b/games/leveldevil/tests/play.c@@ -1,13 +1,13 @@/* Level Devil on a computer, for tests and pictures (make host, make test).*- * play solve every room played through with its solutions (tests/solutions.txt): each- * must reach the door without dying, as it starts and again after one, two- * and three deaths (some rooms change)- * play search L R [D] finds a way through a room (after D deaths), for tests/solutions.txt- * play trace L R [D] where the runner goes with the solution+ * play solve every room played through with its keys (tests/solutions.txt): each must+ * reach the door without dying+ * play search L R finds keys through a room, for tests/solutions.txt+ * play trace L R [KEYS] where the runner goes* play rooms DIR a picture of every room as it starts (DIR/room_LL_R.ppm)- * play film L R DIR [D [KEYS]] the solution of a room (after D deaths), or these keys, a picture- * every 2 steps (DIR/f_NNNN.ppm)+ * play film L R DIR [KEYS] the room played with its keys (or these), a picture every 2 steps+ * (DIR/f_NNNN.ppm)+ * play screens DIR the map and the menus*/#define main ld_main#include "../src/main.c"@@ -32,12 +32,11 @@ void eadk_timing_msleep(uint32_t ms) { (void)ms; }uint32_t eadk_random(void) { return 0x9E3779B9u; }void *np_alloc(uint32_t size) { return malloc(size); }-/* tests/solutions.txt: a line a room, "LEVEL-ROOM: keys", with " | " between the keys for each- number of deaths when the room changes (as it starts, after 1, 2, 3); "R40 RJ12 R30": the keys- held, L R J or N for none, for so many steps */-static char *solutions[ROOM_COUNT][4];+/* tests/solutions.txt: a line a room, "LEVEL-ROOM: keys"; "R40 RJ12 N30": the keys held (L R J D, or+ N for none) for so many steps */+static char *solutions[ROOM_COUNT];static void read_solutions(void) {- static char text[1 << 16];+ static char text[1 << 17];FILE *f = fopen("tests/solutions.txt", "r");size_t n = f ? fread(text, 1, sizeof text - 1, f) : 0;if (f) fclose(f);@@ -46,23 +45,13 @@ static void read_solutions(void) {int l, r, at;if (line[0] == '#' || sscanf(line, "%d-%d:%n", &l, &r, &at) < 2) continue;int i = (l - 1) * ROOMS + r - 1;- if (i < 0 || i >= ROOM_COUNT) continue;- char *p = line + at;- for (int t = 0; t < 4; t++) {- solutions[i][t] = p;- char *bar = strchr(p, '|');- if (bar) *bar = 0, p = bar + 1;- }+ if (i >= 0 && i < ROOM_COUNT) solutions[i] = line + at;}for (int i = 0; i < ROOM_COUNT; i++)- for (int t = 1; t < 4; t++)- if (!solutions[i][t] || solutions[i][t] == solutions[i][t - 1]) solutions[i][t] = solutions[i][t - 1];- for (int i = 0; i < ROOM_COUNT; i++)- for (int t = 0; t < 4; t++)- if (!solutions[i][t]) solutions[i][t] = "";+ if (!solutions[i]) solutions[i] = "";}-static void picture(const char *path) {+static void shot(const char *path) {FILE *f = fopen(path, "wb");if (!f) exit(2);fprintf(f, "P6 320 240 255\n");@@ -75,49 +64,47 @@ static void picture(const char *path) {}static void draw(void) { gfx_render(play_scene, 0, 0, SCREEN_H); }-static void setup(int l, int r, int deaths) {- static int ready;- if (!ready) {- gfx_buf = strip, seed = 1, ready = 1;- if (np_inflate(rooms, ROOM_BYTES, rooms_z, sizeof rooms_z, (np_inflate_tables_t *)(void *)strip) != ROOM_BYTES)- exit(3);- }- scr = SC_PLAY, ov = 0, level = l, rnum = r;+static void setup(int i) {+ gfx_buf = strip, seed = 1;+ scr = SC_PLAY, ov = 0, level = i / ROOMS, rnum = i % ROOMS;enter();- tries = deaths;- reset();- curtain = 0;+ fade = 0;+}+static int keys_of(char c) {+ return c == 'L' ? I_LEFT : c == 'R' ? I_RIGHT : c == 'J' ? I_UP : c == 'D' ? I_DOWN : 0;}-/* plays a solution ("R30 RJ12 N8": the keys held, L R J or N for none, for so many steps);- 1 the door reached, 0 dead, -1 neither */-static int run(const char *s, const char *film) {- int frame = 0;+/* plays keys ("R30 RJ12 N8"); 1 the door reached, 0 dead, -1 neither */+static int play(const char *s, const char *film, int trace) {+ int t = 0;char path[256];for (;;) {while (*s == ' ') s++;- int in = 0, n = 240; /* (after the last keys, nothing for a while) */- for (; *s >= 'A' && *s <= 'Z'; s++) in |= *s == 'L' ? I_LEFT : *s == 'R' ? I_RIGHT : *s == 'J' ? I_JUMP : 0;+ int in = 0, n = 300; /* (after the last keys, nothing for a while) */+ for (; *s >= 'A' && *s <= 'Z'; s++) in |= keys_of(*s);if (*s) {char *e;n = (int)strtol(s, &e, 10);- if (e == s) return -1; /* (not keys) */+ if (e == s) return -1;s = e;}while (n--) {- step(in);- if (film && !(frame++ & 1)) {+ step(in), t++;+ if (trace && (!(t % 4) || dead || won))+ printf("%4d x %6.1f y %6.1f vx %5.1f vy %5.1f%s%s%s\n", t, hx / 256.0, hy / 256.0, vx * 60 / 256.0,+ vy * 60 / 256.0, ground ? " ground" : "", dead ? " DEAD" : "", won ? " DOOR" : "");+ if (film && !(t & 1)) {draw();- snprintf(path, sizeof path, "%s/f_%04d.ppm", film, frame / 2);- picture(path);+ snprintf(path, sizeof path, "%s/f_%04d.ppm", film, t / 2);+ shot(path);}- if ((won || dead) && film) /* the runner in pieces, or the door closing, a little longer */- for (int k = 0; k < 44; k++) {- step(0);- if (!(frame++ & 1)) {+ if ((won || dead) && film) /* the runner in pieces, or the door shutting, a little longer */+ for (int k = 0; k < 40; k++) {+ step(0), t++;+ if (!(t & 1)) {draw();- snprintf(path, sizeof path, "%s/f_%04d.ppm", film, frame / 2);- picture(path);+ snprintf(path, sizeof path, "%s/f_%04d.ppm", film, t / 2);+ shot(path);}}if (won || dead) return won ? 1 : 0;@@ -126,196 +113,188 @@ static int run(const char *s, const char *film) {}}-/* ---- finding a solution: a best-first search over the keys held 4 steps at a time, from the room- as it starts, through states not seen yet, the nearest to the door first */-typedef struct {- obj_t ob[28];- int no, face, ground, coyote, buffer, held_in, anim, mode, warped, sprung;- int32_t px, py, vx, vy;- uint32_t found;-} snap_t;-static void take(snap_t *s) {- memcpy(s->ob, ob, sizeof ob);- s->no = no, s->face = face, s->ground = ground, s->coyote = coyote, s->buffer = buffer, s->held_in = held_in;- s->anim = anim, s->mode = mode, s->warped = warped, s->sprung = sprung, s->px = px, s->py = py, s->vx = vx, s->vy = vy;- s->found = found;+/* ---- finding keys: a beam search over the keys held 4 steps at a time, the states nearest the door+ (or the room's next waypoint) kept at each depth */+static struct {+ void *p;+ size_t n;+} vars[] = {+#define V(x) {&(x), sizeof(x)}+ V(ob), V(st), V(rule), V(no), V(ns), V(nr), V(gcol), V(cnt), V(at_), V(hx), V(hy), V(vx), V(vy), V(hw), V(hh),+ V(hsx), V(hsy), V(tsx), V(tsy), V(hgl), V(run), V(jumpv), V(maxup), V(maxdown), V(back), V(downjump), V(dir),+ V(slide), V(pushx), V(gx), V(gy), V(keyev), V(face), V(ground), V(coyote), V(jumping), V(anim), V(dead), V(won),+ V(frozen), V(born), V(started), V(flapped), V(held_in), V(frame), V(shake), V(shake_n), V(modes), V(waiting),+};+#define NV (int)(sizeof vars / sizeof vars[0])+static size_t snap_size(void) {+ size_t n = 0;+ for (int i = 0; i < NV; i++) n += vars[i].n;+ return n;}-static void give(const snap_t *s) {- memcpy(ob, s->ob, sizeof ob);- no = s->no, face = s->face, ground = s->ground, coyote = s->coyote, buffer = s->buffer, held_in = s->held_in;- anim = s->anim, mode = s->mode, warped = s->warped, sprung = s->sprung, px = s->px, py = s->py, vx = s->vx, vy = s->vy;- found = s->found, dead = won = 0;+static void take(uint8_t *s) {+ for (int i = 0; i < NV; i++) memcpy(s, vars[i].p, vars[i].n), s += vars[i].n;}-static uint64_t key_of(void) { /* the state, roughly: the runner and every object */- uint64_t h = (uint64_t)(px >> 8) * 1000003u ^ (uint64_t)(py >> 8) * 9176u ^ (uint64_t)((vx >> 7) + 64) * 131u ^- (uint64_t)((vy >> 7) + 64) * 7u ^ (uint64_t)ground << 40 ^ (uint64_t)mode << 44 ^- (uint64_t)(held_in & 4) << 50;- for (int k = 0; k < no; k++)- h = h * 1099511628211u ^ (uint64_t)(ob[k].st | ob[k].on << 2 | (ob[k].x >> 4) << 3 | (uint64_t)(ob[k].y >> 4) << 20);- return h ? h : 1;+static void give(const uint8_t *s) {+ for (int i = 0; i < NV; i++) memcpy(vars[i].p, s, vars[i].n), s += vars[i].n;}-static int door_dist(void) { /* from the runner to the nearest real door, in 16ths of a pixel */- int best = 1 << 30;- for (int k = 0; k < no; k++)- if ((ob[k].r[0] & 15) == K_DOOR && !(ob[k].r[0] & F_GHOST)) {- int dx = ob[k].x + 88 - (int)(px >> 4) - 40, dy = ob[k].y + 200 - (int)(py >> 4) - 56;- int d = (int)__builtin_sqrtf((float)(dx * dx + dy * dy));- if (d < best) best = d;- }- return best;-}-#define SEEN (1 << 22)-#define NODES (1 << 20)-static uint64_t *seen;-static struct node {- snap_t s;- int parent, depth, f;- uint8_t in;-} *nodes;-static int *heap, nheap;-static void push(int i) {- int k = nheap++;- for (; k && nodes[heap[(k - 1) / 2]].f > nodes[i].f; k = (k - 1) / 2) heap[k] = heap[(k - 1) / 2];- heap[k] = i;++static int goal_x, goal_y, have_goal;+static int score(void) { /* lower is better: the distance to the door (or the waypoint), in pixels */+ int gxp = goal_x, gyp = goal_y, best = 1 << 30;+ if (!have_goal)+ for (int k = 0; k < no; k++)+ if ((ob[k].kind & 15) == K_DOOR && !(ob[k].f & (F_OFF | F_GHOST))) {+ int dx = (ob[k].x >> 8) - (hx >> 8) - hw / 2, dy = (ob[k].y >> 8) - (hy >> 8) - hh / 2;+ int d = iabs(dx) + iabs(dy);+ if (d < best) best = d, gxp = ob[k].x >> 8, gyp = ob[k].y >> 8;+ }+ int dx = gxp - (hx >> 8) - hw / 2, dy = gyp - (hy >> 8) - hh / 2;+ return iabs(dx) + iabs(dy);}-static int pop(void) {- int top = heap[0], last = heap[--nheap], k = 0;- for (;;) {- int c = 2 * k + 1;- if (c >= nheap) break;- if (c + 1 < nheap && nodes[heap[c + 1]].f < nodes[heap[c]].f) c++;- if (nodes[heap[c]].f >= nodes[last].f) break;- heap[k] = heap[c], k = c;- }- heap[k] = last;- return top;++static const int *sort_sc;+static int by_score(const void *a, const void *b) {+ int x = sort_sc[*(const int *)a], y = sort_sc[*(const int *)b];+ return x != y ? (x > y) - (x < y) : *(const int *)a - *(const int *)b;}-static const uint8_t moves[6] = {I_RIGHT, I_RIGHT | I_JUMP, 0, I_LEFT, I_LEFT | I_JUMP, I_JUMP};-static int search(int i, int deaths) {- if (!seen) seen = calloc(SEEN, 8), nodes = malloc(sizeof *nodes * NODES), heap = malloc(sizeof *heap * NODES);- memset(seen, 0, (size_t)SEEN * 8);- setup(i / ROOMS, i % ROOMS, deaths);- int n = 1;- take(&nodes[0].s), nodes[0].parent = -1, nodes[0].depth = 0, nodes[0].f = 0, nheap = 0;- push(0);- while (nheap && n < NODES - 8) {- int at = pop();- for (int m = 0; m < 6; m++) {- give(&nodes[at].s);- for (int k = 0; k < 4 && !dead && !won; k++) step(moves[m]);- if (dead) continue;- if (won) { /* the keys, back from here */- static uint8_t ins[8192];- int c = 0;- ins[c++] = moves[m];- for (int q = at; q > 0 && c < 8192; q = nodes[q].parent) ins[c++] = nodes[q].in;- char out[16384], *o = out;- for (int a = c - 1; a >= 0;) {- int b = a;- while (b >= 0 && ins[b] == ins[a]) b--;- int in = ins[a];- o += sprintf(o, "%s%s%s%s%d ", in & I_LEFT ? "L" : "", in & I_RIGHT ? "R" : "", in & I_JUMP ? "J" : "",- in ? "" : "N", 4 * (a - b));- a = b;++#define BEAM 600+#define DEPTH 900+static int search(int i, int nmoves, const uint8_t *moves, int chunk, char *out, int depth_max) {+ size_t sz = snap_size();+ uint8_t *cur = malloc(sz * BEAM), *nxt = malloc(sz * BEAM * 9), *path = malloc((size_t)BEAM * DEPTH),+ *npath = malloc((size_t)BEAM * DEPTH * 9);+ int *sc = malloc(sizeof(int) * BEAM * 9), *ord = malloc(sizeof(int) * BEAM * 9);+ uint64_t *keyv = malloc(8 * BEAM * 9);+ int ncur = 1, found = 0;+ setup(i);+ take(cur);+ for (int d = 0; d < depth_max && d < DEPTH && !found; d++) {+ int nn = 0;+ for (int c = 0; c < ncur && !found; c++)+ for (int m = 0; m < nmoves; m++) {+ give(cur + sz * c);+ for (int k = 0; k < chunk && !dead && !won; k++) step(moves[m]);+ if (dead) continue;+ memcpy(npath + (size_t)nn * DEPTH, path + (size_t)c * DEPTH, (size_t)d);+ npath[(size_t)nn * DEPTH + d] = (uint8_t)m;+ if (won) { /* the keys */+ char *o = out;+ const uint8_t *p = npath + (size_t)nn * DEPTH;+ for (int a = 0; a <= d;) {+ int b = a;+ while (b <= d && p[b] == p[a]) b++;+ int in = moves[p[a]];+ o += sprintf(o, "%s%s%s%s%s%d ", in & I_LEFT ? "L" : "", in & I_RIGHT ? "R" : "", in & I_UP ? "J" : "",+ in & I_DOWN ? "D" : "", in ? "" : "N", chunk * (b - a));+ a = b;+ }+ o[-1] = 0;+ found = 1;+ break;}- o[-1] = 0;- printf("%s\n", out);- return 1;+ take(nxt + sz * nn);+ uint64_t key = (uint64_t)(hx >> 9) * 1000003u ^ (uint64_t)(hy >> 9) * 9176u ^ (uint64_t)((vx >> 6) + 512) * 131u ^+ (uint64_t)((vy >> 6) + 512) * 7u ^ (uint64_t)ground << 40 ^ (uint64_t)(gy < 0) << 41;+ for (int e = 0; e < EVENTS; e++) key = key * 31 + cnt[e];+ keyv[nn] = key;+ sc[nn] = score() * 4;+ ord[nn] = nn;+ nn++;}- uint64_t k = key_of();- uint32_t h = (uint32_t)(k % SEEN);- while (seen[h] && seen[h] != k) h = (h + 1) % SEEN;+ if (found || !nn) break;+ /* the best, one of each state */+ sort_sc = sc;+ qsort(ord, (size_t)nn, sizeof *ord, by_score);+ ncur = 0;+ static uint64_t seen[1 << 15];+ memset(seen, 0, sizeof seen);+ for (int a = 0; a < nn && ncur < BEAM; a++) {+ int q = ord[a];+ uint64_t k = keyv[q] | 1;+ uint32_t h = (uint32_t)(k * 0x9E3779B97F4A7C15u >> 49);+ while (seen[h] && seen[h] != k) h = (h + 1) & ((1 << 15) - 1);if (seen[h]) continue;seen[h] = k;- struct node *nd = &nodes[n];- take(&nd->s), nd->parent = at, nd->in = moves[m], nd->depth = nodes[at].depth + 1;- nd->f = nd->depth + 3 * door_dist() / 70;- push(n++);+ memcpy(cur + sz * ncur, nxt + sz * q, sz);+ memcpy(path + (size_t)ncur * DEPTH, npath + (size_t)q * DEPTH, (size_t)d + 1);+ ncur++;}}- printf("no way found (%d states)\n", n);- return 0;+ free(cur), free(nxt), free(path), free(npath), free(sc), free(ord), free(keyv);+ return found;}int main(int argc, char **argv) {char path[256];+ static char out[1 << 16];read_solutions();- if (!strcmp(argc > 1 ? argv[1] : "", "check") && argc > 5) { /* do these keys clear the room? */- int i = (atoi(argv[2]) - 1) * ROOMS + atoi(argv[3]) - 1;- setup(i / ROOMS, i % ROOMS, atoi(argv[4]));- int ok = run(argv[5], 0) == 1;- printf(ok ? "ok\n" : "no\n");- return !ok;+ const char *cmd = argc > 1 ? argv[1] : "";+ int i = argc > 3 ? (atoi(argv[2]) - 1) * ROOMS + atoi(argv[3]) - 1 : 0;+ if (i < 0 || i >= ROOM_COUNT) return 2;+ if (!strcmp(cmd, "search") && argc > 3) {+ static const uint8_t moves[] = {I_RIGHT, I_RIGHT | I_UP, 0, I_LEFT, I_LEFT | I_UP, I_UP, I_DOWN, I_RIGHT | I_DOWN,+ I_LEFT | I_DOWN};+ int n = argc > 4 && strchr(argv[4], 'D') ? 9 : 6, chunk = argc > 5 ? atoi(argv[5]) : 4;+ if (argc > 6) have_goal = sscanf(argv[6], "%d,%d", &goal_x, &goal_y) == 2;+ if (search(i, n, moves, chunk, out, 900)) {+ printf("%d-%d: %s\n", i / ROOMS + 1, i % ROOMS + 1, out);+ return 0;+ }+ printf("no way found\n");+ return 1;}- if (!strcmp(argc > 1 ? argv[1] : "", "search") && argc > 3)- return !search((atoi(argv[2]) - 1) * ROOMS + atoi(argv[3]) - 1, argc > 4 ? atoi(argv[4]) : 0);- if (!strcmp(argc > 1 ? argv[1] : "", "trace") && argc > 3) { /* where the runner goes with the solution */- int i = (atoi(argv[2]) - 1) * ROOMS + atoi(argv[3]) - 1;- setup(i / ROOMS, i % ROOMS, argc > 4 ? atoi(argv[4]) : 0);- const char *s = solutions[i][argc > 4 ? atoi(argv[4]) & 3 : 0];- for (int t = 0;; t++) {- while (*s == ' ') s++;- if (!*s) break;- int in = 0;- for (; *s >= 'A' && *s <= 'Z'; s++) in |= *s == 'L' ? I_LEFT : *s == 'R' ? I_RIGHT : *s == 'J' ? I_JUMP : 0;- for (int n = (int)strtol(s, (char **)&s, 10); n--; t++) {- step(in);- if (!(t % 4) || dead || won) printf("%4d x %4.1f y %4.1f %s%s%s\n", t, px / 256.0, py / 256.0, ground ? "ground" : "",- dead ? " DEAD" : "", won ? " DOOR" : "");- if (dead || won) return 0;- }+ if (!strcmp(cmd, "trace") && argc > 3) {+ setup(i);+ printf("%d\n", play(argc > 4 ? argv[4] : solutions[i], 0, 1));+ return 0;+ }+ if (!strcmp(cmd, "film") && argc > 4) {+ setup(i);+ return play(argc > 5 ? argv[5] : solutions[i], argv[4], 0) == 1 ? 0 : 1;+ }+ if (!strcmp(cmd, "rooms") && argc > 2) {+ for (int r = 0; r < ROOM_COUNT; r++) {+ setup(r);+ for (int k = 0; k < 40; k++) step(0);+ draw();+ snprintf(path, sizeof path, "%s/room_%02d_%d.ppm", argv[2], r / ROOMS + 1, r % ROOMS + 1);+ shot(path);}return 0;}- if (argc < 2) return 2;- if (!strcmp(argv[1], "screens") && argc > 2) { /* the map, the menus and the end, with some progress */+ if (!strcmp(cmd, "screens") && argc > 2) {static const struct {int scr, ov, sel;const char *name;- } screens[] = {{SC_HUB, OV_NONE, 0, "map"}, {SC_HUB, OV_HELP, 0, "help"}, {SC_PLAY, OV_PAUSE, 1, "pause"},- {SC_PLAY, OV_QUIT, 1, "quit"}, {SC_HUB, OV_END, 0, "end"}, {SC_HUB, OV_NONE, 0, "banner"}};- setup(15, 4, 0);+ } screens[] = {{SC_HUB, OV_NONE, 0, "map"}, {SC_HUB, OV_HELP, 0, "help"}, {SC_PLAY, OV_PAUSE, 1, "pause"},+ {SC_PLAY, OV_QUIT, 1, "quit"}, {SC_HUB, OV_END, 0, "end"}, {SC_HUB, OV_NONE, 0, "banner"}};+ setup(15 * ROOMS + 4);sv.open = 12, sv.done = 0x7FF, sv.deaths = 173, sv.sel = 6, sv.run = 4;- for (int i = 0; i < LEVELS; i++) sv.best[i] = (uint16_t)(i * 3 % 7);- for (unsigned i = 0; i < sizeof screens / sizeof screens[0]; i++) {- scr = screens[i].scr, ov = screens[i].ov, sel = screens[i].sel, banner = i == 5 ? 4 : 0;+ for (int l = 0; l < LEVELS; l++) sv.best[l] = (uint16_t)(l * 3 % 7);+ for (unsigned k = 0; k < sizeof screens / sizeof screens[0]; k++) {+ scr = screens[k].scr, ov = screens[k].ov, sel = screens[k].sel, banner = k == 5 ? 4 : 0;+ if (scr == SC_PLAY) setup(15 * ROOMS + 4), scr = SC_PLAY, ov = screens[k].ov, sel = screens[k].sel;gfx_render(scr == SC_HUB ? hub_scene : play_scene, 0, 0, SCREEN_H);- snprintf(path, sizeof path, "%s/%s.ppm", argv[2], screens[i].name);- picture(path);- }- return 0;- }- if (!strcmp(argv[1], "rooms") && argc > 2) {- for (int i = 0; i < ROOM_COUNT; i++) {- setup(i / ROOMS, i % ROOMS, 0);- draw();- snprintf(path, sizeof path, "%s/room_%02d_%d.ppm", argv[2], i / ROOMS + 1, i % ROOMS + 1);- picture(path);+ snprintf(path, sizeof path, "%s/%s.ppm", argv[2], screens[k].name);+ shot(path);}return 0;}- if (!strcmp(argv[1], "film") && argc > 4) {- int i = (atoi(argv[2]) - 1) * ROOMS + atoi(argv[3]) - 1;- if (i < 0 || i >= ROOM_COUNT) return 2;- setup(i / ROOMS, i % ROOMS, argc > 5 ? atoi(argv[5]) : 0);- return run(argc > 6 ? argv[6] : solutions[i][argc > 5 ? atoi(argv[5]) & 3 : 0], argv[4]) == 1 ? 0 : 1;- }- if (!strcmp(argv[1], "solve")) {+ if (!strcmp(cmd, "solve")) {int bad = 0;- for (int i = 0; i < ROOM_COUNT; i++)- for (int t = 0; t < 4; t++) { /* as it starts, then after 1, 2 and 3 deaths */- setup(i / ROOMS, i % ROOMS, t);- int got = run(solutions[i][t], 0);- if (got != 1) {- printf("level %d room %d (after %d deaths): %s at x %d y %d\n", i / ROOMS + 1, i % ROOMS + 1, t,- got ? "stuck" : "dead", (int)(px >> 8), (int)(py >> 8));- bad = 1;- break;- }+ for (int r = 0; r < ROOM_COUNT; r++) {+ setup(r);+ int got = play(solutions[r], 0, 0);+ if (got != 1) {+ printf("level %d room %d: %s at x %d y %d\n", r / ROOMS + 1, r % ROOMS + 1, got ? "stuck" : "dead",+ (int)(hx >> 8), (int)(hy >> 8));+ bad++;}- if (bad) printf("some rooms fail\n");- else printf("all %d rooms solved\n", ROOM_COUNT);- return bad;+ }+ if (bad) printf("%d rooms fail\n", bad);+ else printf("all %d rooms cleared\n", ROOM_COUNT);+ return !!bad;}return 2;}diff --git a/games/leveldevil/tests/solutions.txt b/games/leveldevil/tests/solutions.txtindex 101e33bf..97e98338 100644--- a/games/leveldevil/tests/solutions.txt+++ b/games/leveldevil/tests/solutions.txt@@ -1,82 +1,82 @@-# The keys that clear each room (tests/play.c): "R40 RJ12 R30", the keys held, L R J or N for-# none, for so many steps; " | " between the keys for each number of deaths when the room changes.-1-1: R80 RJ4 R36 | R92 RJ8 R12 RJ4 R4-1-2: R36 RJ4 R44 RJ4 R32-1-3: R16 RJ4 R16 RJ4 R12 RJ4 R20 RJ4 R16 RJ4 R20-1-4: R28 RJ4 R24 RJ4 R20 RJ4 R16 RJ4 R16-1-5: R92 LJ4 R16-2-1: R92 RJ8 R12 RJ4 R4-2-2: R52 RJ4 R64-2-3: R12 RJ8 R16 RJ4 R20 RJ8 R12 RJ8 R32-2-4: R40 RJ4 J4 R20 RJ4 R48-2-5: R96 RJ4 R20-3-1: R52 RJ12 R20 RJ4 R32-3-2: R56 RJ8 R44-3-3: R60 RJ4 R4 RJ4 N4 L4 R52-3-4: R40 RJ4 R32 RJ8 R12 RJ4 R20-3-5: R40 RJ4 R32 RJ8 R12 RJ4 R20-4-1: R68 RJ4 L4 LJ8 L12 LJ8 N4 L32-4-2: R88 RJ4 R8 RJ4 R4-4-3: R32 RJ12 R76-4-4: N150 R32 RJ16 R30-4-5: R72 RJ4 J4 RJ8 N4 L4 LJ4 L4 N4 L12 LJ4 J4 L8 N4 L40-5-1: L48 LJ8 N4 L56 R4-5-2: R48 L12 LJ8 N4 L44 R4-5-3: L40 RJ4 J4 RJ4 R68-5-4: L36 LJ8 N4 L36 LJ4 L28 R4-5-5: R24 L12 LJ4 L20 R12 RJ4 R16 L8 LJ4 L12 R4-6-1: R44 RJ8 R12 RJ4 R52-6-2: R120-6-3: R100 RJ4 R16-6-4: R24 RJ4 R56 RJ4 R8 RJ4 R20-6-5: R16 RJ4 R20 RJ4 R20 LJ4 R8 N8 R12 RJ16 R8 RJ4 R8-7-1: RJ8 J4 RJ4 R4 RJ4 R4 RJ16 R4 L4 RJ24 R44-7-2: R52 RJ4 R64-7-3: R24 RJ8 R20 L8 RJ8 R20 N12 R4 RJ4 R28-7-4: RJ12 R12 J4 RJ12 R8 RJ16 R4 RJ28 R24-7-5: RJ4 R12 RJ8 J4 R8 N4 RJ20 R16 RJ8 R36-8-1: R60-8-2: R12 RJ4 R4 RJ4 R12-8-3: R28 RJ16 R32-8-4: RJ4 R44-8-5: R32 RJ4 R12 RJ4 R8-9-1: R40 RJ4 J4 R4 RJ16 R68-9-2: R28 RJ8 L4 J4 L4 J4 RJ4 R40 RJ4 R40-9-3: R32 L4 R92-9-4: R16 LJ8 R20 RJ4 J4 LJ4 R28 N4 RJ4 N4 J4 R24 LJ4 L4 R36-9-5: R24 RJ4 J4 RJ8 R24 L4 R60-10-1: R68 RJ8 R12 RJ4 R28-10-2: R60 RJ8 J4 R48-10-3: R72 L4 N4 J4 R20 RJ8 R12 RJ4 R4-10-4: R28 J4 N12 R24 RJ4 J4 N4 L4 N4 R28 LJ4 N4 R4 LJ4 N4 R28-10-5: R20 RJ4 R48 RJ4 LJ4 R40-11-1: R32 RJ4 R32 RJ4 R36-11-2: R44 RJ4 R72-11-3: RJ12 N4 J4 R4 LJ4 RJ12 R4 RJ8 R12 RJ12 R4 RJ8 R12 RJ16 R20-11-4: RJ8 J4 R12 RJ16 R8-11-5: R20 RJ4 R16 RJ4 R12 RJ4 R12 RJ4 R12 RJ4 R24-12-1: R16 RJ4 J4 N4 J4 R4 RJ8 N4 RJ8 R72-12-2: R36 RJ4 R12 RJ4 R12 RJ4 R12 RJ4 R32-12-3: R36 RJ4 R12 RJ4 R12 J4 L4 RJ16 R12 RJ4 R16-12-4: RJ12 N4 RJ12 N4 RJ12 R4 RJ8 R16-12-5: R16 RJ4 R12 RJ4 N8 R4 RJ4 R12 RJ4 R12 RJ4 R12 RJ4 R20-13-1: RJ4 R8 N4 R32 RJ4 R12 RJ4 R12 RJ4 R12 RJ4 R12 RJ4 R4-13-2: RJ4 R8 N4 R4 RJ4 R24 N4 RJ12 R8 J4 R44-13-3: R40 J4 LJ4 N4 R4 RJ12 R12 RJ4 R8 RJ4 R36-13-4: R28 RJ4 R4 LJ4 R4 J4 RJ4 J4 R28 RJ4 R36-13-5: R28 J4 LJ4 RJ4 R4 RJ4 R20 RJ8 R16 RJ4 R12 RJ4 R16-14-1: RJ4 R84 RJ8 R24-14-2: RJ4 R28 RJ4 R28 RJ4 R24 RJ4 R24-14-3: R76 RJ8 R12 RJ4 R20-14-4: RJ4 R48 RJ4 R32 RJ4 R28-14-5: RJ4 R60 RJ8 R32 RJ4 R12-15-1: LJ4 J4 L20 R4-15-2: RJ16 R20 N4 LJ4 L4 LJ8 RJ12 R12-15-3: RJ4 R12 RJ8 R4 RJ4 R4 RJ8 R8 RJ4 R4 RJ4 R4 RJ12 R24-15-4: L32-15-5: LJ12 L4 LJ4 J4 L4 LJ4 N4 L36 R4-16-1: R36 RJ8 R40 RJ8 R12 RJ4 R4-16-2: LJ4 L4 N4 LJ4 L4 N4 L4 N4 L4 N4 L8 LJ4 L8 R4 LJ12 L4 N4 L4 LJ4 L12 LJ4 N4 L4 R4 LJ4 R4-16-3: RJ4 R84 RJ8 R24-16-4: R24 RJ4 R20 RJ4 R8 RJ4 R12-16-5: R32 RJ4 L4 R8 LJ16 L56+# Keys that clear each room of Level Devil (tests/play.c): "LEVEL-ROOM: keys", the keys held+# (L R J D, N for none) for so many steps of a 60th of a second. Found by `play search`.+1-1: R140 RJ4 R40+1-2: R128 RJ4 R32 RJ4 R28+1-3: R80 RJ4 R52+1-4: R20 RJ4 R160+1-5: R176 RJ4 R52+2-1:+2-2: R52 RJ4 R56 RJ4 R92 RJ4 R44+2-3: R20 RJ4 R64 RJ4 R20+2-4: R24 RJ4 R36 RJ4 R52 RJ4 R24 RJ4 R16 RJ4 R20 RJ4 R16 RJ4 R20 RJ4 R20+2-5:+3-1: R80 RJ4 R28 N4 R4 N4 L4 N28 L8 RJ4 R12 L4 N4 L4 N4 RJ4 R4 N4 R76+3-2: R128 RJ4 R52+3-3: R24 RJ4 R84 L4 R4 L4 RJ4 R24+3-4: R24 RJ4 R20 N4 RJ4 N8 R4 N8 L4 R4 J4 L12 N8 R4 N8 R4 RJ4 R4 N4 L4 N8 L4 N4 R4 J4 N4 R8 N8 R8 RJ4 R20 L4 R4 RJ4 R4 N4 R4 N12 R4 RJ4 R48+3-5: R16 L180 N4 L4 N8 L4 LJ4 L52+4-1: R140 RJ4 R64+4-2: R28 RJ4 R92 RJ4 R80+4-3: R208+4-4: R92 RJ4 R24 RJ4 R28 RJ4 R124+4-5: R20 J4 R4 N4 R8 L4 RJ4 R8 N4 R4 J4 R8 N4 R4 RJ4 R20 N4 R12 RJ4 R16 RJ4 R20 RJ4 R12 L4 R4 N4 R12 RJ4 R16 RJ4 R20 RJ4 R32 RJ4 R16 RJ4 R20 RJ4 R20 N4 R4 N4 R4 N8 R4+5-1: R16 L48+5-2: R36 RJ4 R56 RJ4 R44 RJ4 R44 RJ4 R56+5-3: R16 L52 LJ4 L56 LJ4 L56 LJ4 L44 LJ4 L12 N4+5-4:+5-5: R16 L64 LJ4 L16 R28 RJ4 R16 L28 LJ4 L16 R8 RJ4 R76+6-1: R112 N4 RJ4 R4 N4 R4 N12 R4 N4 J4 R8 N4 R8 L4 R4 RJ4 R8 N20 R4 RJ4 N4 R4 N4 L4 N8 R4 RJ4 R4 N4 R4 N8 L4 R8 RJ4 R36+6-2: R16 L80 N20 L4 LJ4 L12 N8 R4 L4 LJ4 L12 N8 R4 N8 L4 LJ4 L32 LJ4 L52 N4+6-3: R40 RJ4 R8 N4 R4 N20 R4 RJ4 R52 RJ4 R16 RJ4 R8 L4 N8 L8 R4 J4 N4 L4 N4 L4 N12 RJ4 R4 N4 L4 N4 L4 N8 R4 RJ4 N4 L4 N12 RJ4 R12 L4 N4 RJ4 L4 N4 R4 N4 L4 N4 R4 RJ4 N4 L12 N8 J4 R4 L4 R4 L4 R4 L4 RJ4 R4 L12 R4 RJ4 R56+6-4: R68 RJ4 R20 N12 R4 L4 R4 L4 R4 N4 RJ4 R4 N4 R8 N72 L4 R4 N4 RJ4 R4 N4 R12 L4 R4 RJ4 R4 N8 L12 N16 R4 RJ4 R8 N4 L4 R4 N4 R4 N4 RJ4 N16 L12 R4 L4 R4 L4 R4 L4 R4 L4 R4 N4 J4 R8 L8 N8 L4 R4 L4 R4 L4 R4 L4 R8 RJ4 N8 L4 N4 L8 R4 RJ4 R8 N4 R4 N8 RJ4 R44+6-5: R24 RJ4 R20 RJ4 R20 RJ4 R20 RJ4 R20 RJ4 R20 RJ4 R16 RJ4 R12 N4 R4 RJ4 R16+7-1:+7-2: R132 RJ4 R64 N4 R4 N124 R4 RJ4 R8 L4 N12 R20 N8 L4 N16 R12 N4 R8 L8 N4 L4 N4 R4 N4 L4 R16 N4 L12 N20 R4 N16 L4 N20 R4 N16 L4 N12 L4 R4 N4 R12 L8 N12 R12 N4 R8 N4 L16 R4 L4 R4 L4 R4 N4 L4 R4 N8 L4 N20 R4 N4 R4 L4 N16 R12 L4 R4 N4 L4 R4 L4 N4 L4 R4 N4 L4 R4 N4 R4 N4 L4 N16 R20 N8 L8 N24 R4 N16 L4 N12 L4 R4 N20 R4 L4 N12 L4 R4 N12 R8 L8 N20 L8 R72+7-3: R28 RJ4 R80 N4 L4 R24 N4 R4 N8 L4 R32 N4 R4 L8 R24 N20 R56+7-4:+7-5: R56 RJ4 R120 N8 R84+8-1: R180 RJ4 R4 L8 N8 L8 N12 L4 N4 R52 L8 N4 R4+8-2:+8-3:+8-4:+8-5:+9-1:+9-2:+9-3:+9-4:+9-5:+10-1: R88 RJ4 R28 RJ4 R24+10-2:+10-3:+10-4:+10-5: R16 L56 LJ4 L152+11-1: R124 RJ4 R92 RJ4 R20+11-2: R184 RJ4 R56+11-3: R24 RJ4 R108 RJ4 R100 RJ4 R40+11-4:+11-5:+12-1: R40 RJ4 R20 RJ4 R12 RJ4 R12 RJ4 R4 RJ4 R4 RJ4 R36 RJ4 R24 RJ4 R4 RJ4 R12 RJ4 R8 RJ4 R12 RJ4 R36 RJ4 R12 RJ4 R20 RJ4 R12+12-2:+12-3:+12-4:+12-5:+13-1:+13-2:+13-3:+13-4:+13-5:+14-1:+14-2: R20 RJ4 R184 N8 R4 RJ4 R72 N4 R4 N4 R4 N20 L8 R4 N4 L8 N12 L4 N12 L4 R4 N4 RJ4 R4 N28 L4 R4 N4 L4 N8 R4 N4 L4 R4 L4 N16 L4 N20 RJ4 R4 N4 L8 N4 L4 N4 R4 L4 R28+14-3:+14-4:+14-5:+15-1:+15-2: R16 L4 LJ4 L8 N12 L8 N8 L140 N4 L4 N4 L4 N16 L88 N4 L4 N4 L4 N20 R4+15-3:+15-4:+15-5:+16-1:+16-2:+16-3:+16-4:+16-5:diff --git a/games/leveldevil/tools/fetch.py b/games/leveldevil/tools/fetch.pynew file mode 100644index 00000000..9794b285--- /dev/null+++ b/games/leveldevil/tools/fetch.py@@ -0,0 +1,152 @@+#!/usr/bin/env python3+"""Level Devil's rooms, as the game itself has them: fetches its web build, a Stencyl game, and writes+tools/scenes.json, the 80 rooms of its first world (16 levels of 5) with their tiles and actors.++The build is a script (an OpenFL app) and a packed library of assets (lib/default.pak): its manifest,+inside the script, says where each file is in the library (gzip'ed). A room is two files there:+ scene-N.scn its tiles, run-length coded after a header of 12 or 16 bytes: runs of (2 bytes,+ tileset, tile, count), -1 for none, 33 x 21 tiles of 16 pixels, row by row;+ scene-N.mbs the scene (Stencyl's "MBS" binary format: fixed fields, big-endian), with its actors:+ where each one is, its type, its scale and angle, its name.+What the traps do is in the script, one class a room (scripts.SceneEvents_N): tools/rooms.py has it,+written out by hand from there. The game's colours are there too (the ground of each level).++The rooms are kept as rectangles of tiles (the ground) and actors; scenes.json is committed, so the+build needs neither the network nor this script.++Usage: fetch.py [--from DIR] (DIR: a folder that already has "Level Devil.js" and default.pak)+"""+import argparse+import json+import os+import re+import struct+import sys+import tempfile+import urllib.parse+import urllib.request+import zlib++URL = "https://st.8games.net/14/igra-level-devil-uroven-dyavola/"+WORLDS = ["Pits", "Spikes", "Push", "Coins", "Controls", "Platforms", "Springs", "Warps", "Scale", "Doors", "Saws",+ "Flappy", "Gravity", "Movement", "Wraparound", "Boss"]+W, H = 33, 21++SCENE = [("retainAtlases", "b"), ("depth", "i"), ("description", "s"), ("eventSnippetID", "i"), ("extendedHeight", "i"),+ ("extendedWidth", "i"), ("extendedX", "i"), ("extendedY", "i"), ("format", "s"), ("gravityX", "f"),+ ("gravityY", "f"), ("height", "i"), ("id", "i"), ("name", "s"), ("revision", "s"), ("savecount", "i"),+ ("tileDepth", "i"), ("tileHeight", "i"), ("tileWidth", "i"), ("type", "s"), ("width", "i"),+ ("actorInstances", "l"), ("atlasMembers", "l"), ("layers", "l")]+ACTOR = [("angle", "f"), ("id", "i"), ("customized", "b"), ("groupID", "i"), ("aid", "i"), ("name", "s"),+ ("scaleX", "f"), ("scaleY", "f"), ("x", "i"), ("y", "i"), ("z", "i"), ("orderInLayer", "i"), ("snippets", "l")]+ACTOR_SIZE = 49+++def fetch(name, folder):+ path = os.path.join(folder, name)+ if not os.path.exists(path):+ with urllib.request.urlopen(URL + urllib.parse.quote(name), timeout=120) as r, open(path, "wb") as f:+ f.write(r.read())+ return open(path, "rb").read()+++def library(script, pak):+ """The packed library's files: {path: bytes}"""+ js = script.decode("utf-8", "replace")+ end = js.find('libraryType":"lime.utils.PackedAssetLibrary')+ manifest = js[js.rfind('{"name":null,"assets":"', 0, end):end]+ out = {}+ for m in re.finditer(r"(?:position|R0)i(\d+)(?:y4:size|R1)(?:z|i\d+)(?:y4:type|R2)(?:y\d+:[A-Z]+|R\d+)(?:y2:id|R4)y(\d+):",+ manifest):+ pos, n = int(m.group(1)), int(m.group(2))+ rest = manifest[m.end():]+ ident = urllib.parse.unquote(rest[:n])+ length = re.match(r"(?:y6:length|R6)i(\d+)", rest[n:])+ if length and ident.startswith("assets/data/scene-"):+ out[ident] = zlib.decompress(pak[pos:pos + int(length.group(1))], 31)+ return out+++class Mbs:+ def __init__(self, data):+ self.d = data+ table = struct.unpack_from(">I", data, 12)[0]+ offs = struct.unpack_from(">%dI" % struct.unpack_from(">I", data, table)[0], data, table + 4)+ self.strings = [data[o + 4:o + 4 + struct.unpack_from(">I", data, o)[0]].decode("utf-8", "replace") for o in offs]++ def read(self, at, fields):+ out = {}+ for name, t in fields:+ if t == "b":+ out[name], at = self.d[at], at + 1+ continue+ v = struct.unpack_from(">f" if t == "f" else ">i" if t != "l" else ">I", self.d, at)[0]+ out[name] = self.strings[v] if t == "s" else v+ at += 4+ return out+++def tiles(scn):+ cells, at = [], 12 if struct.unpack_from(">I", scn, 4)[0] == 0 else 16+ while at + 8 <= len(scn):+ _, tileset, _, count = struct.unpack_from(">HhhH", scn, at)+ cells += [tileset != -1] * count+ at += 8+ cells += [False] * (W * H - len(cells))+ return [cells[y * W:(y + 1) * W] for y in range(len(cells) // W)]+++def rectangles(grid):+ """the solid tiles as few rectangles: runs along the rows, joined downwards when the same"""+ rects, open_ = [], {}+ for y, row in enumerate(grid + [[False] * W]):+ runs, x = [], 0+ while x < W:+ if row[x]:+ x0 = x+ while x < W and row[x]:+ x += 1+ runs.append((x0, x - x0))+ x += 1+ nxt = {}+ for run in runs:+ nxt[run] = open_.pop(run, y)+ for (x0, w), y0 in open_.items():+ rects.append((x0, y0, w, y - y0))+ open_ = nxt+ return sorted(rects, key=lambda r: (r[1], r[0]))+++def main():+ ap = argparse.ArgumentParser()+ ap.add_argument("--from", dest="src")+ a = ap.parse_args()+ folder = a.src or tempfile.mkdtemp()+ script = fetch("Level Devil.js", folder)+ pak = fetch("lib/default.pak", folder) if not a.src else open(os.path.join(folder, "default.pak"), "rb").read()+ files = library(script, pak)+ by_name = {}+ for path, data in files.items():+ if path.endswith(".mbs") and re.fullmatch(r"(%s)_[1-5]" % "|".join(WORLDS), Mbs(data).read(struct.unpack_from(">I", data, 16)[0], SCENE)["name"]):+ m = Mbs(data)+ s = m.read(struct.unpack_from(">I", data, 16)[0], SCENE)+ n = struct.unpack_from(">I", data, s["actorInstances"])[0]+ actors = [m.read(s["actorInstances"] + 8 + i * ACTOR_SIZE, ACTOR) for i in range(n)]+ grid = tiles(files[path[:-4] + ".scn"])+ assert len(grid) == H and len(grid[-1]) == W, s["name"]+ by_name[s["name"]] = dict(scene=s["id"], ground=rectangles(grid[:15]),+ actors=[dict(name=x["name"], type=x["aid"], x=x["x"], y=x["y"],+ sx=round(x["scaleX"], 3), sy=round(x["scaleY"], 3),+ angle=round(x["angle"]) % 360) for x in actors])+ rooms = []+ for w in WORLDS:+ for r in range(1, 6):+ rooms.append(dict(name=f"{w}_{r}", **by_name[f"{w}_{r}"]))+ out = os.path.join(os.path.dirname(os.path.abspath(__file__)), "scenes.json")+ with open(out, "w") as f:+ f.write("[\n" + ",\n".join(json.dumps(r, separators=(",", ":")) for r in rooms) + "\n]\n")+ print(f"{len(rooms)} rooms into {out}", file=sys.stderr)+++if __name__ == "__main__":+ main()diff --git a/games/leveldevil/tools/rooms.py b/games/leveldevil/tools/rooms.pyindex e73618f8..0107dac8 100644--- a/games/leveldevil/tools/rooms.py+++ b/games/leveldevil/tools/rooms.py@@ -1,408 +1,1094 @@#!/usr/bin/env python3-"""Level Devil's rooms: sixteen levels of five, and how to clear each one.--Writes OUT/rooms.inc, the rooms packed (raw DEFLATE) for src/main.c, which unpacks them when the-game starts. The format is described in src/main.c; the numbers below (kinds, flags, triggers,-motions, modes) follow it. tests/solutions.txt has the keys that clear each room.--The room is 160 x 120 pixels of the game: the ceiling is the top 10 rows, the side walls 4 wide,-and most floors are at 100. The runner is 5 x 7 and starts at x 14 on the floor. It runs a-little over a pixel a step and jumps about 20 high and 30 across (60 steps a second).-+"""Level Devil's 80 rooms, as the game has them.++tools/scenes.json (written by tools/fetch.py from the game's own files) has each room's tiles and+actors: where they are, their type, scale and angle. What the traps do is in the game's scene+scripts (a script a room: what each trigger sets off, and when); they are written out below, room+by room, with the game's numbers: positions in the scene's pixels (16 a tile, the screen showing+x 50 to 477 and y 0 to 240), times in milliseconds, speeds in its units (10 pixels a second).+This writes OUT/rooms.inc, the rooms packed for src/main.c.++A room, packed:+ its modes (R_*) and where the runner starts (x, y: the corner of its 16 x 16 picture),+ its ground: rectangles of tiles (x, y, w, h),+ its objects: kind (K_*) and turn, flags (F_*), the event a trigger sets off, centre x and y,+ half its width and height (pixels),+ its script: steps (op, object, event and which time of it, frame, three numbers), in order of+ event then time. Event 0 is the room starting; 1 to 8 its triggers (the runner touching a+ Trigger_N); EV_KEY the jump key (once a step has armed it), EV_MOVE the first step taken.Usage: rooms.py OUT"""+import jsonimport osimport sys-import zlib-# kinds, flags, triggers, motions, modes (src/main.c)-BLOCK, SECRET, SPIKE_U, SPIKE_D, SPIKE_L, SPIKE_R, DOOR, SAW, SPRING, WARP, SWITCH, BUTTON = range(12)-HIDDEN, VANISH, GHOST, TRAP = 0x10, 0x20, 0x40, 0x80-START, RIGHT, LEFT, UP, DOWN, TOUCH, AFTER, NEAR = range(8)-ONCE, LOOP, CHASE, FALL = range(4)-BACK, ICE, AIR, FLIP, WRAP = 1, 2, 4, 8, 16-SPEEDS = [0, 2, 4, 6, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128] # 16ths of a pixel a step-FLOOR_Y = 100+HERE = os.path.dirname(os.path.abspath(__file__))+FPS = 60++# kinds, flags, modes, ops (src/main.c)+(K_BLOCK, K_SPIKE, K_SAW, K_SPRING, K_DOOR, K_TRIG, K_COIN, K_BAD, K_WARP, K_BUTTON, K_THRU, K_GSPIKE,+ K_DEATH) = range(13)+F_HIDE, F_GHOST, F_OFF, F_BIG, F_USED, F_ICE = 1, 2, 4, 8, 16, 32+R_WRAP, R_WRAPY, R_SWAP, R_FLAPPY, R_GRAVITY = 1, 2, 4, 16, 32+(O_VEL, O_MOVE, O_SET, O_GROW, O_FLAG, O_SPAWN, O_WARP, O_HERO, O_GRAV, O_HGROW, O_SHAKE, O_FIRE, O_REARM,+ O_TOWARD, O_RULE, O_ACCEL, O_HOP, O_KEY) = range(18)+# O_HERO: what of the runner (speeds in pixels a second)+H_RUN, H_JUMP, H_MAXUP, H_MAXDOWN, H_BACK, H_DOWNJUMP, H_DIR, H_SLIDE, H_PUSHX = range(9)+# O_RULE: what an object does every step until told otherwise+U_NONE, U_PATROL, U_FOLLOW, U_STOPX, U_WRAPX = range(5)+EV_KEY, EV_MOVE = 9, 10+NOBODY = 255++WORLDS = ["Pits", "Spikes", "Push", "Coins", "Controls", "Platforms", "Springs", "Warps", "Scale", "Doors", "Saws",+ "Flappy", "Gravity", "Movement", "Wraparound", "Boss"]+FAKE = [600, 645, 647, 649, 651, 653, 655, 657] # Fake_Tile_1 to 8 (Enemy_Fake_Tile is a 600 too)+TRIGGER = [602, 604, 615, 617, 665, 667, 673, 675] # Trigger_1 to 8+KINDS = {609: K_SPIKE, 684: K_SAW, 621: K_SPRING, 598: K_DOOR, 613: K_COIN, 659: K_BAD, 619: K_WARP, 661: K_BUTTON,+ 562: K_THRU, 698: K_GSPIKE, 846: K_DEATH, 682: K_DOOR}+SKIP = {596, 766, 682} # blood, the keyboard sign, the door's double (Doors_5)+SCENES = {r["name"]: r for r in json.load(open(os.path.join(HERE, "scenes.json")))}+++def frames(ms):+ return int(round(ms * FPS / 1000))class Obj:- def __init__(self, kind, x, y, w, h, flags=0, trap=None):- self.kind, self.x, self.y, self.w, self.h, self.flags, self.trap = kind, x, y, w, h, flags, trap+ def __init__(self, kind, x, y, sx=1.0, sy=1.0, angle=0, typ=None, name="", ev=0):+ self.kind, self.x, self.y, self.sx, self.sy, self.angle = kind, x, y, sx, sy, angle+ self.typ, self.name, self.ev = typ, name, ev+ self.flags, self.back, self.index, self.made = 0, False, None, False+ self.iw, self.ih = (16, 26) if kind == K_GSPIKE else (16, 16)++ @property+ def cx(self):+ return self.x + self.iw / 2+ @property+ def cy(self):+ return self.y + self.ih / 2-def trap(when=START, at=0, does=ONCE, dx=0, dy=0, speed=0, delay=0, after=0, before=0):- """What sets it off (when, at), how many deaths it waits for (after: there from death n on;- before: there until death n), what it does: dx, dy at speed (pixels a step; 0 at once),- delay in steps (rounded to fours)."""- s = min(range(16), key=lambda i: abs(SPEEDS[i] - speed * 16)) if speed else 0- gate = after if after else (before + 4 if before else 0)- return dict(when=when, at=at, does=does, dx=dx, dy=dy, speed=s, delay=(delay + 3) // 4, gate=gate)+ def __repr__(self):+ return f"{self.name}@{self.x},{self.y}"-# the usual traps-def falls(at, **k):- """drops away once the runner's right side passes x = at"""- return trap(RIGHT, at, FALL, **k)+def lst(o):+ return list(o) if isinstance(o, (list, tuple)) else [o]-def pops(at, dy=-5, **k):- """spikes out of the floor (or of whatever hides them) once the runner passes x = at"""- return trap(RIGHT, at, ONCE, dy=dy, speed=4, **k)+def flat(ops):+ out = []+ for o in ops:+ if isinstance(o, (list, tuple)):+ out += flat(o)+ else:+ out.append(o)+ return out++# ------------------------------------------------------------ steps of a script+class Op:+ def __init__(self, code, obj=None, a=0, b=0, c=0):+ self.code, self.obj, self.a, self.b, self.c, self.t, self.cond = code, obj, a, b, c, 0, 0-def block(x, y, w, h, trap=None, flags=0):- return Obj(BLOCK, x, y, w, h, flags, trap)++def at(ms, *ops):+ out = flat(ops)+ for p in out:+ p.t += ms+ return out-def floor(x, w, y=FLOOR_Y, **k):- return block(x, y, w, 120 - y, **k)+def when(cond, ops):+ out = flat(ops)+ for p in out:+ p.cond = cond+ return out-def spikes(x, y, n, side="u", trap=None, flags=0):- """n teeth (5 pixels each) on a floor (u, pointing up), under a ceiling (d), on a wall (l: on its- left side, pointing left; r: on its right side, pointing right)"""- kind = {"u": SPIKE_U, "d": SPIKE_D, "l": SPIKE_L, "r": SPIKE_R}[side]- w, h = (5 * n, 5) if side in "ud" else (5, 5 * n)- return Obj(kind, x, y, w, h, flags, trap)+def nth(n, *ops): # only the n-th time the event goes off+ return when(n, ops)-def door(x, y=FLOOR_Y - 20, trap=None, fake=False, hanging=False, flags=0):- return Obj(DOOR, x, y, 11, 1 if hanging else 20, flags | (GHOST if fake else 0), trap)+def ifev(ev, *ops): # only if event ev has gone off (by then)+ return when(0x10 | ev, ops)-def saw(x, y, size, trap=None, flags=0):- """a saw of that size, its top-left at (x, y)"""- return Obj(SAW, x, y, size, size, flags, trap)+def ifnot(ev, *ops): # only if it has not+ return when(0x20 | ev, ops)-def spring(x, y=FLOOR_Y - 3, w=8, trap=None, flags=0):- return Obj(SPRING, x, y, w, 3, flags, trap)+def vel(objs, vx, vy):+ """setXVelocity and setYVelocity (the game's units)"""+ return [Op(O_VEL, o, round(vx * 10), round(vy * 10)) for o in lst(objs)]-def warp(a, b, trap=None, flags=0):- """two ends, 8 x 12 each, their top-left corners"""- return Obj(WARP, a[0], a[1], b[0], b[1], flags, trap)+def move(objs, dx, dy, ms=0):+ """moved by (dx, dy) pixels, evenly over ms (setX in a loop, or a tween)"""+ return [Op(O_MOVE, o, round(dx), round(dy), frames(ms)) for o in lst(objs)]-def switch(x, y, w, h, toggles, when=RIGHT, at=0, **k):- """an invisible line that toggles modes once"""- t = trap(when, at, ONCE, **k)- t["dx"] = toggles- return Obj(SWITCH, x, y, w, h, 0, t)+def steps(objs, dx, dy, n, rate):+ """for (e = 0; n > e;) runLater(e / rate * 1000, setX(getX() + dx)): n steps, rate a second"""+ return move(objs, dx * n, dy * n, 1000 * n / rate)-def button(x, toggles, y=FLOOR_Y - 2, w=8, ceiling=False):- """a button on the floor (or under a ceiling, y its top) that toggles modes each time it is touched"""- t = trap(TOUCH, 0, ONCE)- t["dx"] = toggles- return Obj(BUTTON, x, y, w, 2, GHOST if ceiling else 0, t)---ROOMS = [] # (modes, start, objects)---def room(objs, modes=0, start=(14, FLOOR_Y)):- ROOMS.append((modes, start, objs))---def chain(objs, first, delay, does=FALL, **k):- """each object's trap goes off a while after the one before it; the first one's when the runner- passes x = first"""- for i, o in enumerate(objs):- o.trap = trap(AFTER if i else RIGHT, objs[i - 1] if i else first, does, delay=delay if i else 0, **k)- return objs---def popping(x, n, at, y=FLOOR_Y, **k):- """spikes hidden in the floor at y, out once the runner passes x = at"""- return spikes(x, y, n, trap=pops(at, **k))---def always(**k):- """no trap, but there only after (or before) so many deaths"""- return trap(START, 0, ONCE, **k)---DOOR_X = 140 # where most doors are, at the end of the floor--# ------------------------------------------------------------------ 1: the floor drops away-# the floor in front of the door drops; after a death it holds, and spikes come up where the runner lands-room([floor(0, 96), floor(96, 24, trap=falls(88, before=1)), floor(96, 24, trap=always(after=1)),- popping(120, 3, 92, after=1), floor(120, 40), door(DOOR_X)])-room([floor(0, 50), floor(50, 22, trap=falls(44)), floor(72, 30), floor(102, 22, trap=falls(96)), floor(124, 36),- door(DOOR_X)])-# the floor behind the runner drops away, a piece after the other: no stopping-room([floor(0, 24)] + chain([floor(24 + 20 * i, 20) for i in range(5)], 30, 18) + [floor(124, 36), door(DOOR_X)])-# stepping stones over a pit, dropping soon after they are stepped on-room([floor(0, 40)] + [block(52 + 30 * i, 100, 16, 6, trap=trap(TOUCH, 0, FALL, delay=14)) for i in range(3)]- + [floor(140, 20), door(144)])-# the door's own floor drops when the runner comes near: jump into the door from afar-room([floor(0, 100), block(100, 100, 60, 20, trap=trap(NEAR, 22, FALL)), door(130, trap=trap(NEAR, 18, FALL))])--# ------------------------------------------------------------------ 2: spikes-# spikes come up in front of the door-room([floor(0, 160), popping(118, 3, 104), door(DOOR_X)])-# a low ceiling, whose spikes drop when the runner jumps: hop low over the spikes on the floor-room([floor(0, 160), block(50, 10, 60, 58), spikes(50, 63, 12, "d", trap=trap(UP, 90, ONCE, dy=5, speed=4)),- spikes(76, 95, 2), door(DOOR_X)])-# spike pits, and more spikes come up where a long jump would land-room([floor(0, 160), spikes(30, 95, 3), popping(57, 2, 34), spikes(85, 95, 3), popping(112, 2, 89), door(DOOR_X)])-# a step: spikes come out of its side as the runner nears it, then out of its top-room([floor(0, 160), block(70, 84, 40, 16), spikes(70, 84, 3, "l", trap=trap(RIGHT, 56, ONCE, dx=-5, speed=4)),- popping(90, 2, 78, y=84), door(DOOR_X)])-# spikes come up behind the runner, one after another, and in front of the door-room([floor(0, 160)] + chain([spikes(30 + 15 * i, 100, 3) for i in range(6)], 50, 14, does=ONCE, dy=-5, speed=4)- + [popping(122, 2, 112), door(DOOR_X)])--# ------------------------------------------------------------------ 3: walls-# over the gap, a pillar comes up out of the floor where the runner would land-room([floor(0, 70), floor(80, 80), block(86, 100, 8, 20, trap=trap(RIGHT, 64, ONCE, dy=-16, speed=3)), door(DOOR_X)])-# a wall slides out of the right wall at the runner: jump it-room([floor(0, 160), block(148, 86, 12, 14, trap=trap(RIGHT, 40, ONCE, dx=-110, speed=1.5)), door(128)])-# a wall comes down from the ceiling, low enough to walk under but not to jump; then a crusher-room([floor(0, 160), block(66, 10, 14, 60, trap=trap(RIGHT, 50, ONCE, dy=22, speed=3)),- block(100, 10, 14, 30, trap=trap(RIGHT, 86, LOOP, dy=60, speed=3)), door(DOOR_X)])-# the ceiling comes down on the whole room: hurry-room([floor(0, 160), block(4, 10, 152, 10, trap=trap(RIGHT, 20, ONCE, dy=78, speed=0.5)), spikes(60, 95, 2),- spikes(100, 95, 3), door(DOOR_X)])-# the left wall comes after the runner-room([floor(0, 160), block(0, 10, 8, 90, trap=trap(RIGHT, 22, ONCE, dx=124, speed=1)), spikes(60, 95, 2),- spikes(100, 95, 3), door(DOOR_X)])--# ------------------------------------------------------------------ 4: the door-# the door goes behind the runner, and spikes come up between-d = door(120, trap=trap(NEAR, 30, ONCE, dx=-96))-room([floor(0, 160), d, spikes(60, 100, 3, trap=trap(AFTER, d, ONCE, dy=-5, speed=4))])-# the door rises out of reach on a pillar: a ledge left behind helps-room([floor(0, 160), block(120, 100, 30, 20, trap=trap(NEAR, 26, ONCE, dy=-26, speed=1)),- door(130, trap=trap(NEAR, 26, ONCE, dy=-26, speed=1)), block(76, 84, 20, 4)])-# a fake door: spikes under it; the real one shows up at the end-s = spikes(52, 100, 4, trap=trap(NEAR, 14, ONCE, dy=-5, speed=4))-room([floor(0, 160), door(56, fake=True), s, door(DOOR_X, flags=HIDDEN, trap=trap(AFTER, s, ONCE))])-# the door rides back and forth on a platform over a pit of spikes-room([floor(0, 44), block(48, 112, 108, 8), spikes(48, 107, 21),- block(60, 94, 24, 4, trap=trap(START, 0, LOOP, dx=60, speed=0.5)),- door(70, y=74, trap=trap(START, 0, LOOP, dx=60, speed=0.5))])-# the door jumps to the start, and the floor between drops away-d = door(130, trap=trap(NEAR, 22, ONCE, dx=-110))-room([floor(0, 70), floor(70, 26, trap=trap(AFTER, d, FALL, delay=8)), floor(96, 64), d])--# ------------------------------------------------------------------ 5: backwards-room([floor(0, 160), spikes(70, 95, 3), door(DOOR_X)], modes=BACK)-# the keys turn round halfway-room([floor(0, 160), switch(0, 0, 0, 0, BACK, at=66), spikes(84, 95, 3), door(DOOR_X)])-# back to front, and the right way round again in the middle of a jump-room([floor(0, 56), floor(84, 76), switch(0, 0, 0, 0, BACK, when=UP, at=90), door(DOOR_X)], modes=BACK)-# back to front over dropping floors-room([floor(0, 50), floor(50, 24, trap=falls(46)), floor(74, 26), floor(100, 24, trap=falls(96)), floor(124, 36),- door(DOOR_X)], modes=BACK)-# the keys turn round, again and again-room([floor(0, 160), switch(0, 0, 0, 0, BACK, at=40), spikes(56, 95, 2), switch(0, 0, 0, 0, BACK, at=80),- spikes(96, 95, 2), switch(0, 0, 0, 0, BACK, at=116), popping(126, 2, 116), door(DOOR_X)])--# ------------------------------------------------------------------ 6: fake ground-# a piece of floor that isn't there-room([floor(0, 60), floor(60, 26, flags=GHOST), floor(86, 74), door(DOOR_X)])-# no floor, but there is one: an invisible bridge; the platform over it is the fake-room([floor(0, 40), block(44, 112, 76, 8), spikes(44, 107, 15)] + [Obj(SECRET, 40 + 20 * i, 100, 20, 4) for i in range(4)]- + [block(62, 76, 36, 4, flags=GHOST), floor(120, 40), door(DOOR_X)])-# a wall to the ceiling: it isn't there, but the pit behind it is-room([floor(0, 120), block(110, 10, 10, 90, flags=GHOST), floor(136, 24), door(DOOR_X)])-# floors, real and fake, side by side-room([floor(0, 40), floor(40, 20, flags=GHOST), floor(60, 20), floor(80, 20), floor(100, 20, flags=GHOST),- floor(120, 40), door(DOOR_X)])-# platforms that vanish once stepped on, and the last one is fake-room([floor(0, 30), block(34, 112, 106, 8), spikes(34, 107, 21)]- + [block(40 + 24 * i, 96, 14, 4, trap=trap(TOUCH, 0, ONCE, delay=10), flags=VANISH) for i in range(3)]- + [block(112, 96, 14, 4, flags=GHOST), floor(140, 20), door(144)])--# ------------------------------------------------------------------ 7: springs-room([floor(0, 160), spring(60), block(100, 58, 56, 42), door(140, y=38)])-# a spring comes out under the runner, into the spikes on the ceiling-room([floor(0, 160), spring(70, flags=HIDDEN, trap=trap(RIGHT, 72)), block(56, 10, 40, 36), spikes(56, 46, 8, "d"),- door(DOOR_X)])-# from spring to spring over the spikes-room([floor(0, 40), block(40, 108, 80, 12), spikes(40, 103, 16), block(62, 96, 10, 12), spring(63, y=93),- block(96, 96, 10, 12), spring(97, y=93), floor(120, 40), door(DOOR_X)])-# the spring slides away as the runner comes-room([floor(0, 40), block(40, 108, 116, 12), spikes(40, 103, 23), block(56, 96, 40, 12),- spring(60, y=93, trap=trap(NEAR, 12, ONCE, dx=26, speed=2)), block(120, 50, 36, 8), door(140, y=30)])-# up a spring, between the spikes of the ceiling-room([floor(0, 160), spring(46), spikes(30, 10, 3, "d"), spikes(60, 10, 8, "d"), block(84, 56, 72, 6),- popping(100, 3, 100, y=56), door(DOOR_X, y=36)])--# ------------------------------------------------------------------ 8: warps-room([floor(0, 160), block(76, 10, 8, 90), warp((50, 88), (110, 88)), door(DOOR_X)])-# the warp moves as the runner comes-room([floor(0, 160), block(76, 10, 8, 90), warp((40, 88), (126, 88), trap=trap(NEAR, 10, ONCE, dx=16, speed=2)),- spikes(30, 95, 2), door(DOOR_X)])-# out of the warp over spikes: keep running-room([floor(0, 160), block(56, 10, 8, 90), warp((30, 88), (70, 66)), block(66, 78, 20, 4), spikes(64, 95, 12),- door(DOOR_X)])-# a warp comes up behind the runner over the gap, and takes it back to the start-room([floor(0, 60), floor(84, 76), warp((90, 76), (14, 88), flags=HIDDEN, trap=trap(UP, 90, ONCE)), door(DOOR_X)])-# warps, up and down-room([floor(0, 160), block(50, 10, 6, 90), block(104, 10, 6, 90), block(56, 52, 22, 4), block(84, 52, 20, 4),- spikes(56, 95, 10), warp((36, 88), (62, 40)), warp((92, 40), (120, 88)), door(DOOR_X)])--# ------------------------------------------------------------------ 9: crushers-room([floor(0, 160), block(70, 10, 20, 30, trap=trap(RIGHT, 50, LOOP, dy=60, speed=2)), door(DOOR_X)])-# a piece of the ceiling falls as the runner passes-room([floor(0, 160), block(60, 10, 30, 14, trap=trap(RIGHT, 58, ONCE, dy=76, speed=4)), spikes(100, 95, 2),- door(DOOR_X)])-# two crushers out of step-room([floor(0, 160), block(54, 10, 18, 30, trap=trap(RIGHT, 26, LOOP, dy=60, speed=2)),- block(96, 10, 18, 30, trap=trap(RIGHT, 26, LOOP, dy=60, speed=2, delay=20)), door(DOOR_X)])-# pieces of the ceiling fall as the runner comes near: wait for each one-room([floor(0, 160)] + [block(36 + 26 * i, 10, 16, 14, trap=trap(NEAR, 28, FALL)) for i in range(4)] + [door(DOOR_X)])-# crushers over dropping floors-room([floor(0, 40), floor(40, 30, trap=falls(36)), floor(70, 90),- block(90, 10, 16, 30, trap=trap(START, 0, LOOP, dy=60, speed=2.5)), door(DOOR_X)])--# ------------------------------------------------------------------ 10: saws-room([floor(0, 160), saw(50, 86, 14, trap=trap(START, 0, LOOP, dx=60, speed=1)), door(DOOR_X)])-# a saw comes up out of the floor-room([floor(0, 160), saw(84, 100, 16, trap=trap(RIGHT, 70, ONCE, dy=-12, speed=3)), door(DOOR_X)])-# a saw drops from the ceiling-room([floor(0, 160), saw(96, 10, 16, trap=trap(RIGHT, 84, FALL)), spikes(120, 95, 2), door(DOOR_X)])-# saws up and down-room([floor(0, 160), saw(50, 20, 14, trap=trap(START, 0, LOOP, dy=66, speed=1.5)),- saw(84, 86, 14, trap=trap(START, 0, LOOP, dy=-66, speed=1.5)),- saw(118, 20, 14, trap=trap(START, 0, LOOP, dy=66, speed=1.5)), door(DOOR_X)])-# the saw in the door's way follows it-room([floor(0, 160), saw(110, 84, 16, trap=trap(NEAR, 30, ONCE, dx=-40, speed=1.5)), spikes(40, 95, 2), door(DOOR_X)])--# ------------------------------------------------------------------ 11: chase-room([floor(0, 160), saw(0, 84, 16, trap=trap(RIGHT, 40, CHASE, dx=1, speed=0.9)), spikes(64, 95, 2),- spikes(104, 95, 2), door(DOOR_X)], start=(26, FLOOR_Y))-# a wall of spikes-room([block(0, 10, 6, 90, trap=trap(RIGHT, 30, ONCE, dx=124, speed=1)),- spikes(6, 10, 18, "r", trap=trap(RIGHT, 30, ONCE, dx=124, speed=1)), floor(60, 20, trap=falls(56)),- floor(0, 60), floor(80, 80), door(DOOR_X)])-# a saw that follows the runner everywhere, slowly-room([floor(0, 160), block(40, 84, 30, 16), block(80, 68, 30, 32), block(120, 52, 36, 48),- saw(10, 20, 14, trap=trap(START, 0, CHASE, dx=1, dy=1, speed=0.5, delay=20)), door(140, y=32)])-# saws from both sides-room([floor(0, 160), saw(0, 86, 14, trap=trap(RIGHT, 40, CHASE, dx=1, speed=0.7)),- saw(146, 86, 14, trap=trap(RIGHT, 40, CHASE, dx=1, speed=0.7)), block(70, 82, 20, 4), door(75, y=62)],- start=(26, FLOOR_Y))-# chased over dropping floors-room([floor(0, 30), saw(0, 84, 16, trap=trap(RIGHT, 36, CHASE, dx=1, speed=0.9))]- + chain([floor(30 + 20 * i, 20) for i in range(5)], 44, 16) + [floor(130, 30), door(DOOR_X)], start=(22, FLOOR_Y))--# ------------------------------------------------------------------ 12: jumps in the air-room([floor(0, 160), block(70, 40, 12, 60), door(DOOR_X)], modes=AIR)-# careful: spikes on the ceiling-room([floor(0, 50), block(54, 112, 70, 8), spikes(54, 107, 14), floor(124, 36), spikes(40, 10, 18, "d"), door(DOOR_X)],- modes=AIR)-# the jumps in the air stop over the pit-room([floor(0, 50), block(54, 112, 70, 8), spikes(54, 107, 14), floor(124, 36),- switch(0, 0, 0, 0, AIR, at=96), door(DOOR_X)], modes=AIR)-# up a tower with spikes on its side, under spikes on the ceiling-room([floor(0, 160), block(70, 34, 30, 66), spikes(65, 44, 10, "l"), spikes(20, 10, 9, "d"), door(80, y=14)],- modes=AIR)-# a wide pit, saws in the air-room([floor(0, 30), block(30, 112, 100, 8), spikes(30, 107, 20), floor(130, 30),- saw(60, 40, 14, trap=trap(START, 0, LOOP, dy=40, speed=1)), saw(96, 70, 14, trap=trap(START, 0, LOOP, dy=-40, speed=1)),- door(DOOR_X)], modes=AIR)--# ------------------------------------------------------------------ 13: gravity-room([floor(0, 40), block(40, 104, 116, 16), spikes(40, 99, 23), button(20, FLIP), door(140, y=10, hanging=True)])-# buttons on the floor and on the ceiling-room([floor(0, 40), block(40, 104, 60, 16), spikes(40, 99, 12), floor(100, 60), button(20, FLIP),- spikes(52, 10, 3, "d"), button(84, FLIP, y=10, ceiling=True), spikes(100, 10, 6, "d"), door(DOOR_X)])-# gravity flips as the runner passes under the spikes-room([floor(0, 160), spikes(60, 10, 8, "d"), switch(0, 0, 0, 0, FLIP, at=64), switch(0, 0, 0, 0, FLIP, at=106),- door(DOOR_X)])-# a jump flips gravity-room([floor(0, 160), switch(0, 0, 0, 0, FLIP, when=UP, at=92), spikes(50, 95, 3), spikes(74, 10, 5, "d"),- button(58, FLIP, y=10, ceiling=True), door(DOOR_X)])-# up and down over the spikes, the door on the ceiling-room([floor(0, 30), block(30, 104, 126, 16), spikes(30, 99, 25), button(16, FLIP), block(50, 10, 20, 16),- spikes(70, 10, 6, "d"), button(56, FLIP, y=26, ceiling=True), block(100, 50, 24, 4), door(140, y=10, hanging=True)])--# ------------------------------------------------------------------ 14: ice-room([floor(0, 100), block(100, 112, 30, 8), spikes(100, 107, 6), floor(130, 30), door(DOOR_X)], modes=ICE)-room([floor(0, 40), block(40, 112, 116, 8), spikes(40, 107, 23), block(60, 100, 14, 4), block(94, 100, 14, 4),- floor(130, 30), door(DOOR_X)], modes=ICE)-# the floor turns to ice before the spikes-room([floor(0, 160), switch(0, 0, 0, 0, ICE, at=60), spikes(100, 95, 3), door(DOOR_X)])-room([floor(0, 50), floor(50, 30, trap=falls(60)), floor(80, 80), spikes(110, 95, 2), door(DOOR_X)], modes=ICE)-room([floor(0, 160), saw(60, 86, 14, trap=trap(START, 0, LOOP, dx=50, speed=1)), spikes(130, 95, 1), door(DOOR_X)],- modes=ICE)--# ------------------------------------------------------------------ 15: round the edges-room([floor(0, 160), block(120, 10, 8, 90), door(DOOR_X)], modes=WRAP)-room([floor(0, 50), floor(110, 50), block(90, 10, 8, 90), door(60, y=60), block(50, 80, 30, 4)], modes=WRAP)-room([floor(0, 160), popping(140, 4, 120), block(30, 10, 8, 90), door(10)], modes=WRAP, start=(60, FLOOR_Y))-room([floor(0, 160), saw(110, 84, 16, trap=trap(LEFT, 60, CHASE, dx=1, speed=0.9)), block(4, 10, 10, 90),- door(20)], modes=WRAP, start=(60, FLOOR_Y))-# a wall in the way, and a pit at the other edge: jump through the edge-room([floor(0, 50), block(50, 10, 6, 90), floor(56, 84), block(140, 112, 20, 8), spikes(140, 107, 4), door(100)],- modes=WRAP, start=(24, FLOOR_Y))--# ------------------------------------------------------------------ 16: the Devil-room([floor(0, 50), floor(50, 24, trap=falls(44)), floor(74, 86), popping(110, 3, 100),- door(DOOR_X, trap=trap(NEAR, 18, ONCE, dx=-16, speed=2))])-room([floor(0, 40), block(40, 104, 116, 16), spikes(40, 99, 23), button(20, FLIP), spikes(80, 10, 4, "d"),- door(140, y=10, hanging=True)], modes=BACK)-room([floor(0, 160), block(60, 10, 20, 30, trap=trap(START, 0, LOOP, dy=60, speed=2)),- saw(100, 86, 14, trap=trap(START, 0, LOOP, dx=26, speed=1)), door(DOOR_X)], modes=ICE)-room([floor(0, 40), floor(40, 20, flags=GHOST), floor(60, 100), block(90, 10, 8, 90), warp((70, 88), (110, 88)),- popping(112, 2, 100), door(DOOR_X)])-s = spikes(66, 100, 5, trap=trap(NEAR, 16, ONCE, dy=-5, speed=4))-room([floor(0, 160), door(70, fake=True), s, switch(0, 0, 0, 0, BACK, when=AFTER, at=s),- door(DOOR_X, flags=HIDDEN, trap=trap(AFTER, s, ONCE))])---def pack_trap(t, index):- at = t["at"]- if isinstance(at, Obj):- at = index[id(at)]- return [t["when"] | t["gate"] << 3 | t["does"] << 6, at & 255, t["dx"] & 255, t["dy"] & 255,- t["speed"] | t["delay"] << 4]---def pack(modes, start, objs):- out = [modes, start[0], start[1], len(objs)]- index = {id(o): i for i, o in enumerate(objs)}- for o in objs:- for v in (o.x, o.y, o.w, o.h):- assert 0 <= v < 256, (o.kind, o.x, o.y, o.w, o.h)- out += [o.kind | o.flags | (TRAP if o.trap else 0), o.x, o.y, o.w, o.h]- if o.trap:- out += pack_trap(o.trap, index)+def setpos(objs, x=None, y=None):+ """setX, setY (the corner of its picture)"""+ out = []+ for o in lst(objs):+ nx, ny = (o.x if x is None else x), (o.y if y is None else y)+ out.append(Op(O_SET, o, round(nx + o.iw / 2), round(ny + o.ih / 2), (x is not None) | (y is not None) << 1))return out+def grow(objs, sx, sy, s=0.0):+ """growTo(sx, sy, s): sx and sy times the size of its picture, over s seconds, about its centre"""+ return [Op(O_GROW, o, round(o.iw * sx / 2), round(o.ih * sy / 2), frames(s * 1000)) for o in lst(objs)]+++def flag(objs, on, off):+ return [Op(O_FLAG, o, on, off) for o in lst(objs)]+++def gone(objs): # recycled+ return flag(objs, F_OFF, 0)+++def hide(objs): # disableActorDrawing+ return flag(objs, F_HIDE, 0)+++def show(objs):+ return flag(objs, 0, F_HIDE)+++def ghost(objs): # nothing to stand on: its group changed, or its body destroyed+ return flag(objs, F_GHOST, 0)+++def solid(objs):+ return flag(objs, 0, F_GHOST)+++def big(objs): # a saw's second picture, twice as big+ return flag(objs, F_BIG, 0)+++def spawn(objs, src=None, dx=0, dy=0):+ """createRecycledActor: there from now on, where it was made or at src's centre and (dx, dy)"""+ return [Op(O_SPAWN, o, NOBODY if src is None else src, round(dx), round(dy)) for o in lst(objs)]+++def warp(x, y):+ """the room's warp: the runner at (x, y) at once, hidden and still for 750 ms"""+ return [Op(O_WARP, None, x, y)]+++def hero(what, v):+ return [Op(O_HERO, None, what, round(v))]+++def run(v): # _MaximumRunningSpeed+ return hero(H_RUN, v * 10)+++def gravity(gx, gy):+ return [Op(O_GRAV, None, round(gx * 10), round(gy * 10))]+++def hgrow(sx, sy, s):+ """the runner's growTo"""+ return [Op(O_HGROW, None, round(sx * 100), round(sy * 100), frames(s * 1000))]+++def shake(amount, s):+ return [Op(O_SHAKE, None, round(amount * 1000), frames(s * 1000))]+++def fire(ev): # shoutToScene+ return [Op(O_FIRE, None, ev)]+++def rearm(objs):+ return [Op(O_REARM, o) for o in lst(objs)]+++def toward(objs, v): # setXVelocity(±v): towards the runner+ return [Op(O_TOWARD, o, round(v * 10)) for o in lst(objs)]+++def patrol(objs, lo, hi):+ """turns round when its corner is at lo or less, hi or more"""+ return [Op(O_RULE, o, U_PATROL, round(lo + o.iw / 2), round(hi + o.iw / 2)) for o in lst(objs)]+++def follow(objs, target, dx=0):+ """its x kept at target's and dx"""+ return [Op(O_RULE, o, U_FOLLOW, target, round(dx)) for o in lst(objs)]+++def stopx(objs, x, snap=None):+ """stops when its corner gets to x (from either side), put at snap"""+ return [Op(O_RULE, o, U_STOPX, round(x + o.iw / 2), round((x if snap is None else snap) + o.iw / 2))+ for o in lst(objs)]+++def wrapx(objs, lo, hi):+ """moving left past lo it comes back at hi, moving right past hi at lo (its corner)"""+ return [Op(O_RULE, o, U_WRAPX, round(lo + o.iw / 2), round(hi + o.iw / 2)) for o in lst(objs)]+++def norule(objs, what=U_NONE):+ return [Op(O_RULE, o, U_NONE, what) for o in lst(objs)]+++def accel(objs, ax, ay):+ """pushed along: ax, ay pixels a second faster each second (held back by the ground)"""+ return [Op(O_ACCEL, o, round(ax), round(ay)) for o in lst(objs)]+++def hop(objs, v):+ """thrown up at v (the game's units) if at rest, and falling back to where it was"""+ return [Op(O_HOP, o, round(v * 10)) for o in lst(objs)]+++def key(ev):+ """from now on the jump key sets off ev, each time it is pressed"""+ return [Op(O_KEY, None, ev)]+++# ------------------------------------------------------------ a room+class Room:+ def __init__(self, name):+ self.name = name+ world = WORLDS.index(name.split("_")[0])+ self.modes = {11: R_FLAPPY, 12: R_GRAVITY, 14: R_WRAP}.get(world, 0)+ if name == "Boss_4":+ self.modes = R_WRAP | R_WRAPY | R_GRAVITY+ s = SCENES[name]+ self.ground = s["ground"]+ self.objs, self.events, self.hero = [], {}, None+ for a in s["actors"]:+ t = a["type"]+ if t in (590, 692):+ self.hero = (a["x"], a["y"])+ elif t not in SKIP:+ o = self.new(t, a["x"], a["y"], a["sx"], a["sy"], a["angle"], a["name"])+ if t == 846: # Generic_Death_Square: not drawn+ o.flags |= F_HIDE+ assert self.hero, name++ def new(self, typ, x, y, sx=1.0, sy=1.0, angle=0, name="made"):+ if typ in FAKE:+ kind, ev = K_BLOCK, 0+ elif typ in TRIGGER:+ kind, ev = K_TRIG, TRIGGER.index(typ) + 1+ else:+ kind, ev = KINDS[typ], 0+ o = Obj(kind, x, y, sx, sy, angle, typ, name, ev)+ self.objs.append(o)+ return o++ # the actors, found as the scripts find them+ def all(self, typ, x=None, y=None, cond=None):+ return [o for o in self.objs if o.typ == typ and not o.made and (x is None or o.x == x)+ and (y is None or o.y == y) and (cond is None or cond(o))]++ def one(self, typ, x=None, y=None):+ out = self.all(typ, x, y)+ assert len(out) == 1, (self.name, typ, x, y, out)+ return out[0]++ def make(self, typ, x, y, sx=1.0, sy=1.0, angle=0):+ """an actor the script creates (createRecycledActor): there once spawn()ed"""+ o = self.new(typ, x, y, sx, sy, angle % 360)+ o.flags |= F_OFF+ o.made = True+ return o++ def init(self, *ops):+ self.on(0, *ops)++ def on(self, ev, *ops):+ self.events.setdefault(ev, []).extend(flat(ops))++ def settle(self):+ """what init does at once to the actors there (growTo over .01 s, hiding): done here"""+ keep = []+ for op in self.events.get(0, []):+ o = op.obj+ if op.t == 0 and op.cond == 0 and isinstance(o, Obj) and not o.made:+ if op.code == O_GROW and op.c <= 1:+ o.sx, o.sy = op.a * 2 / o.iw, op.b * 2 / o.ih+ continue+ if op.code == O_FLAG:+ o.flags = (o.flags | op.a) & ~op.b+ continue+ keep.append(op)+ self.events[0] = keep++ def pack(self):+ """the room as spans of objects (n alike, 16 pixels apart) and steps that act on runs of them"""+ self.settle()+ objs = [o for o in self.objs if not (o.kind == K_COIN and o.x >= 500)] # (coins never seen)+ seen = {id(o) for o in objs}+ evs = sorted(self.events)+ sig = {id(o): [] for o in objs}+ for ev in evs:+ for op in self.events[ev]:+ if isinstance(op.obj, Obj):+ assert id(op.obj) in seen, (self.name, op.obj)+ sig[id(op.obj)].append((ev, op.code, op.cond, ref(op.a), ref(op.b), ref(op.c)))+ for o in objs:+ o.sig = tuple(sorted(sig[id(o)]))+ o.hw, o.hh = u8(o.iw * o.sx / 2)[0], u8(o.ih * o.sy / 2)[0]+ o.vert = o.kind == K_SPIKE and o.angle in (90, 270)+ o.look = (o.kind != K_DOOR, o.kind, o.angle, o.flags, o.ev, o.hw, o.hh, o.vert, o.sig)+ # (all is drawn in the ground's colour but the doors' windows: only the doors need to be first)+ objs.sort(key=lambda o: o.look + ((o.cx, o.cy) if o.vert else (o.cy, o.cx)))+ spans = []+ for o in objs:+ s = spans[-1] if spans else None+ if s and s[0].look == o.look and len(s) < 63 and (+ (o.cx == s[-1].cx and o.cy == s[-1].cy + 16) if o.vert else (o.cy == s[-1].cy and o.cx == s[-1].cx + 16)):+ s.append(o)+ else:+ spans.append([o])+ objs = [o for s in spans for o in s]+ for i, o in enumerate(objs):+ o.index = i+ assert len(objs) <= 120, (self.name, len(objs))+ span_rec = [(s[0].kind | (s[0].angle // 90) << 4 | s[0].vert << 6, s[0].flags, s[0].ev, round(s[0].cx), round(s[0].cy),+ s[0].hw, s[0].hh, len(s)) for s in spans]+ # the steps: those alike on objects one after the other, at the same time or at times along x+ groups = {}+ order = []+ for ev in evs:+ for op in self.events[ev]:+ key = (ev, op.code, op.cond, ref(op.a), ref(op.b), ref(op.c))+ if key not in groups:+ groups[key] = []+ order.append(key)+ groups[key].append(op)+ recs = []+ for key in order:+ ops = sorted(groups[key], key=lambda p: (p.obj.index if isinstance(p.obj, Obj) else -1, p.t))+ i = 0+ while i < len(ops):+ p = ops[i]+ j, k = i + 1, 0+ if isinstance(p.obj, Obj):+ while j < len(ops) and isinstance(ops[j].obj, Obj) and ops[j].obj.index == ops[j - 1].obj.index + 1:+ q = ops[j]+ if j == i + 1: # the slope the first two give, 256ths of a frame a pixel+ dx = q.obj.cx - p.obj.cx+ kk = round((frames(q.t) - frames(p.t)) * 256 / dx) if dx else 0+ if (frames(q.t) != frames(p.t) and not dx) or abs(kk) > 32767:+ break+ else:+ kk = k+ if abs(frames(p.t) + int((q.obj.cx - p.obj.cx) * kk // 256) - frames(q.t)) > 1:+ break+ k = kk+ j += 1+ n = j - i+ if n == 1:+ k = 0+ a, b, c = (v.index if isinstance(v, Obj) else v for v in (p.a, p.b, p.c))+ recs.append((key[0], frames(p.t), p.code, NOBODY if p.obj is None else p.obj.index, n, key[2], a, b, c, k))+ i = j+ recs.sort(key=lambda r: (r[0], r[1]))+ self.expanded = sum(r[4] for r in recs)+ assert len(recs) < 256 and self.expanded <= 240, (self.name, len(recs), self.expanded)+ return span_rec, recs+++def ref(v):+ return ("obj", id(v)) if isinstance(v, Obj) else v+++def i16(v):+ v = int(round(v))+ assert -32768 <= v < 32768, v+ return (v & 0xFFFF).to_bytes(2, "little")+++def u16(v):+ assert 0 <= v < 65536, v+ return v.to_bytes(2, "little")+++def u8(v):+ return bytes([max(0, min(255, int(round(v))))])+++ROOMS = []+++def room(name):+ r = Room(name)+ ROOMS.append(r)+ return r+++def fakes(r):+ """Fake_Tile_1 to 8 of a room"""+ return [r.all(t) for t in FAKE]+++# ================================================================ 1. Pits+r = room("Pits_1")+f1 = r.one(600)+r.init(grow(f1, 1, 5))+r.on(1, vel(f1, 0, 20), at(2000, vel(f1, 0, 0)))++r = room("Pits_2")+f1, f2 = r.one(600), r.one(645)+r.init(grow([f1, f2], 1, 5))+r.on(1, vel(f1, 0, 10), at(2000, vel(f1, 0, 0)))+r.on(2, vel(f2, 0, 20), at(2000, vel(f2, 0, 0)))++r = room("Pits_3")+f1, f2 = r.one(600), r.one(645)+r.init(grow([f1, f2], 7, 5))+r.on(1, move([f1, f2], -64, 0, 500))++r = room("Pits_4")+f1 = r.one(600)+f1.back = True+r.init(grow(f1, 13, 5))+r.on(1, move(f1, 16, 0, 100))+r.on(2, move(f1, 192, 0, 1700))++r = room("Pits_5")+f1, f2 = r.one(600), r.one(645)+f1.back = f2.back = True+r.init(grow(f1, 15, 5), grow(f2, 5, 5))+r.on(1, move(f1, 240, 0, 2000), at(2000, fire(2), setpos(f1, 500)))+r.on(2, move(f2, -16, 0, 100))++# ================================================================ 2. Spikes+r = room("Spikes_1")+r.on(1, move(r.one(609, 240), -16, 0, 250))++r = room("Spikes_2")+r.on(1, steps(r.one(609, 256), -1, 0, 16, 50))+r.on(2, steps(r.one(609, 352), 1, 0, 16, 50))++r = room("Spikes_3")+s1, s2 = r.one(609, 272), r.one(609, 336)+s2.back = True+r.on(1, move(s1, -32, 0, 250)) # (two Trigger_1: each moves it again)+r.on(2, move([s1, s2], -400, 0, 7000))++r = room("Spikes_4")+r.on(1, [at(1000 * s.x / 120, move(s, 0, -16)) for s in r.all(609)])++r = room("Spikes_5")+r.on(1, [at(1000 * s.x / 150, move(s, 0, -16), at(400, move(s, 0, 16))) for s in r.all(609)])+r.on(2, [at(1000 * (528 - s.x) / 250, move(s, 0, -16)) for s in r.all(609)])++# ================================================================ 3. Push+r = room("Push_1")+f1 = r.one(600)+r.init(grow(f1, 1, 2))+r.on(1, move(f1, 0, -32, 250), at(1000, move(f1, -32, 0, 250)), at(1500, move(f1, 0, 32, 500)))++r = room("Push_2")+f1, f2 = r.one(600), r.one(645)+r.init(grow(f1, 1, 2), grow(f2, 2, 5))+r.on(1, vel(f2, 0, 15))+r.on(2, move(f1, 0, -16, 250), at(250, move(f1, 32, 0, 250)), at(500, move(f1, 0, 32, 500)))++r = room("Push_3")+f1 = r.one(600)+r.init(grow(f1, 1, 2))+r.on(1, move(f1, 0, -16, 250), at(250, move(f1, -32, 0, 250)))+r.on(2, move(f1, 176, 0, 750))++r = room("Push_4")+f1, f2, f3 = r.one(600), r.one(645), r.one(647)+r.init(grow(f1, 5, 3), grow([f2, f3], 2, 1))+r.on(1, steps(f2, 0, -1, 16, 100), at(750, steps(f2, 1, 0, 32, 100)),+ at(1750, steps(f1, -1, 0, 80, 100), vel(f2, 6, 0)))+r.on(2, steps(f3, -1, 0, 32, 75))++r = room("Push_5")+f1, f2 = r.one(600), r.one(645)+r.init(grow(f1, 17, 5), grow(f2, 1, 5))+# 256 steps of a pixel, the c-th after c / (50 + c / 5) seconds: faster and faster (in four moves)+r.on(1, [at(500 + 1000 * c / (50 + c / 5), move(f1, -64, 0, 1000 * ((c + 64) / (50 + (c + 64) / 5) - c / (50 + c / 5))))+ for c in (0, 64, 128, 192)])+r.on(2, steps(f2, 0, -1, 32, 100), at(500, steps(f2, 0, 1, 32, 100)))++# ================================================================ 4. Coins+r = room("Coins_1")+f1 = r.one(600)+r.init(grow(f1, 2, 3))+r.on(1, vel(f1, 15, 0), at(2000, vel(f1, 0, 0)))++r = room("Coins_2")+f1 = r.one(600)+r.init(grow(f1, 7, 1), hide(f1))++r = room("Coins_3")+f1 = r.one(600)+r.init(grow(f1, 15, 3))+r.on(1, gone(r.all(602)), vel(f1, 0, 20), at(2000, vel(f1, 0, 0)))++r = room("Coins_4")+r.init(hide(r.all(600)), grow(r.all(600), 1.3, 1))+r.on(1, move(r.one(613, 288), 16, 0, 100))++r = room("Coins_5") # the bad coins pushed right (pushInDirection, 1000 times in 6.7 s)+r.on(1, accel(r.all(659), 90, 0), at(6667, accel(r.all(659), 0, 0)))++# ================================================================ 5. Controls+r = room("Controls_1")+r.init(at(50, hero(H_BACK, 1)))++r = room("Controls_2")+r.init(at(50, hero(H_BACK, 1)))+r.on(1, steps(r.one(609, 352), 1, 0, 16, 100))++r = room("Controls_3") # jumping is Down; Up throws the spikes up+r.init(at(50, hero(H_BACK, 1), hero(H_DOWNJUMP, 1)), hide(r.one(609, 400)), key(EV_KEY))+r.on(1, show(r.all(609)))+r.on(EV_KEY, hop(r.all(609), 30))++r = room("Controls_4")+r.init(at(100, hero(H_JUMP, 100), hero(H_MAXUP, 1000)))++r = room("Controls_5")+r.init(at(50, hero(H_BACK, 1)))+r.on(1, hero(H_BACK, 0), shake(.004, .2))+r.on(2, hero(H_BACK, 1), shake(.004, .2))+r.on(3, hero(H_BACK, 0), shake(.004, .2))++# ================================================================ 6. Platforms+r = room("Platforms_1")+f1, f2, f3 = r.one(600), r.one(645), r.one(647)+r.on(1, vel([f1, f2, f3], 5, 0), at(4800, vel(f2, 0, 0), setpos(f2, 384))) # (Fake_2 stops at 384)+r.on(2, vel(f1, 0, 15))+r.on(3, vel(f3, 0, 15))++r = room("Platforms_2") # a belt of platforms, round and round; the trigger turns it+ps = r.all(600)+r.init(grow(ps, 3, 1), wrapx(ps, 16, 496))+r.on(EV_MOVE, vel(ps, -5, 0))+r.on(1, vel(ps, 5, 0), at(1000, grow(ps, 2, 1, 5)))++r = room("Platforms_3")+fl, f2, f3, f4, f5, f6 = (r.one(t) for t in (600, 645, 647, 649, 651, 653))+r.init(grow([fl, f2, f3, f4, f5, f6], 3, 1))+slide = []+for f, d, ms in ((f2, -7, 0), (f3, 7, 1250), (f4, -7, 2500), (f5, 7, 3750), (f6, -7, 5000)):+ slide += at(ms, vel(f, d, 0), at(80000 / 70, vel(f, 0, 0), setpos(f, 256))) # (stopped at 256)+r.on(1, slide, at(6500, vel([fl, f2, f3, f4, f5, f6], 0, 15)))++r = room("Platforms_4")+fs = [r.one(t) for t in (600, 645, 647, 649, 651)]+r.on(1, grow(fs, 0, 1, .1), ghost(fs))+back = lambda f: [grow(f, 1.1, 1, .1), solid(f)] # noqa: E731+r.on(2, back(fs[0]), at(1500, back(fs[1])), at(3000, back(fs[2])), at(4500, back(fs[3])),+ at(7000, grow(fs[4], .5, 1, .1), at(100, grow(fs[4], 0, 1, .1)), at(1000, back(fs[4]))),+ at(2000, gone(r.all(615))))+r.on(4, at(500, grow(fs[0], 0, 1, .1), ghost(fs[0]), at(500, grow(fs[1], 0, 1, .1), ghost(fs[1])),+ at(1000, grow(fs[2], 0, 1, .1), ghost(fs[2]))))++r = room("Platforms_5")+fs = [r.one(t) for t in (600, 645, 647, 649, 651, 653, 655)]+r.init(grow(fs, 2, 1))+r.on(1, [at(600 + 300 * i, vel(fs[i], 0, 15)) for i in range(5)])+r.on(2, at(500, steps(fs[5], 0, -1, 32, 50)))+r.on(3, vel(fs[6], 0, 18))++# ================================================================ 7. Springs+r = room("Springs_1")+spk = r.all(609)+r.on(1, steps([s for s in spk if s.y == 85], 0, -1, 5, 50))+r.on(2, steps([s for s in spk if s.x in (176, 192)], 0, -1, 5, 50))+r.on(3, steps([s for s in spk if s.x in (272, 288)], 0, -1, 5, 50))+r.on(4, steps([s for s in spk if s.x in (352, 368, 384)], 0, 1, 5, 50))++r = room("Springs_2")+r.on(1, steps(r.all(600), 1, 0, 16, 100), steps(r.all(621, 144), 1, 0, 16, 100))+r.on(2, steps([s for s in r.all(609) if s.x in (256, 272)], 0, 1, 10, 100))+r.on(3, steps(r.all(645), 1, 0, 16, 100), steps(r.all(647), 0, -1, 32, 25), steps(r.one(621, 304, 160), 1, 0, 16, 100),+ steps(r.one(621, 304, 144), 0, -1, 32, 25), steps(r.one(609, 362), 0, -1, 16, 100))++r = room("Springs_3")+sp, f1 = r.one(621), r.one(600)+copy = r.make(600, 0, 0)+r.init(grow(sp, 1.5, 1))+r.on(1, vel([f1, sp], 5, 0), stopx([f1, sp], 368))+r.on(2, spawn(copy, f1), vel(copy, -10, 0), stopx(copy, 144), hide(f1))++r = room("Springs_4")+f2 = r.one(600, 96)+r.init(grow(f2, 1, 4))+r.on(1, steps(f2, -1, 0, 16, 100), steps(r.one(621, 96), -1, 0, 16, 100))+r.on(2, steps(r.all(609), 0, 1, 5, 50), steps(r.one(621, 384), 0, -1, 16, 100))++r = room("Springs_5")+f1, sp = r.all(600), r.all(621)+r.init(grow(sp, 1.5, 1))+for ev, d in ((1, 1), (2, -1), (3, 1), (4, 1)):+ r.on(ev, steps(f1 + sp, d, 0, 16, 100))++# ================================================================ 8. Warps+r = room("Warps_1")+f1 = r.one(600)+r.init(grow(f1, 1, 3))+r.on(1, warp(240, 32))+r.on(2, warp(352, 32))+r.on(3, vel([f1, r.one(609, 320)], 0, 30))+r.on(4, warp(448, 64))++r = room("Warps_2")+w4 = r.one(619, 136)+t2 = r.make(604, 136, 176)+r.on(1, warp(240, 32), spawn(t2), vel([t2, w4], 2, 0))+r.on(2, warp(336, 32), vel(r.all(619), 0, 0))+r.on(3, vel(r.one(619, 256), 0, 30))+r.on(4, steps(r.one(619, 352), 1, 0, 32, 100))+r.on(5, warp(432, 32))++r = room("Warps_3")+r.on(1, warp(296, 32))+r.on(2, steps(r.all(645), -1, 0, 16, 100))+r.on(3, steps(r.one(619, 160), -1, 0, 80, 100))+r.on(4, steps(r.all(600), -1, 0, 16, 100))+r.on(5, warp(336, 32))+r.on(6, steps(r.one(619, 352), -1, 0, 32, 100), steps(r.one(619, 384), -1, 0, 16, 100))+r.on(7, warp(432, 32))++r = room("Warps_4") # each warp sends you back a step, and the step behind falls+fs = [r.one(t) for t in (600, 645, 647, 649, 651, 653)]+f7 = r.one(655)+ws = {w.x: w for w in r.all(619)}+w8, t8 = r.make(619, 200, 176), r.make(675, 200, 176)+r.init(grow(fs, 2, 1), grow(f7, 7, 1), hide([w for x, w in ws.items() if x != 104]))+for i, x in enumerate((104, 136, 168, 200, 232, 264)):+ r.on(i + 1, warp(x - 32, 96), gone(ws[x]), show(ws[x + 32]),+ at(1200, vel(fs[i], 0, 10) if i < 5 else [steps(fs[i], 0, 1, 80, 100), at(1500, spawn([w8, t8]))]))+r.on(7, gone(ws[296]), vel(f7, 100, 0))+r.on(8, warp(320, 96))++r = room("Warps_5") # the first warp follows you about+w, t1 = r.one(619, 96), r.one(602, 96)+both = [w, t1]+r.on(1, warp(64, 176))+r.on(2, warp(224, 16), steps(both, 1, 0, 160, 800), gone(r.one(619, 128)), gone(r.all(604)))+r.on(3, steps(both, -1, 0, 64, 800))+r.on(4, warp(384, 16), gone(r.one(619, 192)))+r.on(5, warp(224, 16), steps(both, 1, 0, 160, 800), gone(r.one(619, 256)))+r.on(6, steps(both, 1, 0, 64, 800))+r.on(7, warp(416, 80), steps(both, -1, 0, 1000, 800), gone(r.one(619, 352)))+r.on(8, warp(448, 16), gone(r.one(619, 416)))++# ================================================================ 9. Scale (the runner grows and shrinks)+r = room("Scale_1")+r.on(1, hgrow(1, 3.5, 2))+r.on(2, hgrow(1, .5, .5), steps(r.one(609, 224), 0, 1, 16, 50))+r.on(3, hgrow(1, 12, 2.5))++r = room("Scale_2")+f1, f2 = r.one(600), r.one(645)+b5, t5 = r.one(661, 248), r.one(665)+r.init(grow(f1, 10, 3), grow(f2, 1, 3))+r.on(1, hgrow(6, 6, .5))+r.on(2, hgrow(.25, .25, .25), steps(f2, -1, 0, 16, 100), at(1000, steps(f1, 0, -1, 80, 100)))+r.on(4, hgrow(50, 50, 6), steps([b5, t5], 0, -1, 64, 100))+r.on(5, hgrow(1, 1, .2))++r = room("Scale_3")+f1 = r.one(600)+r.init(grow(f1, 5, 2))+r.on(1, hgrow(.2, 1, 1))+r.on(2, steps(f1, 1, 0, 6, 50), at(1000, steps(f1, 1, 0, 58, 100)))+r.on(3, hgrow(10, 1, 1), steps(r.one(621, 272), 0, -1, 16, 100))+r.on(4, hgrow(.25, .25, .1))+r.on(5, hgrow(1, 1, .5))++r = room("Scale_4")+r.on(1, hgrow(20, 1, 6), [at(1000 * s.x / 108, steps(s, 0, -1, 16, 30)) for s in r.all(609) if s.y > 128])+r.on(2, hgrow(28, 1, .2), at(2500, hgrow(1, 1, 1)))++r = room("Scale_5")+f2 = r.one(645)+b6, t6 = r.make(661, 273, 144, angle=180), r.make(667, 273, 140)+b5, t5 = r.make(661, 240, 144, angle=180), r.make(665, 240, 140)+r.init(grow(f2, 2, 1))+r.on(1, hgrow(.5, .5, .5), at(250, steps(r.all(600), -1, 0, 6, 100)))+r.on(3, hgrow(16, 1, 5), steps(r.one(609, 202), 1, 0, 6, 100), steps(r.one(609, 310, 160), -1, 0, 6, 100),+ at(750, spawn([b5, t5])))+r.on(4, hgrow(2, 2, .5), steps(r.one(609, 218), 1, 0, 6, 100), steps(r.one(609, 310, 96), -1, 0, 6, 100))+r.on(5, at(750, spawn([b6, t6])))+r.on(6, hgrow(1, 1, .5), steps(r.all(621), 0, -1, 6, 100), steps(f2, 1, 0, 16, 100))++# ================================================================ 10. Doors (the ground is in front of them)+r = room("Doors_1")+d = r.one(598)+k1, k2 = r.make(609, 0, 0), r.make(609, 0, 0)+k1.back = k2.back = True+t5 = r.make(665, 192, 144)+r.on(1, spawn(k1, d), steps(d, 1, 0, 16, 100))+r.on(2, steps(d, 1, 0, 32, 100))+r.on(3, spawn(k2, d), steps(d, 1, 0, 16, 100))+r.on(4, steps(d, 0, 1, 16, 100), at(200, setpos(d, 140)), at(210, steps(d, 0, -1, 16, 100)), spawn(t5))+r.on(5, steps(k1, -1, 0, 96, 150))++r = room("Doors_2") # the doors in the floor come up as steps, on blocks you cannot see+ds = {o.x: o for o in r.all(598, y=160)}+fs = {o.x: o for o in r.all(600)}+r.init(hide(list(fs.values())), grow(list(fs.values()), 1.2, 1))+for i, x in enumerate((256, 224, 192, 160, 128, 96)):+ r.on(i + 1, steps([ds[x], fs.get(x, ds[x])] if x in fs else ds[x], 0, -1, 16, 100))+r.on(7, steps([o for x, o in ds.items() if x != 400], 0, 1, 16, 1.5), steps(list(fs.values()), 0, 1, 16, 2),+ steps(ds[400], 0, -1, 16, 25))++r = room("Doors_3")+r.on(1, steps(r.one(598), 1, 0, 144, 7.5))+r.on(2, steps(r.one(609, 256), 0, -1, 16, 100))++r = room("Doors_4")+d, f1, f2, sp = r.one(598), r.one(600), r.one(645), r.one(621)+d2 = r.make(598, 448, 176)+r.init(hide([f1, sp]), grow(sp, 2, 1))+r.on(1, at(250, vel([d, f1, f2, sp], 5, 0)))+r.on(2, vel([d, f1, f2, sp], 0, 20), at(100, spawn(d2), steps(d2, 0, -1, 16, 100)))++r = room("Doors_5") # you look like the door, and the door like you+r.modes |= R_SWAP+f1, f2 = r.one(600), r.one(645)+r.init(grow(f1, 1, 5), grow(f2, 3, 5))+r.on(1, steps(f1, 1, 0, 8, 100), at(200, steps(f1, -1, 0, 8, 100)), at(750, steps(f2, 1, 0, 48, 200)))++# ================================================================ 11. Saws+r = room("Saws_1")+saw, t1 = r.one(684), r.one(602)+r.init(vel(saw, 7, 0), patrol(saw, 176, 352), follow(t1, saw))+r.on(1, norule([saw, t1]), vel(saw, 0, 0), at(500, grow(saw, 2, 2, .3), at(300, grow(saw, 1, 1), at(10, big(saw)))),+ at(1000, vel(saw, 15, 0)))++r = room("Saws_2")+saw, t1 = r.one(684), r.one(602)+t2, t3 = r.make(604, 0, 0), r.make(615, 0, 0)+r.init(vel(saw, 7, 0), patrol(saw, 192, 240), follow(t1, saw, 24), stopx(saw, 400, 351))+r.on(1, norule(t1), norule(saw, U_PATROL), vel(saw, 0, 0), at(500, spawn(t2, saw, 0, -16), follow(t2, saw)),+ at(1000, vel(saw, 20, 0)))+r.on(2, grow(saw, .5, .5), at(10, big(saw), grow(saw, 2.8, 2.8, 1.5)), at(250, vel(saw, 0, 0)),+ at(2000, vel(saw, -15, 0), stopx(saw, 144)),+ at(3000, grow(saw, .5, .5, .5), at(500, steps(saw, 0, 1, 16, 100)),+ at(1000, setpos(saw, 384), spawn(t3, saw, -32, -16))))+r.on(3, steps(saw, 0, -1, 16, 100))++r = room("Saws_3")+saw = r.one(684)+r.init(at(100, big(saw), grow(saw, 1.8, 1.8, 1)))+r.on(1, grow(saw, 4, 4, .25), at(250, grow(saw, 1.8, 1.8, .25)))+r.on(2, grow(saw, .5, .5, .5), at(2250, grow(saw, 4, 4, .25)), at(3000, vel(saw, -5, 0)))++r = room("Saws_4")+s1, s2, s3 = r.one(684, 136), r.one(684, 104), r.one(684, 360)+r.init(grow([s1, s2, s3], 1.5, 1.5))+r.on(1, steps(s1, -1, 0, 32, 300), steps(s2, 1, 0, 32, 300), at(1000, steps(s1, 0, 1, 128, 300)),+ at(1500, steps(s2, 0, 1, 64, 200)))+r.on(2, steps(s1, 1, 0, 192, 200), at(1750, steps(s1, 0, -1, 112, 50)))+r.on(3, steps(s1, 1, 0, 8, 50), at(250, steps(s1, -1, 0, 8, 50)))+r.on(4, steps(s1, 1, 0, 16, 300), at(500, grow(s3, 1, 1), steps(s3, 0, -1, 16, 50)))++r = room("Saws_5")+s1, s2, s3 = r.one(684, y=64), r.one(684, y=96), r.one(684, y=192)+f1, f3 = r.all(600), r.all(647)+r.init(grow([s1, s2, s3], 2, 2), hide(f1 + f3), grow(f1 + f3, 2, 2))+t = 1000 * (385 - 16) / 70 # (the first saw, and its block, come back from 384)+r.on(1, vel(f1 + [s1], 7, 0), at(t, vel(f1 + [s1], 0, 0), setpos(f1 + [s1], 384), at(250, vel(f1 + [s1], -5, 0))))+r.on(2, vel(s2, -7, 0))+r.on(3, vel(f3 + [s3], 7, 0))++# ================================================================ 12. Flappy (the runner flies: it keeps going, Up flaps)+r = room("Flappy_1")+r.on(1, steps([r.one(598), r.one(600)], 0, -1, 48, 100))++r = room("Flappy_2")+f2, f3 = r.one(645), r.one(647)+t3, b3 = r.make(615, 352, 112, 1, 9), r.make(661, 384, 160, angle=270)+b4, t4 = r.make(661, 368, 64, angle=270), r.make(617, 368, 64)+r.init(grow(f2, 1, 4))+r.on(1, hero(H_DIR, -1))+r.on(2, hero(H_DIR, 1), steps(f2, 0, -1, 120, 100), spawn([t3, b3]), steps(b3, -1, 0, 16, 100))+r.on(3, vel([f3, b3], 7, 0), at(3000, vel([f3, b3], 0, 0), gone([f3, b3])), spawn([b4, t4]))+r.on(4, hero(H_DIR, -1))++r = room("Flappy_3")+walls = r.all(609) + r.all(645)+r.init(hero(H_DIR, -1), grow(r.one(600), 3, 1), grow(r.all(645), 35, 11))+r.on(1, hero(H_DIR, -1), at(1000, grow(r.one(600), 1, 1, 1)))+r.on(2, hero(H_DIR, 1),+ at(1000, run(6), hero(H_JUMP, 20), vel([w for w in walls if w.y < 120], 0, .6), vel([w for w in walls if w.y > 120], 0, -.6)),+ at(2000, run(5), hero(H_JUMP, 18)), at(3000, run(4), hero(H_JUMP, 16)), at(4000, run(3), hero(H_JUMP, 14)),+ at(5000, run(2), hero(H_JUMP, 12)), at(7000, steps([r.one(598), r.one(600)], 1, 0, 16, 10)),+ at(13000, vel(walls, 0, 0)))++r = room("Flappy_4")+d = r.one(598)+r.init(hide(r.all(661)))+r.on(1, steps(d, 1, 0, 96, 100), at(1100, setpos(d, 32), steps(d, 1, 0, 32, 100)), show(r.all(661)))+r.on(2, hero(H_DIR, -1), steps(r.all(609), 1, 0, 15, 100))++r = room("Flappy_5")+f2, f5, f6 = r.one(645), r.one(651), r.one(653)+r.init(run(9), grow(f6, 1, 3))+b2, t2, t3 = r.make(661, 64, 144, angle=90), r.make(604, 112, 144, 1, 7), r.make(615, 56, 144)+b4, t4, t5 = r.make(661, 448, 64, angle=270), r.make(617, 368, 96, 1, 9), r.make(665, 456, 112)+b6, t6 = r.make(661, 64, 96, angle=90), r.make(667, 56, 96)+b7, t7 = r.make(661, 448, 48, angle=270), r.make(673, 302, 112, 1, 13)+b8, t8 = r.make(661, 382, 16, angle=180), r.make(675, 382, 16)+r.on(1, hero(H_DIR, -1), spawn([b2, t2, t3]))+r.on(2, steps([f2, b2, t3], 0, -1, 16, 50))+r.on(3, hero(H_DIR, 1), spawn([b4, t4, t5]))+r.on(4, steps(b4, 0, 1, 48, 100), steps(f5, 0, -1, 16, 50))+r.on(5, hero(H_DIR, -1), spawn([b6, t6]))+r.on(6, hero(H_DIR, 1), spawn([b7, t7]))+r.on(7, steps([b7, f5], 1, 0, 128, 50), spawn([b8, t8]))+r.on(8, hero(H_DIR, -1), steps(f6, 0, -1, 64, 50))++# ================================================================ 13. Gravity (Up turns gravity round)+r = room("Gravity_1")+r.init(grow(r.one(600), 3, 1))+r.on(1, vel(r.one(600), 0, 14))+r.on(2, at(250, steps(r.one(645), -1, 0, 48, 100)))++r = room("Gravity_2")+r.init(grow(r.one(600), 25, 1), grow(r.one(645), 3, 1), grow(r.one(647), 3, 1), grow(r.one(649), 2, 5))+r.on(1, vel(r.one(600), 5, 0))+r.on(2, grow(r.one(645), 1, 1, .25))+r.on(3, steps(r.one(647), -1, 0, 16, 100))+r.on(4, steps(r.one(649), -1, 0, 32, 100))++r = room("Gravity_3") # Up after the trigger: gravity to the right, and you fly off+f1 = r.one(600)+r.init(grow(f1, 3, 1))+r.on(1, key(EV_KEY), vel(f1, 0, 3), vel([r.one(598), r.one(645)], 0, -3))+r.on(EV_KEY, vel(f1, 0, 0), at(10, gravity(12, 0), hero(H_PUSHX, 150)))++r = room("Gravity_4")+t2, t3 = r.make(604, 256, 16), r.make(615, 288, 176)+r.init(grow(r.one(647), 3, 1), grow(r.one(651), 3, 1))+b = r.one(661, 256)+r.on(1, steps(r.all(645) + [b], 0, 1, 64, 200), at(500, spawn(t2, b)))+r.on(2, steps(r.one(651), 0, 1, 64, 200), spawn(t3), grow(t3, 3, 1, .1))+r.on(3, move(r.one(649), 64, 0))++r = room("Gravity_5") # (its other trap, gravity to the right, waits for the space bar: not on a calculator)+s1 = r.one(684, 496)+r.init(grow(s1, 3, 3), big(s1))+r.on(1, steps(r.all(600), 1, 0, 64, 100))+r.on(2, at(1500, steps(s1, -1, 0, 392, 150)), at(4000, ifev(3, steps(s1, 0, 1, 48, 25))))+r.on(3, steps(r.all(645), 1, 0, 64, 100))++# ================================================================ 14. Movement (each room moves differently)+r = room("Movement_1") # ice, and no slowing down in the air+ice = r.all(600) + r.all(645)+for o in ice:+ o.flags |= F_ICE+big_ = {(256, 160): 25, (160, 112): 9, (336, 112): 11}+for o in r.all(600):+ r.init(grow(o, big_[(o.x, o.y)], 1))+r.init(at(100, hero(H_SLIDE, 1)))+r.on(1, steps(r.one(609, 256, 160), 0, -1, 16, 100))+r.on(2, steps(r.one(609, 288, 112), 0, -1, 16, 100))+r.on(3, steps(r.all(645), -1, 0, 16, 100))+r.on(4, steps(r.one(609, 96, 112), 0, -1, 16, 100))++r = room("Movement_2") # floating down+f1, f2, f3, f4, f5 = (r.one(t) for t in (600, 645, 647, 649, 651))+t2 = r.make(604, 240, 112, 1, 10)+r.init(at(100, hero(H_MAXDOWN, 50), gravity(0, 20)), grow([f1, f2], 2, 3), grow([f3, f4, f5], 3, 1), ghost(f4))+r.on(1, steps(r.all(609), 0, -1, 16, 100), steps(f1, 0, -1, 64, 100), at(1000, spawn(t2), steps(f2, 0, -1, 64, 100)))+r.on(2, steps([f1, f2], 0, 1, 80, 25), steps(f3, 0, -1, 176, 25))+r.on(3, steps(r.all(684), 0, 1, 80, 50), steps([f4, f5], 0, -1, 300, 25))+r.on(4, grow(f5, 0, 1, 1), at(1000, ghost(f5)))++r = room("Movement_3") # slow, then fast+saw, f1, f2 = r.one(684), r.one(600), r.one(645)+r.init(grow(saw, 2, 2))+r.on(1, run(3), steps(saw, -1, 0, 600, 65), at(2000, steps(f1, -1, 0, 16, 50)))+r.on(2, run(20), steps(r.all(609), 0, -1, 16, 100), setpos(saw, 496, 112))+r.on(3, steps(r.all(609), 0, 1, 16, 100), steps(f2, -1, 0, 16, 50), at(500, steps(saw, -1, 0, 416, 180)))+r.on(4, run(3), at(1000, steps(saw, 0, 1, 48, 50), at(2000, steps(saw, 1, 0, 600, 100))))++r = room("Movement_4") # falling slowly, running fast: the saw on the door shrinks with each button+saw = r.one(684)+bt = {o.y: o for o in r.all(661)}+r.init(at(100, gravity(0, 20), hero(H_MAXDOWN, 20), run(30)), grow(saw, 0, 0), at(1000, grow(saw, 4, 4, 1.5), big(saw)))+r.on(1, steps([bt[64], r.one(604)], -1, 0, 32, 65))+r.on(2, grow(saw, 3, 3, 1), steps([bt[96], r.one(615)], 1, 0, 32, 65))+r.on(3, grow(saw, 2, 2, 1), steps([bt[128], r.one(617)], -1, 0, 32, 65))+b160 = {o.x: o for o in r.all(661, y=160)}+r.on(4, grow(saw, 1, 1, 1), steps(b160[32], 1, 0, 32, 65), at(1000, steps(b160[32], -1, 0, 32, 65)),+ at(1000, steps([b160[480], r.one(665)], -1, 0, 32, 65)))+r.on(5, grow(saw, .01, .01, 1), at(1000, move(saw, 0, 100)))++r = room("Movement_5") # heavy+fs = {t: r.all(t) for t in FAKE}+r.init(at(20, gravity(0, 200), hero(H_MAXDOWN, 800)), grow(fs[600], 2.95, 1), grow(fs[645] + fs[647] + fs[649] + fs[651], 3, 1),+ grow(fs[655], 2, 10), hide(fs[657]))+r.on(1, gravity(0, 175), gone(fs[657]))+r.on(2, vel(fs[600] + fs[647], -5, 0), vel(fs[645] + fs[649], 0, -3), vel(fs[651], 5, 0), vel(fs[655], 0, 5),+ at(5000, vel(fs[653], 0, 5)),+ at(1000 * (544 - 32) / 30, vel(fs[649], 0, 0), setpos(fs[649], y=32))) # (Fake_Tile_4 stops at y 32)++# ================================================================ 15. Wraparound (off one side, in at the other)+r = room("Wraparound_1")+r.on(1, steps(r.one(598), 1, 0, 32, 100), steps(r.all(609), 0, -1, 16, 100))++r = room("Wraparound_2")+r.on(1, steps(r.all(684), 0, -1, 64, 100), steps(r.all(609), 0, -1, 16, 100))+r.on(2, steps(r.all(684), 1, 0, 32, 50))++r = room("Wraparound_3")+r.on(1, steps([s for s in r.all(609) if s.y > 230] + r.all(600), 0, -1, 32, 100))+r.on(2, steps(r.all(645), 0, 1, 16, 25), steps(r.all(609, y=160), 0, -1, 16, 100))++r = room("Wraparound_4")+r.init(grow(r.all(684), 2, 2), grow(r.all(600) + r.all(645) + r.all(647) + r.all(649), 1, 3))+r.on(1, steps(r.all(600), 0, -1, 48, 100))+r.on(2, steps(r.all(645), 0, -1, 48, 100), steps(r.all(684, y=232), 1, 0, 432, 40))+r.on(3, steps(r.all(647), 0, -1, 48, 100))+r.on(4, steps(r.all(649), 0, -1, 48, 100), at(500, grow(r.all(649), .95, 3)))+r.on(5, steps(r.all(684, y=80), -1, 0, 20, 100))++r = room("Wraparound_5")+saws = {(o.x, o.y): o for o in r.all(684)}+r.init(grow(r.all(684), .9, .9))+r.on(1, steps(r.all(609), 0, -1, 16, 100))+r.on(2, [[steps(s, 0, -1, 8, 100), at(500, toward(s, 9)), at(5000, vel(s, 0, 0), gone(s))]+ for s in r.all(684, y=144)])+r.on(3, [[steps(s, 0, -1, 8, 100), at(250, steps(s, 0, 1, 8, 100))] for s in r.all(684, y=112)])+r.on(4, [[vel(s, 11, 0), at(5000, vel(s, 0, 0), gone(s))] for s in r.all(684, y=96)])+r.on(5, ifnot(4, [[vel(s, 20, 0), at(10000, vel(s, 0, 0), gone(s))] for s in r.all(684, y=96)]))+s80, s64 = saws[(432, 80)], saws[(-16, 64)]+r.on(6, steps(s80, 0, -1, 16, 100), at(200, steps(s80, -1, 0, 176, 100)), at(3500, vel(s80, 9, 0)),+ at(10000, vel(s80, 0, 0), gone(s80)), at(2000, vel(s64, 10, 0), at(10000, vel(s64, 0, 0), gone(s64))))+s52 = saws[(-72, -8)]+r.on(7, nth(1, grow(s52, 6, 6), vel(s52, 16, 0), at(5000, vel(s52, 0, 0), gone(s52)))) # (two Trigger_7)++# ================================================================ 16. Boss+r = room("Boss_1")+sw = {o.x: o for o in r.all(684)}+t2 = r.make(604, 256, 112)+t4 = r.make(617, 400, 112)+t5 = r.make(665, 102, 112)+r.init(grow(r.all(600), 1, 7))+r.on(1, steps(sw[32], 1, 0, 256, 90), at(2250, steps(sw[416], 0, -1, 16, 120)),+ at(3250, steps(sw[32], 0, 1, 16, 90), at(1000, setpos(sw[32], 32, 112)), steps(sw[416], -1, 0, 288, 70)),+ at(7000, steps(sw[32], 1, 0, 24, 90)),+ at(8000, steps(sw[32], -1, 0, 24, 90), steps(sw[416], 0, 1, 16, 90), spawn(t2)))+r.on(2, [at(1000 * (s.x - 112) / 150, steps(s, 0, 1, 16, 30)) for s in r.all(609)],+ at(1500, steps(r.all(619) + r.all(615), 0, -1, 16, 100)))+r.on(3, warp(80, 112), at(500, steps(r.all(609), 0, -1, 16, 50), steps(r.all(619), 0, 1, 16, 50), spawn(t4)))+r.on(4, steps(r.all(598), 1, 0, 48, 150), at(500, setpos(r.all(598), 32), steps(r.all(598), 1, 0, 48, 150), spawn(t5)))+r.on(5, steps(r.all(598) + r.all(600), -1, 0, 16, 100))++r = room("Boss_2")+fs = {t: r.one(t) for t in FAKE}+r.init(grow(fs[600], 1, 5), grow(fs[645], 1, 2), grow(fs[647], 1, 5), grow(fs[649], 1, 2), grow(fs[651], 1, 5),+ grow(fs[653], 2, 5), grow(fs[655], 1, 2), grow(fs[657], 1, 5))+r.on(1, steps(fs[600], 0, 1, 176, 300), at(2000, steps(fs[600], 0, -1, 176, 300)))+r.on(2, steps(fs[645], 0, -1, 16, 200), at(250, steps(fs[645], -1, 0, 32, 100)), at(500, steps(fs[645], 0, 1, 16, 100)),+ at(1000, steps(fs[647], 1, 0, 6, 100), at(200, steps(fs[647], -1, 0, 6, 300))))+r.on(3, steps(fs[649], 0, -1, 32, 200), at(250, steps(fs[649], -1, 0, 176, 150)), at(1750, steps(fs[649], 0, 1, 32, 150)),+ at(250, steps(fs[647], 1, 0, 16, 150)), at(1750, steps(fs[647], -1, 0, 16, 150)))+r.on(4, steps(fs[653], 1, 0, 32, 100), at(500, steps(fs[651], 0, 1, 176, 300), at(1500, steps(fs[651], 0, -1, 176, 300))))+r.on(5, steps(fs[655], 0, -1, 32, 200), at(500, steps(fs[655], 0, 1, 32, 200)))+r.on(6, steps([fs[657], r.one(598)], 1, 0, 16, 200))++r = room("Boss_3")+r.init(hide(r.all(647)))+w0, w208 = r.one(619, 336, 0), r.one(619, 144, 208)+r.on(1, steps(r.all(621) + r.all(600), 0, -1, 112, 40), at(2000, steps(r.all(609), 0, 1, 16, 100)))+r.on(2, steps(r.all(645), 1, 0, 16, 120))+r.on(3, steps(r.all(617) + [w0], 0, 1, 16, 100))+r.on(4, warp(192, 112), steps(r.all(665) + [w208], 1, 0, 224, 50))+r.on(5, nth(1, warp(240, 112)), nth(2, warp(288, 112)), nth(3, warp(336, 112)), at(250, rearm(r.all(665))))++r = room("Boss_4") # gravity turns round, the sides wrap, and the saws bounce from side to side+sw = r.all(684)+t3, b3 = r.make(615, 192, 96), r.make(661, 192, 96)+t4, b4 = r.make(617, 416, 128), r.make(661, 416, 128, angle=180)+t5, b5, k5 = r.make(665, 144, 96), r.make(661, 144, 96), r.make(609, 160, 96)+t6, b6 = r.make(667, 256, 128), r.make(661, 256, 128, angle=180)+k6, k7 = r.make(609, 272, 128, angle=180), r.make(609, 240, 128, angle=180)+r.init(grow(r.all(600), 1, 7))+r.on(1, patrol(sw, 50, 478)) # (the screen's sides)+r.on(2, grow(sw, 1.25, 1.25, .5), steps(r.all(600), 1, 0, 16, 50), spawn([t3, b3]))+r.on(3, grow(sw, 1.5, 1.5, .5), steps(r.all(645), 1, 0, 16, 50), spawn([t4, b4]))+r.on(4, grow(sw, 1.75, 1.75, .5), steps(r.all(647), 1, 0, 16, 50), spawn([t5, b5, k5]))+r.on(5, grow(sw, 2, 2, .5), steps(r.all(649), 1, 0, 16, 50), spawn([t6, b6, k6, k7]))+r.on(6, grow(sw, 2.25, 2.25, .5), steps(r.all(651), 1, 0, 16, 50))++r = room("Boss_5") # six buttons, each slower; then the door runs, and a giant saw comes+saw, door = r.one(684), r.one(598)+t7 = r.make(673, 144, 112)+r.init(grow(r.all(600), 1, 7), at(100, big(saw), grow(saw, 7, 7)))+for i, v in enumerate((8, 6, 5, 4, 3, 2)):+ r.on(i + 1, run(v), shake(.001 * (i + 1 if i < 5 else 7), 1))+r.on(6, spawn(t7), steps(door, 1, 0, 96, 100), at(1000, setpos(door, -16), steps(door, 1, 0, 96, 100)),+ at(5300, vel(saw, -6, 0)), steps(r.all(661), 0, 1, 16, 100))+r.on(7, steps(door, 1, 0, 48, 40))+++# ------------------------------------------------------------ packing+def bitmap(ground):+ """the ground: 33 columns of 15 tiles, a bit each (the top tile the lowest bit)"""+ cols = [0] * 33+ for x, y, w, h in ground:+ for i in range(x, x + w):+ cols[i] |= ((1 << h) - 1) << y+ return b"".join(v.to_bytes(2, "little") for v in cols)+++def packed():+ """everything, column by column (smaller packed): the rooms' modes and runners, their ground,+ how many spans each, the spans' fields, how many steps each, the steps' fields"""+ head, ground, nspan, nrec = bytearray(), bytearray(), bytearray(), bytearray()+ sc = [bytearray() for _ in range(8)]+ rc = [bytearray() for _ in range(10)]+ for r in ROOMS:+ spans, recs = r.pack()+ hx, hy = r.hero+ head += bytes([r.modes]) + i16(hx) + i16(hy)+ ground += bitmap(r.ground)+ nspan.append(len(spans))+ nrec.append(len(recs))+ for s in spans:+ for i, (v, f) in enumerate(zip(s, (u8, u8, u8, i16, i16, u8, u8, u8))):+ sc[i] += f(v)+ for q in recs:+ for i, (v, f) in enumerate(zip(q, (u8, u16, u8, u8, u8, u8, i16, i16, i16, i16))):+ rc[i] += f(v)+ return bytes(head + ground + nspan + b"".join(sc) + nrec + b"".join(rc)), sum(nspan), sum(nrec)++def main():out = sys.argv[1]os.makedirs(out, exist_ok=True)- data = []- for modes, start, objs in ROOMS:- assert len(objs) <= 28, "a room has 28 objects at most"- data += pack(modes, start, objs)- raw = bytes(data)- c = zlib.compressobj(9, zlib.DEFLATED, -15, 9)- z = c.compress(raw) + c.flush()- try: # smaller still with zopfli, as tools/shots.py does (the zlib stream without its header and check)- import zopfli.zlib- z2 = zopfli.zlib.compress(raw, numiterations=60)[2:-4]- if len(z2) < len(z):- z = z2- except ImportError:- pass- assert zlib.decompress(z, -15) == raw+ assert len(ROOMS) == 80+ raw, spans, recs = packed()+ print(f"rooms: {spans} spans, {recs} steps, at most {max(r.expanded for r in ROOMS)} steps a room", file=sys.stderr)with open(os.path.join(out, "rooms.inc"), "w") as f:- f.write(f"/* Made by tools/rooms.py: {len(ROOMS)} rooms, {len(raw)} bytes packed into {len(z)} */\n")- f.write(f"#define ROOM_BYTES {len(raw)}\n")- f.write(f"#define ROOM_COUNT {len(ROOMS)}\n")- f.write(f"static const uint8_t rooms_z[{len(z)}] = {{\n")- for i in range(0, len(z), 24):- f.write(" " + ",".join(str(b) for b in z[i:i + 24]) + ",\n")- f.write("};\n")- print(f"rooms: {len(ROOMS)}, {len(raw)} bytes, packed {len(z)}")+ f.write("/* the rooms (tools/rooms.py) */\n")+ f.write(f"#define ROOM_BYTES {len(raw)}\n#define ROOM_COUNT {len(ROOMS)}\n#define SPANS {spans}\n#define STEPS {recs}\n")+ f.write("static const uint8_t data[ROOM_BYTES] = {")+ for i, b in enumerate(raw):+ f.write(("\n " if i % 24 == 0 else "") + f"{b},")+ f.write("\n};\n")+ print(f"rooms: {len(raw)} bytes", file=sys.stderr)if __name__ == "__main__":diff --git a/games/leveldevil/tools/scenes.json b/games/leveldevil/tools/scenes.jsonnew file mode 100644index 00000000..fbc7186b--- /dev/null+++ b/games/leveldevil/tools/scenes.json@@ -0,0 +1,82 @@+[+{"name":"Pits_1","scene":14,"ground":[[0,0,33,7],[0,7,6,3],[27,7,6,3],[0,10,21,5],[22,10,11,5]],"actors":[{"name":"Hero_New 1","type":590,"x":144,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":368,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 4","type":600,"x":336,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":320,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Keyboard_Tutorial 6","type":766,"x":240,"y":184,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Pits_2","scene":15,"ground":[[0,0,33,6],[0,6,6,4],[27,6,6,4],[0,10,20,5],[21,10,2,5],[24,10,9,5]],"actors":[{"name":"Hero_New 1","type":590,"x":144,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":384,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 4","type":600,"x":320,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":256,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 6","type":604,"x":347,"y":139,"sx":1.0,"sy":1.0,"angle":0},{"name":"Blood 8","type":596,"x":778,"y":203,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 9","type":645,"x":368,"y":192,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Pits_3","scene":16,"ground":[[0,0,33,7],[0,7,9,3],[24,7,9,3],[0,10,13,5],[21,10,12,5]],"actors":[{"name":"Hero_New 1","type":590,"x":176,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":336,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":272,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 8","type":600,"x":240,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 9","type":645,"x":384,"y":192,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Pits_4","scene":27,"ground":[[0,0,33,5],[0,5,8,5],[25,5,8,5],[0,10,10,5],[23,10,10,5]],"actors":[{"name":"Hero_New 1","type":590,"x":144,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":368,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":160,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 7","type":600,"x":256,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 8","type":604,"x":240,"y":144,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Pits_5","scene":23,"ground":[[0,0,33,5],[0,5,6,10],[27,5,6,5],[23,10,10,5]],"actors":[{"name":"Hero_New 1","type":590,"x":112,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":400,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":176,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 7","type":600,"x":192,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 8","type":645,"x":320,"y":192,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Spikes_1","scene":19,"ground":[[0,0,33,4],[0,4,17,2],[24,4,9,6],[0,6,21,1],[0,7,8,3],[0,10,33,5]],"actors":[{"name":"Hero_New 1","type":590,"x":304,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":160,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 4","type":609,"x":320,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 5","type":609,"x":240,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":248,"y":132,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Spikes_2","scene":31,"ground":[[0,0,33,6],[0,6,5,3],[28,6,5,3],[0,9,33,6]],"actors":[{"name":"Hero_New 1","type":590,"x":96,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":416,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 4","type":609,"x":160,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 5","type":609,"x":256,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 6","type":609,"x":352,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 7","type":602,"x":240,"y":120,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 8","type":604,"x":344,"y":120,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Spikes_3","scene":20,"ground":[[0,0,33,1],[14,1,1,9],[18,1,15,8],[16,2,1,8],[18,9,1,1],[23,9,10,2],[0,11,33,4]],"actors":[{"name":"Hero_New 1","type":590,"x":256,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":336,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 4","type":609,"x":272,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 5","type":609,"x":336,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":240,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 7","type":602,"x":272,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 8","type":604,"x":271,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Spikes_4","scene":25,"ground":[[0,0,33,4],[0,7,9,1],[24,7,9,1],[0,8,10,1],[23,8,10,1],[0,9,11,1],[22,9,11,1],[0,10,12,1],[21,10,12,1],[0,11,13,1],[20,11,13,1],[0,12,33,3]],"actors":[{"name":"Hero_New 1","type":590,"x":112,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":400,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 4","type":609,"x":144,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 5","type":609,"x":160,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 6","type":609,"x":176,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 7","type":609,"x":192,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 8","type":609,"x":208,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 9","type":609,"x":224,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 10","type":609,"x":240,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 11","type":609,"x":256,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 12","type":609,"x":272,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 13","type":609,"x":288,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 14","type":609,"x":304,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 15","type":609,"x":320,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 16","type":609,"x":336,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 17","type":609,"x":352,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 18","type":609,"x":368,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 19","type":609,"x":384,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 20","type":609,"x":128,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 21","type":609,"x":112,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 22","type":609,"x":96,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 23","type":609,"x":64,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 24","type":609,"x":80,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 25","type":609,"x":48,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 26","type":602,"x":304,"y":168,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Spikes_5","scene":28,"ground":[[0,0,33,7],[0,7,4,2],[7,7,26,1],[0,9,28,1],[29,9,4,1],[0,10,33,5]],"actors":[{"name":"Hero_New 1","type":590,"x":432,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":80,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 26","type":602,"x":320,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 27","type":609,"x":272,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 28","type":609,"x":432,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 29","type":609,"x":416,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 30","type":609,"x":400,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 31","type":609,"x":384,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 32","type":609,"x":368,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 33","type":609,"x":352,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 34","type":609,"x":336,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 35","type":609,"x":320,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 36","type":609,"x":304,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 37","type":609,"x":288,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 38","type":609,"x":208,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 39","type":609,"x":256,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 40","type":609,"x":240,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 41","type":609,"x":224,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 43","type":609,"x":192,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 44","type":609,"x":176,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 45","type":609,"x":160,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 46","type":609,"x":144,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 47","type":609,"x":128,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 48","type":609,"x":112,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 49","type":609,"x":96,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 50","type":604,"x":192,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 51","type":600,"x":544,"y":128,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Push_1","scene":26,"ground":[[0,0,33,5],[0,5,8,5],[25,5,8,5],[0,10,16,5],[17,10,16,5]],"actors":[{"name":"Hero_New 1","type":590,"x":144,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":368,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 4","type":600,"x":304,"y":168,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":272,"y":144,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Push_2","scene":29,"ground":[[0,0,33,5],[0,5,8,5],[25,5,8,5],[0,10,19,5],[21,10,12,5]],"actors":[{"name":"Hero_New 1","type":590,"x":144,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":368,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 4","type":600,"x":256,"y":168,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":272,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 7","type":604,"x":288,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 8","type":645,"x":312,"y":192,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Push_3","scene":34,"ground":[[0,0,33,5],[0,5,8,10],[25,5,8,5],[9,10,12,5],[23,10,10,5]],"actors":[{"name":"Hero_New 1","type":590,"x":144,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":368,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 4","type":600,"x":176,"y":168,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":160,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 7","type":604,"x":240,"y":144,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Push_4","scene":47,"ground":[[0,0,33,5],[0,5,8,10],[26,5,7,5],[23,10,10,1]],"actors":[{"name":"Hero_New 1","type":590,"x":144,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":384,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 4","type":600,"x":160,"y":208,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":192,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 9","type":645,"x":152,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 10","type":647,"x":376,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 11","type":604,"x":320,"y":154,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Push_5","scene":50,"ground":[[0,0,33,5],[0,5,4,5],[29,5,4,5],[0,10,8,5],[11,10,22,5]],"actors":[{"name":"Hero_New 1","type":590,"x":416,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":80,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 4","type":600,"x":576,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 5","type":609,"x":128,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 6","type":609,"x":112,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 7","type":609,"x":96,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 8","type":602,"x":352,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 9","type":604,"x":168,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 10","type":609,"x":448,"y":128,"sx":1.0,"sy":1.0,"angle":270},{"name":"Spikes 11","type":609,"x":448,"y":144,"sx":1.0,"sy":1.0,"angle":270},{"name":"Spikes 12","type":609,"x":448,"y":96,"sx":1.0,"sy":1.0,"angle":270},{"name":"Spikes 13","type":609,"x":448,"y":112,"sx":1.0,"sy":1.0,"angle":270},{"name":"Spikes 14","type":609,"x":448,"y":80,"sx":1.0,"sy":1.0,"angle":270},{"name":"Fake_Tile_2 15","type":645,"x":128,"y":192,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Coins_1","scene":22,"ground":[[0,8,20,3],[21,8,12,3]],"actors":[{"name":"Hero_New 1","type":590,"x":128,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":384,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 4","type":613,"x":208,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 5","type":613,"x":224,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 6","type":613,"x":240,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 7","type":613,"x":256,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 8","type":613,"x":272,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 9","type":613,"x":288,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 10","type":613,"x":304,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 11","type":613,"x":320,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 12","type":613,"x":336,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 13","type":613,"x":192,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 14","type":613,"x":176,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 15","type":600,"x":320,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 16","type":602,"x":304,"y":104,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 17","type":613,"x":528,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 18","type":613,"x":544,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 19","type":613,"x":528,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 20","type":613,"x":544,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 21","type":613,"x":320,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 22","type":613,"x":320,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 23","type":613,"x":320,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Coins_2","scene":24,"ground":[[0,7,11,3],[20,7,13,3]],"actors":[{"name":"Hero_New 1","type":590,"x":128,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":384,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 19","type":600,"x":224,"y":100,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 20","type":613,"x":176,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 21","type":613,"x":192,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 22","type":613,"x":208,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 23","type":613,"x":224,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 24","type":613,"x":240,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 25","type":613,"x":256,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 26","type":613,"x":272,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 27","type":613,"x":288,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 28","type":613,"x":304,"y":96,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Coins_3","scene":30,"ground":[[0,7,9,3],[24,7,9,3]],"actors":[{"name":"Enemy_Fake_Tile 32","type":600,"x":256,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":128,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 33","type":613,"x":320,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":384,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 35","type":604,"x":336,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 36","type":613,"x":336,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 37","type":613,"x":528,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 38","type":613,"x":544,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 39","type":613,"x":528,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 40","type":613,"x":544,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 20","type":613,"x":176,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 21","type":613,"x":192,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 22","type":613,"x":208,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 23","type":613,"x":224,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 24","type":613,"x":240,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 25","type":613,"x":256,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 27","type":613,"x":288,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 28","type":613,"x":304,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 29","type":602,"x":272,"y":75,"sx":0.375,"sy":1.0,"angle":0},{"name":"Coin 31","type":613,"x":272,"y":80,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Coins_4","scene":35,"ground":[[0,7,13,3],[20,7,13,3]],"actors":[{"name":"Enemy_Fake_Tile 32","type":600,"x":304,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":80,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 39","type":613,"x":224,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 40","type":613,"x":256,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 41","type":613,"x":288,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 42","type":602,"x":282,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 43","type":613,"x":528,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 44","type":613,"x":544,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 45","type":613,"x":528,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 46","type":613,"x":544,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 30","type":600,"x":224,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 31","type":600,"x":256,"y":112,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Coins_5","scene":53,"ground":[[26,4,1,1],[25,5,2,1],[9,6,1,1],[14,6,1,1],[19,6,1,1],[24,6,3,1],[8,7,2,1],[13,7,2,1],[18,7,2,1],[23,7,4,1],[7,8,3,1],[12,8,3,1],[17,8,3,1],[22,8,5,1],[0,9,33,6]],"actors":[{"name":"Hero_New 1","type":590,"x":80,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":448,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 15","type":602,"x":304,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 23","type":659,"x":64,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 24","type":659,"x":112,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 26","type":659,"x":192,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 27","type":659,"x":240,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 28","type":659,"x":272,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 30","type":659,"x":336,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 31","type":659,"x":-16,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 32","type":659,"x":-16,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 33","type":659,"x":-16,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 34","type":659,"x":-16,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 35","type":659,"x":-16,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 36","type":659,"x":-16,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 37","type":659,"x":-16,"y":32,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Controls_1","scene":21,"ground":[[0,0,33,1],[0,1,4,14],[29,1,4,14],[14,7,5,8]],"actors":[{"name":"Hero_New 1","type":590,"x":220,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":288,"y":96,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Controls_2","scene":43,"ground":[[0,0,33,2],[6,9,21,6]],"actors":[{"name":"Hero_New 1","type":590,"x":416,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":96,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 4","type":609,"x":352,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 5","type":609,"x":288,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 6","type":609,"x":224,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 7","type":609,"x":160,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 8","type":602,"x":376,"y":120,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Controls_3","scene":44,"ground":[[0,0,33,4],[6,8,21,7]],"actors":[{"name":"Hero_New 1","type":590,"x":96,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":416,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 7","type":609,"x":176,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 8","type":609,"x":336,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 9","type":609,"x":256,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 10","type":602,"x":344,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 11","type":609,"x":400,"y":112,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Controls_4","scene":48,"ground":[[0,0,33,1],[0,1,9,8],[29,1,4,9],[0,9,4,1],[0,10,22,5],[25,10,8,5]],"actors":[{"name":"Hero_New 1","type":590,"x":64,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 5","type":609,"x":288,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 7","type":609,"x":176,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 8","type":609,"x":176,"y":16,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 9","type":609,"x":192,"y":16,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 10","type":609,"x":264,"y":16,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 11","type":609,"x":312,"y":16,"sx":1.0,"sy":1.0,"angle":180}]},+{"name":"Controls_5","scene":52,"ground":[[0,0,33,1],[0,1,4,4],[29,1,4,4],[0,5,10,10],[11,5,3,10],[15,5,3,10],[19,5,3,10],[23,5,10,10]],"actors":[{"name":"Hero_New 1","type":590,"x":76,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":192,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 6","type":604,"x":256,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 7","type":615,"x":318,"y":64,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Platforms_1","scene":32,"ground":[[0,0,33,4],[0,4,5,6],[28,4,5,6],[0,10,8,5],[25,10,8,5]],"actors":[{"name":"Hero_New 1","type":590,"x":96,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":416,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 5","type":600,"x":128,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 7","type":602,"x":144,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 8","type":604,"x":240,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 9","type":615,"x":320,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 10","type":645,"x":144,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 11","type":647,"x":160,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Generic_Death_Square 12","type":846,"x":400,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Generic_Death_Square 13","type":846,"x":400,"y":176,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Platforms_2","scene":33,"ground":[[0,0,33,4],[0,4,5,6],[28,4,5,7],[0,10,8,1]],"actors":[{"name":"Hero_New 1","type":590,"x":416,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":96,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 5","type":600,"x":416,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 7","type":602,"x":192,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 8","type":604,"x":240,"y":72,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 9","type":600,"x":336,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 10","type":600,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 11","type":600,"x":176,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 12","type":600,"x":96,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 13","type":600,"x":496,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Generic_Death_Square 14","type":846,"x":448,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Platforms_3","scene":46,"ground":[[0,0,33,4],[0,4,8,3],[25,4,8,3],[0,7,13,8],[20,7,13,8]],"actors":[{"name":"Fake_Tile_4 16","type":649,"x":336,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":144,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_5 17","type":651,"x":176,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 18","type":653,"x":336,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":368,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 5","type":600,"x":256,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 7","type":602,"x":256,"y":176,"sx":2.375,"sy":1.0,"angle":0},{"name":"Trigger_2 8","type":604,"x":288,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 14","type":645,"x":336,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 15","type":647,"x":176,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Platforms_4","scene":41,"ground":[[0,0,33,1],[0,1,6,6],[27,1,6,6],[0,7,11,8],[22,7,11,8]],"actors":[{"name":"Trigger_4 16","type":617,"x":288,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":96,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 17","type":645,"x":224,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 18","type":647,"x":256,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":400,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 19","type":649,"x":288,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_5 20","type":651,"x":320,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":112,"y":88,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 11","type":600,"x":192,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 14","type":604,"x":160,"y":88,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 15","type":615,"x":182,"y":88,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Platforms_5","scene":40,"ground":[[0,0,33,1],[0,1,6,11],[27,1,6,3],[25,4,8,11],[0,12,11,3]],"actors":[{"name":"Fake_Tile_3 16","type":647,"x":248,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":144,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 17","type":649,"x":280,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_5 18","type":651,"x":312,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":400,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 19","type":653,"x":344,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_7 20","type":655,"x":376,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":248,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 21","type":615,"x":376,"y":64,"sx":1.5,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 11","type":600,"x":184,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 14","type":604,"x":336,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 15","type":645,"x":216,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Springs_1","scene":37,"ground":[[0,0,33,1],[0,1,4,11],[13,1,20,5],[5,6,28,1],[29,7,4,5],[0,12,33,3]],"actors":[{"name":"Hero_New 1","type":590,"x":192,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":416,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 4","type":621,"x":160,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 5","type":621,"x":256,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 8","type":609,"x":96,"y":85,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 9","type":609,"x":80,"y":85,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 10","type":621,"x":352,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 11","type":621,"x":112,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 12","type":609,"x":384,"y":107,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 13","type":609,"x":368,"y":107,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 14","type":609,"x":352,"y":107,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 15","type":609,"x":176,"y":181,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 16","type":609,"x":192,"y":181,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 17","type":609,"x":272,"y":181,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 18","type":609,"x":288,"y":181,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 19","type":602,"x":112,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 20","type":604,"x":160,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 21","type":615,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 22","type":617,"x":352,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Springs_2","scene":39,"ground":[[0,0,33,2],[0,2,4,7],[29,2,4,7],[0,9,10,6],[11,9,4,6],[16,9,4,6],[21,9,12,6]],"actors":[{"name":"Hero_New 1","type":590,"x":80,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 33","type":645,"x":304,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 34","type":647,"x":304,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":416,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 35","type":621,"x":304,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 4","type":621,"x":144,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 36","type":604,"x":240,"y":150,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 19","type":602,"x":162,"y":137,"sx":0.375,"sy":3.375,"angle":0},{"name":"Trigger_2 20","type":604,"x":244,"y":137,"sx":0.375,"sy":3.375,"angle":0},{"name":"Trigger_3 21","type":615,"x":322,"y":135,"sx":0.375,"sy":2.875,"angle":0},{"name":"Enemy_Fake_Tile 22","type":600,"x":144,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 24","type":609,"x":336,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 25","type":609,"x":352,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 26","type":609,"x":176,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 27","type":609,"x":192,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 28","type":609,"x":256,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 29","type":609,"x":272,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 30","type":621,"x":304,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 31","type":609,"x":362,"y":144,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Springs_3","scene":38,"ground":[[0,0,33,2],[0,2,4,6],[29,2,4,6],[0,8,9,4],[24,8,9,4],[0,12,33,3]],"actors":[{"name":"Spikes 32","type":609,"x":240,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":96,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 33","type":609,"x":224,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 34","type":609,"x":208,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":416,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 35","type":609,"x":192,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 36","type":609,"x":176,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 37","type":609,"x":160,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 38","type":609,"x":144,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 11","type":621,"x":160,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 44","type":600,"x":160,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 45","type":609,"x":368,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 19","type":602,"x":160,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 20","type":604,"x":273,"y":135,"sx":1.0,"sy":3.5,"angle":0},{"name":"Spikes 25","type":609,"x":352,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 26","type":609,"x":336,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 27","type":609,"x":320,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 28","type":609,"x":304,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 29","type":609,"x":288,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 30","type":609,"x":272,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 31","type":609,"x":256,"y":176,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Springs_4","scene":42,"ground":[[0,0,33,1],[0,1,5,1],[7,1,1,5],[29,1,4,12],[0,2,6,1],[0,3,4,12],[20,4,6,2],[14,6,12,2],[8,8,18,5],[8,13,25,2]],"actors":[{"name":"Hero_New 1","type":590,"x":80,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 19","type":602,"x":96,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 20","type":604,"x":376,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 23","type":600,"x":96,"y":200,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 24","type":621,"x":192,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 26","type":621,"x":384,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 11","type":621,"x":96,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 27","type":609,"x":384,"y":11,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 28","type":609,"x":400,"y":11,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 29","type":609,"x":368,"y":11,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spring 30","type":621,"x":288,"y":80,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Springs_5","scene":45,"ground":[[0,0,33,3],[0,3,4,6],[29,3,4,6],[0,9,10,6],[23,9,10,6]],"actors":[{"name":"Hero_New 1","type":590,"x":96,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 38","type":604,"x":210,"y":125,"sx":0.5,"sy":8.375,"angle":0},{"name":"Trigger_3 39","type":615,"x":268,"y":129,"sx":1.0,"sy":9.125,"angle":0},{"name":"Fake_Tile_1 41","type":600,"x":224,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 42","type":600,"x":272,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 11","type":621,"x":176,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 43","type":600,"x":320,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 44","type":617,"x":319,"y":129,"sx":1.0,"sy":10.625,"angle":0},{"name":"Trigger_1 19","type":602,"x":163,"y":137,"sx":0.5,"sy":9.25,"angle":0},{"name":"Enemy_Fake_Tile 23","type":600,"x":176,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 24","type":621,"x":224,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 26","type":621,"x":320,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 30","type":621,"x":272,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Warps_1","scene":36,"ground":[[0,0,33,2],[0,2,9,4],[29,2,4,5],[0,6,4,1],[0,7,9,4],[15,7,4,4],[26,7,7,4],[0,11,20,3],[21,11,12,3],[0,14,33,1]],"actors":[{"name":"Hero_New 1","type":590,"x":64,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 4","type":619,"x":128,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 5","type":619,"x":288,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":128,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 7","type":604,"x":288,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 8","type":609,"x":144,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 9","type":609,"x":192,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 10","type":609,"x":208,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 11","type":609,"x":224,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 12","type":609,"x":304,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 13","type":609,"x":320,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 14","type":609,"x":336,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 15","type":609,"x":352,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Enemy_Fake_Tile 16","type":600,"x":320,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 17","type":609,"x":368,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 18","type":609,"x":384,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 19","type":615,"x":352,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 20","type":609,"x":176,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 21","type":609,"x":160,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 22","type":619,"x":320,"y":208,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 23","type":617,"x":320,"y":208,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 24","type":609,"x":400,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Warps_2","scene":60,"ground":[[0,0,33,2],[0,2,4,1],[25,2,1,7],[29,2,4,4],[0,3,7,1],[11,3,5,1],[17,3,5,1],[0,4,4,11],[27,6,6,1],[29,7,4,2],[25,9,8,1],[29,10,4,5]],"actors":[{"name":"Hero_New 1","type":590,"x":80,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 19","type":615,"x":256,"y":72,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 4","type":619,"x":136,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":136,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 22","type":619,"x":352,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 23","type":617,"x":368,"y":64,"sx":2.5,"sy":1.0,"angle":0},{"name":"Warp 26","type":619,"x":256,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 27","type":665,"x":384,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Warps_3","scene":62,"ground":[[0,0,33,2],[0,2,18,5],[20,2,1,1],[23,2,4,2],[28,2,5,2],[20,3,2,1],[20,4,1,11],[24,4,2,7],[29,4,4,4],[0,7,4,2],[17,7,1,3],[27,8,6,1],[0,9,7,1],[8,9,7,1],[29,9,4,2],[0,10,4,1],[16,10,2,1],[0,11,16,1],[17,11,1,4],[24,11,9,1],[0,12,4,3],[29,12,4,3]],"actors":[{"name":"Hero_New 1","type":590,"x":160,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 33","type":665,"x":80,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_6 34","type":667,"x":352,"y":64,"sx":2.25,"sy":1.0,"angle":0},{"name":"Warp 35","type":619,"x":384,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 4","type":619,"x":160,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_7 36","type":673,"x":368,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":112,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 38","type":598,"x":432,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 19","type":615,"x":208,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 26","type":619,"x":112,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 27","type":604,"x":208,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 28","type":600,"x":112,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 29","type":619,"x":352,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 30","type":645,"x":240,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 31","type":617,"x":120,"y":128,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Warps_4","scene":63,"ground":[[0,0,33,5],[0,5,4,3],[29,5,4,2],[23,7,10,1]],"actors":[{"name":"Warp 32","type":619,"x":136,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":64,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 33","type":619,"x":168,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 34","type":619,"x":200,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 35","type":619,"x":232,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 36","type":619,"x":264,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_7 37","type":673,"x":296,"y":92,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":104,"y":92,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 38","type":619,"x":296,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 7","type":604,"x":136,"y":92,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 19","type":615,"x":168,"y":92,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 20","type":600,"x":72,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 21","type":645,"x":104,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 22","type":647,"x":136,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 23","type":649,"x":168,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_5 24","type":651,"x":200,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 25","type":653,"x":232,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_7 26","type":655,"x":304,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 28","type":617,"x":200,"y":92,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 29","type":665,"x":232,"y":92,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_6 30","type":667,"x":264,"y":92,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 31","type":619,"x":104,"y":96,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Warps_5","scene":68,"ground":[[0,0,33,1],[0,1,5,1],[29,1,4,4],[0,2,4,1],[14,2,1,1],[24,2,1,1],[0,3,5,8],[28,5,5,10],[0,11,3,4]],"actors":[{"name":"Hero_New 1","type":590,"x":64,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":448,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 4","type":619,"x":128,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 5","type":619,"x":192,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 6","type":619,"x":256,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 7","type":619,"x":352,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 8","type":619,"x":416,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 9","type":619,"x":96,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 10","type":602,"x":96,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 11","type":604,"x":128,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 12","type":615,"x":224,"y":48,"sx":5.125,"sy":1.0,"angle":0},{"name":"Trigger_4 13","type":617,"x":192,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 14","type":665,"x":256,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_6 15","type":667,"x":384,"y":48,"sx":5.375,"sy":1.0,"angle":0},{"name":"Trigger_7 16","type":673,"x":352,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_8 17","type":675,"x":416,"y":176,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Scale_1","scene":55,"ground":[[0,0,17,4],[29,0,4,1],[28,1,5,1],[29,2,4,9],[0,4,11,1],[15,4,2,6],[0,5,4,3],[0,8,14,3],[0,11,33,4]],"actors":[{"name":"Hero_New 1","type":590,"x":96,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 33","type":609,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 34","type":609,"x":160,"y":80,"sx":1.0,"sy":1.0,"angle":180},{"name":"Door 3","type":598,"x":448,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 35","type":609,"x":432,"y":16,"sx":1.0,"sy":1.0,"angle":270},{"name":"Spikes 36","type":609,"x":224,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 11","type":609,"x":144,"y":80,"sx":1.0,"sy":1.0,"angle":180},{"name":"Trigger_1 12","type":602,"x":64,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 13","type":661,"x":64,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 15","type":604,"x":200,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 16","type":661,"x":200,"y":64,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 17","type":609,"x":128,"y":80,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 18","type":609,"x":240,"y":160,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 20","type":609,"x":112,"y":80,"sx":1.0,"sy":1.0,"angle":180},{"name":"Trigger_3 21","type":615,"x":272,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 22","type":661,"x":272,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Scale_2","scene":59,"ground":[[0,0,33,2],[0,2,5,3],[27,2,6,8],[0,5,7,1],[0,6,4,6],[29,10,4,2],[0,12,6,3],[7,12,3,3],[22,12,11,3]],"actors":[{"name":"Hero_New 1","type":590,"x":112,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":448,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":64,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 6","type":661,"x":64,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 7","type":604,"x":96,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 8","type":661,"x":96,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Fake_Tile_1 10","type":600,"x":248,"y":288,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 11","type":615,"x":328,"y":120,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 12","type":661,"x":352,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 13","type":617,"x":352,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 14","type":609,"x":352,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 15","type":609,"x":400,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 16","type":609,"x":304,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 17","type":609,"x":256,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 18","type":609,"x":208,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 19","type":609,"x":160,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 20","type":609,"x":112,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Fake_Tile_2 21","type":645,"x":96,"y":208,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 22","type":665,"x":248,"y":240,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 23","type":661,"x":248,"y":240,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 24","type":609,"x":416,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 25","type":609,"x":384,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 26","type":609,"x":368,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 27","type":609,"x":336,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 28","type":609,"x":320,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 29","type":609,"x":288,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 30","type":609,"x":272,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 31","type":609,"x":224,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 32","type":609,"x":240,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 33","type":609,"x":192,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 34","type":609,"x":176,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 35","type":609,"x":144,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 36","type":609,"x":128,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 37","type":609,"x":96,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 38","type":609,"x":80,"y":32,"sx":1.0,"sy":1.0,"angle":180}]},+{"name":"Scale_3","scene":56,"ground":[[0,0,11,2],[12,0,21,1],[12,1,1,7],[29,1,4,2],[0,2,4,4],[10,3,1,1],[25,3,8,1],[9,4,2,1],[29,4,4,11],[8,5,3,1],[23,5,1,1],[0,6,11,2],[0,8,4,3],[20,8,1,1],[0,11,10,4],[15,11,10,2]],"actors":[{"name":"Fake_Tile_1 32","type":600,"x":192,"y":184,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":96,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 34","type":617,"x":448,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 35","type":661,"x":448,"y":144,"sx":1.0,"sy":1.0,"angle":270},{"name":"Trigger_3 36","type":615,"x":64,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 37","type":661,"x":64,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 38","type":621,"x":272,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 40","type":665,"x":400,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 41","type":661,"x":400,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 42","type":621,"x":368,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 12","type":602,"x":64,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 13","type":661,"x":64,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 15","type":604,"x":160,"y":152,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 30","type":609,"x":183,"y":64,"sx":1.0,"sy":1.875,"angle":90},{"name":"Spring 31","type":621,"x":320,"y":112,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Scale_4","scene":57,"ground":[[0,0,33,6],[0,6,4,1],[29,6,4,9],[0,7,16,1],[0,8,4,4],[27,8,1,1],[24,9,1,1],[21,10,1,1],[18,11,1,1],[0,12,19,3]],"actors":[{"name":"Hero_New 1","type":590,"x":272,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 34","type":661,"x":432,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":80,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 35","type":609,"x":240,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 36","type":609,"x":256,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 37","type":609,"x":272,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 38","type":609,"x":224,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 39","type":609,"x":208,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 40","type":609,"x":192,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 41","type":609,"x":176,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 42","type":609,"x":160,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 43","type":609,"x":144,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 12","type":602,"x":240,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 44","type":609,"x":128,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 13","type":661,"x":240,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 45","type":609,"x":112,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 14","type":609,"x":288,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 46","type":609,"x":96,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 15","type":609,"x":336,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 47","type":609,"x":80,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 16","type":609,"x":384,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 48","type":609,"x":64,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 17","type":609,"x":432,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 23","type":604,"x":432,"y":112,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Scale_5","scene":58,"ground":[[0,0,33,6],[0,6,14,1],[20,6,13,1],[0,7,11,1],[22,7,11,1],[0,8,14,1],[15,8,3,1],[20,8,13,3],[0,9,13,2],[0,11,33,4]],"actors":[{"name":"Hero_New 1","type":590,"x":192,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":320,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 4","type":602,"x":176,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 5","type":661,"x":176,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 6","type":600,"x":224,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 7","type":609,"x":208,"y":112,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 8","type":609,"x":202,"y":160,"sx":1.0,"sy":1.0,"angle":90},{"name":"Spikes 9","type":609,"x":310,"y":160,"sx":1.0,"sy":1.0,"angle":270},{"name":"Trigger_2 10","type":604,"x":216,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 13","type":615,"x":256,"y":139,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 14","type":661,"x":256,"y":144,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 18","type":609,"x":310,"y":96,"sx":1.0,"sy":1.0,"angle":270},{"name":"Fake_Tile_2 20","type":645,"x":296,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 21","type":621,"x":288,"y":166,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 23","type":617,"x":240,"y":109,"sx":0.375,"sy":1.375,"angle":0},{"name":"Spikes 24","type":609,"x":218,"y":96,"sx":1.0,"sy":1.0,"angle":90}]},+{"name":"Doors_1","scene":64,"ground":[[0,0,33,7],[0,7,6,3],[27,7,6,3],[0,10,33,5]],"actors":[{"name":"Hero_New 1","type":590,"x":144,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 5","type":598,"x":256,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":240,"y":135,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 7","type":604,"x":260,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 8","type":615,"x":288,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 9","type":617,"x":316,"y":136,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Doors_2","scene":65,"ground":[[0,0,33,6],[0,6,6,4],[27,6,6,4],[0,10,33,5]],"actors":[{"name":"Hero_New 1","type":590,"x":400,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 5","type":598,"x":288,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Blood 6","type":596,"x":752,"y":283,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 7","type":609,"x":304,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 8","type":609,"x":288,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 9","type":609,"x":256,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 10","type":609,"x":240,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 11","type":609,"x":224,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 12","type":609,"x":208,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 13","type":609,"x":192,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 14","type":609,"x":176,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 15","type":609,"x":160,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 16","type":609,"x":144,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 17","type":609,"x":128,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 18","type":609,"x":112,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 19","type":609,"x":96,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 20","type":609,"x":272,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 21","type":600,"x":288,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 22","type":602,"x":288,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 23","type":600,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 24","type":600,"x":224,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 25","type":600,"x":192,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 26","type":600,"x":160,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 27","type":600,"x":128,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 28","type":600,"x":96,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 29","type":598,"x":400,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 30","type":598,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 31","type":598,"x":224,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 32","type":598,"x":192,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 33","type":598,"x":160,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 34","type":598,"x":128,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 35","type":598,"x":96,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 36","type":604,"x":256,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 37","type":615,"x":224,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 38","type":617,"x":192,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 39","type":665,"x":160,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_6 40","type":667,"x":128,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_7 41","type":673,"x":96,"y":128,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Doors_3","scene":66,"ground":[[0,0,33,1],[0,1,16,1],[27,1,6,3],[0,2,26,1],[0,3,6,3],[7,4,26,1],[27,5,6,3],[0,6,26,1],[0,7,6,5],[7,8,26,1],[27,9,6,3],[0,12,33,3]],"actors":[{"name":"Spikes 32","type":609,"x":384,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 33","type":609,"x":368,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":256,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 34","type":602,"x":272,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 35","type":609,"x":352,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 36","type":609,"x":256,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 37","type":604,"x":208,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Blood 6","type":596,"x":752,"y":283,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 29","type":598,"x":208,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 30","type":609,"x":416,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 31","type":609,"x":400,"y":176,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Doors_4","scene":67,"ground":[[0,0,33,2],[0,2,5,2],[29,2,4,9],[0,4,11,11],[27,11,6,4]],"actors":[{"name":"Hero_New 1","type":590,"x":96,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 34","type":602,"x":176,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Blood 6","type":596,"x":752,"y":283,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 38","type":600,"x":176,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 39","type":621,"x":176,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 40","type":598,"x":176,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 41","type":604,"x":400,"y":112,"sx":1.5,"sy":5.0,"angle":0},{"name":"Fake_Tile_2 42","type":645,"x":176,"y":176,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Doors_5","scene":69,"ground":[[0,0,33,2],[0,2,6,13],[27,2,6,13],[7,10,2,5],[10,10,2,5],[15,10,11,5]],"actors":[{"name":"Hero_New 1","type":590,"x":400,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 5","type":598,"x":112,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":224,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door_Dummy 10","type":682,"x":400,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 11","type":609,"x":304,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 12","type":600,"x":144,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 13","type":645,"x":208,"y":192,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Saws_1","scene":70,"ground":[[0,0,33,1],[0,1,4,14],[29,1,4,14],[5,10,23,3]],"actors":[{"name":"Hero_New 1","type":590,"x":108,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":416,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 4","type":684,"x":272,"y":152,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":272,"y":128,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Saws_2","scene":72,"ground":[[0,0,33,1],[0,1,4,14],[29,1,4,14],[6,10,21,3]],"actors":[{"name":"Hero_New 1","type":590,"x":108,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":416,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 4","type":684,"x":192,"y":152,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":192,"y":128,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Saws_3","scene":71,"ground":[[0,0,33,1],[0,1,4,7],[29,1,4,7],[0,8,7,3],[8,8,17,2],[26,8,7,3],[0,11,33,4]],"actors":[{"name":"Hero_New 1","type":590,"x":76,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 4","type":684,"x":256,"y":120,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 6","type":604,"x":208,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 7","type":621,"x":400,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Saws_4","scene":73,"ground":[[0,0,33,1],[0,1,4,1],[9,1,24,2],[0,2,7,10],[9,3,1,5],[21,3,12,6],[11,4,9,3],[19,7,1,5],[9,8,9,3],[29,9,4,3],[0,12,33,3]],"actors":[{"name":"Hero_New 1","type":590,"x":92,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 4","type":684,"x":136,"y":56,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 5","type":684,"x":104,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":116,"y":36,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 7","type":562,"x":288,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 11","type":684,"x":360,"y":200,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 12","type":604,"x":256,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 13","type":562,"x":288,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 14","type":562,"x":288,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 15","type":562,"x":288,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 16","type":562,"x":160,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 17","type":562,"x":160,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 18","type":562,"x":160,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 19","type":562,"x":160,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 20","type":615,"x":288,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 21","type":617,"x":320,"y":96,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Saws_5","scene":74,"ground":[[0,0,33,1],[0,1,8,2],[25,1,8,4],[0,3,3,1],[0,4,9,7],[30,5,3,1],[25,6,8,4],[29,10,4,1],[0,11,3,1],[30,11,3,1],[0,12,9,3],[26,12,7,3]],"actors":[{"name":"Trigger_3 16","type":615,"x":384,"y":40,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":108,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 17","type":617,"x":264,"y":110,"sx":15.75,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 4","type":684,"x":16,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":128,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 6","type":600,"x":16,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 8","type":684,"x":496,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 9","type":647,"x":16,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 10","type":684,"x":16,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 15","type":604,"x":176,"y":40,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Flappy_1","scene":75,"ground":[[0,0,33,1],[0,1,4,9],[0,10,6,1],[0,11,4,4]],"actors":[{"name":"Door 3","type":598,"x":432,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_Flappy 4","type":692,"x":80,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 5","type":600,"x":432,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":385,"y":120,"sx":1.0,"sy":13.125,"angle":0}]},+{"name":"Flappy_2","scene":78,"ground":[[0,0,33,1],[24,4,1,1],[3,7,3,1],[3,8,1,3]],"actors":[{"name":"Door 3","type":598,"x":64,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_Flappy 4","type":692,"x":81,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":376,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 6","type":661,"x":368,"y":112,"sx":1.0,"sy":1.0,"angle":270},{"name":"Fake_Tile_1 7","type":600,"x":384,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 8","type":604,"x":56,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 9","type":661,"x":64,"y":144,"sx":1.0,"sy":1.0,"angle":90},{"name":"Fake_Tile_2 10","type":645,"x":80,"y":72,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 11","type":647,"x":384,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Flappy_3","scene":79,"ground":[[3,7,1,1]],"actors":[{"name":"Door 3","type":598,"x":400,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_Flappy 4","type":692,"x":383,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 5","type":600,"x":400,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 6","type":609,"x":48,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 7","type":609,"x":64,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 8","type":609,"x":80,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 9","type":609,"x":96,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 10","type":609,"x":112,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 11","type":609,"x":128,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 12","type":609,"x":144,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 13","type":609,"x":160,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 14","type":609,"x":176,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 15","type":609,"x":192,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 16","type":609,"x":208,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 17","type":609,"x":224,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 18","type":609,"x":240,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 19","type":609,"x":256,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 20","type":609,"x":272,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 21","type":609,"x":288,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 22","type":609,"x":304,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 23","type":609,"x":320,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 24","type":609,"x":336,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 25","type":609,"x":352,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 26","type":609,"x":368,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 27","type":609,"x":384,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 28","type":609,"x":400,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 29","type":609,"x":416,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 30","type":609,"x":432,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 31","type":609,"x":448,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 32","type":609,"x":464,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Fake_Tile_2 33","type":645,"x":256,"y":-64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 34","type":645,"x":256,"y":288,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 35","type":609,"x":464,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 36","type":609,"x":448,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 37","type":609,"x":432,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 38","type":609,"x":416,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 39","type":609,"x":400,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 40","type":609,"x":384,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 41","type":609,"x":368,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 42","type":609,"x":352,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 43","type":609,"x":336,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 44","type":609,"x":320,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 45","type":609,"x":304,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 46","type":609,"x":288,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 47","type":609,"x":272,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 48","type":609,"x":256,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 49","type":609,"x":240,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 50","type":609,"x":224,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 51","type":609,"x":208,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 52","type":609,"x":192,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 53","type":609,"x":176,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 54","type":609,"x":160,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 55","type":609,"x":144,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 56","type":609,"x":128,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 57","type":609,"x":112,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 58","type":609,"x":96,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 59","type":609,"x":80,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 60","type":609,"x":64,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 61","type":609,"x":48,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 63","type":602,"x":396,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 64","type":661,"x":64,"y":112,"sx":1.0,"sy":1.0,"angle":90},{"name":"Trigger_2 65","type":604,"x":58,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 66","type":609,"x":480,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 67","type":609,"x":496,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 68","type":609,"x":512,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 69","type":609,"x":32,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 70","type":609,"x":16,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 71","type":609,"x":0,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 72","type":609,"x":480,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 73","type":609,"x":496,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 74","type":609,"x":512,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 75","type":609,"x":32,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 76","type":609,"x":16,"y":32,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 77","type":609,"x":0,"y":32,"sx":1.0,"sy":1.0,"angle":180}]},+{"name":"Flappy_4","scene":80,"ground":[[3,0,1,7],[8,0,1,6],[11,0,1,7],[14,0,1,4],[17,0,1,10],[20,0,1,6],[23,0,1,7],[26,0,1,7],[14,6,1,9],[0,8,5,1],[8,8,1,7],[20,8,1,7],[28,8,5,1],[3,9,1,6],[11,9,1,6],[23,9,1,6],[26,9,1,6],[17,12,1,3]],"actors":[{"name":"Door 3","type":598,"x":448,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_Flappy 4","type":692,"x":64,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 5","type":609,"x":369,"y":80,"sx":1.0,"sy":1.0,"angle":90},{"name":"Spikes 6","type":609,"x":321,"y":64,"sx":1.0,"sy":1.0,"angle":90},{"name":"Spikes 8","type":609,"x":225,"y":32,"sx":1.0,"sy":1.0,"angle":90},{"name":"Spikes 10","type":609,"x":129,"y":64,"sx":1.0,"sy":1.0,"angle":90},{"name":"Spikes 11","type":609,"x":129,"y":144,"sx":1.0,"sy":1.0,"angle":90},{"name":"Spikes 12","type":609,"x":177,"y":160,"sx":1.0,"sy":1.0,"angle":90},{"name":"Spikes 14","type":609,"x":273,"y":208,"sx":1.0,"sy":1.0,"angle":90},{"name":"Spikes 16","type":609,"x":369,"y":160,"sx":1.0,"sy":1.0,"angle":90},{"name":"Btn_Button_1 17","type":661,"x":448,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 18","type":602,"x":368,"y":120,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 19","type":604,"x":448,"y":112,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Flappy_5","scene":81,"ground":[[0,0,33,1],[3,3,1,1],[3,12,1,1]],"actors":[{"name":"Door 3","type":598,"x":48,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_Flappy 4","type":692,"x":48,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 6","type":600,"x":464,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 7","type":645,"x":48,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 8","type":647,"x":464,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 9","type":649,"x":48,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_5 10","type":651,"x":464,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 11","type":653,"x":64,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 12","type":602,"x":456,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 13","type":661,"x":448,"y":160,"sx":1.0,"sy":1.0,"angle":270}]},+{"name":"Gravity_1","scene":76,"ground":[[0,0,4,10],[7,0,3,1],[11,0,5,1],[17,0,5,1],[23,0,10,1],[29,1,4,9],[0,10,7,1],[9,10,3,1],[21,10,3,1],[26,10,7,1],[0,11,4,4],[29,11,4,4]],"actors":[{"name":"Door 3","type":598,"x":432,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 5","type":600,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 6","type":645,"x":416,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 7","type":602,"x":256,"y":144,"sx":2.875,"sy":1.0,"angle":0},{"name":"Hero 8","type":590,"x":64,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 9","type":604,"x":384,"y":16,"sx":2.375,"sy":1.0,"angle":0}]},+{"name":"Gravity_2","scene":77,"ground":[[0,0,4,8],[29,0,4,10],[5,1,3,1],[15,1,3,1],[20,1,3,1],[0,8,5,1],[6,8,1,2],[11,8,1,2],[16,8,1,2],[21,8,1,2],[26,8,1,2],[0,9,4,1],[0,10,23,5],[25,10,8,5]],"actors":[{"name":"Trigger_4 16","type":617,"x":368,"y":64,"sx":2.875,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":440,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero 8","type":590,"x":64,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 9","type":600,"x":256,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 10","type":602,"x":80,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 11","type":645,"x":176,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 12","type":647,"x":400,"y":-80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 13","type":604,"x":158,"y":90,"sx":2.25,"sy":1.0,"angle":0},{"name":"Trigger_3 14","type":615,"x":400,"y":-64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 15","type":649,"x":376,"y":192,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Gravity_3","scene":82,"ground":[[0,0,4,11],[5,1,3,1],[11,1,3,1],[17,1,3,1],[0,11,5,1],[0,12,4,3],[8,12,3,1],[14,12,3,1],[20,12,3,1]],"actors":[{"name":"Door 3","type":598,"x":432,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero 8","type":590,"x":64,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 9","type":600,"x":384,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 10","type":602,"x":384,"y":32,"sx":3.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 11","type":645,"x":432,"y":176,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Gravity_4","scene":83,"ground":[[0,0,4,11],[29,0,4,11],[0,11,8,1],[25,11,8,1],[0,12,4,3],[12,12,8,1],[29,12,4,3],[12,14,8,1]],"actors":[{"name":"Fake_Tile_4 34","type":649,"x":352,"y":352,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero 8","type":590,"x":256,"y":208,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 9","type":600,"x":144,"y":528,"sx":1.0,"sy":1.0,"angle":0},{"name":"Grav_Spike_Block 43","type":698,"x":352,"y":373,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 44","type":600,"x":352,"y":400,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 13","type":647,"x":128,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_5 45","type":651,"x":368,"y":-64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 18","type":645,"x":256,"y":-64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 19","type":661,"x":64,"y":80,"sx":1.0,"sy":1.0,"angle":90},{"name":"Grav_Spike_Block 21","type":698,"x":144,"y":501,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 23","type":645,"x":64,"y":-64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 24","type":602,"x":64,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 25","type":661,"x":256,"y":-48,"sx":1.0,"sy":1.0,"angle":180}]},+{"name":"Gravity_5","scene":85,"ground":[[0,0,27,2],[29,0,4,11],[0,2,4,3],[12,2,1,1],[18,2,1,1],[24,2,1,1],[9,4,1,1],[15,4,1,1],[21,4,1,1],[0,5,6,2],[8,5,18,2],[0,7,26,1],[0,8,4,3],[0,11,33,4]],"actors":[{"name":"Door 3","type":598,"x":80,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero 8","type":590,"x":80,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 9","type":684,"x":256,"y":168,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 10","type":684,"x":304,"y":120,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 11","type":684,"x":352,"y":168,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 12","type":684,"x":400,"y":120,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 13","type":600,"x":448,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 14","type":600,"x":448,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 15","type":684,"x":496,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 16","type":645,"x":96,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 18","type":602,"x":432,"y":111,"sx":2.625,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 19","type":600,"x":432,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 20","type":600,"x":432,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 21","type":645,"x":112,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 22","type":645,"x":112,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 23","type":645,"x":96,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 24","type":604,"x":380,"y":59,"sx":1.875,"sy":1.5,"angle":0},{"name":"Saw 25","type":684,"x":208,"y":120,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 26","type":684,"x":160,"y":168,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 27","type":615,"x":106,"y":48,"sx":1.75,"sy":2.0,"angle":0}]},+{"name":"Movement_1","scene":86,"ground":[[0,0,33,1],[0,1,4,6],[29,1,4,10],[0,7,6,1],[0,8,4,3],[0,11,33,1],[0,12,4,3],[29,12,4,3]],"actors":[{"name":"Hero_New 1","type":590,"x":76,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":80,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 36","type":600,"x":160,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":208,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 8","type":621,"x":448,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 10","type":609,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 47","type":600,"x":336,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 53","type":645,"x":240,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 54","type":604,"x":336,"y":88,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 55","type":609,"x":288,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 56","type":615,"x":260,"y":88,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 57","type":617,"x":128,"y":88,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 58","type":609,"x":96,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 31","type":600,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Movement_2","scene":93,"ground":[[0,0,33,1],[0,1,4,10],[29,1,4,2],[27,3,6,1],[29,4,4,11],[0,11,5,1],[0,12,4,3],[15,12,2,3]],"actors":[{"name":"Spikes 32","type":609,"x":256,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Hero_New 1","type":590,"x":64,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 33","type":645,"x":304,"y":276,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 34","type":647,"x":144,"y":260,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":448,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 35","type":615,"x":144,"y":64,"sx":5.125,"sy":1.0,"angle":0},{"name":"Saw 36","type":684,"x":128,"y":-16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 37","type":684,"x":144,"y":-16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 38","type":684,"x":160,"y":-16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 39","type":649,"x":352,"y":260,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_5 40","type":651,"x":400,"y":324,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 41","type":617,"x":400,"y":72,"sx":3.125,"sy":1.0,"angle":0},{"name":"Trigger_1 29","type":602,"x":196,"y":98,"sx":1.0,"sy":10.875,"angle":0},{"name":"Fake_Tile_1 30","type":600,"x":192,"y":276,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 31","type":609,"x":240,"y":192,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Movement_3","scene":94,"ground":[[0,0,33,2],[0,2,4,1],[16,2,1,2],[29,2,4,6],[0,3,6,1],[0,4,5,7],[6,5,22,1],[16,6,1,1],[6,8,27,1],[16,9,1,1],[29,9,4,2],[0,11,33,1],[0,12,5,3],[28,12,5,3]],"actors":[{"name":"Hero_New 1","type":590,"x":76,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 4","type":600,"x":80,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 5","type":684,"x":496,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 6","type":661,"x":256,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 7","type":602,"x":256,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 8","type":661,"x":256,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 9","type":604,"x":256,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 10","type":661,"x":448,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 11","type":615,"x":449,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 12","type":645,"x":80,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 13","type":609,"x":336,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 14","type":661,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 15","type":617,"x":256,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 16","type":665,"x":80,"y":112,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Movement_4","scene":95,"ground":[[0,0,33,1],[0,1,4,14],[29,1,4,14],[16,2,1,1],[16,14,1,1]],"actors":[{"name":"Hero_New 1","type":590,"x":256,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":256,"y":208,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 4","type":684,"x":256,"y":208,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 11","type":602,"x":256,"y":33,"sx":6.875,"sy":1.0,"angle":0},{"name":"Trigger_2 12","type":604,"x":480,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 13","type":615,"x":32,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 14","type":617,"x":480,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 15","type":661,"x":32,"y":160,"sx":1.0,"sy":1.0,"angle":90},{"name":"Trigger_5 16","type":665,"x":480,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 17","type":661,"x":480,"y":64,"sx":1.0,"sy":1.0,"angle":270},{"name":"Btn_Button_1 18","type":661,"x":480,"y":128,"sx":1.0,"sy":1.0,"angle":270},{"name":"Btn_Button_1 19","type":661,"x":480,"y":160,"sx":1.0,"sy":1.0,"angle":270},{"name":"Btn_Button_1 20","type":661,"x":32,"y":96,"sx":1.0,"sy":1.0,"angle":90}]},+{"name":"Movement_5","scene":96,"ground":[[0,0,33,1],[0,1,4,14],[29,1,4,14],[25,5,3,10]],"actors":[{"name":"Hero_New 1","type":590,"x":364,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":416,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 4","type":600,"x":416,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":320,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 6","type":645,"x":112,"y":384,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 7","type":647,"x":640,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 8","type":649,"x":112,"y":544,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_5 9","type":651,"x":-720,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 10","type":653,"x":320,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 11","type":653,"x":288,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 12","type":653,"x":256,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 13","type":653,"x":224,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 14","type":653,"x":192,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 15","type":604,"x":256,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_7 16","type":655,"x":360,"y":152,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_8 17","type":657,"x":400,"y":72,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Wraparound_1","scene":89,"ground":[[16,0,1,6],[15,6,3,1],[16,7,1,8]],"actors":[{"name":"Hero_New 1","type":590,"x":272,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":240,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 4","type":602,"x":224,"y":1,"sx":2.75,"sy":1.0,"angle":0},{"name":"Spikes 5","type":609,"x":240,"y":96,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Wraparound_2","scene":88,"ground":[[29,0,1,3],[25,3,5,1],[25,4,1,3],[29,4,1,2],[27,6,3,1],[29,7,1,8],[0,10,5,1]],"actors":[{"name":"Hero_New 1","type":590,"x":448,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":64,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 6","type":684,"x":240,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 7","type":684,"x":192,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 8","type":684,"x":144,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 9","type":684,"x":96,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 10","type":602,"x":416,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 11","type":604,"x":154,"y":12,"sx":4.375,"sy":1.0,"angle":0},{"name":"Saw 12","type":684,"x":48,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 13","type":609,"x":400,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 14","type":609,"x":416,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 15","type":609,"x":432,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 16","type":609,"x":448,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Generic_Death_Square 17","type":846,"x":32,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Generic_Death_Square 19","type":846,"x":0,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Generic_Death_Square 20","type":846,"x":464,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Generic_Death_Square 21","type":846,"x":464,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Generic_Death_Square 22","type":846,"x":464,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Generic_Death_Square 23","type":846,"x":464,"y":272,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Wraparound_3","scene":87,"ground":[[3,0,1,8],[29,0,1,9],[3,8,4,1],[0,10,9,1],[12,10,2,1],[17,10,2,1],[22,10,2,1],[27,10,6,1],[3,11,1,4],[29,11,1,4]],"actors":[{"name":"Hero_New 1","type":590,"x":64,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":128,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 4","type":600,"x":128,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 5","type":600,"x":144,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 6","type":600,"x":160,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 7","type":600,"x":176,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 8","type":600,"x":192,"y":256,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 9","type":609,"x":128,"y":240,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 10","type":609,"x":144,"y":240,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 11","type":609,"x":160,"y":240,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 12","type":609,"x":176,"y":240,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 13","type":609,"x":192,"y":240,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 14","type":602,"x":160,"y":177,"sx":3.875,"sy":1.0,"angle":0},{"name":"Trigger_2 15","type":604,"x":200,"y":71,"sx":1.0,"sy":10.0,"angle":0},{"name":"Fake_Tile_2 16","type":645,"x":96,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 17","type":609,"x":272,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 18","type":609,"x":288,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 19","type":609,"x":352,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 20","type":609,"x":368,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 21","type":609,"x":432,"y":160,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Wraparound_4","scene":90,"ground":[[0,0,4,3],[9,0,1,1],[15,0,1,1],[21,0,1,1],[27,0,1,3],[30,0,3,8],[9,1,5,1],[15,1,5,1],[21,1,5,1],[9,2,1,3],[15,2,1,1],[21,2,1,1],[0,3,7,1],[12,3,4,1],[17,3,5,1],[23,3,5,1],[0,4,4,2],[15,4,1,1],[21,4,1,1],[27,4,1,4],[9,5,3,1],[15,5,5,1],[21,5,5,1],[0,6,7,1],[9,6,1,3],[15,6,1,3],[21,6,1,3],[0,7,4,8],[27,8,6,1],[29,9,4,6],[9,12,1,3],[15,12,1,3],[21,12,1,3],[27,12,1,3]],"actors":[{"name":"Hero_New 1","type":590,"x":64,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":456,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 6","type":661,"x":64,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 7","type":600,"x":144,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 8","type":645,"x":240,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 9","type":647,"x":336,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 10","type":661,"x":208,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 11","type":661,"x":288,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 12","type":602,"x":62,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 13","type":604,"x":202,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 14","type":615,"x":294,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 15","type":661,"x":384,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 16","type":617,"x":384,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 17","type":684,"x":32,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 18","type":684,"x":0,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 19","type":684,"x":-32,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 20","type":684,"x":-64,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 21","type":684,"x":-96,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 22","type":684,"x":-128,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 23","type":684,"x":-160,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 24","type":684,"x":-192,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 25","type":684,"x":-224,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 26","type":684,"x":-256,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 27","type":684,"x":-288,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 28","type":684,"x":-320,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 29","type":684,"x":-352,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 30","type":684,"x":-384,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 31","type":684,"x":-416,"y":232,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 32","type":649,"x":432,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 34","type":665,"x":448,"y":224,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Wraparound_5","scene":91,"ground":[[0,3,23,1],[26,3,7,1],[0,5,15,1],[18,5,15,1],[0,7,9,1],[12,7,21,1],[0,9,21,1],[24,9,9,1],[0,11,15,1],[18,11,15,1],[15,12,3,2]],"actors":[{"name":"Hero_New 1","type":590,"x":256,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":144,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 4","type":562,"x":272,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 5","type":562,"x":256,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 6","type":562,"x":240,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 7","type":562,"x":336,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 8","type":562,"x":352,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 9","type":562,"x":368,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 10","type":602,"x":304,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 13","type":609,"x":320,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 14","type":562,"x":368,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 15","type":562,"x":352,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 16","type":562,"x":336,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 17","type":684,"x":160,"y":144,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 18","type":604,"x":160,"y":128,"sx":11.625,"sy":0.625,"angle":0},{"name":"Tile_Jumpthrough_2 19","type":562,"x":176,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 20","type":562,"x":160,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 21","type":562,"x":144,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 22","type":562,"x":144,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 23","type":562,"x":160,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 24","type":562,"x":176,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 25","type":562,"x":272,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 26","type":562,"x":256,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 27","type":562,"x":240,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 28","type":562,"x":240,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 29","type":562,"x":256,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 30","type":562,"x":272,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 33","type":562,"x":368,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 34","type":562,"x":368,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 35","type":562,"x":384,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 36","type":562,"x":400,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 37","type":562,"x":400,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Tile_Jumpthrough_2 38","type":562,"x":384,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 43","type":684,"x":224,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 44","type":684,"x":-16,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 45","type":615,"x":160,"y":93,"sx":4.25,"sy":0.5,"angle":0},{"name":"Trigger_4 46","type":617,"x":112,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 47","type":665,"x":224,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_6 48","type":667,"x":256,"y":60,"sx":3.25,"sy":0.5,"angle":0},{"name":"Saw 49","type":684,"x":432,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 50","type":684,"x":-16,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_7 51","type":673,"x":320,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 52","type":684,"x":-72,"y":-8,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_7 53","type":673,"x":424,"y":32,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Boss_1","scene":92,"ground":[[0,0,33,4],[0,4,4,4],[5,4,23,1],[29,4,4,4],[6,5,21,1],[7,6,19,1],[0,8,5,7],[6,8,27,7]],"actors":[{"name":"Hero_New 1","type":590,"x":80,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 4","type":684,"x":32,"y":120,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 5","type":684,"x":416,"y":136,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":144,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 7","type":609,"x":368,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 8","type":609,"x":352,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 9","type":609,"x":336,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 10","type":609,"x":320,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 11","type":609,"x":304,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 12","type":609,"x":288,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 13","type":609,"x":272,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 14","type":609,"x":256,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 15","type":609,"x":240,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 16","type":609,"x":224,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 17","type":609,"x":208,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 18","type":609,"x":192,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 19","type":609,"x":176,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 20","type":609,"x":160,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 21","type":609,"x":144,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 22","type":609,"x":128,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 23","type":609,"x":112,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 24","type":609,"x":400,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Spikes 25","type":609,"x":384,"y":96,"sx":1.0,"sy":1.0,"angle":180},{"name":"Fake_Tile_1 27","type":600,"x":80,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 28","type":615,"x":400,"y":129,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 29","type":619,"x":400,"y":128,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Boss_2","scene":97,"ground":[[0,0,33,3],[5,6,1,5],[7,6,4,5],[12,6,8,5],[23,6,4,5]],"actors":[{"name":"Hero_New 1","type":590,"x":80,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 4","type":600,"x":96,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 5","type":602,"x":99,"y":72,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 6","type":604,"x":114,"y":72,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 7","type":645,"x":144,"y":104,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 8","type":647,"x":176,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 9","type":649,"x":272,"y":104,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 10","type":615,"x":240,"y":72,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_5 11","type":651,"x":320,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_6 12","type":653,"x":344,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 13","type":617,"x":304,"y":72,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_7 14","type":655,"x":368,"y":104,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 15","type":665,"x":332,"y":72,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_8 16","type":657,"x":432,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_6 17","type":667,"x":422,"y":80,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Boss_3","scene":98,"ground":[[0,0,33,1],[12,5,4,1],[17,5,4,1],[0,11,10,4],[23,11,10,4]],"actors":[{"name":"Hero_New 1","type":590,"x":56,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 4","type":613,"x":80,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 6","type":613,"x":112,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin_Bad 7","type":659,"x":144,"y":160,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 8","type":602,"x":136,"y":152,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_1 9","type":600,"x":160,"y":192,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spring 10","type":621,"x":160,"y":176,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 11","type":645,"x":256,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 12","type":604,"x":240,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 13","type":613,"x":320,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 14","type":613,"x":304,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 15","type":613,"x":288,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 16","type":613,"x":304,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 17","type":613,"x":320,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Coin 18","type":613,"x":320,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 19","type":647,"x":288,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 20","type":647,"x":304,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 21","type":647,"x":320,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 22","type":647,"x":320,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 23","type":647,"x":304,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 24","type":647,"x":320,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 25","type":615,"x":332,"y":16,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 26","type":617,"x":336,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 27","type":619,"x":336,"y":0,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 28","type":665,"x":144,"y":208,"sx":1.0,"sy":1.0,"angle":0},{"name":"Warp 29","type":619,"x":144,"y":208,"sx":1.0,"sy":1.0,"angle":0},{"name":"Spikes 30","type":609,"x":160,"y":0,"sx":1.0,"sy":1.0,"angle":180}]},+{"name":"Boss_4","scene":99,"ground":[[0,0,4,7],[29,0,4,7],[27,1,1,6],[0,7,33,1],[0,8,4,7],[29,8,4,7]],"actors":[{"name":"Hero_New 1","type":590,"x":64,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":448,"y":96,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 4","type":684,"x":528,"y":104,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 5","type":684,"x":-16,"y":120,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 6","type":602,"x":76,"y":84,"sx":0.5,"sy":3.25,"angle":135},{"name":"Fake_Tile_1 7","type":600,"x":448,"y":80,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_2 8","type":645,"x":448,"y":64,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_3 9","type":647,"x":448,"y":48,"sx":1.0,"sy":1.0,"angle":0},{"name":"Fake_Tile_4 10","type":649,"x":448,"y":32,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 12","type":604,"x":144,"y":128,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 13","type":661,"x":144,"y":128,"sx":1.0,"sy":1.0,"angle":180},{"name":"Fake_Tile_5 14","type":651,"x":448,"y":16,"sx":1.0,"sy":1.0,"angle":0}]},+{"name":"Boss_5","scene":100,"ground":[[0,8,33,7]],"actors":[{"name":"Hero_New 1","type":590,"x":80,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Door 3","type":598,"x":432,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_1 10","type":602,"x":144,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_2 11","type":604,"x":192,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_3 12","type":615,"x":240,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_4 13","type":617,"x":288,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_5 14","type":665,"x":336,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Trigger_6 15","type":667,"x":384,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 16","type":661,"x":384,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 17","type":661,"x":336,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 18","type":661,"x":288,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 19","type":661,"x":240,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 20","type":661,"x":192,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Btn_Button_1 21","type":661,"x":144,"y":112,"sx":1.0,"sy":1.0,"angle":0},{"name":"Saw 22","type":684,"x":640,"y":16,"sx":1.0,"sy":1.0,"angle":0}]}+]diff --git a/tests/test_games.py b/tests/test_games.pyindex 84094a51..d4c60ffd 100644--- a/tests/test_games.py+++ b/tests/test_games.py@@ -86,8 +86,8 @@ GAMES = {# new game from the pause menu and its first square"minesweeper": ("Minesweeper.nwa", "mines.sav", presses((1500, "ok"), (2000, "ok"), (2400, "right")), 3000,presses((1500, "ok"), (2000, "back"), (2300, "down"), (2600, "ok"), (3000, "ok")), 3600),- # past the keys, the first door: the runner runs right into the first trap, and again; next time the- # first door again (the keys not shown), and more deaths+ # past the keys, the first door: the runner runs right into the first pit; next time (only the copy of the+ # save left) the first door again, the keys not shown, and another death"leveldevil": ("LevelDevil.nwa", "leveldevil.sav", presses((1500, "ok"), (2000, "ok"), (3000, "right", 4000)), 8000,presses((1500, "ok"), (2500, "right", 3000)), 6500),# Play, serve, a brick or more: the best is kept; next time, Settings, screen shake off, back@@ -228,7 +228,7 @@ COPIES = {"championisland": "champion_saves.py", "numblocks": "numblocks_saves.p"numpowder": "numpowder_saves.py", "undertale": "undertale_saves.py", "subway": "subway_saves.py","fnaf": "fnaf_saves.py", "doom": "doom_saves.py", "isaac": "isaac_saves.py","hillclimb": "hillclimb_saves.py", "pvz": "pvz_saves.py", "sonic": "sonic_saves.py",- "cookieclicker": "cookieclicker_saves.py"}+ "cookieclicker": "cookieclicker_saves.py", "leveldevil": "leveldevil_saves.py"}CHECKS = {# the island remembers where Lucky was; after the reinstall, from the copy"championisland": (lambda v: v[:3] == b"CI1" and b"PLAYER_LOC" in v,) * 2,@@ -305,7 +305,7 @@ CHECKS = {"blockblast": (lambda v: len(v) == 92 and v[:3] == b"B\1\3" and struct.unpack_from("<I", v, 12)[0] >= 1and struct.unpack_from("<I", v, 8)[0] >= struct.unpack_from("<I", v, 12)[0],lambda v: v[2] & 1 and struct.unpack_from("<I", v, 12)[0] >= 2),- # the keys were shown and the runner died (the deaths at 8); then died again+ # the keys were shown and the runner died (the deaths at 8); after the reinstall, from the copy, it died again"leveldevil": (lambda v: len(v) == 48 and v[:2] == b"L\1" and v[2] & 1 and struct.unpack_from("<I", v, 8)[0] >= 1,lambda v: struct.unpack_from("<I", v, 8)[0] >= 2),# the best score ("I", version 1, the best at 4): some invaders shot; then kept, or beatendiff --git a/tools/release.py b/tools/release.pyindex c5f2db50..537d39b1 100644--- a/tools/release.py+++ b/tools/release.py@@ -50,6 +50,8 @@ ALONE = {"pvz": ("Plants vs. Zombies", "the whole Adventure, from the front lawn to the roof and Dr. Zomboss: 50 levels, 40 ""plants, 24 zombies, Crazy Dave, his shop and the Almanac. Too big to share the calculator with NumPlay: ""install it on its own"),+ "leveldevil": ("Level Devil", "Unept's troll platformer, all sixteen worlds of five rooms, with the game's own "+ "rooms and traps. Install it on its own"),"sonic": ("Sonic the Hedgehog", "the whole 1991 game: Green Hill to Scrap Brain, the Final Zone, the Special ""Stages and the six Chaos Emeralds, and the ending. Too big to share the calculator with NumPlay: install ""it on its own"),