[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Rotating Sprites



On Sun, 2002-06-16 at 11:04, Leonardo Santagada wrote:
> Em Sun, 16 Jun 2002 04:45:39 -0400
> "Brendan Becker" <tgz@orotech.net> escreveu:
> 
> > >how to make rotating sprites in pygame using the sprite module? does 
> > >someone know the fast way to do it?
> > 
> > self.image = pygame.transform.rotozoom(self.originalimage,newangle,0)
> 
> thanks but I also want to know how to make the sprite rotations and how to put it in memory to grab it fast. Should I make a for loop with the rotozoom or use the pygame.transform.rotate and should I put my images in a list a dict or tuple? why don't pygame already come with a sprite object that do that?

I would put them in a list, like so:

self.anim = []
for angle in range(360):
    self.anim.append(pygame.transform.rotozoom(self.originalimage,angle,0))

You can then simply iterate through the self.anim list each frame.

Nat

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org