Explosions break blocks off screen
Explosions break blocks off screen is a quirk of Spelunky Classic in which an explosion out of sight breaks blocks as one on the screen does.
A Bomb that goes off out of sight breaks the blocks around it as one on the screen does. The code that breaks them has a test that looks meant to spare blocks off the screen, everywhere but the Tutorial, and the test is always passed.
What happens
#In the Temple, the player drops a bomb beside a Damsel and runs left, until the bomb is far past the right edge of the screen. It goes off there, out of sight: the screen shakes. When he walks back, the floor where the bomb lay is gone, and he drops into the hole [1].
Why
#An explosion breaks a block when it touches it, but only if this test passes:
if (isLevel("rTutorial") or (x > view_xview[0]-16 and x < view_xview[0] + view_wview[0]+16 and
y > view_yview[0]-16 and y < view_yview[0] + view_hview[0]+16))objects/oExplosion/collision_oSolid.gml:1-2, from spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).The second half asks whether the explosion is within 16 pixels of the screen, as the thrown items'
step does (Items freeze off screen). The first half reads as "or this is the Tutorial", but isLevel takes
no argument (GameMaker passes it one anyway, and nothing reads it). It asks whether the room is a level at all,
the Tutorial, any level of the game, Olmec's lair or a custom level
[2]. So on a level the test always passes, and the explosion breaks every block
it touches but the unbreakable ones, the level's border and the blocks under its doors [3]. (The
only other room with explosions, the high scores room's Sun Room, passes the screen test anyway: its screen
doesn't move, and the room is barely taller than it [4].) Whether isRoom, which does take a room's name, was meant is a guess: the screen's own
code uses isRoom("rTutorial") to keep the Tutorial's messages white [5].
The same mix-up is in the level's copy of that code, where it does nothing that shows: the screen's yellow
covers it.
The blast still only reaches what the game is running. Every step, the level pauses (deactivates) everything more than 96 pixels past the screen, keeping the explosion itself going, and a paused bomb's fuse doesn't burn [6]. So a bomb goes off out of sight only within that margin, or where the level keeps more running: further to the right of and below the player, where a mistake in the same code reaches, and around a rolling Boulder or Olmec. The blocks it breaks are the ones still running.
Reproducing it
#Drop a bomb and run, so that it's out of sight but not too far when it goes off, then go back: the blocks around it are gone. It happens on every level, with any bomb left behind, and with a dead Fire Frog's. The clip's replay drops the bomb on level 13 (frame 790) and runs left. It goes off on 909 at x 497, with the screen's left edge at 103, 74 pixels past its right edge, and breaks six temple blocks and a stone block, the floor it lay on among them (909-917). The player walks back and drops into the hole (1028-1037) [7]. In seed 9's City of Gold run, a Fire Frog the player kills on level 7 leaves its bomb behind him, and it breaks two blocks 93 pixels past the screen's left edge (3095-3097) [8].
In the port
#The spelunky.ai port reproduces it exactly: it's in docs/quirks.md's list of the 1.1 source's bugs [3], and the oracle's fingerprint of the clip's replay pins the blocks the explosion breaks. No option turns it off.
FAQ
#- Does a bomb that explodes off screen break blocks in Spelunky Classic?
Yes. An explosion breaks every block it touches, but the level's unbreakable ones, wherever it is. The code has a test meant to limit that to the screen, outside the Tutorial, but the test is always passed.
- Why does a bomb sometimes not go off while I'm far away?
The game pauses most things more than 96 pixels past the edge of the screen (more to the right of and below the player), a bomb's fuse with them. A bomb out there waits until the player comes back near it, then burns on. One closer to the screen goes off, and its blast breaks blocks.
- What is isLevel("rTutorial")?
The test in the explosion's code that was meant to ask "is this the Tutorial?". The function it calls, isLevel, takes no argument and asks "is this a level?", which is true on every level of the game.
See also
#References
#- Clip quirks/bomb-off-screen
scripts/isLevel.gml:7An explosion breaks blocks off the screen too.
, docs/quirks.md §1objects/oSunRoom/alarm_0.gml:31-36objects/oScreen/step_begin.gml:252objects/oLevel/step.gml:64-100- Replay
fidelity/replays/temple-seed-2-bomb-off-screen.txt, which the clip A bomb breaks the floor off the screen plays - Replay
fidelity/replays/city-of-gold-seed-9.txt