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.

# Door

From the spelunky.ai wiki: <https://spelunky.ai/wiki/door>.

*For the title screen's doors, see [Title screen](https://spelunky.ai/wiki/title-screen); for the Temple's doors that slam shut, see [Ceiling Trap](https://spelunky.ai/wiki/ceiling-trap).*

A Door is terrain in Spelunky Classic: a level's entrance, where the player starts, or its exit, which he takes by pressing up to go on to the next level.

![A dark doorway framed in stone](https://spelunky.ai/wiki/media/sprites/sExit/frames/0%404x.png)

| Door         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Effect       | Up in front of the exit: the next level[^1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Destroyed by | Nothing: it isn't a block                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Objects      | `oEntrance`, `oExit`, `oXMarket`, `oXGold`, `oGoldDoor`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Found in     | [The Mines](https://spelunky.ai/wiki/mines), [The Jungle](https://spelunky.ai/wiki/jungle), [The Ice Caves](https://spelunky.ai/wiki/ice-caves), [The Temple](https://spelunky.ai/wiki/temple), [Olmec's Lair](https://spelunky.ai/wiki/olmecs-lair), [Black Market](https://spelunky.ai/wiki/black-market), [Yeti Lair](https://spelunky.ai/wiki/yeti-lair), [Moai](https://spelunky.ai/wiki/moai), [Tutorial](https://spelunky.ai/wiki/tutorial), [Sun Room](https://spelunky.ai/wiki/sun-room), [Moon Room](https://spelunky.ai/wiki/moon-room), [Stars Room](https://spelunky.ai/wiki/stars-room) |

Every level has two doors: the entrance, where the player starts it, and the exit, his way on to the next
level. A few levels have a third, the way to a special level: the hidden door to
[the Black Market](https://spelunky.ai/wiki/black-market) and the gold door to [the City of Gold](https://spelunky.ai/wiki/city-of-gold). Doors are part of
the background, not blocks: nothing destroys one.

## How it works

**Clip: Taking the exit.** The player walks to the exit, a doorway in the rock, and presses up in front of it; he turns to it and walks in through the door. ([video](https://spelunky.ai/wiki/media/clips/door/exit/clip.mp4))

### The entrance

When a level is built, the player is put in its entrance's doorway[^2].
The entrance does nothing more: it's not a way back. The [Ankh](https://spelunky.ai/wiki/ankh) brings a player back to life at it, but
inside the [Moai](https://spelunky.ai/wiki/moai) or at the left end of [Olmec's Lair](https://spelunky.ai/wiki/olmecs-lair)[^3].

### Taking the exit

Pressing up in front of the exit while standing on the ground, not dead, stunned or whipping, takes it[^4]. The player walks in through the door, out of reach of anything[^5], and when he's through, the screen between levels comes, then the
next level[^6]. The clip shows it: the
player walks to the exit, presses up, and walks in[^7]. As he goes:

- **What he holds** goes with him in his hands to the next level, but a heavy item, which he puts down; a
  [Bomb](https://spelunky.ai/wiki/bomb) or [Rope](https://spelunky.ai/wiki/rope), which goes back into his count (a lit bomb is dropped); the
  [Golden Idol](https://spelunky.ai/wiki/golden-idol), which is cashed in; and a [Damsel](https://spelunky.ai/wiki/damsel), who walks in with him and is
  rescued[^8].
- **The money** he picked up on the level is added to his total[^9].
- **A thief** has one level fewer to fear the [Shopkeepers](https://spelunky.ai/wiki/shopkeeper)[^10].
- **[Monkeys](https://spelunky.ai/wiki/monkey)** holding on to him are thrown off[^11].

Carrying the idol or a Damsel into the exit's doorway is enough, even without pressing up: the idol is cashed
in and the Damsel walks in[^12].

### Special doors

- **The Black Market's door** is an exit hidden inside a block on one of [the Jungle](https://spelunky.ai/wiki/jungle)'s levels. Taken,
  it leads to [the Black Market](https://spelunky.ai/wiki/black-market) as the next level[^13][^14].
- **The gold door**, which level generation stands on a block that can't be destroyed on one Temple level[^15][^16], opens when
  the player carries the [Sceptre](https://spelunky.ai/wiki/sceptre) into it wearing the [Hedjet](https://spelunky.ai/wiki/hedjet): the Sceptre is used up, and the door becomes an exit to [the City of Gold](https://spelunky.ai/wiki/city-of-gold).
  Without the Hedjet, it only says "THE SCEPTRE FITS... BUT NOTHING IS HAPPENING!"[^17][^18].
  Where it can end up is [The City of Gold's door anywhere](https://spelunky.ai/wiki/gold-door-anywhere).

## Locations

The room templates have one tile for both doors, with a block under it: in the room the level starts in, it
makes the entrance, and in any other, the room the level's path ends in, the exit, whose block can't be
destroyed[^19]. The [Moai](https://spelunky.ai/wiki/moai) has an exit of its own, in its chamber[^20]. The [Tutorial](https://spelunky.ai/wiki/tutorial), [Olmec's Lair](https://spelunky.ai/wiki/olmecs-lair), the
screens between levels and the bonus rooms, the [Sun](https://spelunky.ai/wiki/sun-room), [Moon](https://spelunky.ai/wiki/moon-room) and
[Stars Rooms](https://spelunky.ai/wiki/stars-room), have doors the room editor placed[^21][^22][^23]. In custom levels they're the [level editor](https://spelunky.ai/wiki/level-editor)'s tiles `@` (the entrance)
and `X` (an exit)[^24], and an exit can lead to another custom
level[^25].

## Interactions

- **[Bombs](https://spelunky.ai/wiki/bomb)** pass doors by: a door isn't solid, and the blast only breaks what is[^26].
- **[Damsels](https://spelunky.ai/wiki/damsel)** running free leave by an exit by themselves, and count as rescued[^27].

## Trivia

- The entrance is set up with the type "Exit", the same as the exit's[^28][^29].
- Both doors keep a name of the custom level they lead to, which only the level editor draws, over the door[^30][^31].

## FAQ

### How do you leave a level in Spelunky Classic?

By pressing up in front of the exit while standing on the ground, not stunned or whipping. The player walks in through the door, and the next level begins.

### What happens to the item you're holding when you take the exit in Spelunky Classic?

Most go with the player to the next level, in his hands. A heavy one is put down; a Bomb or Rope goes back into his count; the [Golden Idol](https://spelunky.ai/wiki/golden-idol) is cashed in, and a [Damsel](https://spelunky.ai/wiki/damsel) is rescued.

### Can you destroy the exit in Spelunky Classic?

No. A door isn't a block, so a bomb's blast passes it by, and the block a level's exit stands on can't be destroyed either.

### How do you open the gold door in Spelunky Classic?

By carrying the [Sceptre](https://spelunky.ai/wiki/sceptre) into it while wearing the [Hedjet](https://spelunky.ai/wiki/hedjet). Then it becomes an exit to the [City of Gold](https://spelunky.ai/wiki/city-of-gold). Without the Hedjet, the game only says "THE SCEPTRE FITS... BUT NOTHING IS HAPPENING!".

## See also

- **Related:** [Golden Idol](https://spelunky.ai/wiki/golden-idol), [Damsel](https://spelunky.ai/wiki/damsel), [Black Market](https://spelunky.ai/wiki/black-market), [City of Gold](https://spelunky.ai/wiki/city-of-gold), [Sceptre](https://spelunky.ai/wiki/sceptre), [The City of Gold's door anywhere](https://spelunky.ai/wiki/gold-door-anywhere), [Scoring](https://spelunky.ai/wiki/scoring)

## References

[^1]: [`objects/oPlayer1/step.gml:759-902`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L759-L902)

[^2]: [`scripts/scrInitLevel.gml:200-204`](https://spelunky.ai/wiki/source/scripts/scrInitLevel#L200-L204)

[^3]: [`objects/oPlayer1/step.gml:1856-1872`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L1856-L1872)

[^4]: [`objects/oPlayer1/step.gml:759-765`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L759-L765)

[^5]: [`objects/oPlayer1/step.gml:855-878`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L855-L878)

[^6]: [`objects/oPlayer1/other_animation_end.gml:44-70`](https://spelunky.ai/wiki/source/objects/oPlayer1/other_animation_end#L44-L70)

[^7]: Clip [door/exit](https://spelunky.ai/wiki/door#clip-door-exit)

[^8]: [`objects/oPlayer1/step.gml:767-853`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L767-L853)

[^9]: [`objects/oPlayer1/step.gml:862-865`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L862-L865)

[^10]: [`objects/oPlayer1/step.gml:874`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L874)

[^11]: [`objects/oPlayer1/step.gml:890-901`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L890-L901)

[^12]: [`objects/oPlayer1/step.gml:2068-2113`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L2068-L2113)

[^13]: [`objects/oXMarket/create.gml:3`](https://spelunky.ai/wiki/source/objects/oXMarket/create#L3)

[^14]: [`objects/oPlayer1/step.gml:879`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L879)

[^15]: [`scripts/scrEntityGen.gml:400-406`](https://spelunky.ai/wiki/source/scripts/scrEntityGen#L400-L406)

[^16]: [`scripts/scrEntityGen.gml:483-490`](https://spelunky.ai/wiki/source/scripts/scrEntityGen#L483-L490)

[^17]: [`objects/oGoldDoor/collision_oSceptre.gml:1-23`](https://spelunky.ai/wiki/source/objects/oGoldDoor/collision_oSceptre#L1-L23)

[^18]: [`objects/oPlayer1/step.gml:880`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L880)

[^19]: [`scripts/scrRoomGen.gml:345-357`](https://spelunky.ai/wiki/source/scripts/scrRoomGen#L345-L357)

[^20]: [`scripts/scrRoomGen3.gml:496-497`](https://spelunky.ai/wiki/source/scripts/scrRoomGen3#L496-L497)

[^21]: Room [`rTutorial`](https://spelunky.ai/wiki/source/rooms/rTutorial), as the room editor placed it

[^22]: Room [`rOlmec`](https://spelunky.ai/wiki/source/rooms/rOlmec), as the room editor placed it

[^23]: Room [`rSun`](https://spelunky.ai/wiki/source/rooms/rSun), as the room editor placed it

[^24]: [`scripts/scrCreateTileObj.gml:24-31`](https://spelunky.ai/wiki/source/scripts/scrCreateTileObj#L24-L31)

[^25]: [`objects/oPlayer1/step.gml:881-888`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L881-L888)

[^26]: [`objects/oExplosion/collision_oSolid.gml:1-31`](https://spelunky.ai/wiki/source/objects/oExplosion/collision_oSolid#L1-L31)

[^27]: [`objects/oDamsel/step.gml:3-24`](https://spelunky.ai/wiki/source/objects/oDamsel/step#L3-L24)

[^28]: [`objects/oEntrance/create.gml:1`](https://spelunky.ai/wiki/source/objects/oEntrance/create#L1)

[^29]: [`objects/oExit/create.gml:1`](https://spelunky.ai/wiki/source/objects/oExit/create#L1)

[^30]: [`objects/oExit/create.gml:2`](https://spelunky.ai/wiki/source/objects/oExit/create#L2)

[^31]: [`objects/oExit/draw.gml:1-7`](https://spelunky.ai/wiki/source/objects/oExit/draw#L1-L7)

### Source code

- [`objects/oEntrance/create.gml`](https://spelunky.ai/wiki/source/objects/oEntrance/create)
- [`objects/oExit/create.gml`](https://spelunky.ai/wiki/source/objects/oExit/create)
- [`objects/oXMarket/create.gml`](https://spelunky.ai/wiki/source/objects/oXMarket/create)
- [`objects/oGoldDoor/collision_oSceptre.gml`](https://spelunky.ai/wiki/source/objects/oGoldDoor/collision_oSceptre)
- [`objects/oPlayer1/step.gml`](https://spelunky.ai/wiki/source/objects/oPlayer1/step)
- [`objects/oPlayer1/other_animation_end.gml`](https://spelunky.ai/wiki/source/objects/oPlayer1/other_animation_end)
- [`scripts/scrInitLevel.gml`](https://spelunky.ai/wiki/source/scripts/scrInitLevel)
- [`scripts/scrRoomGen.gml`](https://spelunky.ai/wiki/source/scripts/scrRoomGen)
