Class AnimatedActor

java.lang.Object
  extended by greenfoot.Actor
      extended by AnimatedActor

public class AnimatedActor
extends greenfoot.Actor

Manages an actor's (player or enemy) movement and animation

Version:
0.9
Author:
Carlos

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

animating

protected boolean animating

IDLE_INDEX

public static final int IDLE_INDEX
See Also:
Constant Field Values

inWorld

protected boolean inWorld
Constructor Detail

AnimatedActor

public AnimatedActor()
Method Detail

animate

public void animate()
Change currentframe and the actor's image if not looping, stop animation and go back to first index


getAnimString

public java.lang.String getAnimString()

initAnimation

public void initAnimation(java.lang.String animString,
                          int numFrames,
                          boolean loop)
Initializes animation variables as well as the animation array

Parameters:
numFrames - total number of Frames
animString - common base name for the series of images in the animation
loop - whether or not to cycle the animation

output

public void output()
Outputs data for debugging


removeMe

public void removeMe()

scaleAnimation

public void scaleAnimation(double scaleFactor)

startAnimation

public void startAnimation()

stopAnimation

public void stopAnimation()