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.

# Surging UFO laser

From the spelunky.ai wiki: <https://spelunky.ai/wiki/surging-ufo-laser>. Verified against the spelunky.ai port [v0.1.13](https://github.com/851-labs/spelunky/releases/tag/v0.1.13) on 28 October 2026.

The surging UFO laser is a quirk of Spelunky Classic in which a UFO's laser falls in surges, stopping dead every seven steps.

| Quirk     |                                                                                                                                                                                                  |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Status    | GML + Oracle                                                                                                                                                                                     |
| Where     | [`objects/oLaser/step.gml:1-3`](https://spelunky.ai/wiki/source/objects/oLaser/step#L1-L3)                                                                                                       |
| Pinned by | `fidelity/replays/enemy-ufo-stunned-yeti-seed-14.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 UFO's laser falls in surges.” |

A [UFO](https://spelunky.ai/wiki/ufo) fires its laser straight down at the player, and the laser gathers speed as it falls. It should
stop gathering at 4 pixels a step, but instead it stops moving altogether and starts over, so every laser falls in
surges: a run of quickening steps, a pause, another run.

## What happens

The player throws a stunned yeti under a UFO. The UFO fires, and its laser falls in surges, speeding up and
stopping dead every seven steps, until it hits the yeti, which flies up into the UFO and blows it up[^1].

**Clip: A UFO's laser falls in surges.** The player throws a stunned yeti under a UFO. The UFO fires its laser, which falls in surges, speeding up and stopping dead every seven steps, and hits the yeti, which flies up into the UFO and blows it up. ([video](https://spelunky.ai/wiki/media/clips/quirks/ufo-laser-surges/clip.mp4))

## Why

A laser starts with no speed and a gravity of 0.6[^2]. Each step, it
moves by its speed, adds the gravity, and checks the speed against 4:

```gml objects/oLaser/step.gml:1-3
y += yVel;
yVel += yAcc;
if (yVel > 4) yVel = 0;
```

[`objects/oLaser/step.gml:1-3`](https://spelunky.ai/wiki/source/objects/oLaser/step#L1-L3), 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 check is a cap that sets the speed to 0 instead of 4[^3]. So the laser moves 0, 0.6, 1.2,
1.8, 2.4, 3.0 and 3.6 pixels on seven steps; then its speed would reach 4.2, goes back to 0, and the run starts
over: about 12.6 pixels every 7 steps.

## Reproducing it

Every laser a UFO fires falls this way. In the replay of the clip, a laser fired on frame 1865 has a speed of 0
again on 1871 and 1878, and never above 4, before it hits the yeti on 1881[^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 the laser's fall. No option turns it off.

## FAQ

### Why does the UFO's laser move in jerks in Spelunky Classic?

Its speed grows by 0.6 pixels a step, and once it would pass 4, the code sets it to 0 instead of capping it. So the laser speeds up for six steps, stands still for one, and starts again.

### How fast does a UFO's laser fall?

About 12.6 pixels every 7 steps, 1.8 pixels a step on average, and never more than 3.6 in a step. Held at 4, as was meant, it would cover more than twice that on a long fall.

### Can you outrun a UFO's laser?

It only falls straight down, so stepping out from under the UFO is enough, and the surges give the player a little more time to do it.

## See also

- **Related:** [UFO](https://spelunky.ai/wiki/ufo)

## References

[^1]: Clip quirks/ufo-laser-surges

[^2]: [`objects/oLaser/create.gml:3-4`](https://spelunky.ai/wiki/source/objects/oLaser/create#L3-L4)

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

[^4]: Replay `fidelity/replays/enemy-ufo-stunned-yeti-seed-14.txt`

### Source code

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