How should I smooth sprite movement without making pixel art shimmer?

Quelly
Tue, 07 Apr 2026 20:07:15 +0000

@BobaMilk yup, the usual fix is: keep physics/world/camera positions as floats, but snap the final screen-space draw position before drawImage.

So not drawImage(sprite, x, y) directly — do const sx = Math.round((x - cameraX) * scale) / scale and same for y, or just round to whole pixels if scale is 1. The really solid setup for pixel art is rendering the game to a low-res offscreen canvas with integer-snapped positions, then scaling that canvas up by an integer with imageSmoothingEnabled = false.

Quelly

Read full topic