SpelunkyFan wiki

Skulls breaking on any ceiling

Verified against the spelunky.ai port v0.1.10 on .

Skulls breaking on any ceiling is a quirk of Spelunky Classic in which a Skull thrown up breaks on any ceiling it reaches, where a Jar breaks only rising fast.

The Skull moves by a copy of the Jar's code, with the speeds it breaks at lowered. One of them was lowered past the point of meaning anything: a Skull thrown up breaks on any ceiling it reaches, at any speed, where a Jar has to hit it hard.

What happens

#

The player throws a Jar up at the ceiling. It arrives slowly and bounces off whole, only breaking when it lands. Then he throws a Skull the same way: it arrives slower still, and shatters against the ceiling [1].

A skull breaks on a gentle ceiling hit. The player throws a jar up at the ceiling. It arrives slowly and bounces off whole, only breaking when it lands. Then he throws a skull the same way: it arrives slower still, and shatters against the ceiling.

Why

#

The Skull's step is the Jar's, copied. Where it hits a ceiling going up, both test how fast it's going:

    if (colTop and yVel < 0)
    {
        if (yVel < 2) destroy = true;
        yVel = -yVel * 0.8;
    }
    
    if (colLeft or colRight)
    {
        if (abs(xVel) > 2) destroy = true;
        xVel = -xVel * 0.5;
    }
objects/oSkull/step.gml:37-47, from spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).

yVel < 0 is moving up, and inside that test yVel < 2 always holds, so the Skull breaks on every ceiling. The Jar's line is if (yVel < -3): rising faster than 3 pixels a step, as the step has already added its gravity, faster than 3.6 before it [2]. Against a wall the Skull's threshold is lower as well, 2 pixels a step across where the Jar's is 3, but that one still means something [3] [4].

Reproducing it

#

Throw a Skull straight up under a ceiling it can reach: it breaks there, however slowly it arrives. The replay of the clip's staged scene, on a custom level, throws a Jar up under a ceiling four blocks up; it reaches it rising at 3 pixels a step and bounces off, breaking only when it lands. A Skull thrown the same way reaches it at 2.4 and breaks there [5]. The wall's lower threshold is read in the code, and not yet checked against the original game.

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 [4], and the oracle's fingerprint of the replay pins both throws. No option turns it off.

FAQ

#
Why does the Skull break on the ceiling in Spelunky Classic?

Its code tests for a speed below 2 pixels a step downward while it's moving up, which always holds. So a Skull breaks on any ceiling it reaches, however slowly.

Does a Jar break on the ceiling?

Only rising fast: a Jar breaks on a ceiling it hits going up faster than 3 pixels a step, and bounces off whole otherwise.

Does a Skull break against walls more easily too?

Yes: a Skull thrown faster than 2 pixels a step across breaks on a wall, where a Jar needs more than 3. That's a lower threshold, not a broken one, so a slow Skull still bounces off.

See also

#

References

#
  1. Clip quirks/skull-breaks-on-ceiling
  2. objects/oJar/step.gml:37-41
  3. objects/oJar/step.gml:43-47
  4. Quirk 1 (docs/quirks.md)
  5. Replay fidelity/replays/item-skull-breaks-on-ceiling.txt

Source code

#