Modifier and Type | Field and Description |
---|---|
protected PathBasedMap<? extends AbstractPathTile> |
map |
Constructor and Description |
---|
AbstractPathMover(PathBasedMap<? extends AbstractPathTile> map) |
Modifier and Type | Method and Description |
---|---|
void |
assignDestination(int dx,
int dy)
Assign a specified location; will move automaticaly until reach it.
|
float |
getSpeedX()
Get horizontal speed.
|
float |
getSpeedY()
Get vertical speed.
|
int |
getX()
Get horizontal location.
|
int |
getXInTile()
Get horizontal location in tile (location on map).
|
int |
getY()
Get vertical location.
|
int |
getYInTile()
Get vertical location in tile (location on map).
|
boolean |
hasReachedDestination() |
void |
manualMove(float dx,
float dy,
float extrp)
Move to specified destination only on call.
|
void |
place(float x,
float y)
Set specified location.
|
void |
setSpeed(float speedX,
float speedY)
Set move speed.
|
void |
update(float extrp)
Update automatic moves if has.
|
protected PathBasedMap<? extends AbstractPathTile> map
public AbstractPathMover(PathBasedMap<? extends AbstractPathTile> map)
public void manualMove(float dx, float dy, float extrp)
PathMover
manualMove
in interface PathMover
dx
- destination x.dy
- destination y.extrp
- extrapolation value.public void place(float x, float y)
PathMover
public void assignDestination(int dx, int dy)
PathMover
assignDestination
in interface PathMover
dx
- destination x.dy
- destination y.public void update(float extrp)
PathMover
public boolean hasReachedDestination()
public void setSpeed(float speedX, float speedY)
PathMover
public float getSpeedX()
PathMover
public float getSpeedY()
PathMover
public int getX()
PathMover
public int getY()
PathMover
public int getXInTile()
PathMover
getXInTile
in interface PathMover
public int getYInTile()
PathMover
getYInTile
in interface PathMover