|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgame.motion.PieceMover
public class PieceMover
At each tick, set the location of the Piece according to the specified Trajectory.
| Constructor Summary | |
|---|---|
PieceMover(Piece p,
Trajectory t)
|
|
| Method Summary | |
|---|---|
void |
bounce(double xfactor,
double yfactor)
Change the Trajectory associated with this piece to a new one whose velocity's x and y components are multiplied by xfactor and yfactor, respectively. |
void |
die()
|
boolean |
isDead()
Subscribers must be able to say when they are still alive or are dead. |
void |
observeEvent(ClockTick e)
In response to a clock tick, set the location of the Relocatable to the current location of the Trajectory. |
void |
redirect(lab4.Vector newDirection,
double speedFactor)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PieceMover(Piece p,
Trajectory t)
| Method Detail |
|---|
public void observeEvent(ClockTick e)
observeEvent in interface Subscriber<ClockTick>e - The PutSubEvent, varies by Publisher.
public void bounce(double xfactor,
double yfactor)
xfactor - yfactor -
public void redirect(lab4.Vector newDirection,
double speedFactor)
public boolean isDead()
Subscriber
isDead in interface Subscriber<ClockTick>public void die()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||