|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Motion
Title: Motion
Description: This interface give motion to a game piece. These classes will maintain the Animation objects that the motion uses, updating the correct one and return the current image to be displayed. There will be an Animation for each direction that the Game Piece will need motion for.
Copyright: Copyright (c) 2005
Method Summary | |
---|---|
Motion |
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 |
BoundingBox |
getBounds()
Returns the motions BoundingBox for collision detection at the Motion level. |
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. |
boolean |
isBoundsSet()
Returns true if the BoundingBox is set for Collision. |
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 |
setBoundingBox(BoundingBox boundingBox)
Set the BoundingBox size for Collision detection at the Motion level. |
void |
setBoundingBox(int left,
int top,
int right,
int bottom)
Set the BoundingBox size for Collision detection at the Motion level. |
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. |
Method Detail |
---|
Motion copy()
void draw(java.awt.Graphics2D graphics, int x, int y)
graphics
- x
- y
- Animation[] getAnimations()
BoundingBox getBounds()
float getDirection()
java.awt.Image getImage()
java.lang.String getName()
boolean isBoundsSet()
void reset()
void setBoundingBox(BoundingBox boundingBox)
boundingBox
- void setBoundingBox(int left, int top, int right, int bottom)
left
- top
- right
- bottom
- void setDirection(float direction)
direction
- intvoid setName(java.lang.String name)
name
- void update(long elapseTime, float direction)
elapseTime
- longdirection
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |