Sky Zone Omega - PC Version
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PS_ParticleEffect Class Reference

Handles Particle objects and Particle Effect functions. More...

#include <PS_ParticleEffect.h>

Collaboration diagram for PS_ParticleEffect:
Collaboration graph

Public Member Functions

 PS_ParticleEffect (C_Texture *texture, C_Vec2 emitter, bool emit, float moveSpeed, float scale)
 Constructs the ParticleEffect Object. More...
 
 PS_ParticleEffect (C_Texture *texture, C_Vec2 emitter, bool emit, float moveSpeed, float scale, float timerLength)
 Constructs the ParticleEffect Object. More...
 
 PS_ParticleEffect (C_Texture *texture, C_Vec2 emitter, bool emit, float moveSpeed, float scale, SDL_Colour minTint, SDL_Colour maxTint)
 Constructs the ParticleEffect Object. More...
 
 PS_ParticleEffect (C_Texture *texture, C_Vec2 emitter, bool emit, float moveSpeed, float scale, float timerLength, SDL_Colour minTint, SDL_Colour maxTint)
 Constructs the ParticleEffect Object. More...
 
 ~PS_ParticleEffect ()
 Destructs the ParticleEffect Object deleting the Particle Object from memory. More...
 
void update (float dt)
 A function that updates the ParticleEffect. More...
 
void draw (SDL_Renderer *renderer)
 Draws the ParticleEffect. More...
 
void setEmitter (C_Vec2 emitter)
 Set the position of the emitter. More...
 
void setEmitting (bool emit)
 Set the value of the emit boolean. More...
 
void setMoveSpeed (float moveSpeed)
 Set the value of the movement speed. More...
 
void setParticleScale (float scale)
 Set the scale of the particles. More...
 
C_TimergetLifeSpan ()
 Get the timer for the lifespan of the effect. More...
 
void setDead (bool dead)
 Set the value of dead. More...
 
bool getDead ()
 Get the value of dead. More...
 

Private Member Functions

void makeNewParticles ()
 Creates the new Particle objects. More...
 

Private Attributes

std::vector< PS_Particle * > particles
 A vector of Particle objects. More...
 
C_Texturetexture
 A pointer to the Texture of the particles. More...
 
float moveSpeed
 The move speed of the particles. More...
 
C_Vec2 emitter
 The position of the Particle emitter. More...
 
bool emit
 A boolean for if the ParticleEffect should emit. More...
 
float scale
 The scale of the particles. More...
 
C_TimerlifeSpan
 A timer for the lifespan of the particle effect. More...
 
bool dead
 A boolean for if the particle effect should be deleted. More...
 
bool tint
 A boolean for if the texture will be tinted. More...
 
SDL_Colour maxTint
 The max colour tint. More...
 
SDL_Colour minTint
 The min colour tint. More...
 

Detailed Description

Handles Particle objects and Particle Effect functions.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

PS_ParticleEffect::PS_ParticleEffect ( C_Texture texture,
C_Vec2  emitter,
bool  emit,
float  moveSpeed,
float  scale 
)

Constructs the ParticleEffect Object.

Parameters
textureA pointer to the particle texture.
emitterThe position that the particle effect emits from.
emitThe new value of the emit boolean.
moveSpeedThe speed of the particle effect movement.
scaleThe scale of the particles.

Here is the call graph for this function:

PS_ParticleEffect::PS_ParticleEffect ( C_Texture texture,
C_Vec2  emitter,
bool  emit,
float  moveSpeed,
float  scale,
float  timerLength 
)

Constructs the ParticleEffect Object.

Parameters
textureA pointer to the particle texture.
emitterThe position that the particle effect emits from.
emitThe new value of the emit boolean.
moveSpeedThe speed of the particle effect movement.
scaleThe scale of the particles.
timerLengthThe length of the lifespan timer for the particle effect.

Here is the call graph for this function:

PS_ParticleEffect::PS_ParticleEffect ( C_Texture texture,
C_Vec2  emitter,
bool  emit,
float  moveSpeed,
float  scale,
SDL_Colour  minTint,
SDL_Colour  maxTint 
)

Constructs the ParticleEffect Object.

Parameters
textureA pointer to the particle texture.
emitterThe position that the particle effect emits from.
emitThe new value of the emit boolean.
moveSpeedThe speed of the particle effect movement.
scaleThe scale of the particles.
minTintThe minimum tint for the particles.
maxTintThe maximum tint for the particles.

Here is the call graph for this function:

PS_ParticleEffect::PS_ParticleEffect ( C_Texture texture,
C_Vec2  emitter,
bool  emit,
float  moveSpeed,
float  scale,
float  timerLength,
SDL_Colour  minTint,
SDL_Colour  maxTint 
)

Constructs the ParticleEffect Object.

Parameters
textureA pointer to the particle texture.
emitterThe position that the particle effect emits from.
emitThe new value of the emit boolean.
moveSpeedThe speed of the particle effect movement.
scaleThe scale of the particles.
timerLengthThe length of the lifespan timer for the particle effect.
minTintThe minimum tint for the particles.
maxTintThe maximum tint for the particles.

Here is the call graph for this function:

PS_ParticleEffect::~PS_ParticleEffect ( )

Destructs the ParticleEffect Object deleting the Particle Object from memory.

Member Function Documentation

void PS_ParticleEffect::draw ( SDL_Renderer *  renderer)

Draws the ParticleEffect.

Parameters
rendererA pointer to the renderer.

Here is the caller graph for this function:

bool PS_ParticleEffect::getDead ( )

Get the value of dead.

Returns
If the particle effect is dead.
C_Timer * PS_ParticleEffect::getLifeSpan ( )

Get the timer for the lifespan of the effect.

Returns
A pointer to the timer of the particle effect.
void PS_ParticleEffect::makeNewParticles ( )
private

Creates the new Particle objects.

Here is the caller graph for this function:

void PS_ParticleEffect::setDead ( bool  dead)

Set the value of dead.

Parameters
deadThe value of dead.
void PS_ParticleEffect::setEmitter ( C_Vec2  emitter)

Set the position of the emitter.

Parameters
emitterThe new position of the emitter.

Here is the caller graph for this function:

void PS_ParticleEffect::setEmitting ( bool  emit)

Set the value of the emit boolean.

Parameters
emitThe new value of the emit boolean.

Here is the caller graph for this function:

void PS_ParticleEffect::setMoveSpeed ( float  moveSpeed)

Set the value of the movement speed.

Parameters
moveSpeedThe new value of the movement speed.
void PS_ParticleEffect::setParticleScale ( float  scale)

Set the scale of the particles.

Parameters
scaleThe scale of the particle.
void PS_ParticleEffect::update ( float  dt)

A function that updates the ParticleEffect.

Parameters
dtThe delta time.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool PS_ParticleEffect::dead
private

A boolean for if the particle effect should be deleted.

bool PS_ParticleEffect::emit
private

A boolean for if the ParticleEffect should emit.

C_Vec2 PS_ParticleEffect::emitter
private

The position of the Particle emitter.

C_Timer* PS_ParticleEffect::lifeSpan
private

A timer for the lifespan of the particle effect.

SDL_Colour PS_ParticleEffect::maxTint
private

The max colour tint.

SDL_Colour PS_ParticleEffect::minTint
private

The min colour tint.

float PS_ParticleEffect::moveSpeed
private

The move speed of the particles.

std::vector<PS_Particle*> PS_ParticleEffect::particles
private

A vector of Particle objects.

float PS_ParticleEffect::scale
private

The scale of the particles.

C_Texture* PS_ParticleEffect::texture
private

A pointer to the Texture of the particles.

bool PS_ParticleEffect::tint
private

A boolean for if the texture will be tinted.


The documentation for this class was generated from the following files: