Class com.next.gt.Actor
All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class com.next.gt.Actor
java.lang.Object
   |
   +----com.next.gt.Actor
  -  public class Actor
  -  extends Object
   
  -   currentFrame currentFrame
-  
  
-   height height
-  
  
-   hFrames hFrames
-  
  
-   image image
-  
  
-   numFrames numFrames
-  
  
-   owner owner
-  
  
-   velocity_x velocity_x
-  
  
-   velocity_y velocity_y
-  
  
-   width width
-  
  
-   wrapAround wrapAround
-  
  
-   x x
-  
  
-   x_old x_old
-  
  
-   y y
-  
  
-   y_old y_old
-  
   
  -   Actor() Actor()
-  
   
  -   bounceOff(Actor) bounceOff(Actor)
-  Bounce off the specified Actor.
  
-   calculateCurrentFrame() calculateCurrentFrame()
-  Calculates the current frame.
  
-   calculateNewPosition() calculateNewPosition()
-  Calculates the new X and Y position based on velocity and time.
  
-   calculateNewVelocity() calculateNewVelocity()
-  Override this to provide your own behaviour.
  
-   checkForOutOfBounds() checkForOutOfBounds()
-  Check for out of bounds and wrap if it is.
  
-   collideWithActor(Actor) collideWithActor(Actor)
-  Override this method to handle the case when Actor collides with another.
  
-   draw(Graphics) draw(Graphics)
-  Each Actor is handed a g and is expected to draw itself in it.
  
-   setImage(Image) setImage(Image)
-  Set the image used for animation.
  
-   setImage(Image, int, int) setImage(Image, int, int)
-  Set the image used for animation.
  
-   setImage(Image, int, int, int, int) setImage(Image, int, int, int, int)
-  Set the image used for animation.
  
-   tick() tick()
-  Change animation frame, calculate new position, and calculate new velocity..
   
 image
image
  protected Image image
 numFrames
numFrames
  protected int numFrames
 width
width
  public int width
 height
height
  public int height
 currentFrame
currentFrame
  public int currentFrame
 hFrames
hFrames
  protected int hFrames
 x
x
  public double x
 y
y
  public double y
 x_old
x_old
  public double x_old
 y_old
y_old
  public double y_old
 velocity_x
velocity_x
  public double velocity_x
 velocity_y
velocity_y
  public double velocity_y
 owner
owner
  public Gamelet owner
 wrapAround
wrapAround
  public boolean wrapAround
   
 Actor
Actor
  public Actor()
   
 tick
tick
  public void tick()
  -  Change animation frame, calculate new position, and calculate new velocity..
 setImage
setImage
  protected void setImage(Image theImage,
                          int frameXSize,
                          int frameYSize,
                          int framesHorizontally,
                          int totalFrames)
  -  Set the image used for animation.
 setImage
setImage
  protected void setImage(Image theImage)
  -  Set the image used for animation.  Good for an image that has all frames
within it and none empty.
 setImage
setImage
  protected void setImage(Image theImage,
                          int horizontalFrames,
                          int totalFrames)
  -  Set the image used for animation.  Good for an image that has some empty
frames within it.
 calculateNewPosition
calculateNewPosition
  protected void calculateNewPosition()
  -  Calculates the new X and Y position based on velocity and time.  Also may check if
Actor needs to wrap around at the edges if the wraparound flag is set.
 calculateNewVelocity
calculateNewVelocity
  protected void calculateNewVelocity()
  -  Override this to provide your own behaviour.
 calculateCurrentFrame
calculateCurrentFrame
  protected void calculateCurrentFrame()
  -  Calculates the current frame.  Behaviour is to flip through frames sequentially
and loop.
 checkForOutOfBounds
checkForOutOfBounds
  protected void checkForOutOfBounds()
  -  Check for out of bounds and wrap if it is.
 draw
draw
  public void draw(Graphics g)
  -  Each Actor is handed a g and is expected to draw itself in it.
 collideWithActor
collideWithActor
  protected void collideWithActor(Actor theActor)
  -  Override this method to handle the case when Actor collides with another.
 bounceOff
bounceOff
  public void bounceOff(Actor theActor)
  -  Bounce off the specified Actor.  Changes it's velocity so that it appears
to bounce off.
All Packages  Class Hierarchy  This Package  Previous  Next  Index