| | |
frame by frame animation in pygame
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2007
Posts: 2
Reputation:
Solved Threads: 0
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?
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?
•
•
Join Date: Jul 2006
Posts: 608
Reputation:
Solved Threads: 150
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
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.
![]() |
Similar Threads
- javascript and iframes (JavaScript / DHTML / AJAX)
- help me (JSP)
- Banners for branding (Advertising Sales Strategies)
- Any cocoa developers out there... (OS X)
- Using sprites... (C)
Other Threads in the Python Forum
- Previous Thread: Function for assigning variables
- Next Thread: Help - Frame class in tkinter is playing up
| Thread Tools | Search this Thread |
Tag cloud for Python
ansi assignment avogadro backend beginner binary bluetooth character cmd code copy customdialog data decimals dictionary drive dynamic error examples excel exe file float format ftp function gnu graphics gui heads homework http ideas import input java leftmouse line linux list lists logging loop module mouse newb number numbers output parsing path pointer port prime program programming progressbar projects push py2exe pygame pyglet pyqt python random recursion recursive refresh schedule scrolledtext sqlite ssh statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial ubuntu unicode update urllib urllib2 variable wikipedia windows write wxpython xlib





