RSS Forums RSS

frame by frame animation in pygame

Please support our Python advertiser: Programming Forums
Reply
Posts: 2
Reputation: Suplexx is an unknown quantity at this point 
Solved Threads: 0
Suplexx Suplexx is offline Offline
Newbie Poster

frame by frame animation in pygame

  #1  
Mar 15th, 2007
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?
AddThis Social Bookmark Button
Reply With Quote  
Posts: 602
Reputation: jrcagle is on a distinguished road 
Solved Threads: 84
jrcagle jrcagle is offline Offline
Practically a Master Poster

Re: frame by frame animation in pygame

  #2  
Mar 15th, 2007
Are you using pygame? livewires? wxPython?
Reply With Quote  
Posts: 602
Reputation: jrcagle is on a distinguished road 
Solved Threads: 84
jrcagle jrcagle is offline Offline
Practically a Master Poster

Re: frame by frame animation in pygame

  #3  
Mar 17th, 2007
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 11:27 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the Python Forum
Views: 2636 | Replies: 2 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:54 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC