game
Class MovingGraphics
java.lang.Object
game.MovingBody
game.MovingGraphics
- All Implemented Interfaces:
- Animated
- Direct Known Subclasses:
- FancyDart, MovingPicture
public class MovingGraphics
- extends MovingBody
Manage a set of shapes that move in concert with a supplied trajectory.
Each shape can be offset from the
trajectory by a specified amount.
|
Method Summary |
void |
addGraphic(Graphic shape,
Vector delta)
Include the specified shape in this MovingBody. |
void |
respondAfterTick()
Responds by relocating each shape, relative to the
trajectory, and offset by its delta. |
void |
respondToDeath()
Responds by removing each shape from the controller's display. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MovingGraphics
public MovingGraphics(Controller controller,
Trackable trajectory,
Point ul,
Point lr)
addGraphic
public void addGraphic(Graphic shape,
Vector delta)
- Include the specified shape in this MovingBody.
The shape is added to the controller's display, so it appears immediately
- Parameters:
shape - The shape to be manageddelta - The offset from the trajectory at which this shape should move.
respondAfterTick
public void respondAfterTick()
- Responds by relocating each shape, relative to the
trajectory, and offset by its delta.
- Specified by:
respondAfterTick in class MovingBody
respondToDeath
public void respondToDeath()
- Responds by removing each shape from the controller's display.
TBD: after death, we should tick no more, and some code shouold
be deployed to prevent such a thing.
- Specified by:
respondToDeath in class MovingBody