CS111 Contracts

AnimationWorld

Created by Elaine Yang

AnimationWorld is a framework for learning how to create objects and use graphics in Java. AnimationWorld is modelled after the process of creating an animation. The process itself is comprised of three tasks:
  1. Creating Sprites. A Sprite is an object that moves in an animation. We need to have a library of Sprites before we can create an animation. This is like having gathering people to tryout for a movie. Before we can cast a movie or play, we need to have actors and actresses who can participate.

  2. Creating Animations. An Animation is similar to a script for a play. It includes information such as which Sprites are involved in the animation, when they are visible on stage, when they move, etc. Creating an Animation is comparable to creating a videotape of the production. We're recording who is where at what time doing what, etc.

  3. Creating Animation Players. An Animation Player is like a VCR. There may be many different kinds of Animation Players (like different kinds of VCRs), but they can all play animations. In order to view our animation, we need to put the animation in an Animation Player.

An animation is created by showing a sequence of frames. The frames are numbered starting from 1. After the first frame, the following frames are derived by updating each Sprite, and then painting the Sprite on a new frame (default white background).

The three steps above are described in more detail in the pages below. Examples are given after each description. Animations discussed in these pages can be viewed in the BuggleShowcase.

Sprites

Animations

Animation Players