us.asciiroth.client.agents
Class Tetrite
java.lang.Object
us.asciiroth.client.core.AbstractPiece
us.asciiroth.client.agents.AbstractAgent
us.asciiroth.client.agents.AbstractAnimatedAgent
us.asciiroth.client.agents.Tetrite
- All Implemented Interfaces:
- Agent, Animated, Piece
public class Tetrite
- extends AbstractAnimatedAgent
A creature that divides when killed through 3 generations before
finally dying. Because of this exponential creation of critters,
the Tetrite does not have a color and does not fire a color event
when it is killed.
Constructor Summary |
Tetrite(int generation)
Constructor. |
Method Summary |
void |
onDie(Event event,
Cell agentLoc)
Called when the agent dies on a given cell. |
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). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERIALIZER
public static final Serializer<Tetrite> SERIALIZER
- Type serializer.
Tetrite
public Tetrite(int generation)
- Constructor.
- Parameters:
generation
- what generation is this Tetrite? (0-2)
onDie
public void onDie(Event event,
Cell agentLoc)
- Description copied from interface:
Agent
- Called when the agent dies on a given cell.
- Specified by:
onDie
in interface Agent
- Overrides:
onDie
in class AbstractAgent
onFrame
public void onFrame(Context ctx,
Cell cell,
int frame)
- Description copied from interface:
Animated
- Animation callback, executed once each frame for each piece
animated on the board.
onHit
public void onHit(Event event,
Cell attackerLoc,
Cell agentLoc,
Agent agent)
- Description copied from interface:
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).
- Specified by:
onHit
in interface Agent
- Overrides:
onHit
in class AbstractAgent
© 2009 Alx Dark