breakout
Class BlinkBrick
java.lang.Object
|
+--breakout.DefaultActiveBreakoutComponent
|
+--breakout.BlinkBrick
- All Implemented Interfaces:
- ActiveBreakoutComponent, BreakoutComponent, Runnable
- public class BlinkBrick
- extends DefaultActiveBreakoutComponent
A brick that blinks between two colors.
Method Summary |
void |
act()
subclasses must implement the act method to have the component
interact with the world after moving. |
void |
hitBy(BreakoutComponent striker)
subclasses must implement the hitBy method to have the
component react to being struck. |
void |
paint(Graphics g)
subclasses must implement the paint method in order to draw
their component. |
Methods inherited from class breakout.DefaultActiveBreakoutComponent |
getCenter, getDirection, getLocation, getShape, getSize, getTimeBetweenActs, isDead, isTransient, kill, run, setDirection, setLocation, setWorld |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlinkBrick
public BlinkBrick(Point location,
Dimension size,
World w,
Color c,
int hp)
paint
public void paint(Graphics g)
- Description copied from class:
DefaultActiveBreakoutComponent
- subclasses must implement the paint method in order to draw
their component.
- Specified by:
paint
in interface BreakoutComponent
- Specified by:
paint
in class DefaultActiveBreakoutComponent
- Parameters:
g
- Graphics object used to draw with.
hitBy
public void hitBy(BreakoutComponent striker)
- Description copied from class:
DefaultActiveBreakoutComponent
- subclasses must implement the hitBy method to have the
component react to being struck.
- Specified by:
hitBy
in interface BreakoutComponent
- Specified by:
hitBy
in class DefaultActiveBreakoutComponent
- Parameters:
striker
- BreakoutComponent that struck this component
act
public void act()
- Description copied from class:
DefaultActiveBreakoutComponent
- subclasses must implement the act method to have the component
interact with the world after moving.
- Specified by:
act
in interface ActiveBreakoutComponent
- Specified by:
act
in class DefaultActiveBreakoutComponent