java.lang.Objectgreenfoot.Actor
AnimatedActor
public class AnimatedActor
Manages an actor's (player or enemy) movement and animation
| Field Summary | |
|---|---|
protected boolean |
animating
|
static int |
IDLE_INDEX
|
protected boolean |
inWorld
|
| Constructor Summary | |
|---|---|
AnimatedActor()
|
|
| Method Summary | |
|---|---|
void |
animate()
Change currentframe and the actor's image if not looping, stop animation and go back to first index |
java.lang.String |
getAnimString()
|
void |
initAnimation(java.lang.String animString,
int numFrames,
boolean loop)
Initializes animation variables as well as the animation array |
void |
output()
Outputs data for debugging |
void |
removeMe()
|
void |
scaleAnimation(double scaleFactor)
|
void |
startAnimation()
|
void |
stopAnimation()
|
| Methods inherited from class greenfoot.Actor |
|---|
act, addedToWorld, getHeight, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWidth, getWorld, getX, getY, intersects, setImage, setImage, setLocation, setRotation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean animating
public static final int IDLE_INDEX
protected boolean inWorld
| Constructor Detail |
|---|
public AnimatedActor()
| Method Detail |
|---|
public void animate()
public java.lang.String getAnimString()
public void initAnimation(java.lang.String animString,
int numFrames,
boolean loop)
numFrames - total number of FramesanimString - common base name for the series of images in the animationloop - whether or not to cycle the animationpublic void output()
public void removeMe()
public void scaleAnimation(double scaleFactor)
public void startAnimation()
public void stopAnimation()