Creates a ParticleEffect object that handles Particle objects.
More...
#include <ParticleEffect.h>
|
| JAM_ParticleEffect (std::string fileName, JAM_Vec2 emitter, bool emit, SDL_Renderer *renderer, int screenHeight) |
|
| JAM_ParticleEffect (JAM_Vec2 emitter, bool emit, SDL_Renderer *renderer, int r, int g, int b, int screenHeight) |
|
| ~JAM_ParticleEffect () |
|
void | update (float dt) |
|
void | draw (SDL_Renderer *renderer) |
|
void | setEmitter (JAM_Vec2 emitter) |
|
void | setEmitting (bool emit) |
|
Creates a ParticleEffect object that handles Particle objects.
- Author
- Jamie Slowgrove Reference ~ This is a modified version of my PGG Assignment 2 Particle Effect class.
JAM_ParticleEffect::JAM_ParticleEffect |
( |
std::string |
fileName, |
|
|
JAM_Vec2 |
emitter, |
|
|
bool |
emit, |
|
|
SDL_Renderer * |
renderer, |
|
|
int |
screenHeight |
|
) |
| |
Constructs the ParticleEffect Object.
- Parameters
-
objectName | The file name of the texture that the Particle will use. |
emitter | The position that the particle effect emits from. |
emit | The new value of the emit boolean. |
renderer | A pointer to the renderer. |
screenHeight | The screen height. |
JAM_ParticleEffect::JAM_ParticleEffect |
( |
JAM_Vec2 |
emitter, |
|
|
bool |
emit, |
|
|
SDL_Renderer * |
renderer, |
|
|
int |
r, |
|
|
int |
g, |
|
|
int |
b, |
|
|
int |
screenHeight |
|
) |
| |
Constructs the ParticleEffect Object.
- Parameters
-
emitter | The position that the particle effect emits from. |
emit | The new value of the emit boolean. |
renderer | A pointer to the renderer. |
r | The red value (0-255). |
g | The green value (0-255). |
b | The blue value (0-255). |
screenHeight | The screen height. |
JAM_ParticleEffect::~JAM_ParticleEffect |
( |
| ) |
|
Destructs the ParticleEffect Object deleting the Particle Object from memory.
void JAM_ParticleEffect::draw |
( |
SDL_Renderer * |
renderer | ) |
|
Draws the ParticleEffect.
- Parameters
-
renderer | A pointer to the renderer. |
void JAM_ParticleEffect::makeNewParticles |
( |
| ) |
|
|
private |
Creates the new Particle objects.
void JAM_ParticleEffect::setEmitter |
( |
JAM_Vec2 |
emitter | ) |
|
Setter # The position of the emitter.
- Parameters
-
emitter | The new position of the emitter. |
void JAM_ParticleEffect::setEmitting |
( |
bool |
emit | ) |
|
Setter # The value of the emit boolean.
- Parameters
-
emit | The new value of the emit boolean. |
void JAM_ParticleEffect::update |
( |
float |
dt | ) |
|
A function that updates the ParticleEffect
- Parameters
-
bool JAM_ParticleEffect::emit |
|
private |
A boolean for if the ParticleEffect should emit.
The position of the Particle emitter.
float JAM_ParticleEffect::moveSpeed |
|
private |
The move speed of the particles.
A vector of Particle objects.
int JAM_ParticleEffect::screenHeight |
|
private |
A pointer to the Texture of the particles.
The documentation for this class was generated from the following files: