org.deken.game.movement
Class WanderToTile4Movement
java.lang.Object
org.deken.game.movement.BaseMovement
org.deken.game.movement.ToTile4Movement
org.deken.game.movement.WanderToTile4Movement
- All Implemented Interfaces:
- Movement, Updateable
public class WanderToTile4Movement
- extends ToTile4Movement
- implements Movement
Title: WanderToTile4Movement
Description: This movement moves the Actor in one of four possible
directions, based on the map in FindPathFourWay. This extends the
ToTile4Movement, moving the actor square by square. By setting up Taboos the
Actor will not wander onto those paths.
Copyright: Copyright (c) Sep 8, 2013
- Version:
- 1.0
- Author:
- aazimon
Nested Class Summary |
static class |
WanderToTile4Movement.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 |
Fields inherited from class org.deken.game.movement.ToTile4Movement |
currentXTile, currentYTile, mapSize, movingToTile, parent, running, speed, targetX, targetXTile, targetY, targetYTile |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WanderToTile4Movement
public WanderToTile4Movement()
WanderToTile4Movement
public WanderToTile4Movement(MapSize mapSize,
Actor parent,
FindPathsFourWay findPaths)
WanderToTile4Movement
public WanderToTile4Movement(MapSize mapSize,
Actor parent,
FindPathsFourWay findPaths,
WanderToTile4Movement.FINDING_DIRECTION pathFinding)
addTaboo
public void addTaboo(int xTile,
int yTile)
addTaboo
public void addTaboo(java.lang.String locationKey)
collideHorizontal
public void collideHorizontal()
- Description copied from interface:
Movement
- Adjust the horizontal (x axis) movement to a collision.
- Specified by:
collideHorizontal
in interface Movement
- Overrides:
collideHorizontal
in class ToTile4Movement
collideVertical
public void collideVertical()
- Description copied from interface:
Movement
- Adjust the vertical (y axis) movement to a collision.
- Specified by:
collideVertical
in interface Movement
- Overrides:
collideVertical
in class ToTile4Movement
copy
public Movement copy(Actor actor)
- Description copied from interface:
Movement
- Copies the movement.
- Specified by:
copy
in interface Movement
- Returns:
- Movement
getName
public java.lang.String getName()
- Specified by:
getName
in interface Updateable
- Overrides:
getName
in class BaseMovement
- Returns:
resetLocation
public void resetLocation(int xTile,
int yTile)
resetLocation
public void resetLocation(int xTile,
int yTile,
int lastXTile,
int lastYTile)
setFindPaths
public void setFindPaths(FindPathsFourWay findPaths,
Sprite target)
update
public void update(long elapseTime)
- Description copied from interface:
Movement
- This method takes the elapse time, since the last update, and to determine
the next movement to set to the GameVector.
- Specified by:
update
in interface Movement
- Specified by:
update
in interface Updateable
- Overrides:
update
in class ToTile4Movement
- Parameters:
elapseTime
- long
markTileReached
protected void markTileReached()
- Specified by:
markTileReached
in class ToTile4Movement
getDirectionEnum
protected GameVector.DIRECTION getDirectionEnum()
- Specified by:
getDirectionEnum
in class ToTile4Movement