Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
JAM_ParticleEffect Class Reference

Creates a ParticleEffect object that handles Particle objects. More...

#include <ParticleEffect.h>

Collaboration diagram for JAM_ParticleEffect:
Collaboration graph

Public Member Functions

 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)
 

Private Member Functions

void makeNewParticles ()
 

Private Attributes

std::vector< JAM_Particle * > particles
 
JAM_Texturetexture
 
float moveSpeed
 
JAM_Vec2 emitter
 
bool emit
 
int screenHeight
 

Detailed Description

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.

Constructor & Destructor Documentation

JAM_ParticleEffect::JAM_ParticleEffect ( std::string  fileName,
JAM_Vec2  emitter,
bool  emit,
SDL_Renderer *  renderer,
int  screenHeight 
)

Constructs the ParticleEffect Object.

Parameters
objectNameThe file name of the texture that the Particle will use.
emitterThe position that the particle effect emits from.
emitThe new value of the emit boolean.
rendererA pointer to the renderer.
screenHeightThe screen height.

Here is the call graph for this function:

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
emitterThe position that the particle effect emits from.
emitThe new value of the emit boolean.
rendererA pointer to the renderer.
rThe red value (0-255).
gThe green value (0-255).
bThe blue value (0-255).
screenHeightThe screen height.

Here is the call graph for this function:

JAM_ParticleEffect::~JAM_ParticleEffect ( )

Destructs the ParticleEffect Object deleting the Particle Object from memory.

Member Function Documentation

void JAM_ParticleEffect::draw ( SDL_Renderer *  renderer)

Draws the ParticleEffect.

Parameters
rendererA pointer to the renderer.
void JAM_ParticleEffect::makeNewParticles ( )
private

Creates the new Particle objects.

Here is the call graph for this function:

Here is the caller graph for this function:

void JAM_ParticleEffect::setEmitter ( JAM_Vec2  emitter)

Setter # The position of the emitter.

Parameters
emitterThe new position of the emitter.
void JAM_ParticleEffect::setEmitting ( bool  emit)

Setter # The value of the emit boolean.

Parameters
emitThe new value of the emit boolean.
void JAM_ParticleEffect::update ( float  dt)

A function that updates the ParticleEffect

Parameters
dtThe delta time.

Here is the call graph for this function:

Member Data Documentation

bool JAM_ParticleEffect::emit
private

A boolean for if the ParticleEffect should emit.

JAM_Vec2 JAM_ParticleEffect::emitter
private

The position of the Particle emitter.

float JAM_ParticleEffect::moveSpeed
private

The move speed of the particles.

std::vector<JAM_Particle*> JAM_ParticleEffect::particles
private

A vector of Particle objects.

int JAM_ParticleEffect::screenHeight
private

The screen height.

JAM_Texture* JAM_ParticleEffect::texture
private

A pointer to the Texture of the particles.


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