|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.sprites.Sprite
org.deken.game.sprites.Actor
public abstract class Actor
Title: Actor
Description: A moving sprite.
Copyright: Copyright (c) 2005
Field Summary | |
---|---|
protected int |
currentMoveMotion
|
protected int |
currentStillMotion
|
protected Movement |
movement
|
protected Motion[] |
moveMotion
|
protected Motion[] |
stillMotion
|
Fields inherited from class org.deken.game.sprites.Sprite |
---|
boundingBox, collisionMap, location, size |
Constructor Summary | |
---|---|
Actor(Motion motion,
Movement movement,
SpriteSize size)
|
|
Actor(Motion motion,
Movement movement,
SpriteSize size,
Animation stillAnimation)
|
|
Actor(SpriteSize size)
Actor This constructor is used by the DocumentManager. |
Method Summary | |
---|---|
protected BaseActor |
copyBase(BaseActor newActor)
|
void |
draw(java.awt.Graphics2D graphics,
int xOffset,
int yOffset)
If the Motion has a non zero speed (it's moving), then return the AnimationMotion's image. |
BoundingBox |
getBounds()
|
Motion |
getCurrentMoveMotion()
|
float |
getDirection()
|
Movement |
getMovement()
|
Motion[] |
getMoveMotions()
|
double |
getSpeed()
|
Motion[] |
getStillMotion()
|
void |
setCurrentMoveMotion(int currentMoveMotion)
|
void |
setDirection(float direction)
This is a cover method, to set the direction in the current movement Motion. |
void |
setMotion(Motion motion)
This sets the first moveMotion. |
void |
setMovement(Movement movement)
|
void |
setMoveMotions(Motion[] motions)
|
void |
setStillAnimations(Animation[] stillAnimation)
|
void |
setStillMotion(Motion[] stillMotion)
|
void |
update(long elaspeTime)
This method calls the update for the motion, and sets the new location, based on the updated X and Y. |
protected void |
updateCurrentMotion()
This sets the current motion indices based on the current speed of the Actor. |
protected void |
updateLocationX()
|
protected void |
updateLocationY()
|
Methods inherited from class org.deken.game.sprites.Sprite |
---|
copy, getDepth, getHeight, getLocation, getName, getSize, getWidth, getXLocation, getYLocation, removeFromMap, setBoundingBox, setBoundingBox, setCollisionMap, setLocation, setName, setSize, spriteCollison, toString, updateLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Movement movement
protected Motion[] moveMotion
protected int currentMoveMotion
protected Motion[] stillMotion
protected int currentStillMotion
Constructor Detail |
---|
public Actor(SpriteSize size)
size
- PieceSizepublic Actor(Motion motion, Movement movement, SpriteSize size)
motion
- Motionmovement
- Movementsize
- SpriteSizepublic Actor(Motion motion, Movement movement, SpriteSize size, Animation stillAnimation)
motion
- Motionmovement
- Movementsize
- SpriteSizestillAnimation
- AnimationMethod Detail |
---|
public void draw(java.awt.Graphics2D graphics, int xOffset, int yOffset)
draw
in class Sprite
graphics
- xOffset
- yOffset
- public BoundingBox getBounds()
getBounds
in class Sprite
public float getDirection()
public Motion getCurrentMoveMotion()
public Motion[] getMoveMotions()
public Movement getMovement()
public double getSpeed()
public Motion[] getStillMotion()
public void setCurrentMoveMotion(int currentMoveMotion)
public void setDirection(float direction)
direction
- floatpublic void setMotion(Motion motion)
motion
- Motionpublic void setMoveMotions(Motion[] motions)
motions
- public void setMovement(Movement movement)
movement
- Movementpublic void setStillAnimations(Animation[] stillAnimation)
stillAnimation
- public void setStillMotion(Motion[] stillMotion)
public void update(long elaspeTime)
update
in interface Updateable
update
in class Sprite
elaspeTime
- longprotected BaseActor copyBase(BaseActor newActor)
newActor
-
protected void updateCurrentMotion()
protected void updateLocationX()
protected void updateLocationY()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |