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.

# The Mines

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

The Mines are the first area of Spelunky Classic, levels 1–4: brick caves of ladders, Snakes, Bats, Spiders and arrow traps, and the game's first shops.

![A square of brown brick with a darker mortar pattern](https://spelunky.ai/wiki/media/197bfc59562320b5/sprites/sBrick/frames/0%404x.png)

| The Mines |         |
| --------- | ------- |
| Levels    | 1–4[^1] |

Every new game starts here, on level 1, and the four levels down to [the Jungle](https://spelunky.ai/wiki/jungle) are brick
caves, with ladders between their ledges. Level generation fills them with [Snakes](https://spelunky.ai/wiki/snake) on the ground and
[Bats](https://spelunky.ai/wiki/bat) and [Spiders](https://spelunky.ai/wiki/spider) on the ceilings, turns stone blocks into [Arrow Traps](https://spelunky.ai/wiki/arrow-trap), and
from level 2 builds shops, Kali's altars and the [Udjat Eye](https://spelunky.ai/wiki/udjat-eye)'s locked chest. Each level can
instead be a snake pit or a dark level.

## Generation

The Mines are levels 1 to 4: the game's level type is the Mines' unless the level number puts it in a
later area[^1]. A new game's first level is reached through the
title screen's START door; the very first game a player starts goes to the Tutorial instead[^2]. In the first clip, the player walks into the
START door and level 1 loads[^3].

**Clip: Into the Mines.** On the title screen, the player walks left into the START door, and the first level of the Mines loads: brick ledges, ladders and stone blocks. ([video](https://spelunky.ai/wiki/media/197bfc59562320b5/clips/mines/start/clip.mp4))

A level is a grid of four rooms by four, each 10 tiles wide and 8 high (a tile is 16 pixels), inside a
border of bricks that can't be destroyed[^4][^5]. First, a path is laid: it starts in a random room of the top
row, which holds the entrance, and wanders left and right, dropping a row at random, until it leaves the
bottom row, where the last room it reached holds the exit[^6][^7]. The path's rooms are built from layouts that leave a way
through: open rooms, ladders, and drops into the room below. The rest are side rooms, which needn't lead
anywhere[^8]. Each layout has slots that take one of a set of
5-by-3 chunks at random: a platform, a mound with [Spikes](https://spelunky.ai/wiki/spikes), an overhang[^9]. Then every tile is made: a brick, or, one time in ten, a
stone block[^10].

Then the side rooms get their features[^11]:

| Room                                                                                                                                 | Chance                                                                                   |       |
| ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | ----- |
| Kali's altar                                                                                                                         | 1 in 16 for each side room from level 2, once a level                                    | [^12] |
| [Golden Idol](https://spelunky.ai/wiki/golden-idol) room, with a giant tiki head and its [Boulder](https://spelunky.ai/wiki/boulder) | 1 in 10 for each side room off the bottom row, once the altar's roll fails, once a level | [^13] |
| A shop                                                                                                                               | From level 2 (below)                                                                     | [^14] |

On top of that, a level may be special. Three side rooms one above the other, from the top row or the
second, become a snake pit, 1 in 8 for each such column, once a level; from the top row, the
pit runs down all four rows when the bottom room is a side room too[^15][^16]. From level 2, a
level may be a dark level, 1 in 12, at most once in the area, and never the first level after the title screen, nor one after a level finished 20 seconds or less past a whole minute on its clock[^17][^18][^19].

Taking a level's exit leads to the screen between levels, which counts up what the player found, and on to
the next level[^20]. In the second clip, the player
climbs down through level 1 and takes its exit[^21].

**Clip: Through a Mines level.** In the Mines' first level, the player drops down past Bats, whips a Snake beside a Damsel, and takes the exit without losing a heart. The screen between levels counts up his time, loot, kills and money. ([video](https://spelunky.ai/wiki/media/197bfc59562320b5/clips/mines/exit/clip.mp4))

## Inhabitants

Level generation goes over every block outside the shops and below the top row, and outside the room the
entrance is in, and may hang a monster under it, if the two tiles below are open, or stand one on top of it[^22]:

| Monster                                               | Where                                                 | Chance                                                    |            |
| ----------------------------------------------------- | ----------------------------------------------------- | --------------------------------------------------------- | ---------- |
| [Giant Spider](https://spelunky.ai/wiki/giant-spider) | Hanging, where there's room for its two blocks by two | 1 in 40 for each block, on one level in six, once a level | [^23][^24] |
| [Scarab](https://spelunky.ai/wiki/scarab)             | Hanging, on a dark level only                         | 1 in 40, once the roll for a lamp fails                   | [^25]      |
| [Bat](https://spelunky.ai/wiki/bat)                   | Hanging                                               | 1 in 60                                                   | [^26]      |
| [Spider](https://spelunky.ai/wiki/spider)             | Hanging                                               | 1 in 80, once the Bat's fails                             | [^27]      |
| [Snake](https://spelunky.ai/wiki/snake)               | On top                                                | 1 in 60                                                   | [^28]      |
| [Caveman](https://spelunky.ai/wiki/caveman)           | On top                                                | 1 in 800, once the Snake's fails                          | [^29]      |

The Mines are the only area whose generation makes Snakes, Spiders and Giant Spiders. A
snake pit adds a shaft full of Snakes. The treasure's piles of bones (below) may be a
[Skeleton](https://spelunky.ai/wiki/skeleton) waiting to rise. From level 2, the [Ghost](https://spelunky.ai/wiki/ghost) comes to a level the player stays on
for 5,000 steps[^30].

## Hazards

- **[Arrow Traps](https://spelunky.ai/wiki/arrow-trap).** One stone block in four becomes an Arrow Trap, if it's outside a shop,
  more than 48 pixels from the entrance (and not on the entrance's row within 144 pixels of it), and has a
  block behind it and open ground in front: two tiles on one side, three on the other[^31].
- **[Spikes](https://spelunky.ai/wiki/spikes)** come with the ground chunks that have a spike pit, one tile in three[^32][^33].
- **[Webs](https://spelunky.ai/wiki/web)** hang in nooks and tunnels (below). One holds the player, who struggles free by jumping, and
  stops monsters and thrown items[^34][^35][^36][^37].
- **The [Boulder](https://spelunky.ai/wiki/boulder)** of an idol room comes down when the [Golden Idol](https://spelunky.ai/wiki/golden-idol) is lifted.

## Items and shops

### Shops

From level 2, a level may have a shop: always on level 2, two times in three on level 3, one time in two on
level 4 (the code's `rand(1, level) <= 2`). It goes in a side room beside a room of the path, and only if
there is one: a side room qualifies when the room to its right is one the path crosses or leaves downward
(not one it drops into), or, in the rightmost column, when the room to its left is[^14].
So a level whose side rooms beside the path all have it on their left, outside the rightmost column, has no
shop: seed 5's level 2 is one[^19][^38]. Its kind is one of seven, each as
likely: a General Store, Bomb Shop, Weapon Shop,
Rare Shop, Clothing Shop, Dice House or
Kissing Parlor[^39].

### Treasure

Level generation scatters loose things over every block outside the shops (the same in every area but
Olmec's Lair), keeping them 32 pixels from the entrance and the exit and 64 from a Golden
Idol[^40]:

| Spot                                | What, and the chance                                                                                                                                                                                                                                                                                                                                              |       |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| Any block with room above           | A [Rock](https://spelunky.ai/wiki/rock) 1 in 100, else a [Jar](https://spelunky.ai/wiki/jar) 1 in 40                                                                                                                                                                                                                                                              | [^41] |
| A nook (rock above and to one side) | A [Web](https://spelunky.ai/wiki/web) 1 in 5; else a [Crate](https://spelunky.ai/wiki/crate) 1 in 10, a [Chest](https://spelunky.ai/wiki/chest) 1 in 15, a Damsel 1 in 8 (one a level), bones, a [Gold Bar](https://spelunky.ai/wiki/gold-bar) 1 in 3, [Gold Bars](https://spelunky.ai/wiki/gold-bars), or a big gem, each roll made once the ones before it fail | [^42] |
| A tunnel (rock on both sides)       | A web 1 in 10; else a Gold Bar 1 in 4, Gold Bars 1 in 8, bones, or a big gem                                                                                                                                                                                                                                                                                      | [^43] |
| Open ground                         | A Gold Bar 1 in 40, else Gold Bars 1 in 50, else bones                                                                                                                                                                                                                                                                                                            | [^44] |

The webs' odds are meant to be 1 in 60 away from a Giant Spider, but a typo makes the code always take its
near-a-Giant-Spider odds[^19]. The bones' odds grow with the level number, and one pile in
eight is a [Skeleton](https://spelunky.ai/wiki/skeleton) waiting to rise[^45].

The bricks hold more. About one in five shows a vein of gold, which breaks into three
[Gold Chunks](https://spelunky.ai/wiki/gold-chunk), and one in ten a rich vein, which adds a [Gold Nugget](https://spelunky.ai/wiki/gold-nugget). Of the
rest, 1 in 100 holds a big sapphire, and rarer ones a big emerald, a big ruby, or an item[^46][^47].

## Secrets

- **Kali's altars**, from level 2 (above).
- **The [Udjat Eye](https://spelunky.ai/wiki/udjat-eye)**: one level from 2 to 4 hides a locked chest and its key[^48].
- **The snake pit**'s bottom holds big rubies and a free [Mattock](https://spelunky.ai/wiki/mattock)[^49][^50].
- **Shortcuts.** In the screen after level 4, the Tunnel Man may ask for money toward a shortcut, which
  opens a door to the Jungle on the title screen[^51].

## Trivia

- The room script's header calls the Mines "Area 1"[^52], and its
  comment explains the layouts: "ROOMS are 10x8 tile areas", and "OBSTACLES are 5x3 tile chunks that are
  randomized within rooms"[^4].
- The path script's own header says the path is the route to the exit with "no-bombs/no-rope (in theory)"[^53].
- A roll to move the path toward a room it has already taken moves it the other way instead, or down a row
  when both sides are taken; only at the level's edge does it do nothing. The code's indentation pairs each `else` with a check for the level's edge,
  where a blocked move would do nothing and be rolled again, but the `else` belongs to the nearest `if`[^54][^19][^55].

## FAQ

### What levels are the Mines in Spelunky Classic?

Levels 1 to 4. Every game starts in the Mines, and taking level 4's exit leads to [the Jungle](https://spelunky.ai/wiki/jungle), level 5.

### What monsters live in the Mines in Spelunky Classic?

[Snakes](https://spelunky.ai/wiki/snake), [Bats](https://spelunky.ai/wiki/bat), [Spiders](https://spelunky.ai/wiki/spider) and, rarely, [Cavemen](https://spelunky.ai/wiki/caveman), with a [Giant Spider](https://spelunky.ai/wiki/giant-spider) on one level in six. A snake pit holds more Snakes, a dark level has [Scarabs](https://spelunky.ai/wiki/scarab), and the [Ghost](https://spelunky.ai/wiki/ghost) comes to a level the player stays on too long.

### Are there shops in the Mines in Spelunky Classic?

Yes, from level 2: level 2 always rolls one, level 3 two times in three and level 4 one time in two, but a level gets its shop only if a side room beside the path qualifies, and one with the path on its left only does in the rightmost column. The shop is one of seven kinds, each as likely.

### Are there traps in the Mines in Spelunky Classic?

Yes. One stone block in four that faces open ground becomes an [Arrow Trap](https://spelunky.ai/wiki/arrow-trap), and there are [Spikes](https://spelunky.ai/wiki/spikes), webs and, in an idol room, a [Boulder](https://spelunky.ai/wiki/boulder).

## See also

- **Found here:** [Arrow Trap](https://spelunky.ai/wiki/arrow-trap), [Bat](https://spelunky.ai/wiki/bat), [Boulder](https://spelunky.ai/wiki/boulder), [Bow](https://spelunky.ai/wiki/bow), [Cape](https://spelunky.ai/wiki/cape), [Caveman](https://spelunky.ai/wiki/caveman), [Chest](https://spelunky.ai/wiki/chest), [Climbing Gloves](https://spelunky.ai/wiki/climbing-gloves), [Compass](https://spelunky.ai/wiki/compass), [Crate](https://spelunky.ai/wiki/crate), [Ghost](https://spelunky.ai/wiki/ghost), [Giant Spider](https://spelunky.ai/wiki/giant-spider), [Gold Bar](https://spelunky.ai/wiki/gold-bar), [Gold Bars](https://spelunky.ai/wiki/gold-bars), [Gold Chunk](https://spelunky.ai/wiki/gold-chunk) (In the rock's gold veins)[^47], [Gold Nugget](https://spelunky.ai/wiki/gold-nugget) (In the rock's rich gold veins)[^56], [Golden Idol](https://spelunky.ai/wiki/golden-idol), [Jar](https://spelunky.ai/wiki/jar), [Jetpack](https://spelunky.ai/wiki/jetpack), [Kapala](https://spelunky.ai/wiki/kapala) (Kali's gift, at her altar)[^57], [Machete](https://spelunky.ai/wiki/machete), [Mattock](https://spelunky.ai/wiki/mattock), [Parachute](https://spelunky.ai/wiki/parachute), [Paste](https://spelunky.ai/wiki/paste), [Pistol](https://spelunky.ai/wiki/pistol), [Pitcher's Mitt](https://spelunky.ai/wiki/pitchers-mitt), [Rock](https://spelunky.ai/wiki/rock), [Scarab](https://spelunky.ai/wiki/scarab), [Shotgun](https://spelunky.ai/wiki/shotgun), [Skeleton](https://spelunky.ai/wiki/skeleton), [Skull](https://spelunky.ai/wiki/skull), [Snake](https://spelunky.ai/wiki/snake), [Spectacles](https://spelunky.ai/wiki/spectacles), [Spider](https://spelunky.ai/wiki/spider), [Spike Shoes](https://spelunky.ai/wiki/spike-shoes), [Spikes](https://spelunky.ai/wiki/spikes), [Spring Shoes](https://spelunky.ai/wiki/spring-shoes), [Teleporter](https://spelunky.ai/wiki/teleporter), [Udjat Eye](https://spelunky.ai/wiki/udjat-eye) (In a locked chest on level 2, 3 or 4)[^48], [Web](https://spelunky.ai/wiki/web), [Web Cannon](https://spelunky.ai/wiki/web-cannon)

## References

[^1]: `scripts/scrInitLevel.gml:24-29`

[^2]: `objects/oPlayer1/other_animation_end.gml:72-86`

[^3]: Clip mines/start

[^4]: `scripts/scrRoomGen.gml:24-45`

[^5]: `scripts/scrInitLevel.gml:117-126`

[^6]: `scripts/scrLevelGen.gml:25-31`

[^7]: `scripts/scrLevelGen.gml:89-133`

[^8]: `scripts/scrRoomGen.gml:85-239`

[^9]: `scripts/scrRoomGen.gml:242-315`

[^10]: `scripts/scrRoomGen.gml:325-340`

[^11]: `scripts/scrRoomGen.gml:85-121`

[^12]: `scripts/scrRoomGen.gml:87-91`

[^13]: `scripts/scrRoomGen.gml:92-101`

[^14]: `scripts/scrLevelGen.gml:239-297`

[^15]: `scripts/scrLevelGen.gml:138-185`

[^16]: `scripts/scrClearGlobals.gml:55`

[^17]: `scripts/scrInitLevel.gml:167-174`

[^18]: `scripts/scrClearGlobals.gml:54`

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

[^20]: `objects/oPlayer1/other_animation_end.gml:63-70`

[^21]: Clip mines/exit

[^22]: `scripts/scrEntityGen.gml:35-74`

[^23]: `scripts/scrEntityGen.gml:32-34`

[^24]: `scripts/scrEntityGen.gml:52-60`

[^25]: `scripts/scrEntityGen.gml:61-62`

[^26]: `scripts/scrEntityGen.gml:63`

[^27]: `scripts/scrEntityGen.gml:64`

[^28]: `scripts/scrEntityGen.gml:69`

[^29]: `scripts/scrEntityGen.gml:70`

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

[^31]: `scripts/scrEntityGen.gml:145-171`

[^32]: `scripts/scrRoomGen.gml:273-284`

[^33]: `scripts/scrRoomGen.gml:343`

[^34]: `scripts/characterStepEvent.gml:294-305`

[^35]: `scripts/characterStepEvent.gml:743-748`

[^36]: `objects/oWeb/collision_oEnemy.gml:1-5`

[^37]: `objects/oWeb/collision_oItem.gml:1-5`

[^38]: Replay `fidelity/replays/mines-seed-5.txt`

[^39]: `scripts/scrRoomGen.gml:173-204`

[^40]: `scripts/scrTreasureGen.gml:26-29`

[^41]: `scripts/scrTreasureGen.gml:42-46`

[^42]: `scripts/scrTreasureGen.gml:47-94`

[^43]: `scripts/scrTreasureGen.gml:95-115`

[^44]: `scripts/scrTreasureGen.gml:116-133`

[^45]: `scripts/scrTreasureGen.gml:80-88`

[^46]: `objects/oBrick/create.gml:7-16`

[^47]: `objects/oBrick/destroy.gml:9-29`

[^48]: `scripts/scrInitLevel.gml:178-184`

[^49]: `scripts/scrRoomGen.gml:212-218`

[^50]: `scripts/scrRoomGen.gml:471-481`

[^51]: `objects/oTransition/create.gml:47-51`

[^52]: `scripts/scrRoomGen.gml:1-5`

[^53]: `scripts/scrLevelGen.gml:1-6`

[^54]: `scripts/scrLevelGen.gml:96-111`

[^55]: Replay `fidelity/replays/mines-seed-1.txt`

[^56]: `objects/oBrick/destroy.gml:18-29`

[^57]: `scripts/scrRoomGen.gml:363-369`

### Source code

- `scripts/scrInitLevel.gml`
- `scripts/scrLevelGen.gml`
- `scripts/scrRoomGen.gml`
- `scripts/scrEntityGen.gml`
- `scripts/scrTreasureGen.gml`
- `objects/oBrick/create.gml`
