Spelunky is © 2008, 2009 Derek Yu and Mossmouth, LLC, and is used under the [Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt). spelunky.ai is an unofficial fan project, not affiliated with or endorsed by Mossmouth. The game and its assets may not be sold.

Music by George Buzinkai and Jonathan Perry; sound effects made in SFXR. From Spelunky Classic 1.1, © 2008, 2009 Derek Yu and Mossmouth, LLC.

# Ghost

From the spelunky.ai wiki: <https://spelunky.ai/wiki/ghost>. Verified against the spelunky.ai port [v0.1.10](https://github.com/851-labs/spelunky/releases/tag/v0.1.10) on 27 October 2026.

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.

![A pale, wispy ghost with a wide mouth and a curling tail, floating](https://spelunky.ai/wiki/media/17b72a4951674638/sprites/sGhostLeft/anim%404x.png)

| Ghost     |                                                  |
| --------- | ------------------------------------------------ |
| Health    | Can't be harmed[^1]                              |
| Damage    | Kills the player outright[^2]                    |
| Speed     | 1 pixel per step[^3]                             |
| Behaviour | Drifts straight at the player, through walls[^4] |
| Object    | `oGhost`                                         |
| Found in  | The Mines, The Jungle, The Ice Caves, The Temple |
| Drops     | Skull, Diamond (from a big gem it touches)[^5]   |

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

**Clip: Ghost.** Long after the player has arrived on a level, a ghost appears at the edge of the screen and drifts toward him through the walls, turning a big sapphire it passes into a diamond. Its touch kills him at once, leaving his bones and skull. ([video](https://spelunky.ai/wiki/media/17b72a4951674638/clips/ghost/touch/clip.mp4))

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](https://spelunky.ai/wiki/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

- Once the Ghost's touch has checked that the player isn't invincible, it tests `if (true)`, which always
  holds[^26][^27].
- The line in its step that would count a kill has a Bat's tally commented out above it[^22]:

  ```gml objects/oGhost/step.gml:1-6
  if (hp < 1)
  {
      //global.bats += 1;
      global.kills += 1;
      instance_destroy();
  }
  ```

  `objects/oGhost/step.gml:1-6`, from `spelunky.gmk`, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC ([Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt)).

## 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

[^1]: `objects/oGhost/collision_oWhip.gml:1`

[^2]: `objects/oGhost/collision_oCharacter.gml:16`

[^3]: `objects/oGhost/step.gml:18`

[^4]: `objects/oGhost/step.gml:15-28`

[^5]: `objects/oRubyBig/collision_oGhost.gml:1-2`

[^6]: `objects/oGame/step.gml:39-46`

[^7]: `objects/oGhost/create.gml:29`

[^8]: `objects/oScreen/step_begin.gml:231-234`

[^9]: `objects/oGame/step.gml:40-45`

[^10]: Clip ghost/touch

[^11]: `objects/oSapphireBig/collision_oGhost.gml:1-2`

[^12]: Replay `fidelity/replays/item-seed-2-diamond.txt`

[^13]: `objects/oGame/step.gml:14-21`

[^14]: `objects/oLevel/create.gml:12-14`

[^15]: `objects/oGame/step.gml:26-46`

[^16]: Replay `fidelity/replays/flow-pause-ghost-timer.txt`

[^17]: `objects/oGame/step.gml:39-41`

[^18]: `objects/oGhost/collision_oCharacter.gml:1-33`

[^19]: `objects/oGhost/other_animation_end.gml:9-12`

[^20]: `objects/oGhost/collision_oCharacter.gml:5`

[^21]: `scripts/scrWriteStats.gml:139`

[^22]: `objects/oGhost/step.gml:1-6`

[^23]: `objects/oSacAltarLeft/destroy.gml:39-58`

[^24]: `objects/oPlayer1/step.gml:1230-1239`

[^25]: `objects/oSunRoom/alarm_0.gml:9-14`

[^26]: `objects/oGhost/collision_oCharacter.gml:1-3`

[^27]: Quirk 1 (docs/quirks.md)

### Source code

- `objects/oGhost/create.gml`
- `objects/oGhost/step.gml`
- `objects/oGhost/collision_oCharacter.gml`
- `objects/oGhost/collision_oWhip.gml`
- `objects/oGhost/other_animation_end.gml`
- `objects/oGame/step.gml`
- `objects/oLevel/create.gml`
- `objects/oRubyBig/collision_oGhost.gml`
- `objects/oSacAltarLeft/destroy.gml`
