|
||||||||||
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
public abstract class ToTile4Movement
Title: ToTileMovement
Description: TODO
Copyright: Copyright (c) Sep 16, 2012
Field Summary | |
---|---|
protected int |
currentXTile
|
protected int |
currentYTile
|
protected MapSize |
mapSize
|
protected boolean |
movingToTile
|
protected Actor |
parent
|
protected boolean |
running
|
protected double |
speed
|
protected double |
targetX
|
protected int |
targetXTile
|
protected double |
targetY
|
protected int |
targetYTile
|
Fields inherited from class org.deken.game.movement.BaseMovement |
---|
gameVector, name |
Constructor Summary | |
---|---|
ToTile4Movement()
|
|
ToTile4Movement(MapSize mapSize,
Actor parent)
|
Method Summary | |
---|---|
protected void |
checkReverseDirection()
This method must be over-ridden if the implementing class can reverse, direction when moving between tiles. |
void |
collideHorizontal()
Adjust the horizontal (x axis) movement to a collision. |
void |
collideLayer()
Adjust the layer (z axis) movement to a collision. |
void |
collideVertical()
Adjust the vertical (y axis) movement to a collision. |
ToTile4Movement |
copyBase(ToTile4Movement toTileMovement)
|
protected abstract GameVector.DIRECTION |
getDirectionEnum()
|
double |
getXUpdate()
This returns the amount of X movement for a given update. |
double |
getYUpdate()
This returns the amount of Y movement for a given update. |
protected boolean |
isMovingToTile()
|
protected abstract void |
markTileReached()
|
void |
reset()
|
void |
setRunning(boolean running)
|
void |
setSpeed(double speed)
|
protected void |
setTargetTile()
|
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.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 |
---|
copy, getDirection, getGameVector |
Methods inherited from interface org.deken.game.Updateable |
---|
getName |
Field Detail |
---|
protected MapSize mapSize
protected int currentXTile
protected int currentYTile
protected int targetXTile
protected int targetYTile
protected double targetX
protected double targetY
protected double speed
protected Actor parent
protected boolean running
protected boolean movingToTile
Constructor Detail |
---|
public ToTile4Movement()
public ToTile4Movement(MapSize mapSize, Actor parent)
Method Detail |
---|
public void collideHorizontal()
Movement
collideHorizontal
in interface Movement
public void collideLayer()
Movement
collideLayer
in interface Movement
public void collideVertical()
Movement
collideVertical
in interface Movement
public ToTile4Movement copyBase(ToTile4Movement toTileMovement)
public void update(long elapseTime)
Movement
update
in interface Movement
update
in interface Updateable
elapseTime
- longpublic double getXUpdate()
Movement
getXUpdate
in interface Movement
public double getYUpdate()
Movement
getYUpdate
in interface Movement
public void reset()
public void setRunning(boolean running)
public void setSpeed(double speed)
protected void checkReverseDirection()
protected abstract void markTileReached()
protected boolean isMovingToTile()
protected abstract GameVector.DIRECTION getDirectionEnum()
protected void setTargetTile()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |