AnimationWorld -- Sprites

The process of creating Sprites is similar to the process for designing and creating any kind of objects in Java. We need to decide what our objects will do, what information we need to keep track of, write constructor methods so people can create instances of our class, write methods so the objects actually do something, and write methods that tell us the state of the object which helps us debug the object.

To create Sprites, we extend the Sprite class. The general process for creating objects map to the following steps for creating Sprites:

  1. Deciding what the Sprite will look like and how it will move.
  2. Deciding what information is needed to keep track of the state of the Sprite. This information will be stored in instance variables. We need instance variables for both the initial and current positions of the Sprite.
  3. Writing constructors.
  4. Writing three required Sprite methods.
  5. Writing three optional Sprite methods to help with debugging. Sprites have some information about their environment. They are

    Below are five examples of Sprites:


    AnimationWorld
    Sprites
    Animations
    Animation Players
    HTML pages