Animation help in pygame

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
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
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
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.
while left is being pressed
     if timer.time >= 0 && timer.time <=4 then
          blit images[0]

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

     if timer.time >= 10 && timer.time <=14
          blit image[2]
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
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 7,192 Mar 19, 2008 01:13 AM
Last Post: hertzcastle
  pygame framework foosh 0 4,840 Feb 29, 2008 02:09 AM
Last Post: foosh
  So... anyone doing any stuff in Python/Pygame...? Malarkey 12 12,746 Aug 23, 2007 12:09 PM
Last Post: Malarkey
  Python and Pygame. bronxbomber92 10 8,168 Dec 31, 2006 11:00 AM
Last Post: bronxbomber92
  Choosing Between Pygame and GLUT doucette 6 9,372 Aug 24, 2006 06:50 PM
Last Post: OneSadCookie