SpelunkyFan wiki

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

#
Trap blocks crumbling. In a Jungle idol room, the player drops onto a floor of skull blocks and picks up the golden idol from it. The blocks crumble from the outside in, two at a time, and he falls with the idol into the pool below, unhurt.

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

#
The Sacrifice Pit's trap blocks. At the top of the Sacrifice Pit, the player picks up the golden idol beside a damsel. The four skull blocks under them vanish at once, and the player, the idol and the damsel fall down the pit into the lava at its bottom, where he dies.

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.

WhereThe fall
The Jungle's idol roomInto water, unhurt[9]
The Sacrifice PitInto lava, which kills the player and the Damsel[20]

Locations

#
PlaceChance
The JungleThe 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 Pit1 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

#
  1. objects/oPlayer1/step.gml:1240-1279
  2. objects/oPlayer1/step.gml:1222
  3. scripts/scrRoomGen2.gml:109-114
  4. scripts/scrRoomGen2.gml:477-482
  5. scripts/scrRoomGen2.gml:395-398
  6. objects/oPlayer1/step.gml:1240-1248
  7. objects/oTrapBlock/step.gml:3-7
  8. objects/oTrapBlock/destroy.gml:1-14
  9. Clip trap-block/crumble
  10. scripts/scrRoomGen2.gml:111
  11. objects/oPlayer1/step.gml:1234-1239
  12. scripts/scrLevelGen.gml:71-86
  13. scripts/scrClearGlobals.gml:60
  14. scripts/scrRoomGen4.gml:193-204
  15. scripts/scrRoomGen4.gml:399-409
  16. scripts/scrRoomGen4.gml:328-337
  17. scripts/scrRoomGen4.gml:497-500
  18. objects/oPlayer1/step.gml:1250-1279
  19. scripts/scrLevelGen.gml:85
  20. Clip trap-block/pit
  21. Replay fidelity/replays/trap-sacrifice-pit.txt
  22. scripts/scrRoomGen2.gml:79-114
  23. objects/oGoldIdol/step.gml:29-33
  24. objects/oExplosion/collision_oSolid.gml:1-15
  25. objects/oPlayer1/step.gml:1252-1266
  26. Quirk 1 (docs/quirks.md)
  27. scripts/scrRoomGenMarket.gml:369-372
  28. scripts/scrRoomGen4.gml:406-409
  29. objects/oPlayer1/step.gml:1243-1247
  30. objects/oPlayer1/step.gml:1269-1278

Source code

  • objects/oTrapBlock/create.gml
  • objects/oTrapBlock/step.gml
  • objects/oTrapBlock/destroy.gml
  • objects/oPlayer1/step.gml
  • objects/oGoldIdol/step.gml
  • scripts/scrRoomGen2.gml
  • scripts/scrRoomGen4.gml
  • scripts/scrLevelGen.gml
#