SpelunkyFan wiki

Arrow Trap

Verified against the spelunky.ai port v0.1.10 on .

For the item it fires, see Arrow.

The Arrow Trap is a trap in Spelunky Classic, a block in the Mines' and Temple's walls that fires one arrow at whatever moves in front of it, for 2 hearts.

An Arrow Trap looks like a carved stone block set into a wall, with an opening facing along a corridor. It fires an arrow the first time anything moves in front of it, and never again. The arrow takes 2 hearts from the player, as any fast arrow does, and hurts monsters as a thrown arrow does. On a dark level the traps are lit, glowing so that the player can see them.

How it works

#
Arrow trap. The player stands in front of an arrow trap three blocks away without setting it off, then takes a step toward it: it fires an arrow across the floor, which hits him for two hearts and knocks him down.

A trap has a sensor: an invisible strip in front of it, made one step after the trap, that reaches from its face to the first block in its row, but no farther than 6 blocks for a trap facing left and 5 for one facing right [4] [5] [6]. The two directions' code measures the strip differently, which is where the extra block comes from: the left-facing one counts up to 96 pixels from the trap, the right-facing one up to 80 from the block in front of it.

Anything in the strip that's moving sets the trap off: the player, a monster, an item, a piece of treasure, a pushed block or a Boulder. The player also sets it off near the end of his drop from a ledge into a hang from it, even without moving [7] [8] [9]. Standing still in the strip doesn't.

When it's set off, the trap fires an arrow from its face at 8 pixels a step (240 a second), plays its sound, and its sensor is destroyed, so it never fires again [10]. The first clip shows the player standing in a trap's strip, three blocks from it, without setting it off; when he takes a step toward it, it fires, and the arrow hits him.

An arrow falls as it flies, and on the ground it loses 70% of its speed each step, as any item does [11] [12]. A trap fires from near the top of its block, so its arrow along a floor lands after about three blocks and slides on too slowly to hurt. The second clip shows a player setting a trap off from the far end of its strip: the arrow drops onto the floor and stops short of him.

Arrow trap firing short. The player walks toward an arrow trap from five blocks away and sets it off; its arrow drops onto the floor, slows and stops short of him, harmless.

Damage

#

The trap itself hurts nothing: its arrow does, the same arrow the Bow shoots, while it's moving fast.

VictimDamage
The player2 hearts from an arrow faster than 3 pixels a step, which throws him the way it was going, stuns him for 20 steps (0.67 seconds) and is used up[1]
Most monsters1 hit point, as from any thrown item faster than 2 pixels a step[13]
A Vampire4 hit points: arrows are stakes to it (the Bow's damage)[14]

An arrow that kills the player is counted in the end-of-game statistics' arrow row [15]. The check takes the arrow nearest the player, not necessarily the one touching him [16].

Locations

#

Level generation turns some of the plain blocks of the walls into Arrow Traps, after it has placed everything else:

AreaChance for each block
The Mines1 in 4[17]
The Temple1 in 3[18]

A block only qualifies if it isn't in a shop, is more than 48 pixels from the entrance and not within 144 pixels of it on the same row, and has a block behind it and two open blocks in front of it: it faces left if the block to its right is solid and the two to its left are open, else right if the opposite holds (a right-facing trap's check also takes in the first pixel of a third block) [19]. On a dark level, the trap made is the lit kind [20].

Arrow Traps are also:

  • In the Sun challenge room, a bonus room reached from the high scores, whose traps fire every 100 to 200 steps whatever is in front of them, while the player is alive [21] [22].
  • In custom levels, as the level editor's tiles < (facing left) and > (facing right) [23].

Avoiding

#
  • Use up its arrow. A trap fires once, at whatever moves first: a Rock or any other item thrown through its strip, a monster walking by, or the player stepping in at the far end, where the arrow lands short.
  • Destroy it. A trap is a block, and a Bomb destroys it like one. One destroyed before it has fired leaves its arrow lying where it was [24]. The third clip shows a lit trap firing at the player as he drops down a ladder across its line, taking two hearts, and a bomb laid beside it destroying it.
  • Stand still. Standing in the strip doesn't set it off, but taking a step does.
Lit arrow trap. On a dark level, a lit arrow trap fires as the player drops down a ladder through its line; the arrow takes two hearts. He walks back, lays a bomb beside the trap and climbs away, and the blast destroys it.

Interactions

#
  • Boulders set off the traps they roll past, as the Boulder's clips show [25].
  • The Bow collects a trap's arrow, once it lies still, like one of its own [26].
  • Light. A lit trap counts as a light source on a dark level, as a lamp or a tiki torch does [27].

Trivia

#
  • The traps were first meant to watch along their row on their own: their step events still hold a motion check that would fire an arrow at the first moving thing in line, commented out. The sensor objects replaced it [28].
  • Both kinds have an alarm, never set, that would fire a slow arrow to the right at 5 pixels a step, from either side: a left-facing trap's would come out of its back [29] [30].
  • An unused object, oTemp, is an earlier arrow trap that plays a sound the game no longer has [31].

FAQ

#
How much damage does an Arrow Trap do in Spelunky Classic?

2 hearts. An arrow moving faster than 3 pixels a step takes 2 of the player's hearts, knocks him back and stuns him for 20 steps.

How do you avoid an Arrow Trap in Spelunky Classic?

Set it off from a distance. A trap fires only once, at the first thing that moves in its line, so a thrown item, a monster walking by or the player stepping in at the far end of its line uses its arrow up. An arrow fired along a floor drops onto it and slows, and is harmless once it's slower than 3 pixels a step.

Do Arrow Traps reload in Spelunky Classic?

No. Each Arrow Trap fires one arrow and is then a plain block for the rest of the level. Only the Sun challenge room's traps fire again and again.

How do you destroy an Arrow Trap in Spelunky Classic?

With a Bomb, like a block. One destroyed before it has fired leaves its arrow behind.

See also

#

References

#
  1. objects/oPlayer1/step.gml:1513-1536
  2. objects/oArrowTrapTest/collision_oCharacter.gml:1-29
  3. objects/oArrowTrapTest/collision_oCharacter.gml:14-23
  4. objects/oArrowTrapLeft/create.gml:9
  5. objects/oArrowTrapLeft/alarm_1.gml:1-13
  6. objects/oArrowTrapRight/alarm_1.gml:1-17
  7. objects/oArrowTrapTest/collision_oCharacter.gml:5-8
  8. objects/oArrowTrapTest/collision_oItem.gml:5
  9. objects/oArrowTrapTest/collision_oBoulder.gml:5
  10. objects/oArrowTrapTest/collision_oCharacter.gml:10-28
  11. objects/oItem/step.gml:93-110
  12. objects/oItem/create.gml:21
  13. objects/oItem/step.gml:256-363
  14. objects/oItem/step.gml:265-266
  15. objects/oPlayer1/step.gml:1520-1521
  16. objects/oPlayer1/step.gml:1515
  17. scripts/scrEntityGen.gml:145-171
  18. scripts/scrEntityGen.gml:497-524
  19. scripts/scrEntityGen.gml:155-168
  20. scripts/scrEntityGen.gml:158-166
  21. Room rSun, as the room editor placed it
  22. objects/oArrowRepeaterL/step.gml:1-9
  23. scripts/scrCreateTileObj.gml:229-236
  24. objects/oArrowTrapLeft/destroy.gml:1-10
  25. Replay fidelity/replays/trap-boulder-crush.txt
  26. objects/oPlayer1/step.gml:1973-1988
  27. objects/oPlayer1/step.gml:113-124
  28. objects/oArrowTrapLeft/step.gml:1-44
  29. objects/oArrowTrapLeft/alarm_0.gml:1-2
  30. objects/oArrowTrapLeft/create.gml:8
  31. Quirk 1 (docs/quirks.md)

Source code

  • objects/oArrowTrapLeft/create.gml
  • objects/oArrowTrapLeft/alarm_1.gml
  • objects/oArrowTrapLeft/destroy.gml
  • objects/oArrowTrapLeft/step.gml
  • objects/oArrowTrapRight/alarm_1.gml
  • objects/oArrowTrapTest/collision_oCharacter.gml
  • objects/oArrowTrapTest/collision_oItem.gml
  • objects/oArrowRepeaterL/step.gml
  • objects/oPlayer1/step.gml
  • scripts/scrEntityGen.gml
#