Spelunky is © 2008, 2009 Derek Yu and Mossmouth, LLC, and is used under the [Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt). spelunky.ai is an unofficial fan project, not affiliated with or endorsed by Mossmouth. The game and its assets may not be sold.

Music by George Buzinkai and Jonathan Perry; sound effects made in SFXR. From Spelunky Classic 1.1, © 2008, 2009 Derek Yu and Mossmouth, LLC.

# Arrow traps seeing farther left

From the spelunky.ai wiki: <https://spelunky.ai/wiki/arrow-trap-sensor-left-wider>. Verified against the spelunky.ai port [v0.1.10](https://github.com/851-labs/spelunky/releases/tag/v0.1.10) on 28 October 2026.

Arrow traps seeing farther left is a quirk of Spelunky Classic in which a left-facing arrow trap sees 6 blocks in the open, and a right-facing one only 5.

| Quirk     |                                                                                                                                                                                                                                 |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status    | GML + Oracle                                                                                                                                                                                                                    |
| Where     | [`objects/oArrowTrapLeft/alarm_1.gml:1-13`](https://spelunky.ai/wiki/source/objects/oArrowTrapLeft/alarm_1#L1-L13)                                                                                                              |
| Pinned by | `fidelity/replays/trap-arrow-sensor-left-wider.txt`                                                                                                                                                                             |
| Row       | [docs/quirks.md §1, Bugs and leftovers in the 1.1 source](https://github.com/851-labs/spelunky/blob/main/docs/quirks.md#1-bugs-and-leftovers-in-the-11-source): “A left-facing arrow trap sees 6 blocks, a right-facing one 5.” |

An [Arrow Trap](https://spelunky.ai/wiki/arrow-trap) fires at the first thing that moves in a line in front of it, which runs to the
first block in its row. With nothing in the way, that line is a block longer for a trap facing left than for
one facing right, so a player can stand safely 6 blocks from one kind, and not the other.

## What happens

The player stands midway between two Arrow Traps that face each other across an open room, as far from one as
from the other. He turns round, and only the left-facing trap fires; its arrow stops short of him. He takes two
steps toward the right-facing one before it fires too[^1].

**Clip: A left-facing arrow trap sees a block farther.** The player stands midway between two arrow traps that face each other, as far from one as from the other. He turns around, and only the left-facing trap fires; its arrow stops short of him. He takes two steps toward the right-facing one before it fires too. ([video](https://spelunky.ai/wiki/media/1d3f433106e37ef1/clips/quirks/arrow-trap-sensor-left-wider/clip.mp4))

## Why

A step after it's made, each trap makes its sensor, an invisible strip (`oArrowTrapTest`) along its row that
sets it off when anything moving touches it[^2].
To size it, the trap scans its row for a block, up to 97 pixels away. The left-facing trap's code measures
the strip from where the scan stopped back to the trap:

```gml objects/oArrowTrapLeft/alarm_1.gml:3-11
    xAct = x-1;
    while (not collision_point(xAct, y+8, oSolid, 0, 0))
    {
        if (x - xAct > 96) break;
        xAct -= 1;
    }
    if (xAct > x-16) { xAct = x-16; }
    obj = instance_create(xAct, y, oArrowTrapTest);
    obj.image_xscale = ceil(((x-1)-xAct)/16);
```

[`objects/oArrowTrapLeft/alarm_1.gml:3-11`](https://spelunky.ai/wiki/source/objects/oArrowTrapLeft/alarm_1#L3-L11), from `spelunky.gmk`, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC ([Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt)).

In the open the scan stops 97 pixels out, and the strip is `ceil(96/16)`, 6 blocks. The right-facing trap's
code scans as far, but then takes 8 more pixels off and starts the strip at the block in front of it:

```gml objects/oArrowTrapRight/alarm_1.gml:12-15
    xAct -= (x+8);
    if (xAct < 32) { xAct = 32; }
    obj = instance_create(x+16, y, oArrowTrapTest);
    obj.image_xscale = ceil((xAct-16)/16);
```

[`objects/oArrowTrapRight/alarm_1.gml:12-15`](https://spelunky.ai/wiki/source/objects/oArrowTrapRight/alarm_1#L12-L15), from `spelunky.gmk`, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC ([Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt)).

That's `ceil(73/16)`, 5 blocks. With a block within 5 blocks of either trap, both strips reach it, and they
agree; only in the open does the left-facing one see a block farther[^3].

## Reproducing it

Stand 6 blocks in front of an Arrow Trap with open floor between: a left-facing trap fires when the player
moves, a right-facing one doesn't. Play reaches it at every trap with more than 5 open blocks in front of
it. The replay of the clip's staged scene, on a custom level, puts two traps 11
open blocks apart: the player midway turns round and sets off only the left-facing one, then walks left until
the right-facing one fires[^4].

## In the port

The spelunky.ai port reproduces it exactly: it's in docs/quirks.md's list of the 1.1 source's bugs[^3], and the oracle's fingerprint of the replay pins both sensors. No option turns it off.

## FAQ

### How far can an Arrow Trap see in Spelunky Classic?

To the first block in its row, but no farther than 6 blocks for a trap facing left and 5 for one facing right. Anything moving inside that line sets it off.

### Why does a left-facing Arrow Trap see farther?

The two kinds of [Arrow Trap](https://spelunky.ai/wiki/arrow-trap) measure their line with two copies of the same code, written differently: the left-facing one's comes out a block longer.

### Is it safe to stand 6 blocks from an Arrow Trap?

In front of a right-facing trap, in the open, yes: it sees 5 blocks. In front of a left-facing one, no: the sixth block is still in its line.

## See also

- **Related:** [Arrow Trap](https://spelunky.ai/wiki/arrow-trap)

## References

[^1]: Clip quirks/arrow-trap-sensor-left-wider

[^2]: [`objects/oArrowTrapTest/collision_oCharacter.gml:1-29`](https://spelunky.ai/wiki/source/objects/oArrowTrapTest/collision_oCharacter#L1-L29)

[^3]: Quirk 1 (docs/quirks.md)

[^4]: Replay `fidelity/replays/trap-arrow-sensor-left-wider.txt`

### Source code

- [`objects/oArrowTrapLeft/alarm_1.gml`](https://spelunky.ai/wiki/source/objects/oArrowTrapLeft/alarm_1)
- [`objects/oArrowTrapRight/alarm_1.gml`](https://spelunky.ai/wiki/source/objects/oArrowTrapRight/alarm_1)
- [`objects/oArrowTrapTest/collision_oCharacter.gml`](https://spelunky.ai/wiki/source/objects/oArrowTrapTest/collision_oCharacter)
