Spikes
Verified against the spelunky.ai port v0.1.10 on .
Spikes are a trap in Spelunky Classic, a row of points on the ground that kills the player who falls onto them, whatever his hearts, but not one walking across.
Spikes stand on top of a block, in pits and along floors, in the Mines, the Jungle and the Ice Caves. They don't move and never wear out: they hurt only what falls onto them, and kill it outright, the player included. Walking over them on level ground is safe.
How it works
#Spikes do nothing on their own: the player's and the monsters' code each step checks whether they're falling onto some. The player dies on them if, touching them, he's moving down and has been falling for more than 4 steps, or is stunned [2]. The clip shows both sides of the rule: the player walks across two Spikes on the floor unhurt, then walks off a ledge onto a row of them one block down and dies as he lands.
A player who dies on them stays on them, sinking slowly into the points, and drips blood [3] [4]. The Spikes he dies on turn bloody [5].
Damage
#| Victim | What happens | |
|---|---|---|
| The player | Loses 99 hearts, every heart he can have, if he has been falling for more than 4 steps or is stunned | [6] |
| Most monsters | Killed (hit points set to 0) if falling faster than 2 pixels a step | [7] |
| A Damsel | Killed if falling faster than 2 pixels a step | [8] |
A death on Spikes is counted in the end-of-game statistics' spikes row [9]. A monster killed on them doesn't count as the player's kill [10]. The monsters' check is in the code most monsters share, so those whose own step event replaces it, such as the Bat and the Giant Spider, fall onto Spikes unharmed.
Locations
#Spikes are placed by the room templates' spike tiles, on top of a block. Most of these tiles hold Spikes with a 1 in 3 chance; some are always Spikes:
| Area | Spikes | |
|---|---|---|
| The Mines | 1 in 3 for each spike tile | [11] |
| The Jungle | 1 in 3 for each spike tile, and always on the floor of one pit room, all spike tiles | [12] |
| The Black Market | As the Jungle | [13] |
| The Ice Caves | Always, on every spike tile | [14] |
| A Yeti lair | 1 in 3 for each spike tile, and always on its own spike-floored tiles | [15] [16] |
They're also in the Moon challenge room, a bonus room [17], and in custom levels as the
level editor's tile ^ [18].
Avoiding
#- Walk, don't drop. Walking across Spikes on level ground is safe. Jumping onto them, or walking off a ledge onto them, is a fall of more than 4 steps, which kills.
- Don't land on them stunned. A stunned player dies on Spikes however short his fall, so a hit that knocks him onto them kills him.
- Remove the block under them. Spikes are destroyed with the block they stand on [19], and a Bomb's blast or a Mattock removes any Spikes left with nothing under them [20] [21].
- Spike Shoes don't help: the player's check for Spikes doesn't look at them.
Interactions
#- Boulders destroy the Spikes on the blocks they break [22].
- Treasure. Level generation doesn't put gold or gems on a block with Spikes on it [23], and the locked chest of the Udjat Eye's level avoids them too [24].
- A stunned monster thrown onto them dies, if it runs the shared code, as on any fast fall onto Spikes.
Trivia
#- Spikes have no code of their own beyond being breakable: everything they do is in the code of what falls onto them [25].
- Level generation once lined the bottom of the Ice Caves with Spikes: the line is still there, commented out, beside the dark rock it lays instead [26].
FAQ
#- Do spikes kill you instantly in Spelunky Classic?
Only when the player falls onto them. Landing on Spikes after falling for more than 4 steps, or while stunned, takes every heart he has. Walking across them, or standing on them, does nothing.
- Can you walk on spikes in Spelunky Classic?
Yes. Spikes only hurt the player while he's falling onto them, so walking across them on level ground is safe. Jumping onto them, or dropping onto them from a ledge, kills him.
- Do Spike Shoes protect you from spikes in Spelunky Classic?
No. Nothing protects the player from falling onto Spikes: the check for them looks only at how he's falling. Spike Shoes make his stomps stronger, nothing more.
See also
#- Related
References
#objects/oPlayer1/step.gml:1693-1710objects/oPlayer1/step.gml:1682-1693objects/oPlayer1/step.gml:1685-1691objects/oPlayer1/step.gml:1810-1813objects/oPlayer1/step.gml:1705-1709objects/oPlayer1/step.gml:1693-1703objects/oEnemy/step.gml:108-128objects/oDamsel/step.gml:93-110objects/oPlayer1/step.gml:1697objects/oEnemy/step.gml:120scripts/scrRoomGen.gml:343scripts/scrRoomGen2.gml:351-352scripts/scrRoomGenMarket.gml:266-267scripts/scrRoomGen3.gml:307scripts/scrRoomGenYeti.gml:317scripts/scrRoomGenYeti.gml:423-426- Room
rMoon, as the room editor placed it scripts/scrCreateTileObj.gml:225-228objects/oSolid/destroy.gml:9-13objects/oExplosion/collision_oSolid.gml:22-28objects/oMattockHit/other_animation_end.gml:30-36objects/oBoulder/collision_oSolid.gml:16-23scripts/scrTreasureGen.gml:32-37scripts/scrEntityGen.gml:81-93objects/oSpikes/create.gml:1-3scripts/scrInitLevel.gml:131-137objects/oEnemy/step.gml:108-124
Source code
objects/oSpikes/create.gmlobjects/oPlayer1/step.gmlobjects/oEnemy/step.gmlobjects/oDamsel/step.gmlobjects/oSolid/destroy.gmlobjects/oExplosion/collision_oSolid.gmlscripts/scrRoomGen.gmlscripts/scrRoomGen2.gmlscripts/scrRoomGen3.gml