org.deken.game.movement
Interface Movement

All Superinterfaces:
Updateable
All Known Subinterfaces:
KeyMovement, MouseMovement
All Known Implementing Classes:
BaseMovement, FourKeyMovement, FourKeyToTile4Movement, MouseDragMovement, NoMovement, PathFindingToTile4Movement, ScriptMovement, SimpleMovement, TimeMovement, ToCorner4Movement, ToTile4Movement, TwoKeyMovement, Wander8Movement, WanderToTile4Movement

public interface Movement
extends Updateable

Title: Movement

Description: This interface is for implementing a movement control system, either through the Keyboard, mouse or other device.

Copyright: Copyright (c) 2006

Version:
1.0
Author:
Gary Deken

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.
 Movement copy(Actor actor)
          Copies the movement.
 float getDirection()
          This returns the direction of the movement.
 GameVector getGameVector()
          This returns the current GameVector for this movement.
 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 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 interface org.deken.game.Updateable
getName
 

Method Detail

collideHorizontal

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


collideLayer

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


collideVertical

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


copy

Movement copy(Actor actor)
Copies the movement.

Parameters:
actor -
Returns:
Movement

getDirection

float getDirection()
This returns the direction of the movement.

Returns:
float

getGameVector

GameVector getGameVector()
This returns the current GameVector for this movement.

Returns:
GameVector

getXUpdate

double getXUpdate()
This returns the amount of X movement for a given update.

Returns:
double

getYUpdate

double getYUpdate()
This returns the amount of Y movement for a given update.

Returns:
double

update

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.

Specified by:
update in interface Updateable
Parameters:
elapseTime - long