Hi! This is my first post here and my first attempt at game dev (long time boring web/app developer!). I thought Playdate would be a great constrained platform to get started building simple games for my kid.
I'm working on what will become some kind of racing/car game, using the macOS SDK v2.0.3 (simulator-only; hardware coming in the next few weeks!). I'm having an issue with moveWithCollisions
. Everything behaves normally but occasionally, as I rotate my sprite, I'll get a weird jump to a faraway position. (See video for an example--the car jumping back is not a video glitch, it's what happens in the game).
I've tried to fix this bug in lots of different ways, but it seems that moveWithCollisions
is doing all the move logic itself, and opaque to me. If there were another function like maybeMoveWithCollisions
that would let me do the actual move based on whether the actual x and y positions are acceptable to me, then I think I could have a workaround.
But instead I should probably get to the bottom of what's going on. The only 'weird' thing I'm doing is that I'm rotating my sprite, and as I rotate the sprite I'm redrawing the collision rect to attempt to make it match the size/shape of the rotated sprite better. The 'jump' seems to only happen while I'm colliding AND rotating at the same time.
Anyone have any ideas?