Class: ParticleSystem

ParticleSystem(texture, xPos, yPos, width, yAcceleration, life, xVelocity, yVelocity, flicker, intensity, xAcceleration, size, yOffset, startColor, finalColor, yMultiplier) → {ParticleSystem}

new ParticleSystem(texture, xPos, yPos, width, yAcceleration, life, xVelocity, yVelocity, flicker, intensity, xAcceleration, size, yOffset, startColor, finalColor, yMultiplier) → {ParticleSystem}

Default Constructor
Parameters:
Name Type Description
texture String The particle texture
xPos float The x position for the ParticleSystem
yPos float The y position for the ParticleSystem
width float The maximum horizontal offset for the particles
yAcceleration float The vertical acceleration for the paritcles
life float The life for the particles
xVelocity float The initial horizontal boost for the particles
yVelocity float The initial vertical boost for the particles
flicker float How quickly particles shrink
intensity float The number of ParticleSystem particles created per update cycle
xAcceleration float The horizontal acceleration for the paritcles
size float The size for the paritcles
yOffset float The maximum vertical offset for the paritcles
startColor Array.<Array> The beginning color for the particles
finalColor Array.<Array> The final color for the particles
yMultiplier float The number y variables will be multiplied by
Source:
Returns:
New instance of object
Type
ParticleSystem

Methods

createParticle(atX, atY) → {Paritcle}

The function for creating particles (needs to be overrided to be used)
Parameters:
Name Type Description
atX int the base xPos for the particle
atY int the base yPos for the particle
Source:
Returns:
p the particle created
Type
Paritcle

draw(aCamera)

Draws the particles on the camera passed in the argument
Parameters:
Name Type Description
aCamera Camera the camera to be viewed on
Source:

getFinalColor() → {Array.<Array>}

Returns the final color of the particles
Source:
Returns:
this.finalColor
Type
Array.<Array>

getFlicker() → {float}

Get the rate that the particles are fading
Source:
Returns:
this.flicker
Type
float

getIntensity() → {float}

Get the number of particles created per update cycle
Source:
Returns:
this.intensity
Type
float

getLife() → {float}

Increase the life of the particles
Source:
Returns:
this.life
Type
float

getParticleSize() → {float}

Get the size of the particles
Source:
Returns:
this.size
Type
float

getPos() → {Array.<Float>}

A function to return the the location of the base of the ParticleSystem
Source:
Returns:
The x and y position of the ParticleSystem
Type
Array.<Float>

getSizeBase() → {float}

Returns the base number for caluclating size
Source:
Returns:
this.sizeBase
Type
float

getStartColor() → {Array.<Array>}

Return the initial color of the particles
Source:
Returns:
this.startColor
Type
Array.<Array>

getWidth() → {float}

Get the width of the ParticleSystem object
Source:
Returns:
this.width
Type
float

getxAcceleration() → {float}

Get the xAcceleration of the particles
Source:
Returns:
this.xAcceleration
Type
float

getxVelocity() → {float}

Get the x velocity of the particles
Source:
Returns:
this.xVelocity
Type
float

getyAcceleration() → {float}

Get the yAcceleration of the particles
Source:
Returns:
this.yAcceleration
Type
float

getyMultiplier() → {float}

Return the yMultiplier of the ParticleSystem Object
Source:
Returns:
this.yMultiplier
Type
float

getyOffset() → {float}

Get the yOffset of the particles
Source:
Returns:
this.yOffset
Type
float

getyVelocity() → {float}

Get the y velocity of the particles
Source:
Returns:
this.yVelocity
Type
float

incFlicker(inc)

Increases the rate of the particles fading
Parameters:
Name Type Description
inc float how much to increment by
Source:

incIntensity(inc)

Increase the intensity (number of particles created per update cycle) of the ParticleSystem object necessary to increase as you increase the width or height of the ParticleSystem object
Parameters:
Name Type Description
inc float how much to increment by
Source:

incLife(inc)

Increase the lifespan of the particles
Parameters:
Name Type Description
inc float how much to increment by
Source:

incParticleSize(inc)

Increase the size of the particles
Parameters:
Name Type Description
inc float how much to increment by
Source:

incWidth(inc)

Increase the width of the ParticleSystem object
Parameters:
Name Type Description
inc float how much to increment by
Source:

incxAcceleration(inc)

Increase the xAcceleration of the particles
Parameters:
Name Type Description
inc float how much to increment by
Source:

incxVelocity(inc)

Increase the x velocity of the particles
Parameters:
Name Type Description
inc float how much to increment by
Source:

incyAcceleration(inc)

Increase the yAcceleration of the particles
Parameters:
Name Type Description
inc float how much to increment by
Source:

incyOffset(inc)

Increase the yOffset of the particles
Parameters:
Name Type Description
inc float how much to increment by
Source:

incyVelocity(inc)

Increase the y velocity of the particles
Parameters:
Name Type Description
inc float how much to increment by
Source:

processCollision(objSet)

Handles collsision for all particles in regards the all objects in the passed set
Parameters:
Name Type Description
objSet ObjSet the GameObjectSet to check for collision
Source:

setFinalColor(color)

Set the final color of the particles
Parameters:
Name Type Description
color Array.<Array> The new final color
Source:

setFlicker(flicker)

Sets the flicker to the passed number
Parameters:
Name Type Description
flicker float The number to set the shrinking rate to
Source:

setIntensity(intensity)

Sets the intensity to the passed number
Parameters:
Name Type Description
intensity float The number to set the intensity to
Source:

setLife(life)

Sets the life to the passed number
Parameters:
Name Type Description
life float The number to set the life to
Source:

setPos(xPos, yPos)

Set the position of the ParticleSystem Object
Parameters:
Name Type Description
xPos float The x position
yPos float They y position
Source:

setSize(size)

Sets the size to the passed number
Parameters:
Name Type Description
size float The number to set the size to
Source:

setSizeBase(num)

Set the base size number
Parameters:
Name Type Description
num float The new size base
Source:

setStartColor(color)

Set the start color of the particles
Parameters:
Name Type Description
color Array.<Array> The new start color
Source:

setWidth(width)

Sets the width to the passed number
Parameters:
Name Type Description
width float The number to set the width to
Source:

setxAcceleration(xAcceleration)

Sets the xAcceleration to the passed number
Parameters:
Name Type Description
xAcceleration float The number to set the xAcceleration to
Source:

setxVelocity(xVelocity)

Sets the xVelocity to the passed number
Parameters:
Name Type Description
xVelocity float The number to set the xVelocity to
Source:

setyAcceleration(yAcceleration)

Sets the yAcceleration to the passed number
Parameters:
Name Type Description
yAcceleration float The number to set the yAcceleration to
Source:

setyMultiplier(num)

Set the yMultiplier for the ParticleSystem object
Parameters:
Name Type Description
num float The new yMultiplier
Source:

setyOffset(yOffset)

Sets the yOffset to the passed number
Parameters:
Name Type Description
yOffset float The number to set the yOffset to
Source:

setyVelocity(yVelocity)

Sets the yVelocity to the passed number
Parameters:
Name Type Description
yVelocity float The number to set the yVelocity to
Source:

update()

Creates new particles and updates them
Source: