Crazy collisions when rotating sprite

,

When you rotate your sprite, this rotation shifts the collideRect (the red square) to a position that is overlapping your walls:
SpriteRotation2

Then you do moveWithCollisions which resolves the overlap in an unexpected (to you) way.
Adjusting the collideRect during rotation so it is centred on the sprite rather than at 0,0 fixes this.

1 Like