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.

# Whip hits on every step

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

Whip hits on every step are a quirk of Spelunky Classic in which a swing hurts a monster on every step it touches it, so one swing can take several hit points.

| Quirk     |                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Status    | GML + Oracle                                                                                                                                                                                                                                                                                                                                                                                                             |
| Where     | `objects/oEnemy/collision_oWhip.gml:1-8`                                                                                                                                                                                                                                                                                                                                                                                 |
| Pinned by | `fidelity/replays/enemy-megamouth-whip-every-step.txt`                                                                                                                                                                                                                                                                                                                                                                   |
| Rows      | [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 whip swing hurts a monster on every step it touches it.” “The Whip hurts the Yeti King only with its wind-up.” “The Whip's wind-up hurts the Tomb Lord from any height, with no wait.” “The Magma Man's whip does nothing, but the wind-up hurts it.” |

A [Whip](https://spelunky.ai/wiki/whip) swing is two hits: the wind-up behind the player, then the crack in front of him. The code most monsters share takes a hit from each on every step it touches them, with
no pause between hits. It matters for the few monsters with more than one hit point, and most for those whose
own code limits the whip, which forgets the wind-up.

## What happens

The player whips a [Megamouth](https://spelunky.ai/wiki/megamouth) three times as it charges. The second swing's crack stays on the
fish for seven steps and takes a hit point on each, seven in all[^1].

**Clip: A whip swing hurts a monster on every step it touches it.** The player whips a megamouth three times as it charges. A swing has no pause between hits: the second one stays on the fish for seven steps and takes a hit point on each, seven in all. ([video](https://spelunky.ai/wiki/media/015c74cb8645abba/clips/quirks/whip-hits-every-step/clip.mp4))

### The wind-up behind the player

A [Giant Spider](https://spelunky.ai/wiki/giant-spider) waits 10 steps between whip hits, by its own
code. With his back to one, the player swings: the wind-up behind him takes 1 of its
10 hit points on each of three steps in a row, while that wait is still
running[^2].

**Clip: The whip's wind-up hurts a giant spider with no wait.** With his back to a giant spider, the player swings the whip: the wind-up behind him takes 1 of its 10 hit points on each of three steps in a row, though its own code waits 10 steps between whip hits, and is still waiting. The spider leaps on him. ([video](https://spelunky.ai/wiki/media/015c74cb8645abba/clips/quirks/giant-spider-whip-wind-up/clip.mp4))

The [Tomb Lord](https://spelunky.ai/wiki/tomb-lord) can only be cracked level with its top 12 pixels, so a player on its own floor
can't hurt it facing it. With his back to it, the wind-up takes three of its hit points a swing[^3].

**Clip: The Tomb Lord takes the Whip's wind-up from its own floor.** With his back to a tomb lord, the player swings the Whip: the wind-up behind him takes three of its hit points. Turned to face it, from the same floor, the crack of the whip takes none. ([video](https://spelunky.ai/wiki/media/015c74cb8645abba/clips/quirks/tomb-lord-whip-wind-up/clip.mp4))

The [Yeti King](https://spelunky.ai/wiki/yeti-king)'s own code makes the Whip's crack harmless. The wind-up takes three of its hit
points each swing all the same, so the Whip kills it in 10 swings with the player's back to it[^4].

**Clip: The Whip hurts the Yeti King only with its wind-up.** The player whips with his back to the Yeti King: the wind-up behind him takes three of its hit points each swing. Turned to face it, the crack of the whip takes none. ([video](https://spelunky.ai/wiki/media/015c74cb8645abba/clips/quirks/yeti-king-whip-wind-up/clip.mp4))

## Why

The collision of most monsters (`oEnemy`) with the whip takes the swing's `damage` and nothing else: no wait,
no stun, no check of where the hit is. A collision event runs on every step two things overlap, so it hits
again on every step[^5]:

```gml objects/oEnemy/collision_oWhip.gml:1-8
hp -= other.damage;
countsAsKill = true;
if (bloodLeft > 0)
{
    scrCreateBlood(x+sprite_width/2, y+sprite_height/2, 1);
    if (hp < 0) bloodLeft -= 1;
}
playSound(global.sndHit);
```

`objects/oEnemy/collision_oWhip.gml:1-8`, 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)).

Its collision with the wind-up (`oWhipPre`, which lasts 3 steps) is the same code[^6][^7]. A
Megamouth (40 hit points) and the [Alien Boss](https://spelunky.ai/wiki/alien-boss) (10 hit points) have
no whip code of their own, so they take every step's hit[^8].

The monsters that limit the whip do it in their own collision with `oWhip`, the crack: the Giant Spider with
a wait (`whipped`)[^9], the Tomb Lord with the wait
and a height test[^10], the Yeti King with a test the
Whip never passes (only a hit that punctures hurts it, and the Whip's doesn't)[^11], and the [Magma Man](https://spelunky.ai/wiki/magma-man) by only playing a
sound[^12]. None of them has a collision with `oWhipPre`,
so the wind-up runs the shared code instead, with no wait and no test. A Magma Man's hit points are its life,
which runs out by itself, so the wind-up takes 3 steps off it[^8].

The [Machete](https://spelunky.ai/wiki/machete) and the [Mattock](https://spelunky.ai/wiki/mattock) swing kinds of whip (children of `oWhip` and `oWhipPre`),
so their slashes and wind-ups do the same, 2 a step; a Mattock swing makes its wind-up twice[^8].

## Reproducing it

Whip a Megamouth, or turn the player's back on a Giant Spider, a Tomb Lord, the Yeti King or a Magma Man and
swing. The replays of the clips' staged scenes pin each case: three swings at a Megamouth taking 1, 7 and 3 of
its hit points[^13], a wind-up taking a
Giant Spider from 10 to 7 inside its wait[^14],
a Tomb Lord from 20 to 17 from its own floor[^15],
and the Yeti King from 30 to 21 in three swings while the crack takes nothing[^16].

## In the port

The spelunky.ai port reproduces all of it exactly: the four rows are in docs/quirks.md's list of the 1.1
source's bugs[^8], and the oracle's fingerprints of the replays pin every hit. No option turns
it off.

## FAQ

### How many times does one whip swing hit in Spelunky Classic?

Once a step for as long as it touches the monster. A crack that stays on a [Megamouth](https://spelunky.ai/wiki/megamouth) for 7 steps takes 7 hit points, and the wind-up behind the player can hit as well.

### Can the Whip hurt the Yeti King in Spelunky Classic?

Only with its wind-up, behind the player's back. The crack in front does nothing to the [Yeti King](https://spelunky.ai/wiki/yeti-king), but the wind-up takes 1 on each of its 3 steps, so a swing with the player's back to it takes 3.

### Why does the whip hurt the Tomb Lord when the player turns his back on it?

The [Tomb Lord](https://spelunky.ai/wiki/tomb-lord)'s own code only lets the crack hurt it level with its head and once every 10 steps, but it has no code for the wind-up, so it takes the shared code's, which has neither limit.

### Is hitting with the whip's wind-up a bug?

It's in the 1.1 source: the monsters that limit the whip have no code for the wind-up behind the player, so it hurts them as it hurts any monster. The spelunky.ai port keeps it.

## See also

- **Related:** [Whip](https://spelunky.ai/wiki/whip), [Machete](https://spelunky.ai/wiki/machete), [Mattock](https://spelunky.ai/wiki/mattock), [Megamouth](https://spelunky.ai/wiki/megamouth), [Giant Spider](https://spelunky.ai/wiki/giant-spider), [Tomb Lord](https://spelunky.ai/wiki/tomb-lord), [Yeti King](https://spelunky.ai/wiki/yeti-king), [Magma Man](https://spelunky.ai/wiki/magma-man), [Alien Boss](https://spelunky.ai/wiki/alien-boss)

## References

[^1]: Clip quirks/whip-hits-every-step

[^2]: Clip quirks/giant-spider-whip-wind-up

[^3]: Clip quirks/tomb-lord-whip-wind-up

[^4]: Clip quirks/yeti-king-whip-wind-up

[^5]: `objects/oEnemy/collision_oWhip.gml:1-8`

[^6]: `objects/oEnemy/collision_oWhipPre.gml:1-8`

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

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

[^9]: `objects/oGiantSpider/collision_oWhip.gml:1-7`

[^10]: `objects/oTombLord/collision_oWhip.gml:1-8`

[^11]: `objects/oYetiKing/collision_oWhip.gml:1-16`

[^12]: `objects/oMagmaMan/collision_oWhip.gml:1-6`

[^13]: Replay `fidelity/replays/enemy-megamouth-whip-every-step.txt`

[^14]: Replay `fidelity/replays/enemy-giant-spider-whip-wind-up.txt`

[^15]: Replay `fidelity/replays/enemy-tomb-lord-whip-wind-up.txt`

[^16]: Replay `fidelity/replays/enemy-yeti-king-whip-wind-up.txt`

### Source code

- `objects/oEnemy/collision_oWhip.gml`
- `objects/oEnemy/collision_oWhipPre.gml`
- `objects/oGiantSpider/collision_oWhip.gml`
- `objects/oTombLord/collision_oWhip.gml`
- `objects/oYetiKing/collision_oWhip.gml`
- `objects/oMagmaMan/collision_oWhip.gml`
