|
||||||||||
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.Wander8Movement
public class Wander8Movement
Title: Wander8Movement
Description: This is a random movement that moves only in 8 directions.
Copyright: Copyright (c) Dec 18, 2010
Nested Class Summary | |
---|---|
class |
Wander8Movement.ExtremeRandomness
The randomness is Extreme, in that it will change a random direction often. |
class |
Wander8Movement.MildRandomness
The randomness is mild, in that it is most likely to go straight. |
class |
Wander8Movement.Randomness
class to determine the randomness of the wandering. |
Field Summary |
---|
Fields inherited from class org.deken.game.movement.BaseMovement |
---|
gameVector, name |
Constructor Summary | |
---|---|
Wander8Movement()
|
|
Wander8Movement(double speed,
int minDistance)
Create a Wander8Movement with a speed and a minDistance. |
|
Wander8Movement(double speed,
int minDistance,
float direction)
Create a Wander8Movement with a speed and a minDistance. |
|
Wander8Movement(double speed,
int minDistance,
float direction,
Wander8Movement.Randomness randomness)
Create a Wander8Movement with a speed and a minDistance. |
|
Wander8Movement(double speed,
int minDistance,
Wander8Movement.Randomness randomness)
Create a Wander8Movement with a speed and a minDistance. |
Method Summary | |
---|---|
void |
collideHorizontal()
Handle a horizontal collision. |
void |
collideLayer()
Adjust the layer (z axis) movement to a collision. |
void |
collideVertical()
Handle a vertical |
Wander8Movement |
copy(Actor actor)
Copies the movement. |
double |
getCurrentDistance()
|
int |
getMinDistance()
|
double |
getSpeed()
|
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. |
void |
setRunning(boolean running)
|
void |
setSpeed(double speed)
|
java.lang.String |
toString()
|
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, wait, wait, wait |
Methods inherited from interface org.deken.game.movement.Movement |
---|
getDirection, getGameVector |
Methods inherited from interface org.deken.game.Updateable |
---|
getName |
Constructor Detail |
---|
public Wander8Movement()
public Wander8Movement(double speed, int minDistance)
speed
- minDistance
- public Wander8Movement(double speed, int minDistance, Wander8Movement.Randomness randomness)
speed
- minDistance
- randomness
- public Wander8Movement(double speed, int minDistance, float direction)
speed
- minDistance
- direction
- public Wander8Movement(double speed, int minDistance, float direction, Wander8Movement.Randomness randomness)
speed
- minDistance
- direction
- randomness
- Method Detail |
---|
public void collideHorizontal()
collideHorizontal
in interface Movement
public void collideVertical()
collideVertical
in interface Movement
public void collideLayer()
Movement
collideLayer
in interface Movement
public Wander8Movement copy(Actor actor)
copy
in interface Movement
public double getCurrentDistance()
public int getMinDistance()
public double getSpeed()
public double getXUpdate()
Movement
getXUpdate
in interface Movement
public double getYUpdate()
Movement
getYUpdate
in interface Movement
public void setRunning(boolean running)
public void setSpeed(double speed)
public java.lang.String toString()
toString
in class java.lang.Object
public void update(long elapseTime)
Movement
update
in interface Movement
update
in interface Updateable
elapseTime
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |