Pygame surface rotation, rect rotation or sprite rotation?

Posted by Alan on Game Development See other posts from Game Development or by Alan
Published on 2012-11-29T12:46:47Z Indexed on 2012/11/29 17:20 UTC
Read the original article Hit count: 725

Filed under:
|

i seem to have a conceptual misunderstanding of the surface and rect object in pygame.

I currently observe these objects this way:

Surface

  • Just the loaded image

rect

  • the 'hard' representation of the ingame object (sprite). Used for simplifying object moment and collision detection

sprite

  • rect and surface grouped together

What i want to do is rotate my sprite. The only available method i found for rotation is pygame.transform.rotate.

How do i rotate the rectangle, or even better, the whole sprite?

Below is the image of how i visualize this problem.

enter image description here

© Game Development or respective owner

Related posts about rotation

Related posts about pygame