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.

# Spear Trap

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

The Spear Trap is a trap in Spelunky Classic, a two-block carved pillar in the Jungle and the Temple that thrusts spears at anything beside it, 4 hearts a step.

![A carved stone block with a grinning face and slots on either side](https://spelunky.ai/wiki/media/dbb0da14e7366b44/sprites/sSpearTrap1/frames/0%404x.png)

| Spear Trap |                                                                                                          |
| ---------- | -------------------------------------------------------------------------------------------------------- |
| Damage     | 4 hearts a step of its thrust[^1]                                                                        |
| Trigger    | Anything level with it, within 64 pixels[^2]                                                             |
| Objects    | `oSpearTrapTop`, `oSpearTrapBottom`, `oSpearTrapLit`, `oSpearsLeft`                                      |
| Found in   | [The Jungle](https://spelunky.ai/wiki/jungle), [The Temple](https://spelunky.ai/wiki/temple), Dark level |
| Drops      | [Arrow](https://spelunky.ai/wiki/arrow) (never in play: only from an alarm nothing sets)[^3]             |

A Spear Trap is a pillar two blocks tall that rises from the floor, a carved face with a slot on each side.
When the player, a monster or an item comes level with it, within 64 pixels, it thrusts a set of spears out
into the block beside it on that side; they strike 20 steps later, taking 4 hearts from the player on each
step he's in them. On a dark level its upper block is lit.

## How it works

**Clip: Spear trap.** The player, with eight hearts, walks up to a spear trap, which thrusts its spears at him as he comes in range; 20 steps later they strike him on three steps running, taking four hearts each, and kill him. ([video](https://spelunky.ai/wiki/media/dbb0da14e7366b44/clips/spear-trap/stab/clip.mp4))

Each of the trap's two blocks watches its own row, both ways. Each step, unless it has thrust in the last
50 steps (1.67 seconds), it checks the player, the
nearest monster, the nearest pushable block and the nearest item: one level with it, within 4 pixels, and
within 64 pixels of it on one side makes it thrust its spears out on that side[^4][^5]. The lower
block runs the same code, so it can thrust along the row below[^6].

The spears fill the one block beside the trap, so the trap sees farther than it reaches. They come out over
31 steps, one frame of their animation a step, and are gone at its end; they only strike on frames 20 to 23,
4 steps that start 20 steps (0.67 seconds) after the trap sees something[^7][^8].
Spears whose trap has been destroyed vanish[^9].

The clip shows a player with eight hearts walking up to a trap: it thrusts as he comes within range, he walks
into the spears' block, and when they strike they take 4 hearts on three steps running, 8 to 4 to 0 to -4.

## Damage

| Victim                                                                                                                                                                                       | Damage                                                                              |       |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----- |
| The player                                                                                                                                                                                   | 4 hearts on each step of the strike he's in the spears, which throw him up and away | [^1]  |
| Most monsters                                                                                                                                                                                | 2 hit points on each step of the strike                                             | [^10] |
| A [Caveman](https://spelunky.ai/wiki/caveman), [Mantrap](https://spelunky.ai/wiki/mantrap), [Yeti](https://spelunky.ai/wiki/yeti), [Hawkman](https://spelunky.ai/wiki/hawkman) or Shopkeeper | 2 hit points while it has hit points left, and stuns it, throwing it up and away    | [^11] |

Nothing spaces out the hits: there's no invincibility after one, so the player is hit again on every step of
the strike he's still in the spears, and each hit he takes alive is counted in the end-of-game statistics'
spear trap row, not only the one that kills him[^12]. The monsters' check looks at the spears
nearest the monster, not necessarily the ones touching it[^13][^12]. A monster a Spear Trap kills doesn't count
as the player's kill[^14][^15]. The
monsters' check is in the code most monsters share, so those whose own step event replaces it, such as the
[Bat](https://spelunky.ai/wiki/bat), aren't hurt.

## Locations

Level generation turns a floor block into a Spear Trap's lower half and puts its upper half on top. A block
qualifies if it's at the edge of a drop (open on at least one side), has two open blocks above it and ground
under it, isn't in a shop or in a column at the edge of a room, and is more than 64 pixels from the
entrance:

| Area                                          | Chance for each such block                                           |       |
| --------------------------------------------- | -------------------------------------------------------------------- | ----- |
| [The Jungle](https://spelunky.ai/wiki/jungle) | 1 in 12; on a dark level, once a 1 in 20 roll for a tiki torch fails | [^16] |
| [The Temple](https://spelunky.ai/wiki/temple) | 1 in 12, but not where the trap would block a passage of lava        | [^17] |

On a dark level the upper half is the lit kind, which glows and lights the darkness like a
lamp[^18][^19][^20]. Spear Traps
are also in the Sun challenge room, a bonus room[^21], and in custom levels as the
level editor's tiles `]` (the upper half) and `[` (the lower)[^22].

## Avoiding

- **Pass after the thrust.** Once the spears have struck, the trap can't thrust again until 50 steps after
  the last thrust, so the player can set it off from out of reach and go past when the strike is over.
- **Go over it.** The trap only sees what's level with one of its blocks, so a player standing on top of it
  doesn't set it off. The second clip shows him standing on a lit trap unhurt.
- **Set it off with something else.** A monster or a thrown item level with it uses up a thrust too.
- **Destroy it.** A [Bomb](https://spelunky.ai/wiki/bomb) destroys it like a block, as the second clip shows, and a trap with nothing
  under it falls apart, on screen[^23].

**Clip: Bombing a spear trap.** On a dark Jungle level, the player stands on top of a lit spear trap while it thrusts its spears to the side, lays a bomb on it and runs off; the blast destroys the trap. ([video](https://spelunky.ai/wiki/media/dbb0da14e7366b44/clips/spear-trap/bomb/clip.mp4))

## Interactions

- **Water.** Destroying a Spear Trap lets water and lava flow into the space, as destroying a block does[^24].
- **Push blocks and ice blocks** set it off as monsters do[^25].

## Trivia

- Spear Traps were meant to fire arrows: both halves have an alarm, never set, that would fire one to the
  left at 5 pixels a step[^3][^26].
- The spears' object is called `oSpearsLeft` whichever way they point: a trap thrusting right makes the same
  object and gives it the right-pointing sprite[^27].

## FAQ

### How much damage does a Spear Trap do in Spelunky Classic?

4 hearts on each step its spears strike the player, and they strike for up to 4 steps. A player who stays in them can lose 12 or more hearts to one thrust.

### How do you get past a Spear Trap in Spelunky Classic?

Set it off and wait. Its spears strike 20 steps after they come out and are gone after 31, and the trap can't thrust again for 50 steps, so the player can pass once the thrust is over. Standing on top of the trap doesn't set it off.

### Can you destroy a Spear Trap in Spelunky Classic?

Yes, with a [Bomb](https://spelunky.ai/wiki/bomb), like a block. It also falls apart when the ground under it is destroyed.

### Do Spear Traps hurt monsters?

Yes: 2 hit points on each step the spears strike them, and they stun a Caveman, a Mantrap, a Yeti, a Hawkman or a Shopkeeper. A monster a Spear Trap kills doesn't count as the player's kill.

## See also

- **Related:** [Arrow Trap](https://spelunky.ai/wiki/arrow-trap), [Smash Trap](https://spelunky.ai/wiki/smash-trap)
- **Damages:** [Alien](https://spelunky.ai/wiki/alien)[^10], [Caveman](https://spelunky.ai/wiki/caveman)[^11], [Fire Frog](https://spelunky.ai/wiki/fire-frog)[^28], [Frog](https://spelunky.ai/wiki/frog)[^28], [Hawkman](https://spelunky.ai/wiki/hawkman)[^11], [Mantrap](https://spelunky.ai/wiki/mantrap)[^11], [Monkey](https://spelunky.ai/wiki/monkey)[^28], [Skeleton](https://spelunky.ai/wiki/skeleton)[^28], [Snake](https://spelunky.ai/wiki/snake)[^28], [Spider](https://spelunky.ai/wiki/spider)[^28], [Tomb Lord](https://spelunky.ai/wiki/tomb-lord)[^10], [Vampire](https://spelunky.ai/wiki/vampire)[^10], [Yeti](https://spelunky.ai/wiki/yeti)[^11], [Yeti King](https://spelunky.ai/wiki/yeti-king)[^10], [Zombie](https://spelunky.ai/wiki/zombie)[^28]

## References

[^1]: `objects/oPlayer1/step.gml:1629-1647`

[^2]: `objects/oSpearTrapTop/step.gml:3-77`

[^3]: `objects/oSpearTrapTop/alarm_0.gml:1-2`

[^4]: `objects/oSpearTrapTop/step.gml:1-77`

[^5]: `objects/oSpearTrapTop/create.gml:3-5`

[^6]: `objects/oSpearTrapBottom/step.gml:1-89`

[^7]: `objects/oSpearsLeft/other_animation_end.gml:1`

[^8]: `objects/oPlayer1/step.gml:1632`

[^9]: `objects/oSpearsLeft/step.gml:1-8`

[^10]: `objects/oEnemy/step.gml:98-104`

[^11]: `objects/oEnemy/step.gml:76-97`

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

[^13]: `objects/oEnemy/step.gml:76-78`

[^14]: `objects/oEnemy/step.gml:87`

[^15]: `objects/oEnemy/step.gml:101`

[^16]: `scripts/scrEntityGen.gml:226-252`

[^17]: `scripts/scrEntityGen.gml:410-441`

[^18]: `scripts/scrEntityGen.gml:248`

[^19]: `scripts/scrEntityGen.gml:436`

[^20]: `objects/oPlayer1/step.gml:125-130`

[^21]: `rSun`, as the room editor placed it

[^22]: `scripts/scrCreateTileObj.gml:237-244`

[^23]: `objects/oSpearTrapTop/step.gml:79-86`

[^24]: `objects/oSpearTrapTop/destroy.gml:11`

[^25]: `objects/oSpearTrapTop/step.gml:21-28`

[^26]: `objects/oSpearTrapTop/create.gml:8`

[^27]: `objects/oSpearTrapTop/step.gml:41-47`

[^28]: `objects/oEnemy/step.gml:76-106`

### Source code

- `objects/oSpearTrapTop/create.gml`
- `objects/oSpearTrapTop/step.gml`
- `objects/oSpearTrapBottom/step.gml`
- `objects/oSpearsLeft/step.gml`
- `objects/oPlayer1/step.gml`
- `objects/oEnemy/step.gml`
- `scripts/scrEntityGen.gml`
