|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectus.asciiroth.client.core.AbstractPiece
us.asciiroth.client.agents.AbstractAgent
us.asciiroth.client.agents.Pusher
public class Pusher
A pusher is an object that moves slowly in one and only one direction on the board. It can sit dormant until triggered by a color event, or it can be placed active on the board but held in place by another piece like a boulder. (However, once it is started, it cannot be stopped again.) It will push sliders in its path and blow up bombs when it hits them.
| Field Summary | |
|---|---|
static Serializer<Pusher> |
SERIALIZER
Type serializer. |
| Constructor Summary | |
|---|---|
Pusher(Direction dir,
Color color,
State state)
Constructor. |
|
| Method Summary | |
|---|---|
void |
onColorEvent(Context ctx,
Cell cell,
Cell origin)
Terrain has received a color event, probably related to the firing of a color event on the board. |
void |
onFrame(Context ctx,
Cell cell,
int frame)
Animation callback, executed once each frame for each piece animated on the board. |
void |
onHit(Event event,
Cell attackerLoc,
Cell agentLoc,
Agent agent)
Fired when this agent collides with the player, or if this agent is the player, when the player collides with another agent (in other words, this method will not fire if one non-player agent collides with another non-player agent). |
boolean |
randomSeed()
Should this animation start with a randomly seeded number as its first frame? For some animations, this can prevent all presentations of the piece on the board executing the same animation frame at the same time. |
| Methods inherited from class us.asciiroth.client.agents.AbstractAgent |
|---|
canEnter, changeHealth, onDie, onHitBy, onHitBy |
| Methods inherited from class us.asciiroth.client.core.AbstractPiece |
|---|
getColor, getName, getSymbol, is, not |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface us.asciiroth.client.core.Piece |
|---|
getColor, getName, getSymbol, is, not |
| Field Detail |
|---|
public static final Serializer<Pusher> SERIALIZER
| Constructor Detail |
|---|
public Pusher(Direction dir,
Color color,
State state)
dir - the direction the pusher will movecolor - the color event that will turn pusher on/offstate - the current state of this pusher instance| Method Detail |
|---|
public void onColorEvent(Context ctx,
Cell cell,
Cell origin)
ColorListener
onColorEvent in interface ColorListenerctx - a context object with references to game state
public void onFrame(Context ctx,
Cell cell,
int frame)
Animated
onFrame in interface Animated
public void onHit(Event event,
Cell attackerLoc,
Cell agentLoc,
Agent agent)
Agent
onHit in interface AgentonHit in class AbstractAgentpublic boolean randomSeed()
Animated
randomSeed in interface Animated
|
0.7 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
© 2009 Alx Dark