|
||||||||||
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.TwoWayMotion
public class TwoWayMotion
Title: TwoWayMotion
Description: This animates a game piece with two directional motion. It defines a right and left animation.
Copyright: Copyright (c) 2005
Field Summary |
---|
Fields inherited from class org.deken.game.motion.BaseMotion |
---|
boundingBox, boundingBoxSet |
Constructor Summary | |
---|---|
protected |
TwoWayMotion()
Used by copy(). |
|
TwoWayMotion(Animation[] animations)
TwoWayMotion |
|
TwoWayMotion(Animation rightAnimation,
Animation leftAnimation)
TwoWayMotion |
Method Summary | |
---|---|
TwoWayMotion |
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 method returns the current frame of the animation. |
java.lang.String |
getName()
The method returns the name of this Motion. |
void |
reset()
This resets the animation strip back to its default (or initial start) frame, based on the direction the game piece is going. |
void |
setDirection(float direction)
This is for setting the direction. |
void |
setName(java.lang.String name)
Sets the name for the Motion. |
void |
update(long elapseTime,
float direction)
This method takes the elapse time and the the direction and updates the Animation used based on the direction. |
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 TwoWayMotion(Animation rightAnimation, Animation leftAnimation)
rightAnimation
- AnimationleftAnimation
- Animationpublic TwoWayMotion(Animation[] animations)
animations
- Animation[]protected TwoWayMotion()
Method Detail |
---|
public TwoWayMotion 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()
Motion
public java.lang.String getName()
Motion
public void reset()
Motion
public void setDirection(float direction)
Motion
direction
- intpublic void setName(java.lang.String name)
Motion
public void update(long elapseTime, float direction)
Motion
elapseTime
- long
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |