ballworlds.ball
Class Ball

java.lang.Object
  extended by ballworlds.ball.Ball
All Implemented Interfaces:
Animate, Drawable, Relocatable

public abstract class Ball
extends Object
implements Drawable, Relocatable, Animate

A Ball is an abstract class that does nothing -- it is just a convenient name for a "generic" ball, that is, any Drawable, Relocatable, Animate object.

Specific kinds of Balls are expected to do other things like move on their own, bounce, shrink and grow in size, explode, and be draggable by the mouse.

Specific kinds of Balls should extend this class, simply so that they can be declared to be a Ball in classes that refer to a generic Ball.

A Ball must have a constructor that:

Students: you should NOT add any code to this abstract Ball class. Instead, write classes that extend this Ball class.

Author:
David Mutchler, Salman Azhar and others, January 2005. Modified September, 2008.

Constructor Summary
Ball(BallEnvironment ballEnvironment)
          Adds itself to its World (otherwise, the Ball is neither displayed nor asked to act).
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ballworlds.framework.Drawable
getColor, getShape
 
Methods inherited from interface ballworlds.framework.Relocatable
distanceFrom, moveTo
 
Methods inherited from interface ballworlds.framework.Animate
act, die, pauseOrResume
 

Constructor Detail

Ball

public Ball(BallEnvironment ballEnvironment)
Adds itself to its World (otherwise, the Ball is neither displayed nor asked to act). This stub does nothing. Specific kinds of Balls should override this constructor so that it accomplishes the above.

Parameters:
ballEnvironment - The BallEnvironment for all the Balls in this Ball's World.