Trap Block
Verified against the spelunky.ai port v0.1.10 on .
Trap blocks are a trap in Spelunky Classic, skull blocks under a golden idol that give way when the idol is lifted, dropping the player.
A trap block is a tan stone block carved with a skull, a solid block like any other until a golden idol standing on it is lifted. Level generation builds them in two places: the floor of the Jungle's idol room, over a pool of water, and the top of the Sacrifice Pit, a Temple level, over a drop into lava. Lifting the idol takes them away, and the player falls with it.
How it works
#The Jungle's idol room
#The Jungle's idol room has the idol on a floor of six trap blocks across the middle of the room, an open row below them and a pool of water below that [3]. Each block is given a delay when it's made: 40 steps less its distance in pixels from the idol, but not below 0, which comes to 0 for the outer two, 16 for the next two and 32 for the two under the idol [4] [5].
When the player lifts the idol, every trap block within 90 pixels of him starts its delay [6]. Each counts its delay down a step at a time, then crumbles into rubble with a thump that shakes the screen [7] [8]. So the floor goes from the outside in: the outer two on the step he lifts it, the next two 16 steps later, and the two under him 32 steps later, and he drops into the water with the idol. The clip shows the player dropping into a Jungle idol room, lifting the idol, and falling into the pool unhurt as the floor crumbles away [9].
On a graveyard level, the room holds the Crystal Skull instead, with no trap blocks: lifting it brings a ghost [10] [11].
The Sacrifice Pit
#One Temple level in 8 is a Sacrifice Pit: a column of four rooms, other than the start's, is a pit from the top of the level to the bottom [12] [13]. At its top, a Damsel and a golden idol stand on four trap blocks; below them, the pit drops through the two rooms beneath into a pool of Lava in the bottom room, with big rubies in the blocks under it [14] [15] [16] [17].
In the Temple, lifting an idol brings down the Ceiling Trap if the level has one. A Sacrifice Pit level has no idol room, so it has none, and the player's code takes its other branch: every trap block within 90 pixels of him is destroyed at once [18] [19]. The blocks crumble into rubble on the step he lifts it, and he, the idol and the Damsel fall down the pit. The clip shows the player lifting the idol beside the Damsel and falling the length of the pit into the lava, where he dies [20] [21].
Damage
#The blocks hurt nothing; what's below them does.
| Where | The fall | |
|---|---|---|
| The Jungle's idol room | Into water, unhurt | [9] |
| The Sacrifice Pit | Into lava, which kills the player and the Damsel | [20] |
Locations
#| Place | Chance | |
|---|---|---|
| The Jungle | The idol room: 1 in 9 for two side rooms in three, once the altar's 1 in 12 fails, at most once a level; not on a graveyard level | [22] |
| The Sacrifice Pit | 1 in 8 for each Temple level | [12] |
The level editor has no tile for them, and an idol lifted in a custom level sets nothing off [2].
Avoiding
#- Knock the idol off first. The trap is set off by lifting an idol that hasn't left the ground; an idol knocked off its perch, by a Bomb's blast, say, turns its trigger off, and lifting it then sets nothing off [23].
- Destroy them. A trap block is a block, and a Bomb destroys it like one, with rubble but no thump [24] [8].
- In the Jungle, the fall is harmless: it ends in water.
Interactions
#- The Ceiling Trap takes the trap blocks' place in the Temple: with one on the level, lifting an idol brings it down and leaves the trap blocks alone [25].
- The idol's trigger stays on after a lift in the Jungle, so lifting the idol again before it has left the ground runs the trap blocks' code again [26].
Trivia
#- The Black Market's room code can make a trap block, from a tile none of its rooms uses [27] [26].
- The Temple's tile for them rolls 1 in 1, a roll that always passes but still draws a random number, four on every Sacrifice Pit level [28] [26].
- The Jungle's branch still holds the Temple's way of taking the blocks, commented out: they were once destroyed at once there too [29].
- In the Temple's branch, the thump and the screen's shake are inside the loop over the trap blocks, but outside the test for their distance, so they play once for every trap block on the level, near or not [30]. Lifting the Sacrifice Pit's idol plays them four times on one step, which sounds and looks like once: each play restarts the same thump, and the shake only goes up to the same 10 [26] [21].
FAQ
#- What happens when you take the idol in the Jungle in Spelunky Classic?
The six skull blocks it sits on crumble, from the outside in, and the player drops with the idol into the pool of water below, unhurt. The outer two go at once, the next two 16 steps later and the middle two 32 steps later.
- What is under the idol in the Sacrifice Pit in Spelunky Classic?
A shaft to the bottom of the level, ending in lava. Lifting the idol destroys at once the four skull blocks that it and the Damsel beside it stand on, and the player and the Damsel fall down the shaft into the lava.
- How do you take the idol without setting off the trap blocks in Spelunky Classic?
Knock it off its blocks first, with a Bomb's blast, say. An idol that has left the ground sets nothing off when it's lifted. A Bomb also destroys trap blocks like any other block.
See also
#References
#objects/oPlayer1/step.gml:1240-1279objects/oPlayer1/step.gml:1222scripts/scrRoomGen2.gml:109-114scripts/scrRoomGen2.gml:477-482scripts/scrRoomGen2.gml:395-398objects/oPlayer1/step.gml:1240-1248objects/oTrapBlock/step.gml:3-7objects/oTrapBlock/destroy.gml:1-14- Clip trap-block/crumble
scripts/scrRoomGen2.gml:111objects/oPlayer1/step.gml:1234-1239scripts/scrLevelGen.gml:71-86scripts/scrClearGlobals.gml:60scripts/scrRoomGen4.gml:193-204scripts/scrRoomGen4.gml:399-409scripts/scrRoomGen4.gml:328-337scripts/scrRoomGen4.gml:497-500objects/oPlayer1/step.gml:1250-1279scripts/scrLevelGen.gml:85- Clip trap-block/pit
- Replay
fidelity/replays/trap-sacrifice-pit.txt scripts/scrRoomGen2.gml:79-114objects/oGoldIdol/step.gml:29-33objects/oExplosion/collision_oSolid.gml:1-15objects/oPlayer1/step.gml:1252-1266- Quirk 1 (docs/quirks.md)
scripts/scrRoomGenMarket.gml:369-372scripts/scrRoomGen4.gml:406-409objects/oPlayer1/step.gml:1243-1247objects/oPlayer1/step.gml:1269-1278
Source code
objects/oTrapBlock/create.gmlobjects/oTrapBlock/step.gmlobjects/oTrapBlock/destroy.gmlobjects/oPlayer1/step.gmlobjects/oGoldIdol/step.gmlscripts/scrRoomGen2.gmlscripts/scrRoomGen4.gmlscripts/scrLevelGen.gml