Animation help in pygame

suplexx
Unregistered
 
Post: #1
I am trying to learn python/pygame and I've ran into a problem. Is it possible to use a spritesheet to simulate walking? I can move the sprite around but it's just like he's sliding around. I'm sorry if I didn't explain in detail, but perhaps someone could help me with this?
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #2
You should do both, moving the sprite's coordinates and changing the sprite's picture (so he appears to be moving legs etc.)

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Member
Posts: 312
Joined: 2006.10
Post: #3
You can use time based animation or frame based animation.

Say you have an array (tables in python?) of each image names 'images' and a timer called 'timer', this is what the psudeo code would look like.
Code:
while left is being pressed
     if timer.time >= 0 && timer.time <=4 then
          blit images[0]
     end

     if timer.time >= 5 && timer.time <=9 then
          blit image[1]
     end

     if timer.time >= 10 && timer.time <=14
          blit image[2]
     end
end
That's very basic way to do animations and not the best, but you should get the idea Wink
Quote this message in a reply
suplexx
Unregistered
 
Post: #4
thanks a lot for the replies guys

hopefully I wont bug you much anymore LOL
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  pygame or lingo? hertzcastle 6 4,491 Mar 19, 2008 01:13 AM
Last Post: hertzcastle
  pygame framework foosh 0 2,374 Feb 29, 2008 02:09 AM
Last Post: foosh
  So... anyone doing any stuff in Python/Pygame...? Malarkey 12 6,988 Aug 23, 2007 12:09 PM
Last Post: Malarkey
  Python and Pygame. bronxbomber92 10 4,914 Dec 31, 2006 11:00 AM
Last Post: bronxbomber92
  Choosing Between Pygame and GLUT doucette 6 4,410 Aug 24, 2006 06:50 PM
Last Post: OneSadCookie