SpelunkyFan wiki

Skeletons facing right

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

Skeletons facing right is a quirk of Spelunky Classic in which a skeleton made before the player, as a custom level's are, walks right wherever the player is.

A Skeleton faces the player when it's made, and walks toward him. It can only do that if the player is there yet, and in a custom level (the level editor's) he isn't: the level's tiles come first. So a custom level's Skeleton faces right, wherever the player is.

What happens

#

A Skeleton placed in a custom level walks right, away from the player, until it reaches the wall: it's made before the player, so it doesn't turn to face him [1].

A skeleton in a custom level faces right. A skeleton placed in a custom level walks right, away from the player, until it reaches the wall: it's made before the player, so it doesn't turn to face him.

Why

#

A Skeleton's create event faces it right, and turns it left only if there's a player, left of its middle:

LEFT = 0;
RIGHT = 1;
facing = RIGHT;
if (instance_exists(oPlayer1))
{
    if (oPlayer1.x < x+8) facing = LEFT;
}
objects/oSkeleton/create.gml:25-31, from spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).

Its walk turns only at a wall [2]. A custom level makes its tiles first, the level editor's K among them [3], and the player after them, at its entrance [4] [5]. So when a tile's Skeleton is made there's no player, and it keeps facing right. In the generated levels, Skeletons only rise from piles of bones while the player is there, and turn to him [6].

Reproducing it

#

Make a custom level with a K right of the player's entrance, and play it: the Skeleton walks right, away from him. The level editor's test does the same. The replay of the clip's staged scene, on a custom level, has a Skeleton right of the player: it starts walking right, away from him, and turns only at the wall [7].

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

FAQ

#
Why do Skeletons in custom levels walk away from the player?

A Skeleton turns to face the player only if he exists when it's made. A custom level makes its tiles before the player, so its Skeletons keep facing right, and walk right until a wall turns them.

Do Skeletons in the game's own levels face the player?

Yes. There, a Skeleton only rises from a pile of bones while the player is in the level, and turns to him.

Does the level editor's test show it too?

Yes. Testing a level in the level editor loads it the same way, its tiles first and the player after them.

See also

#

References

#
  1. Clip quirks/skeleton-faces-right
  2. objects/oSkeleton/step.gml:48-61
  3. scripts/scrCreateTileObj.gml:143-146
  4. scripts/scrLoadLevel.gml:100
  5. scripts/scrLoadLevel.gml:162-173
  6. Quirk 1 (docs/quirks.md)
  7. Replay fidelity/replays/enemy-skeleton-tile-faces-right.txt

Source code

#