SPYR0.DEV

ARCHIVE 02 · DEV NOTE

The bug where Sparx forgot how screens work

On some displays Sparx would reach the Crystal Dragon area, stop moving and eventually pop back to the left. A first attempt to protect the hero text actually made the behavior worse on smaller screens.

Updated Oct 2026·SPYR0.DEV·Responsive animation

The symptom

At first it looked like he was colliding with the Crystal Dragon. He was not.

Sparx has two basic behaviors on the homepage: free roaming and occasionally following Spyro across the scene. His movement is eased toward target coordinates and clamped so he stays above the curved grass bank.

The awkward part was the hero copy. Earlier logic tried to keep Sparx from crossing the text. On certain viewport proportions, the safe route underneath became too narrow. Sparx got pinned at the edge of that route, which happened to visually line up with the Crystal Dragon area.

The wrong fix

Routing above the headline solved one problem and created another.

The first responsive fix added an alternate path above the text if there was not enough room below it. Technically it gave Sparx somewhere to go, but on shorter screens it pushed him up toward the navigation and made the movement look much stranger than simply crossing the words.

The fix was basically admitting the text never needed collision logic in the first place.

The final version

Let him fly through the text and guard the actual ugly case.

The text-avoidance routing was removed. Sparx can now take the natural path his roaming/follow logic gives him, even if that means crossing the hero copy for a moment.

The separate visible teleport bug still needed protection. When Spyro wraps from the right side back to the left for a new lap, Sparx is only moved with him if Sparx actually made it far enough across the scene.

const madeItAcross = sparxState.x > hero.clientWidth * 0.72;

if (madeItAcross) {
  // wrap with Spyro
} else {
  // return to normal roaming instead of teleporting
  chooseSparxSpot(timestamp);
}

That check solves the part visitors actually notice. If routing, resizing or frame timing leaves Sparx behind, he simply goes back to roaming instead of jumping across half the page.

Takeaway

Not every overlap needs collision logic.

The original constraint was self-imposed. Once I decided Sparx flying through text was visually acceptable, a large amount of routing complexity stopped being useful.

For something decorative like this, looking natural matters more than enforcing a rule nobody can see anyway.

Email copied