Sprites seem to ignore `playdate.graphics.setDrawOffset()`, but only sometimes

In my Minesweeper game, I have camera shake when you accidentally click a mine. It’s implemented by calling playdate.graphics.setDrawOffset() before playdate.graphics.sprite.update(). You can see this happen in playdate.update() at main.lua:104 in the attached project.

While researching the issue, I opened up my Grelda project (which revealed Rotated sprites draw with black backgrounds), because I knew that it used the same API to implement camera scrolling, yet that project doesn’t seem to exhibit the same issue. I’m not totally sure what the difference is, but I would guess maybe the screen isn’t shaking in the Minesweeper project because there isn’t anything else that would trigger a frame redraw?

Mines.zip (587.9 KB)

Looks like it’s the same root problem as the glitched tilemap drawing. After fixing that, the camera shake works correctly.

Confirmed fixed in 1.3.0 :+1:

1 Like