ballworlds.ball
Class Bouncer
java.lang.Object
ballworlds.ball.Ball
ballworlds.ball.Dud
ballworlds.ball.DudThatMoves
ballworlds.ball.Mover
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
act
public void act()
- Act (possibly bouncing) unless the Bouncer is paused.
- Specified by:
act
in interface Animate
- Overrides:
act
in class Mover