0

I'm making a simple game to get my knowledge of Python and Pygame going, but, since I haven't used rotation before, I am encountering a problem. Every time my rectangle rotates, it gets bigger and smaller, and my game needs a centered rotating object.

I have two solutions, maybe three. Will any of these work? If not, do you have a solution of your own?

  1. Move the coods of my rectangle back and forth depending on the angle - This would be hard work.
  2. Is there a way to blit an object by the middle of it, rather than the top left corner? This would be perfect
  3. Use sprites??? I'm not sure if it would help at all, I haven't looked into or learnt anything about sprites at all yet.
Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
Bluetiger6001
  • 151
  • 2
  • 3
  • 9
  • Look at this http://stackoverflow.com/questions/4183208/pygame-rotating-an-image-around-its-center – Joe Feb 25 '13 at 23:08

1 Answers1

0

It would clarify your question if you post some code. Not having seen your code, I suggest the following: draw the rectangle as usual onto a Surface and then rotate the Surface using pygame.transform.rotate

Paco Barter
  • 182
  • 1
  • 3