University of Toronto Department of Computer Science CSC108H, Summer 1998
Project: Animation
Due: at the start of tutorial on Wednesday, August 5.

The Problem

Create an applet that provides a choice of animations using a Choice button. Implement two of these animations:

You are not expected to make these simulations correspond accurately in timing to the laws of physics. I only want things to look good.

The Program

After selecting an animation from the Choice menu, you should print a message on the animation Canvas telling the user to click on it to start it. After it runs once, further clicks will repeat the animation.

You are free to arrange the program as you like.

You have two things to do

Your program will not be huge; but it will be big enough that you should spend some time in the design phase. A problem like this breaks down naturally into two parts:

  1. the animations, and
  2. the graphical interface that you see on the screen.

You should work on these two parts separately, though you will have to join the corresponding parts of your program into one applet.

For part 1. begin by visualizing what you want to do. Use the text examples listed to help you get started. Think about what classes are needed and draw an object diagram. Initially, write the Java classes implementing each of your animations, as separate applets.

For part 2 decide what classes are needed and what instance variables and methods are appropriate for each class, then create an object diagram before starting to implement the code. Step back from time to time to consider how your object design will work.

The graphical interface

Here is a simple animation Demo.

Getting started

When you receive this handout, you will know nearly nothing about applets. You can anticipate this topic by reading the text's applet- based examples, which begin as early as Chapter 2. However, to at least some extent, you can build a graphical interface by trial and error, so you can probably postpone the graphical interface while you begin work on the animations.

At some point you will know enough about applets to begin working on the Event driven interface design and the animation design in parallel, so that you can link the two parts together when they are reasonably well developed.

Hints and Suggestions

There are useful techniques buried in the text's examples. See pages 370-2 for an applet that has a component that is a Canvas. On pages 395-402 is an applet that uses buttons; it's much longer than you need, but you can read it to find useful techniques. The Rotating_Disk applet on pages 262-3 might help animate the rotation of the coin. The GridLayout layout manager is described on pages 385-6.

A little math that may help.

Bonus Marks

(The maximum grade for the assignment is 15. The bonus marks may be used to offset marks you lose for other reasons.)

As well as the Graphical Users Interface, you will be marked largely on how good the animations look. Bonus marks are available if your animations look particularly impressive or if you implement one of these features.

What To Hand In

The marker is going to run your program to see how well it works. Consequently, you do not need to hand in test runs, though of course you should have tested it thoroughly, because the marker will be trying hard to find things wrong with your program.

Here's what you do need to hand in:

Remember to write the usual identifying information on all these items. Don't forget to label your disk! -because disks can easily become separated from papers.



About this document ...

Mon Jul 13 14:47:52 EDT 1998


Craig MacDonald
Mon Jul 13 14:47:53 EDT 1998