Breakout Problem Set Javadocs

breakout
Interface ActiveBreakoutComponent

All Superinterfaces:
BreakoutComponent
All Known Subinterfaces:
Ball
All Known Implementing Classes:
DefaultActiveBreakoutComponent, SimpleBall

public interface ActiveBreakoutComponent
extends BreakoutComponent

interface ActiveBreakoutComponent is a BreakoutComponent that acts on it own and has a velocity.

Version:
$Id: ActiveBreakoutComponent.java,v 1.2 2004/03/26 20:39:33 gus Exp $
Author:
benmv@olin.edu
See Also:
BreakoutComponent, DefaultActiveBreakoutComponent

Method Summary
 void act()
          actively interact with the world.
 java.awt.Point getDirection()
          returns a Point representing the direction the component is travelling.
 int getTimeBetweenActs()
          returns the time in milliseconds between act()s.
 void setDirection(java.awt.Point d)
          sets the direction of the component.
 
Methods inherited from interface breakout.BreakoutComponent
getCenter, getLocation, getShape, getSize, hitBy, isDead, isTransient, kill, paint, setLocation, setWorld
 

Method Detail

act

public void act()
actively interact with the world. Before act() is called the component is moved forward according to it's direction.


getDirection

public java.awt.Point getDirection()
returns a Point representing the direction the component is travelling. The x and y coordinates range between -100 and 100 and are interpreted as hundreths of a pixel to move per iteration.


setDirection

public void setDirection(java.awt.Point d)
sets the direction of the component. The given point's coordinates should range from -100 to 100, and will be interpreted as hundreths of a pixel per act().


getTimeBetweenActs

public int getTimeBetweenActs()
returns the time in milliseconds between act()s. Represents the velocity / frequency of the component.

Returns:
int milliseconds between calls to the act method.

Breakout Problem Set Javadocs