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
#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.
Damage
#The trap itself hurts nothing: its arrow does, the same arrow the Bow shoots, while it's moving fast.
| Victim | Damage | |
|---|---|---|
| The player | 2 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 monsters | 1 hit point, as from any thrown item faster than 2 pixels a step | [13] |
| A Vampire | 4 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:
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.
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
#- Related
References
#objects/oPlayer1/step.gml:1513-1536objects/oArrowTrapTest/collision_oCharacter.gml:1-29objects/oArrowTrapTest/collision_oCharacter.gml:14-23objects/oArrowTrapLeft/create.gml:9objects/oArrowTrapLeft/alarm_1.gml:1-13objects/oArrowTrapRight/alarm_1.gml:1-17objects/oArrowTrapTest/collision_oCharacter.gml:5-8objects/oArrowTrapTest/collision_oItem.gml:5objects/oArrowTrapTest/collision_oBoulder.gml:5objects/oArrowTrapTest/collision_oCharacter.gml:10-28objects/oItem/step.gml:93-110objects/oItem/create.gml:21objects/oItem/step.gml:256-363objects/oItem/step.gml:265-266objects/oPlayer1/step.gml:1520-1521objects/oPlayer1/step.gml:1515scripts/scrEntityGen.gml:145-171scripts/scrEntityGen.gml:497-524scripts/scrEntityGen.gml:155-168scripts/scrEntityGen.gml:158-166- Room
rSun, as the room editor placed it objects/oArrowRepeaterL/step.gml:1-9scripts/scrCreateTileObj.gml:229-236objects/oArrowTrapLeft/destroy.gml:1-10- Replay
fidelity/replays/trap-boulder-crush.txt objects/oPlayer1/step.gml:1973-1988objects/oPlayer1/step.gml:113-124objects/oArrowTrapLeft/step.gml:1-44objects/oArrowTrapLeft/alarm_0.gml:1-2objects/oArrowTrapLeft/create.gml:8- Quirk 1 (docs/quirks.md)
Source code
objects/oArrowTrapLeft/create.gmlobjects/oArrowTrapLeft/alarm_1.gmlobjects/oArrowTrapLeft/destroy.gmlobjects/oArrowTrapLeft/step.gmlobjects/oArrowTrapRight/alarm_1.gmlobjects/oArrowTrapTest/collision_oCharacter.gmlobjects/oArrowTrapTest/collision_oItem.gmlobjects/oArrowRepeaterL/step.gmlobjects/oPlayer1/step.gmlscripts/scrEntityGen.gml