Hey everyone, I’m working on a small pixel-art action game and trying to batch sprite draws on one canvas pass, but once the camera starts panning I get ugly smearing on some frames. If I round positions hard, motion looks choppy, and if I keep subpixels, the art stops looking crisp.
ctx.imageSmoothingEnabled = false;
for (const s of sprites) {
const dx = s.x - camera.x;
const dy = s.y - camera.y;
ctx.drawImage(sheet, s.sx, s.sy, 16, 16, dx, dy, 16, 16);
}
Is there a safe way to handle camera movement and sprite positions so batching stays fast without making pixel art blur or jitter?
Sarah