org.jrabbit.standard.game.objects.particles.generic
Class SprayParticle

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.generic.GenericParticle
                  extended by org.jrabbit.standard.game.objects.particles.generic.SprayParticle
All Implemented Interfaces:
Renderable, Updateable, Skin, GLTransform, Colored, Dimensioned, GLGroupTransformed, Located, Rotated, Scaled, ScreenObject, Visible
Direct Known Subclasses:
ExplosionParticle

public class SprayParticle
extends GenericParticle

SprayParticle extends GenericParticle to simplify the process of creating a certain type of particle effect - in this case, a particle shot straight out from its origin at an angle. This effect is useful for things like flamethrowers, steam / smoke, and any other "spurt"-like affect.

Author:
Chris Molini

Field Summary
 
Fields inherited from class org.jrabbit.standard.game.objects.particles.generic.GenericParticle
acceleration, fadeRate, scaleRate, spinRate, velocity
 
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
SprayParticle(float angle, float speed, float scaleRate, float spinRate, float lifetime)
          Creates a SprayParticle with the indicated settings.
 
Method Summary
protected static Vector2f genAngledVelocity(float angle, float speed)
          Creates a velocity vector from the indicated angle and speed.
 
Methods inherited from class org.jrabbit.standard.game.objects.particles.generic.GenericParticle
appendToParent, update
 
Methods inherited from class org.jrabbit.standard.game.objects.particles.base.Particle
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
 

Constructor Detail

SprayParticle

public SprayParticle(float angle,
                     float speed,
                     float scaleRate,
                     float spinRate,
                     float lifetime)
Creates a SprayParticle with the indicated settings.

Parameters:
angle - The angle at which the particle moves, in degrees.
speed - The speed of the particle.
scaleRate - The rate at which the particle is scaled over time.
spinRate - The rate at which the particle is rotated.
lifetime - The duration of the fadeout of the particle, in seconds.
Method Detail

genAngledVelocity

protected static Vector2f genAngledVelocity(float angle,
                                            float speed)
Creates a velocity vector from the indicated angle and speed.

Parameters:
angle - The angle of the velocity, in degrees.
speed - The magnitude of the velocity.
Returns:
The appropriate velocity.