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.

# Controls

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

Controls in Spelunky Classic are the arrow keys, Z to jump, X to attack, C for items, A for bombs, S for ropes, Shift to run, P to pay and Escape to pause.

Each action has a key, which the settings program can change, and a gamepad button; the game
reads the gamepad first and the keyboard after it, so both work at once[^1]. Besides the twelve actions, Escape pauses, Enter and Escape move
past the screens between scenes, and a few function keys work on the title screen and the pause screen.

## How it works

### The keys

The game starts with these keys and buttons, then reads the player's own from `keys.cfg` and
`gamepad.cfg`, if the settings program has written them[^2][^3].

| Action      | Key    | Button       | What it does                                                                                                                                               |              |
| ----------- | ------ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| Left, right | ← →    | Stick or hat | Walk, and steer in the air                                                                                                                                 | [^4]         |
| Up          | ↑      | Stick or hat | Look up; climb a ladder or rope; go through a door; with attack, open a [Chest](https://spelunky.ai/wiki/chest) or [Crate](https://spelunky.ai/wiki/crate) | [^5][^6][^7] |
| Down        | ↓      | Stick or hat | Look down; duck and crawl; with attack, pick an item up; with jump, let go of a ledge                                                                      | [^8][^9]     |
| Jump        | Z      | 2            | Jump; swim up; free the player from a web                                                                                                                  | [^10]        |
| Attack      | X      | 1            | Whip, or use or [throw](https://spelunky.ai/wiki/throwing) what the player holds; held while walking, run                                                  | [^11]        |
| Item        | C      | 3            | Take out a [Bomb](https://spelunky.ai/wiki/bomb), then a [Rope](https://spelunky.ai/wiki/rope), then put back what the player held                         | [^12]        |
| Run         | Shift  | 5            | Run                                                                                                                                                        | [^13]        |
| Bomb        | A      | 7            | Throw a lit bomb                                                                                                                                           | [^14]        |
| Rope        | S      | 8            | Throw a rope up, or with down, over the ledge in front                                                                                                     | [^15]        |
| Flare       | F      | 4            | Nothing                                                                                                                                                    | [^16]        |
| Pay         | P      | 6            | In a shop, buy the item held, a bet or a kiss                                                                                                              | [^17]        |
| Start       | Escape | 10           | Pause; move past a screen                                                                                                                                  | [^18]        |

The keys do nothing while the player is stunned or dead[^19],
and the bomb and rope keys nothing once he has no hearts left[^20]. Up and down move the view once they've been held for 31
steps with the player standing or hanging still, 4 pixels a step, so he can look over a drop[^21].

### Running

The player walks at up to 3 pixels per step[^22]. He runs,
at up to 6, once a run has been held for 10 steps on the ground: the run key counts as held at once, and
the attack key, held while he isn't whipping, counts up a step at a time, so holding attack while walking
also starts a run[^23][^24]. With the settings program's run on down (on by
default), ducking while moving faster than 2 pixels per step keeps him running rather than slowing to a crawl[^25][^26].

### Pausing

**Clip: Pausing.** Escape pauses the game on the first level: the screen darkens and lists the level, its depth, the money, kills, time and saves, with the keys to return, die or quit. Escape again resumes play; paused once more, F1 kills the player, and the game over screen follows. ([video](https://spelunky.ai/wiki/media/015c74cb8645abba/clips/controls/pause/clip.mp4))

Escape (or the gamepad's start) pauses when the room allows it and the player is alive: the screen darkens,
the music goes quiet and everything else stops, so the clock stops too[^27]. The clip shows it on the first level: the pause screen
lists the level, its depth in feet, the money, the kills, the time on the level and in all, and the saves,
with the keys it takes[^28][^29].

- **Escape** returns to the game[^30].
- **F1** kills the player, which ends the game as any death does, unless an [Ankh](https://spelunky.ai/wiki/ankh) revives him[^31]. It's only shown, and only works, in a level.
- **F10** quits Spelunky[^32].

With the gamepad on, the screen names its buttons instead: start returns, bomb dies and rope quits[^33]. The title screen, once the player stands in it, and the
high scores room can be paused too[^34][^35].

### Other screens

- **The intro and the title screen.** Enter, Escape, attack or start skip the intro and the title
  screen's opening[^36][^37]. On the title screen, F2 opens the
  level editor and F3 the custom levels[^38][^39]. Climbing its rope to the top shows the credits and
  quits[^40][^41].
- **Music.** M turns the music off and on[^42].
- **Between levels.** Attack or start goes on to the next level once the tally has finished; pressed
  earlier, it hurries the tally ([Scoring](https://spelunky.ai/wiki/scoring#between-levels))[^43].
  Up and down raise and lower a donation to the [Tunnel Man](https://spelunky.ai/wiki/tunnel-man)[^44].
- **Game over.** Attack or start first finishes counting the money, then goes to the high scores room[^45].
- **The ending.** Enter, Escape, attack or start skip the volcano and the escape, straight to the final
  score ([Endings](https://spelunky.ai/wiki/endings))[^46][^47].

### The gamepad

The gamepad works when the settings program has turned it on (`settings.cfg`'s fourth line)[^48]. A direction is the hat's or the stick's, and a button may be
one of the first 20 or a trigger[^49][^50].

## Numbers

|                                                | Value                              |       |
| ---------------------------------------------- | ---------------------------------- | ----- |
| Walking, at most                               | 3 pixels per step (90 per second)  | [^51] |
| Running, at most                               | 6 pixels per step (180 per second) | [^52] |
| Steps a run is held before the player runs     | 10                                 | [^53] |
| Steps up or down is held before the view moves | 31                                 | [^54] |
| The view's speed when it moves                 | 4 pixels per step                  | [^55] |

## Examples

- The clip above pauses on the first level, resumes, pauses again and dies with F1[^29].
- With keys set in the settings program, the game plays on them: a replay plays with up and down both W,
  jump and attack both Space, and item and run both E[^56].

## Quirks

- **The pause screen's keys aren't only the ones it shows.** The bomb key kills the player like F1, and the
  rope key quits like F10, on the keyboard as well as the gamepad[^57][^58].
- **The flare key does nothing.** The game reads it with the others, but the line that would check it is
  commented out, and so is the code that would light a flare[^16][^59]; the settings program never asks for it[^57]. A replay presses it in the tutorial, and the oracle's run is the same as without the
  press[^56].
- **Playing as the [Damsel](https://spelunky.ai/wiki/damsel), the climb out by the title screen's rope shows the Spelunker.** She
  climbs the rope as herself, but the figure that climbs on out of sight at the top is set to her sprite and
  then, by an "else" that belongs to the [Tunnel Man](https://spelunky.ai/wiki/tunnel-man)'s check, to the Spelunker's[^60][^57]. The clip shows her change at the top
  of the rope[^61][^62].

## FAQ

### What are the controls in Spelunky Classic?

The arrow keys move, look and climb, Z jumps, X whips or throws what the player holds, C switches between a bomb, a rope and the held item, A throws a bomb, S throws a rope, Shift runs, P pays in a shop and Escape pauses. Up enters a door.

### How do you run in Spelunky Classic?

Hold Shift while walking, or hold the attack key (X), which starts a run after 10 steps. Running is up to 6 pixels per step, where walking is 3.

### Can you play Spelunky Classic with a gamepad?

Yes, with the gamepad turned on in the settings program. Its stick or hat moves the player, and each action has a button (jump 2, attack 1, item 3, run 5 by default); the keyboard keeps working beside it.

### How do you quit or restart a level in Spelunky Classic?

Pause with Escape: on the pause screen F1 kills the player, which ends the game unless he has an Ankh, and F10 quits Spelunky. The bomb key and the rope key do the same as F1 and F10 there.

### What does the flare key do in Spelunky Classic?

Nothing. The game reads a flare key from its key settings, but the line that would check it is commented out.

## Gallery

**Clip: The Damsel leaves as the Spelunker.** Playing as the Damsel, the player climbs the title screen's rope to quit. She climbs as the Damsel, but at the top the figure that climbs on out of sight is the Spelunker. ([video](https://spelunky.ai/wiki/media/015c74cb8645abba/clips/quirks/damsel-title-rope-spelunker/clip.mp4))

## See also

- **Related:** [Throwing](https://spelunky.ai/wiki/throwing), [Scoring](https://spelunky.ai/wiki/scoring), [Endings](https://spelunky.ai/wiki/endings)

## References

[^1]: `scripts/checkJump.gml:1-4`

[^2]: `scripts/scrInit.gml:38-59`

[^3]: `scripts/scrInit.gml:90-140`

[^4]: `scripts/characterStepEvent.gml:12-26`

[^5]: `scripts/characterStepEvent.gml:609-610`

[^6]: `objects/oPlayer1/step.gml:759-766`

[^7]: `objects/oPlayer1/step.gml:561`

[^8]: `objects/oPlayer1/step.gml:1203-1209`

[^9]: `scripts/characterStepEvent.gml:494-505`

[^10]: `scripts/characterStepEvent.gml:294-338`

[^11]: `objects/oPlayer1/step.gml:1175-1201`

[^12]: `objects/oPlayer1/step.gml:954-1044`

[^13]: `scripts/characterStepEvent.gml:117-121`

[^14]: `objects/oPlayer1/step.gml:1137-1174`

[^15]: `objects/oPlayer1/step.gml:1045-1062`

[^16]: `objects/oPlayer1/step.gml:413`

[^17]: `objects/oPlayer1/step.gml:1359-1450`

[^18]: `scripts/checkStartPressed.gml:1-4`

[^19]: `scripts/characterStepEvent.gml:71-88`

[^20]: `objects/oPlayer1/step.gml:406-410`

[^21]: `objects/oPlayer1/step.gml:385-397`

[^22]: `scripts/characterStepEvent.gml:797-800`

[^23]: `scripts/characterStepEvent.gml:117-129`

[^24]: `scripts/characterStepEvent.gml:685-698`

[^25]: `scripts/characterStepEvent.gml:700-727`

[^26]: `scripts/scrInit.gml:32`

[^27]: `objects/oScreen/step_begin.gml:34-61`

[^28]: `objects/oScreen/step_begin.gml:85-117`

[^29]: Clip controls/pause

[^30]: `objects/oScreen/step_begin.gml:62-72`

[^31]: `objects/oScreen/keypress_F1.gml:1-11`

[^32]: `objects/oScreen/keypress_F10.gml:1-2`

[^33]: `objects/oScreen/step_begin.gml:116-122`

[^34]: `objects/oTitle/create.gml:72-89`

[^35]: `objects/oHighscores/create.gml:1`

[^36]: `objects/oIntro/step.gml:1-4`

[^37]: `objects/oTitle/step.gml:1-23`

[^38]: `objects/oTitle/keypress_F2.gml:1-3`

[^39]: `objects/oTitle/keypress_F3.gml:1-8`

[^40]: `objects/oPlayer1/step.gml:49-60`

[^41]: `objects/oCredits1/step.gml:48`

[^42]: `objects/oGame/keypress_M.gml:1-22`

[^43]: `objects/oTransition/step.gml:1-33`

[^44]: `objects/oTransition/step.gml:35-58`

[^45]: `objects/oPlayer1/step.gml:907-930`

[^46]: `objects/oEnd/step.gml:1-14`

[^47]: `objects/oEnd2/step.gml:1-10`

[^48]: `scripts/scrInit.gml:73-75`

[^49]: `objects/oGamepad/step.gml:1-57`

[^50]: `scripts/checkJoyButton.gml:1-23`

[^51]: `scripts/characterStepEvent.gml:799`

[^52]: `scripts/characterStepEvent.gml:690`

[^53]: `scripts/characterStepEvent.gml:685`

[^54]: `objects/oPlayer1/step.gml:389`

[^55]: `objects/oPlayer1/step.gml:390`

[^56]: Replay `fidelity/replays/config-keys-tutorial.txt`

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

[^58]: Replay `fidelity/replays/flow-pause-game-over-new-game.txt`

[^59]: `objects/oPlayer1/step.gml:1321-1358`

[^60]: `objects/oPDummy5/create.gml:6-8`

[^61]: Clip quirks/damsel-title-rope-spelunker

[^62]: Replay `fidelity/replays/title-damsel-rope.txt`

### Source code

- `scripts/scrInit.gml`
- `scripts/characterStepEvent.gml`
- `objects/oPlayer1/step.gml`
- `objects/oScreen/step_begin.gml`
- `objects/oGamepad/step.gml`
- `scripts/checkJump.gml`
