org.jrabbit.standard.game.objects.particles.base
Class AnimatedParticle

java.lang.Object
  extended by org.jrabbit.standard.game.objects.base.Spatial
      extended by org.jrabbit.standard.game.objects.base.BaseSprite
          extended by org.jrabbit.standard.game.objects.particles.base.Particle
              extended by org.jrabbit.standard.game.objects.particles.base.AnimatedParticle
All Implemented Interfaces:
Renderable, Updateable, Skin, GLTransform, Colored, Dimensioned, GLGroupTransformed, Located, Rotated, Scaled, ScreenObject, Visible

public class AnimatedParticle
extends Particle

An AnimatedParticle is a Particle that loops through the available Skins in its parent, providing simple, looping Animation. To create more advanced animations, it's recommended that you build your own.

Author:
Chris Molini

Field Summary
protected  int frameCounter
          This counter keeps track of how long the animation has been on its current frame.
protected  int frameInterval
          Indicates how many microseconds the animation is supposed to linger on each frame.
 
Fields inherited from class org.jrabbit.standard.game.objects.particles.base.Particle
parent, skinID
 
Fields inherited from class org.jrabbit.standard.game.objects.base.BaseSprite
color, screenCoords, transforms, visible
 
Fields inherited from class org.jrabbit.standard.game.objects.base.Spatial
location, rotation, scalar
 
Constructor Summary
AnimatedParticle(int interval)
          Creates an animation that loops through the Skins of its parent at the indicated speed.
AnimatedParticle(int interval, int startFrame)
          Creates an animation that loops through the Skins of its parent at the indicated speed, beginning at the indicated frame.
 
Method Summary
 void update(int delta)
          Updates the animation.
 
Methods inherited from class org.jrabbit.standard.game.objects.particles.base.Particle
appendToParent, draw, height, kill, setParent, setSkinID, skin, skinID, width
 
Methods inherited from class org.jrabbit.standard.game.objects.base.BaseSprite
bind, color, onscreen, release, render, screenCoords, setVisible, shouldRender, transforms, visible
 
Methods inherited from class org.jrabbit.standard.game.objects.base.Spatial
location, rotation, scalar, scaledDiameter, scaledHeight, scaledWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frameCounter

protected int frameCounter
This counter keeps track of how long the animation has been on its current frame.


frameInterval

protected int frameInterval
Indicates how many microseconds the animation is supposed to linger on each frame.

Constructor Detail

AnimatedParticle

public AnimatedParticle(int interval)
Creates an animation that loops through the Skins of its parent at the indicated speed. NOTE: The animation begins at frame 0.

Parameters:
interval - The number of microseconds the animation will linger on each frame of animation.

AnimatedParticle

public AnimatedParticle(int interval,
                        int startFrame)
Creates an animation that loops through the Skins of its parent at the indicated speed, beginning at the indicated frame.

Parameters:
interval - The number of microseconds the animation will linger on each frame of animation.
startFrame - The beginning frame.
Method Detail

update

public void update(int delta)
Updates the animation.

Parameters:
delta - The number of microseconds that have passed.