Class: Particle

Particle

new Particle(pos) → {Particle}

Default Constructor

Defines a particle

Parameters:
Name Type Description
pos vec2 Position of particle
Source:
Returns:
New instance of Particle
Type
Particle

Methods

draw(aCamera) → {void}

Draw function called by GameLoop
Parameters:
Name Type Description
aCamera Camera Camera to draw too
Source:
Returns:
Type
void

getAcceleration() → {Array.<Float>}

Return Acceleration
Source:
Returns:
current Acceleration [X, Y]
Type
Array.<Float>

getColor() → {Array.<Float>}

Return the current color of the particle
Source:
Returns:
current color [R, G, B, A]
Type
Array.<Float>

getDrag() → {Number}

Return Drag
Source:
Returns:
current drag value
Type
Number

getDrawBounds() → {Boolean}

Returns the bound drawing state
Source:
Returns:
true of bounds are drawn
Type
Boolean

getPosition() → {vec2}

Return current position
Source:
Returns:
current position of particle [X, Y]
Type
vec2

getVelocity() → {vec2}

Return Velocity
Source:
Returns:
current Velocity [X, Y]
Type
vec2

getXPos() → {Number}

Return the X position
Source:
Returns:
current X position
Type
Number

getYPos() → {Number}

Return the Y position
Source:
Returns:
current Y position
Type
Number

setAcceleration(g) → {undefined}

Set Acceleration
Parameters:
Name Type Description
g Array.<Float> new Acceleration [X, Y]
Source:
Returns:
Type
undefined

setColor(color) → {void}

Set the particle Color
Parameters:
Name Type Description
color Array.<Float> new color of particle [R, G, B, A]
Source:
Returns:
Type
void

setDrag(d) → {void}

Set Drag
Parameters:
Name Type Description
d Number new Drag value
Source:
Returns:
Type
void

setDrawBounds(d) → {void}

Set the bound drawing state
Parameters:
Name Type Description
d Boolean true if bounds are to be drawn
Source:
Returns:
Type
void

setPosition(xPos, yPos) → {void}

Set new position
Parameters:
Name Type Description
xPos Number New X position
yPos Number New Y position
Source:
Returns:
Type
void

setVelocity(f) → {void}

Set Velocity
Parameters:
Name Type Description
f vec2 new Velocity [X, Y]
Source:
Returns:
Type
void

setXPos(xPos) → {void}

Set the X position
Parameters:
Name Type Description
xPos Number new X position
Source:
Returns:
Type
void

setYPos(yPos) → {void}

Set the Y position
Parameters:
Name Type Description
yPos Number new Y position
Source:
Returns:
Type
void

update() → {void}

/** Update Function called by GameLoop
Source:
Returns:
Type
void