breakout
Class SingleShotBall

java.lang.Object
  |
  +--breakout.DefaultActiveBreakoutComponent
        |
        +--breakout.SimpleBall
              |
              +--breakout.SingleShotBall
All Implemented Interfaces:
ActiveBreakoutComponent, Ball, BreakoutComponent, Runnable

public class SingleShotBall
extends SimpleBall

SingleShotBall is a transient ball that hits exactly one thing. Transient components don't interact with other components.

Version:
$Id: SingleShotBall.html,v 1.1 2003/03/10 16:34:48 bvandiver Exp $
Author:
benmv@olin.edu
See Also:
SimpleBall, ShooterBumper

Field Summary
 
Fields inherited from interface breakout.Ball
DEFAULT_SPEED
 
Constructor Summary
SingleShotBall(Point location, Dimension size, World w, Point direction, int timeBetweenActs, Color c, BreakoutComponent creator)
           
 
Method Summary
 void act()
          actively interact with the world.
 boolean isTransient()
          returns true if the component is transient.
 
Methods inherited from class breakout.SimpleBall
getShape, hitBy, paint
 
Methods inherited from class breakout.DefaultActiveBreakoutComponent
getCenter, getDirection, getLocation, getSize, getTimeBetweenActs, isDead, kill, run, setDirection, setLocation, setWorld
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface breakout.ActiveBreakoutComponent
getDirection, getTimeBetweenActs, setDirection
 
Methods inherited from interface breakout.BreakoutComponent
getCenter, getLocation, getSize, isDead, kill, setLocation, setWorld
 

Constructor Detail

SingleShotBall

public SingleShotBall(Point location,
                      Dimension size,
                      World w,
                      Point direction,
                      int timeBetweenActs,
                      Color c,
                      BreakoutComponent creator)
Method Detail

act

public void act()
Description copied from interface: ActiveBreakoutComponent
actively interact with the world. Before act() is called the component is moved forward according to it's direction.

Specified by:
act in interface ActiveBreakoutComponent
Overrides:
act in class SimpleBall

isTransient

public boolean isTransient()
Description copied from interface: BreakoutComponent
returns true if the component is transient.

Specified by:
isTransient in interface BreakoutComponent
Overrides:
isTransient in class DefaultActiveBreakoutComponent
Returns:
boolean true if component is transient