Ghost
Verified against the spelunky.ai port v0.1.10 on .
The Ghost is a monster in Spelunky Classic that comes for a player who lingers on a level, drifting through walls and killing him with one touch.
The Ghost is the game's limit on how long the player can spend on a level. It comes once he has been on a level for 5,000 steps (2 minutes 46.67 seconds), from the edge of the screen, and floats straight at him through anything in its way. Nothing can hurt it, so the only way out is the level's exit.
Behaviour
#A Ghost appears halfway down the edge of the screen, the right edge if the player is in the right half of the level and the left edge otherwise, and plays its sound [6] [7]. It flies straight at the player at 1 pixel per step (30 per second) in whatever direction he is, turning to face him, and nothing stops it: it has no code for walls or anything else it passes through [4]. On a dark level it lights up the cave around it [8]. Only one Ghost comes to a level [9].
The clip shows a Ghost coming for a player who has stood still on a level of the Mines: it drifts through the rock toward him, turns a Big Sapphire it passes into a Diamond, and kills him when it reaches him [10]. Every Big Emerald, Big Ruby and Big Sapphire it touches becomes a Diamond, even one still inside a block [11] [12].
When it comes. Every step the player is alive on a level, the level's clock gains 30 (the steps in a second), from 0 when the level starts [13] [14]. At 120,000, 4,000 steps (2 minutes 13.33 seconds) in, the game warns "A CHILL RUNS UP YOUR SPINE... LET'S GET OUT OF HERE!" and the music fades; at 150,000, 5,000 steps in, the Ghost comes [15]. The clock stops while the game is paused [16]. Neither happens on the first level, on Olmec's level, on a custom level, while the player is going out through the exit, or while he has the Hedjet [17].
Damage
#When a Ghost touches the player, unless he's invincible from a hit in the last 30 steps, he dies at once, whatever his hearts: his body bursts into three bones and a Skull, and whatever he was holding flies out of his hands [18]. The Ghost then fades away [19]. On the game's own levels the death is counted against the Ghost in the deaths table [20] [21].
Defeating
#A Ghost can't be harmed. It isn't one of the monsters most weapons look for, so whips, bombs, bullets and thrown items pass through it, and its own whip event is empty [1]. Its step event has code to remove it when its hit points run out, but nothing ever takes them [22]. The only escape is the level's exit: the clock and the Ghost start over on every level [14].
Locations
#The clock brings a Ghost to any level of the Mines, the Jungle, the Ice Caves and the Temple after the first [6]. Ghosts also come:
- For defiling an altar. The third time the player destroys one of Kali's altars, and every time after, the level goes dark and a Ghost comes, if there's none already [23].
- For the golden idol in a graveyard. Picking up the golden idol on a Jungle graveyard level sends one [24].
- In the Sun Room, the bonus room, once the player has 80 points there [25].
Tips
#- The warning comes 1,000 steps (33.33 seconds) before the Ghost: time enough to make for the exit.
- A Ghost is slow, 1 pixel a step, but it never stops and nothing blocks it.
- Big gems the Ghost passes become Diamonds, even ones still in the rock.
Trivia
#-
The Ghost's touch tests
if (true), so it always kills [26]. -
The line in its step that would count a kill has a Bat's tally commented out above it [22]:
if (hp < 1) { //global.bats += 1; global.kills += 1; instance_destroy(); }objects/oGhost/step.gml:1-6, fromspelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).
FAQ
#- When does the Ghost appear in Spelunky Classic?
After the player has spent 5,000 steps (2 minutes 46.67 seconds) on a level, on any level but the first and Olmec's. A thousand steps before, the game warns "A CHILL RUNS UP YOUR SPINE... LET'S GET OUT OF HERE!" and the music fades.
- Can you kill the Ghost in Spelunky Classic?
No. Nothing hurts it: whips, bombs, bullets and thrown items pass through it, and it passes through walls. The only way to escape it is to leave the level.
- What happens if the Ghost touches you in Spelunky Classic?
The player dies at once, however many hearts he has, and his body turns into bones and a skull. Only the second of invincibility after another hit protects him.
- Does the Ghost turn gems into diamonds in Spelunky Classic?
Yes. A Big Emerald, Big Ruby or Big Sapphire the Ghost touches becomes a Diamond, even one still inside a block, since the Ghost drifts through walls.
References
#objects/oGhost/collision_oWhip.gml:1objects/oGhost/collision_oCharacter.gml:16objects/oGhost/step.gml:18objects/oGhost/step.gml:15-28objects/oRubyBig/collision_oGhost.gml:1-2objects/oGame/step.gml:39-46objects/oGhost/create.gml:29objects/oScreen/step_begin.gml:231-234objects/oGame/step.gml:40-45- Clip ghost/touch
objects/oSapphireBig/collision_oGhost.gml:1-2- Replay
fidelity/replays/item-seed-2-diamond.txt objects/oGame/step.gml:14-21objects/oLevel/create.gml:12-14objects/oGame/step.gml:26-46- Replay
fidelity/replays/flow-pause-ghost-timer.txt objects/oGame/step.gml:39-41objects/oGhost/collision_oCharacter.gml:1-33objects/oGhost/other_animation_end.gml:9-12objects/oGhost/collision_oCharacter.gml:5scripts/scrWriteStats.gml:139objects/oGhost/step.gml:1-6objects/oSacAltarLeft/destroy.gml:39-58objects/oPlayer1/step.gml:1230-1239objects/oSunRoom/alarm_0.gml:9-14objects/oGhost/collision_oCharacter.gml:3
Source code
objects/oGhost/create.gmlobjects/oGhost/step.gmlobjects/oGhost/collision_oCharacter.gmlobjects/oGhost/collision_oWhip.gmlobjects/oGhost/other_animation_end.gmlobjects/oGame/step.gmlobjects/oLevel/create.gmlobjects/oRubyBig/collision_oGhost.gmlobjects/oSacAltarLeft/destroy.gml