Hello Terry. To answer your question: > With an animated sprite -- saying a walking figure > representing the > player -- is that one sprite with many surfaces > representing each frame > of the walk cycle?
Yes. This is the approach I would take. > Are sprite groups supposed to > help with this kind > of animation or am I supposed to handle all of that > in the class I > derive from Sprite? I would go with the latter approach - handle animation using a class derived from Sprite. The way I understand it, a sprite is a python object that has "image" and "rect" attributes, referring to the actual image bitmap and the sprite's position on the screen, respectively. A group is simply a container designed to handle sprites efficiently, meaning, to be able to manipulate many sprites at the same time. By using a group, multiple sprites (with perhaps very similar roles) can be easily updated using a single "update" call to the associated group, and, as Kris already said, you will be easily able to use the bounding-box collision routines included in Pygame. In a typical game, you will probably use multiple groups, with each group containing a single type of sprite. So one group may contain enemies only, another may contain shots only, etc. I think that the Aliens example included in the Pygame source documentation is a good example of how the sprite module might play its role. To accomplish animation, you will probably have to store the animation frames elsewhere in your sprite (perhaps in a list stored in an attribute such as "images"), and just change the image attribute of the sprite directly as needed to achieve animation. This is analogous to changing the rect attribute to change a sprite's position. In summary: To change the sprite appearance, change the "image" attribute. To change the sprite position, change the "rect" attribute. Chuck Arellano - Game Programming Video Tutorials for Beginners at http://www.scriptedfun.com/ ____________________________________________________________________________________ Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index
