|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.movement.BaseMovement
org.deken.game.movement.ToTile4Movement
org.deken.game.movement.PathFindingToTile4Movement
public class PathFindingToTile4Movement
Title: PathFindingToTileMovement
Description: TODO
Copyright: Copyright (c) Apr 1, 2012
Nested Class Summary | |
---|---|
static class |
PathFindingToTile4Movement.FINDING_DIRECTION
FORWARD_FORWARD = path is always forward FORWARD_BACK = path is forward, but on New Target change go back ANY_BACK = path is first find path, but on New Target change go back ANY_FORWARD = path is first find path, but on New Target change go forward |
Field Summary |
---|
Fields inherited from class org.deken.game.movement.ToTile4Movement |
---|
currentXTile, currentYTile, mapSize, movingToTile, parent, running, speed, targetX, targetXTile, targetY, targetYTile |
Fields inherited from class org.deken.game.movement.BaseMovement |
---|
gameVector, name |
Constructor Summary | |
---|---|
PathFindingToTile4Movement()
|
|
PathFindingToTile4Movement(Actor actor,
MapSize mapSize,
FindPathsFourWay findPaths,
Sprite target)
|
|
PathFindingToTile4Movement(Actor actor,
MapSize mapSize,
FindPathsFourWay findPaths,
Sprite target,
PathFindingToTile4Movement.FINDING_DIRECTION pathFinding)
The Targeting is used to determine the course of action. |
Method Summary | |
---|---|
void |
addTileMovementListener(TileMovementListener listener)
|
void |
collideHorizontal()
Adjust the horizontal (x axis) movement to a collision. |
void |
collideVertical()
Adjust the vertical (y axis) movement to a collision. |
Movement |
copy(Actor actor)
Copies the movement. |
protected GameVector.DIRECTION |
getDirectionEnum()
|
boolean |
isTargetReached()
|
protected void |
markTileReached()
|
void |
reset()
|
void |
resetLocation(int xTile,
int yTile)
|
void |
resetLocation(int xTile,
int yTile,
int lastXTile,
int lastYTile)
|
void |
setFindPaths(FindPathsFourWay findPaths,
Sprite target)
|
void |
setTarget(Sprite sprite)
Sets a new Target for Parent to move towards. |
void |
update(long elapseTime)
This method takes the elapse time, since the last update, and to determine the next movement to set to the GameVector. |
Methods inherited from class org.deken.game.movement.ToTile4Movement |
---|
checkReverseDirection, collideLayer, copyBase, getXUpdate, getYUpdate, isMovingToTile, setRunning, setSpeed, setTargetTile |
Methods inherited from class org.deken.game.movement.BaseMovement |
---|
baseCopy, getDirection, getGameVector, getName, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.deken.game.movement.Movement |
---|
collideLayer, getDirection, getGameVector, getXUpdate, getYUpdate |
Methods inherited from interface org.deken.game.Updateable |
---|
getName |
Constructor Detail |
---|
public PathFindingToTile4Movement()
public PathFindingToTile4Movement(Actor actor, MapSize mapSize, FindPathsFourWay findPaths, Sprite target)
public PathFindingToTile4Movement(Actor actor, MapSize mapSize, FindPathsFourWay findPaths, Sprite target, PathFindingToTile4Movement.FINDING_DIRECTION pathFinding)
actor
- mapSize
- findPaths
- target
- pathFinding
- Method Detail |
---|
public void addTileMovementListener(TileMovementListener listener)
public void collideHorizontal()
Movement
collideHorizontal
in interface Movement
collideHorizontal
in class ToTile4Movement
public void collideVertical()
Movement
collideVertical
in interface Movement
collideVertical
in class ToTile4Movement
public Movement copy(Actor actor)
Movement
copy
in interface Movement
public boolean isTargetReached()
public void reset()
reset
in class ToTile4Movement
public void resetLocation(int xTile, int yTile)
public void resetLocation(int xTile, int yTile, int lastXTile, int lastYTile)
public void setFindPaths(FindPathsFourWay findPaths, Sprite target)
public void setTarget(Sprite sprite)
sprite
- public void update(long elapseTime)
Movement
update
in interface Movement
update
in interface Updateable
update
in class ToTile4Movement
elapseTime
- longprotected void markTileReached()
markTileReached
in class ToTile4Movement
protected GameVector.DIRECTION getDirectionEnum()
getDirectionEnum
in class ToTile4Movement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |