# Spot the bug - #175: Bouncing Saucer Sprite

**URL:** <https://forum.kirupa.com/t/spot-the-bug-175-bouncing-saucer-sprite/683735>\
**Category:** web dev\
**Created:** [October 15, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-175-bouncing-saucer-sprite/683735 "2026-10-15T07:00:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quelly](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/quelly/32/31386_2.png) [@Quelly](https://forum.kirupa.com/u/Quelly)\
**Post date:** [October 15, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-175-bouncing-saucer-sprite/683735/1 "2026-10-15T07:00:11Z")

</div>

Why is this bouncing saucer stuck in a frozen state?

```js
const saucer = document.querySelector("#saucer");
const bounds = { min: 20, max: 420 };
let posX = 30;
let speed = 4;
let isDescending = false;

function updateSaucer() {
  posX += speed;

  if (posX >= bounds.max || posX <= bounds.min) {
    speed = -speed;
    isDescending = !isDescending;
  }

  const wobble = Math.sin(posX * 0.05) * 8;
  saucer.style.left = posX;
  saucer.style.top = `${80 + wobble}px`;
  saucer.style.transform = `rotate(${speed * 3}deg)`;

  requestAnimationFrame(updateSaucer);
}

requestAnimationFrame(updateSaucer);

```

Reply with what is broken and how you would fix it.
