The Mines
Verified against the spelunky.ai port v0.1.10 on .
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.
Every new game starts here, on level 1, and the four levels down to the Jungle are brick caves, with ladders between their ledges. Level generation fills them with Snakes on the ground and Bats and Spiders on the ceilings, turns stone blocks into Arrow Traps, and from level 2 builds shops, Kali's altars and the 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].
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, 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 room, with a giant tiki head and its 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].
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 | 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 | Hanging, on a dark level only | 1 in 40, once the roll for a lamp fails | [25] |
| Bat | Hanging | 1 in 60 | [26] |
| Spider | Hanging | 1 in 80, once the Bat's fails | [27] |
| Snake | On top | 1 in 60 | [28] |
| 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 waiting to rise. From level 2, the Ghost comes to a level the player stays on for 5,000 steps [30].
Hazards
#- Arrow Traps. 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 come with the ground chunks that have a spike pit, one tile in three [32] [33].
- Webs 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 of an idol room comes down when the 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 1 in 100, else a Jar 1 in 40 | [41] |
| A nook (rock above and to one side) | A Web 1 in 5; else a Crate 1 in 10, a Chest 1 in 15, a Damsel 1 in 8 (one a level), bones, a Gold Bar 1 in 3, 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 waiting to rise [45].
The bricks hold more. About one in five shows a vein of gold, which breaks into three Gold Chunks, and one in ten a rich vein, which adds a 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: 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 [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
elsewith a check for the level's edge, where a blocked move would do nothing and be rolled again, but theelsebelongs to the nearestif[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, level 5.
- What monsters live in the Mines in Spelunky Classic?
Snakes, Bats, Spiders and, rarely, Cavemen, with a Giant Spider on one level in six. A snake pit holds more Snakes, a dark level has Scarabs, and the 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, and there are Spikes, webs and, in an idol room, a Boulder.
See also
#- Found here
- Arrow Trap
- Bat
- Boulder
- Bow
- Cape
- Caveman
- Chest
- Climbing Gloves
- Compass
- Crate
- Ghost
- Giant Spider
- Gold Bar
- Gold Bars
- Gold Chunk (In the rock's gold veins)[47]
- Gold Nugget (In the rock's rich gold veins)[56]
- Golden Idol
- Jar
- Jetpack
- Kapala (Kali's gift, at her altar)[57]
- Machete
- Mattock
- Parachute
- Paste
- Pistol
- Pitcher's Mitt
- Rock
- Scarab
- Shotgun
- Skeleton
- Skull
- Snake
- Spectacles
- Spider
- Spike Shoes
- Spikes
- Spring Shoes
- Teleporter
- Udjat Eye (In a locked chest on level 2, 3 or 4)[48]
- Web
- Web Cannon
References
#scripts/scrInitLevel.gml:24-29objects/oPlayer1/other_animation_end.gml:72-86- Clip mines/start
scripts/scrRoomGen.gml:24-45scripts/scrInitLevel.gml:117-126scripts/scrLevelGen.gml:25-31scripts/scrLevelGen.gml:89-133scripts/scrRoomGen.gml:85-239scripts/scrRoomGen.gml:242-315scripts/scrRoomGen.gml:325-340scripts/scrRoomGen.gml:85-121scripts/scrRoomGen.gml:87-91scripts/scrRoomGen.gml:92-101scripts/scrLevelGen.gml:239-297scripts/scrLevelGen.gml:138-185scripts/scrClearGlobals.gml:55scripts/scrInitLevel.gml:167-174scripts/scrClearGlobals.gml:54- Quirk 1 (docs/quirks.md)
objects/oPlayer1/other_animation_end.gml:63-70- Clip mines/exit
scripts/scrEntityGen.gml:35-74scripts/scrEntityGen.gml:32-34scripts/scrEntityGen.gml:52-60scripts/scrEntityGen.gml:61-62scripts/scrEntityGen.gml:63scripts/scrEntityGen.gml:64scripts/scrEntityGen.gml:69scripts/scrEntityGen.gml:70objects/oGame/step.gml:39-46scripts/scrEntityGen.gml:145-171scripts/scrRoomGen.gml:273-284scripts/scrRoomGen.gml:343scripts/characterStepEvent.gml:294-305scripts/characterStepEvent.gml:743-748objects/oWeb/collision_oEnemy.gml:1-5objects/oWeb/collision_oItem.gml:1-5- Replay
fidelity/replays/mines-seed-5.txt scripts/scrRoomGen.gml:173-204scripts/scrTreasureGen.gml:26-29scripts/scrTreasureGen.gml:42-46scripts/scrTreasureGen.gml:47-94scripts/scrTreasureGen.gml:95-115scripts/scrTreasureGen.gml:116-133scripts/scrTreasureGen.gml:80-88objects/oBrick/create.gml:7-16objects/oBrick/destroy.gml:9-29scripts/scrInitLevel.gml:178-184scripts/scrRoomGen.gml:212-218scripts/scrRoomGen.gml:471-481objects/oTransition/create.gml:47-51scripts/scrRoomGen.gml:1-5scripts/scrLevelGen.gml:1-6scripts/scrLevelGen.gml:96-111- Replay
fidelity/replays/mines-seed-1.txt objects/oBrick/destroy.gml:18-29scripts/scrRoomGen.gml:363-369
Source code
scripts/scrInitLevel.gmlscripts/scrLevelGen.gmlscripts/scrRoomGen.gmlscripts/scrEntityGen.gmlscripts/scrTreasureGen.gmlobjects/oBrick/create.gml
What links here
#- Arrow Trap
- Bat
- Boulder
- Bow
- Cape
- Caveman
- Chest
- Climbing Gloves
- Compass
- Crate
- Crystal Skull
- Ghost
- Giant Spider
- Gold Bar
- Gold Bars
- Gold Chunk
- Gold Nugget
- Golden Idol
- Jar
- Jetpack
- Kapala
- Machete
- Mattock
- Parachute
- Paste
- Pistol
- Pitcher's Mitt
- Rock
- Scarab
- Shotgun
- Skeleton
- Skull
- Snake
- Spectacles
- Spider
- Spike Shoes
- Spikes
- Spring Shoes
- Teleporter
- The Ice Caves
- The Jungle
- The Temple
- Udjat Eye
- Web
- Web Cannon