org.deken.game.movement
Class SimpleMovement

java.lang.Object
  extended by org.deken.game.movement.BaseMovement
      extended by org.deken.game.movement.SimpleMovement
All Implemented Interfaces:
Movement, Updateable

public class SimpleMovement
extends BaseMovement
implements Movement

Title: SimpleMovement

Description: This movement is for movements that are one directional. A simple movement with no intelligence.

Copyright: (c) 2010

Version:
1.0
Author:
Gary Deken

Field Summary
 
Fields inherited from class org.deken.game.movement.BaseMovement
gameVector, name
 
Constructor Summary
protected SimpleMovement()
           
  SimpleMovement(GameVector gameVector)
          SimpleMovement Creates a SimpleMovement going in the direction of the GameVector.
 
Method Summary
 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.
 SimpleMovement copy(Actor actor)
          Copies this SimpleMovement.
 java.lang.String getName()
           
 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 setGameVector(GameVector gameVector)
           
 void setRunning(boolean running)
           
 void setSpeed(double speed)
           
 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, 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
getDirection, getGameVector
 

Constructor Detail

SimpleMovement

public SimpleMovement(GameVector gameVector)
SimpleMovement Creates a SimpleMovement going in the direction of the GameVector.

Parameters:
gameVector - GameVector

SimpleMovement

protected SimpleMovement()
Method Detail

collideHorizontal

public void collideHorizontal()
Adjust the horizontal (x axis) movement to a collision.

Specified by:
collideHorizontal in interface Movement

collideVertical

public void collideVertical()
Adjust the vertical (y axis) movement to a collision.

Specified by:
collideVertical in interface Movement

collideLayer

public void collideLayer()
Adjust the layer (z axis) movement to a collision.

Specified by:
collideLayer in interface Movement

copy

public SimpleMovement copy(Actor actor)
Copies this SimpleMovement.

Specified by:
copy in interface Movement
Returns:
SimpleMovement

getName

public java.lang.String getName()
Specified by:
getName in interface Updateable
Overrides:
getName in class BaseMovement
Returns:

getSpeed

public double getSpeed()

getXUpdate

public double getXUpdate()
Description copied from interface: Movement
This returns the amount of X movement for a given update.

Specified by:
getXUpdate in interface Movement
Returns:
double

getYUpdate

public double getYUpdate()
Description copied from interface: Movement
This returns the amount of Y movement for a given update.

Specified by:
getYUpdate in interface Movement
Returns:
double

setGameVector

public void setGameVector(GameVector gameVector)

setRunning

public void setRunning(boolean running)

setSpeed

public void setSpeed(double speed)

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
Parameters:
elapseTime - long