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.

# Stomped targets drift in the Moon Room

From the spelunky.ai wiki: <https://spelunky.ai/wiki/moon-room-stomped-targets>.

Stomped targets drift in the Moon Room is a quirk of Spelunky Classic in which a target stomped late comes back where it had swayed to, worth 3.

| Quirk                                       |                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [How we know](https://spelunky.ai/wiki#how) | Read in the game's code and seen in the original game running                                                                                                                                                                                                                                                                                                                                                          |
| Where                                       | [`objects/oBatTarget/collision_oCharacter.gml:13`](https://spelunky.ai/wiki/source/objects/oBatTarget/collision_oCharacter#L13)                                                                                                                                                                                                                                                                                        |
| Pinned by                                   | [`fidelity/replays/bonus-moon-stomped-targets.txt`](https://github.com/851-labs/spelunky/blob/ebb9b804d076cb4e81ad3f239dc01016cc07c5cc/fidelity/replays/bonus-moon-stomped-targets.txt)                                                                                                                                                                                                                                |
| Row                                         | [docs/quirks.md §1, Bugs and leftovers in the 1.1 source](https://github.com/851-labs/spelunky/blob/ebb9b804d076cb4e81ad3f239dc01016cc07c5cc/docs/quirks.md#1-bugs-and-leftovers-in-the-11-source): [“A target stomped in the Moon Room's last 20 seconds comes back where it had swayed to, worth 3.”](https://github.com/851-labs/spelunky/blob/ebb9b804d076cb4e81ad3f239dc01016cc07c5cc/docs/quirks.md?plain=1#L82) |

In the [Moon Room](https://spelunky.ai/wiki/moon-room)'s last 20 seconds the targets come back as UFOs, worth 2 points more,
and sway sideways as they fly. A target shot with the [Bow](https://spelunky.ai/wiki/bow) comes back over the middle of its own path,
at its own value. One the player lands on comes back over the spot where it had swayed to, and since only the
middle and far targets' places make a target worth more than the nearest, it's worth 3, whatever it was.

## What happens

With 3 seconds left, the player runs off the ledges and lands on three targets in a row: a UFO, then the
middle target and the far one, both swayed well left of their paths. Each comes back as a UFO above the spot
where it was stomped, worth 3, and sways on from there; the last bounce takes the player onto the
[Spikes](https://spelunky.ai/wiki/spikes)[^1].

**Clip: Stomped targets come back where they swayed to.** With 3 seconds left in the Moon Room, the player runs off the ledges and lands on three swaying targets in a row. Each comes back as a UFO above the spot where it was stomped, worth 3, the middle and far ones well left of their own paths, before the last bounce takes him onto the Spikes. ([video](https://spelunky.ai/wiki/media/clips/quirks/moon-room-stomped-targets/clip.mp4))

## Why

An arrow's hit makes the new target at `xMid`, the middle of the old one's path[^2], but landing on it makes the new one at `x`, where the
old one is[^3]:

```gml objects/oBatTarget/collision_oCharacter.gml:11-13
    oMoonRoom.baskets += difficulty;

    instance_create(x, -64, oBatTarget);
```

[`objects/oBatTarget/collision_oCharacter.gml:11-13`](https://spelunky.ai/wiki/source/objects/oBatTarget/collision_oCharacter#L11-L13), 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)).

Until the last 20 seconds the two are the same. From then on, each step below the top of its path moves the
target left of its middle by up to 32 pixels, and nothing moves it back[^4]:

```gml objects/oBatTarget/step.gml:18-22
if (oMoonRoom.timer <= 20 and y > 64)
{
    x = xMid - abs(sin(xDiff)*32);
    xDiff += 0.01;
}
```

[`objects/oBatTarget/step.gml:18-22`](https://spelunky.ai/wiki/source/objects/oBatTarget/step#L18-L22), 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)).

A new target takes its worth from where it's made: 2 at the middle target's place, 4 at the far one's, 1
anywhere else, and 2 more as a UFO[^5]. Made at a swayed spot, it
misses both places, so it's worth 1, 3 as a UFO, and it sways from its new middle, further left[^6].

## Reproducing it

Land on a target once the timer reads 20 or less and the target has started to sway: a running jump off the
room's ledges reaches the nearest, and its bounce the others. The middle and far targets show it best: shot,
they come back worth 4 and 6; stomped, 3. The replay of the clip lands on the near target first, at 17
seconds, whose replacement comes back 23 pixels left of the near target's path, and climbs back to the ledges.
At the end it lands on three in a row, and afterwards no target is on the middle or far path, or worth more
than 3[^7].

## 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[^6], and the oracle's fingerprint of the replay pins where each new target is made and what it's
worth. No option turns it off.

## FAQ

### Is it worth stomping the targets in the Moon Room in Spelunky Classic?

A stomp scores the target's points, as an arrow does. But in the last 20 seconds a stomped middle or far target comes back worth 3, where a shot one comes back worth 4 or 6, so shooting them keeps more points in play.

### Why do the Moon Room's targets move left after you stomp them?

In the last 20 seconds the targets sway up to 32 pixels to the left. An arrow's hit makes the new target at the middle of the old one's path, but a stomp makes it where the old one had swayed to, and it sways from there, further left.

### Does stomping a target cost a heart in the Moon Room?

No. Landing on a target from above, falling or jumping, scores it and bounces the player up, as a stomp does. Any other touch near its middle costs a heart, at most once every 30 steps.

## See also

- **Related:** [Moon Room](https://spelunky.ai/wiki/moon-room)

## References

[^1]: Clip [quirks/moon-room-stomped-targets](https://spelunky.ai/wiki/moon-room-stomped-targets#clip-quirks-moon-room-stomped-targets)

[^2]: [`objects/oBatTarget/collision_oArrow.gml:7`](https://spelunky.ai/wiki/source/objects/oBatTarget/collision_oArrow#L7)

[^3]: [`objects/oBatTarget/collision_oCharacter.gml:13`](https://spelunky.ai/wiki/source/objects/oBatTarget/collision_oCharacter#L13)

[^4]: [`objects/oBatTarget/step.gml:18-22`](https://spelunky.ai/wiki/source/objects/oBatTarget/step#L18-L22)

[^5]: [`objects/oBatTarget/create.gml:5-14`](https://spelunky.ai/wiki/source/objects/oBatTarget/create#L5-L14)

[^6]: [“A target stomped in the Moon Room's last 20 seconds comes back where it had swayed to, worth 3.”](https://github.com/851-labs/spelunky/blob/ebb9b804d076cb4e81ad3f239dc01016cc07c5cc/docs/quirks.md?plain=1#L82), [docs/quirks.md §1](https://github.com/851-labs/spelunky/blob/ebb9b804d076cb4e81ad3f239dc01016cc07c5cc/docs/quirks.md#1-bugs-and-leftovers-in-the-11-source)

[^7]: Replay [`fidelity/replays/bonus-moon-stomped-targets.txt`](https://github.com/851-labs/spelunky/blob/ebb9b804d076cb4e81ad3f239dc01016cc07c5cc/fidelity/replays/bonus-moon-stomped-targets.txt), which the clip [Stomped targets come back where they swayed to](https://spelunky.ai/wiki/moon-room-stomped-targets#clip-quirks-moon-room-stomped-targets) plays

### Source code

- [`objects/oBatTarget/create.gml`](https://spelunky.ai/wiki/source/objects/oBatTarget/create)
- [`objects/oBatTarget/step.gml`](https://spelunky.ai/wiki/source/objects/oBatTarget/step)
- [`objects/oBatTarget/collision_oArrow.gml`](https://spelunky.ai/wiki/source/objects/oBatTarget/collision_oArrow)
- [`objects/oBatTarget/collision_oCharacter.gml`](https://spelunky.ai/wiki/source/objects/oBatTarget/collision_oCharacter)
- [`objects/oMoonRoom/alarm_11.gml`](https://spelunky.ai/wiki/source/objects/oMoonRoom/alarm_11)
