Animation help in pygame
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?
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
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.
That's very basic way to do animations and not the best, but you should get the idea
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

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