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.

# Olmec not slamming while drifting left

From the spelunky.ai wiki: <https://spelunky.ai/wiki/olmec-slam-drifting-left>. Verified against the spelunky.ai port [v0.1.11](https://github.com/851-labs/spelunky/releases/tag/v0.1.11) on 28 October 2026.

Olmec not slamming while drifting left is a quirk of Spelunky Classic in which Olmec drifting left fast passes over the player without stopping to slam.

| Quirk     |                                                                                                                                                                                                                   |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status    | GML + Oracle                                                                                                                                                                                                      |
| Where     | [`objects/oOlmec/step.gml:92-131`](https://spelunky.ai/wiki/source/objects/oOlmec/step#L92-L131)                                                                                                                  |
| Pinned by | `fidelity/replays/ending-seed-1.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): “Olmec doesn't stop to slam while drifting left.” |

[Olmec](https://spelunky.ai/wiki/olmec) fights by hopping toward the player and stopping in the air over him, to slam down on him.
The check that stops him treats left and right differently: drifting right, he stops over the player at once;
drifting left at half his top speed or more, he passes over him.

## What happens

Olmec hops and drifts left over the player without stopping, and stops to slam only once his drift has slowed.
On his next hop he drifts right and stops over the player at once[^1].

**Clip: Olmec doesn't stop to slam while drifting left.** Olmec hops and drifts left over the player without stopping, and stops to slam only once his drift has slowed. On his next hop he drifts right and stops over the player at once. ([video](https://spelunky.ai/wiki/media/clips/quirks/olmec-slam-drifting-left/clip.mp4))

## Why

In the air after a hop, Olmec's drift, `xVel`, goes up by 0.25 a step toward the player to 2 and back down
again[^2]. On every step he tests whether to stop and slam:

```gml objects/oOlmec/step.gml:121-129
        if ((not oPlayer1.active and yVel >= 0) or
            (oPlayer1.y > y and abs(oPlayer1.x - (x+32)) < 32 and xVel > -1))
        {
            status = PREPARE;
            yVel = 0;
            xVel = 0;
            myGrav = 0;
            counter = 20;
        }
```

[`objects/oOlmec/step.gml:121-129`](https://spelunky.ai/wiki/source/objects/oOlmec/step#L121-L129), 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)).

The player has to be below Olmec's top and within 32 pixels of his middle, and `xVel` greater than -1. A drift
to the right always passes that last test, but a drift to the left of -1 or faster, half his top drift or more,
fails it, so he goes on over the player[^3].

## Reproducing it

Stand on Olmec's left as he hops: a fast drift toward the player carries him over without stopping. The
replay of a whole game with seed 1 shows both sides: on one hop he drifts left over the player for 8 steps, his
`xVel` -2 at the fastest, and stops only once it's back to -0.75. On his next he drifts right and stops over the
player at once, with an `xVel` of 2[^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 his drift and the step he stops. No option
turns it off.

## FAQ

### Why does Olmec sometimes fly over the player without slamming?

[Olmec](https://spelunky.ai/wiki/olmec) stops over the player to slam only while his drift to the left is slower than a pixel a step. Drifting left any faster, he passes over the player and stops once his drift slows down again.

### Does it matter which side of Olmec the player is on?

Yes. A hop toward a player on his left can carry him past before he stops, while one toward a player on his right stops over him at once, at any speed.

### How fast does Olmec drift?

His drift speeds up by a quarter of a pixel a step to 2 and slows down again, and he moves twice that, so up to 4 pixels a step. He stops over a player on his left only while it's slower than 1.

## See also

- **Related:** [Olmec](https://spelunky.ai/wiki/olmec), [Olmec's Lair](https://spelunky.ai/wiki/olmecs-lair)

## References

[^1]: Clip quirks/olmec-slam-drifting-left

[^2]: [`objects/oOlmec/step.gml:104-119`](https://spelunky.ai/wiki/source/objects/oOlmec/step#L104-L119)

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

[^4]: Replay `fidelity/replays/ending-seed-1.txt`

### Source code

- [`objects/oOlmec/step.gml`](https://spelunky.ai/wiki/source/objects/oOlmec/step)
