943,718 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 4897
  • Python RSS
Mar 15th, 2007
0

frame by frame animation in pygame

Expand Post »
Can someone please explain to me how to animate a sprite, using an image with a set of poses? For example is it possible to specify one part of an image, or do i have to use seperate image files for each pose? And lastly, how exactly would one go about animating a character frame by frame, so to simulate walking. As in you show the sprite's legs moving, to make it look more realistic.

I've figured out how to move an image across the screen, but I don't even know how to specify the coordinates in which the image will be. Jeez I'm bad at this. Can someone please attempt to help me? Or can you lead me in the right direction?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Suplexx is offline Offline
2 posts
since Mar 2007
Mar 15th, 2007
0

Re: frame by frame animation in pygame

Are you using pygame? livewires? wxPython?
Reputation Points: 92
Solved Threads: 156
Practically a Master Poster
jrcagle is offline Offline
608 posts
since Jul 2006
Mar 17th, 2007
0

Re: frame by frame animation in pygame

I just realized that your title answered my question. :o

The way that I know to do this is to cycle through a list of sprites and keep a timer running. When time's up, display the next sprite.

This is how the livewires package handles animation.

If that turns out to be computationally expensive, you could make a sprite group and change out only some of the sprites.

Hope it helps,
Jeff
Last edited by jrcagle; Mar 17th, 2007 at 12:27 pm.
Reputation Points: 92
Solved Threads: 156
Practically a Master Poster
jrcagle is offline Offline
608 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Function for assigning variables
Next Thread in Python Forum Timeline: Help - Frame class in tkinter is playing up





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC