|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.motion.BaseMotion
org.deken.game.motion.FourWayMotion
public class FourWayMotion
Title: FourWayMotion
Description: This animates a game piece in four directions, up, down, right and left.
Copyright: Copyright (c) 2005
Field Summary |
---|
Fields inherited from class org.deken.game.motion.BaseMotion |
---|
boundingBox, boundingBoxSet |
Constructor Summary | |
---|---|
protected |
FourWayMotion()
Used by copy(). |
|
FourWayMotion(Animation[] animations)
FourWayMotion The animation array is set in the order of the FourWayMotion constants for directions. |
|
FourWayMotion(Animation north_Animation,
Animation east_Animation,
Animation south_Animation,
Animation west_Animation)
FourWayMovement |
Method Summary | |
---|---|
FourWayMotion |
copy()
Copies the Motion. |
void |
draw(java.awt.Graphics2D graphics,
int x,
int y)
This method gets the current animation and draws it. |
Animation[] |
getAnimations()
Returns the Animations that make up this Motion |
float |
getDirection()
Returns the direction of the Motion. |
java.awt.Image |
getImage()
This returns the current frame of the current Animation. |
java.lang.String |
getName()
The method returns the name of this Motion. |
void |
reset()
This reset all the Animations, setting them to begin a new. |
void |
setDirection(float direction)
This sets the direction in the GameVector, and sets the current Animation based on the direction. |
void |
setName(java.lang.String name)
Sets the name for the Motion. |
void |
update(long elapseTime,
float direction)
This takes the elapse time and GameVector, it calls the setGameVector() and update() on the current Animation. |
Methods inherited from class org.deken.game.motion.BaseMotion |
---|
getBounds, isBoundsSet, setBoundingBox, setBoundingBox |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FourWayMotion(Animation north_Animation, Animation east_Animation, Animation south_Animation, Animation west_Animation)
north_Animation
- Animationeast_Animation
- Animationsouth_Animation
- Animationwest_Animation
- Animationpublic FourWayMotion(Animation[] animations)
animations
- Animation[]protected FourWayMotion()
Method Detail |
---|
public FourWayMotion copy()
public void draw(java.awt.Graphics2D graphics, int x, int y)
Motion
graphics
- x
- y
- public Animation[] getAnimations()
Motion
public float getDirection()
Motion
public java.awt.Image getImage()
public java.lang.String getName()
Motion
public void reset()
public void setDirection(float direction)
direction
- floatpublic void setName(java.lang.String name)
Motion
public void update(long elapseTime, float direction)
elapseTime
- longdirection
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |