4.3. Sprite Animation
Learning Objectives
When you have finished section 4.3, you should be able to:
- Use animated sprites in games.
- Grab frames out of a sprite sheet.
- Work with multiple sprites.
- Create a sprite handler.
- Draw sprite frames.
- Enhance games with animated sprites.
Required Tasks
- Study Chapter 9, Sprite Animation, in the eTextbook.
- Study the example programs (AnimSprite, SpriteHandler, SpriteGrabber, MultipleSprites, DrawFrame) carefully by typing the code into your IDE. Build and run each of the programs.
- Reload the Tank War game into your IDE, and enhance the game using the techniques you have learned in this section.
- Complete the Chapter 9 quiz, and check your answers in Appendix A.
Optional Tasks
- From the Files link below, load the Sprite Animation example programs, and play with the code.
- Then build and run the programs.
Files (ainimsprite, drawframe, multiplesprites, spritegrabber, spritehandler, tankwar_r4)