Skip to content

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

Celeste: Badeline breaks the floor of 6A's boss-00 again

Mason Chen7b727d9e88c4
diff --git a/games/celeste/src/level.c b/games/celeste/src/level.c
index 02d4d21c..0d405dd3 100644
--- a/games/celeste/src/level.c
+++ b/games/celeste/src/level.c
@@ -381,9 +381,9 @@ V2 level_spawn_near(V2 at) {
return player_spawn_near(at);
}
-bool level_in_bounds(V2 p, float pad) {
+bool level_in_bounds(V2 p, float pad) { /* Level.IsInBounds(position, pad): the room grown by pad */
Room *rm = g_level.room;
- return p.x >= rm->x + pad && p.x < rm->x + rm->w - pad && p.y >= rm->y + pad && p.y < rm->y + rm->h - pad;
+ return p.x >= rm->x - pad && p.x < rm->x + rm->w + pad && p.y >= rm->y - pad && p.y < rm->y + rm->h + pad;
}
static int room_at(V2 p) {
diff --git a/games/celeste/tests/check.py b/games/celeste/tests/check.py
index db7ed32b..1007ff77 100644
--- a/games/celeste/tests/check.py
+++ b/games/celeste/tests/check.py
@@ -119,6 +119,13 @@ out = run(["--chapter", "13", "--room", "c-10", "--nowipe"], 520,
"300-500:r,306-316:j,314-315:x,314-460:g,330-460:u", what="5A's c-10")
check("room c-12 " in out and " deaths 0 " in out, f"5A's c-10 was not crossed (its touch switches' gate): {out[-160:]}")
+# 6A's boss-00: after the intro (its dialog, OK pressed through), Badeline hit twice dives through the floor, a dash block only
+# she breaks, and the player follows her down into boss-01 (the second hit: the player put next to her, out of her shots)
+out = run(["--chapter", "16", "--room", "boss-00", "--nowipe", "--at", "352,144", "--tp", "1680:546,112"], 2100,
+ ",".join(f"{f}-{f + 2}:o" for f in range(60, 1450, 10)) + ",1500-1560:r,1505-1515:j,1522-1523:x,1760-1830:r,1762-1775:j",
+ what="6A's boss-00")
+check("room boss-01 " in out, f"6A's boss-00: Badeline didn't break the floor: {out[-160:]}")
+
# a chapter's end: its screen, then the chapter select
out = run(["--chapter", "1", "--room", "1"], 500, "400-401:o", env={"COMPLETE_AT": "60"}, what="a chapter's end")
diff --git a/games/celeste/tests/play.c b/games/celeste/tests/play.c
index e8997f04..da9d28dd 100644
--- a/games/celeste/tests/play.c
+++ b/games/celeste/tests/play.c
@@ -1,5 +1,6 @@
/* Host runner: plays the game with scripted keys and saves screenshots.
* play DATA.bin [--frames N] [--keys "F0-F1:keys,..."] [--shot F:path ...] [--room NAME] [--chapter N]
+ * [--tp F:X,Y] (the player moved there at frame F)
* [--draw N: draw every N frames (else only for shots and the last frame)]
* [--load F:ROOM:INTRO:FX:FY: at frame F, LoadLevel(INTRO) into ROOM at the spawn nearest (FX, FY) of it]
* [--record A-B:DIR: every frame from A to B as DIR/NNNNN.ppm (for the README's GIFs)]
@@ -52,6 +53,8 @@ int main(int argc, char **argv) {
fread(data, 1, n, f);
fclose(f);
cel_bin = data;
+ int tp_at = -1;
+ float tp_x = 0, tp_y = 0;
int frames = 120, chapter = -1, area = -1, checkpoint = -1, at_set = 0, dash_code = 0, list = 0, draw = 0, load_at = -1, load_intro = 0,
nowipe = 0;
const char *load_room = NULL, *rec_dir = NULL;
@@ -91,6 +94,7 @@ int main(int argc, char **argv) {
}
else if (!strcmp(argv[i], "--list")) list = 1;
else if (!strcmp(argv[i], "--at")) sscanf(argv[++i], "%f,%f", &at_x, &at_y), at_set = 1;
+ else if (!strcmp(argv[i], "--tp")) sscanf(argv[++i], "%d:%f,%f", &tp_at, &tp_x, &tp_y);
else if (!strcmp(argv[i], "--shot")) {
char *s = argv[++i], *c = strchr(s, ':');
shot_at[nshots] = atoi(s);
@@ -139,6 +143,10 @@ int main(int argc, char **argv) {
static const float d[6][2] = {{0, -1}, {-1, 0}, {0.7071f, 0.7071f}, {0.7071f, -0.7071f}, {-1, 0}, {-0.7071f, -0.7071f}};
level_dash_listeners(v2(d[fr - 120][0], d[fr - 120][1]));
}
+ if (fr == tp_at && g_player.ent && g_level.room) { /* --tp F:X,Y: at frame F, the player there (in the room), still */
+ g_player.ent->x = g_level.room->x + tp_x, g_player.ent->y = g_level.room->y + tp_y;
+ g_player.speed = v2(0, 0);
+ }
if (fr == load_at) level_load_room_near(chapter_find_room(g_session.chapter, load_room), load_intro, load_fx, load_fy);
game_frame();
if (getenv("DUSTDBG") && fr % 30 == 0) {