ballworlds.ball
Class Bouncer

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

public class Bouncer
extends Mover

A Bouncer behaves just like a Mover, except that it bounces off the edges of its World.

Author:
David Mutchler. Created March 20, 2009.

Constructor Summary
Bouncer(BallEnvironment ballEnvironment)
          Adds the Bouncer to its World at the middle of the World with the default color and diameter for a Bouncer, and with a constant but randomly chosen velocity.
 
Method Summary
 void act()
          Act (possibly bouncing) unless the Bouncer is paused.
 
Methods inherited from class ballworlds.ball.Mover
die, distanceFrom, isPaused, moveTo, pauseOrResume
 
Methods inherited from class ballworlds.ball.DudThatMoves
getVelocity, setVelocity
 
Methods inherited from class ballworlds.ball.Dud
getBallEnvironment, getColor, getDiameter, getLocation, getShape, setColor, setDiameter, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bouncer

public Bouncer(BallEnvironment ballEnvironment)
Adds the Bouncer to its World at the middle of the World with the default color and diameter for a Bouncer, and with a constant but randomly chosen velocity.

Parameters:
ballEnvironment - the object that manages Balls in this World
Method Detail

act

public void act()
Act (possibly bouncing) unless the Bouncer is paused.

Specified by:
act in interface Animate
Overrides:
act in class Mover