Skip To Content

Athabasca University

4.3. Sprite Animation

Learning Objectives

When you have finished section 4.3, you should be able to:

  1. Use animated sprites in games.
  2. Grab frames out of a sprite sheet.
  3. Work with multiple sprites.
  4. Create a sprite handler.
  5. Draw sprite frames.
  6. Enhance games with animated sprites.

Required Tasks

  1. Study Chapter 9, Sprite Animation, in the eTextbook.
  2. Study the example programs (AnimSprite, SpriteHandler, SpriteGrabber, MultipleSprites, DrawFrame) carefully by typing the code into your IDE. Build and run each of the programs.
  3. Reload the Tank War game into your IDE, and enhance the game using the techniques you have learned in this section.
  4. Complete the Chapter 9 quiz, and check your answers in Appendix A.

Optional Tasks

  1. From the Files link below, load the Sprite Animation example programs, and play with the code.
  2. Then build and run the programs.

Files (ainimsprite, drawframe, multiplesprites, spritegrabber, spritehandler, tankwar_r4)

Updated May 24 2016 by FST Course Production