Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
ParticleEffect.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SDL.h>
4 #include <vector>
5 #include <time.h>
6 #include <string>
7 #include "Particle.h"
8 #include "Vec2.h"
9 #include "Utilities.h"
10 
12 #define MAX_NUMBER_OF_PARTICLES 100
13 
20 {
21 private:
23  std::vector<JAM_Particle*> particles;
27  float moveSpeed;
31  bool emit;
34 
38  void makeNewParticles();
39 
40 public:
49  JAM_ParticleEffect(std::string fileName, JAM_Vec2 emitter, bool emit, SDL_Renderer* renderer, int screenHeight);
50 
61  JAM_ParticleEffect(JAM_Vec2 emitter, bool emit, SDL_Renderer* renderer, int r, int g, int b, int screenHeight);
62 
67 
72  void update(float dt);
73 
78  void draw(SDL_Renderer* renderer);
79 
84  void setEmitter(JAM_Vec2 emitter);
85 
90  void setEmitting(bool emit);
91 };
JAM_Texture * texture
Definition: ParticleEffect.h:25
void makeNewParticles()
Definition: ParticleEffect.cpp:120
Creates a Texture for use with a renderer. Creates a Texture from an image file, this can then be use...
Definition: Texture.h:13
int screenHeight
Definition: ParticleEffect.h:33
JAM_Vec2 emitter
Definition: ParticleEffect.h:29
void update(float dt)
Definition: ParticleEffect.cpp:68
void draw(SDL_Renderer *renderer)
Definition: ParticleEffect.cpp:107
JAM_ParticleEffect(std::string fileName, JAM_Vec2 emitter, bool emit, SDL_Renderer *renderer, int screenHeight)
Definition: ParticleEffect.cpp:6
float moveSpeed
Definition: ParticleEffect.h:27
void setEmitter(JAM_Vec2 emitter)
Definition: ParticleEffect.cpp:150
~JAM_ParticleEffect()
Definition: ParticleEffect.cpp:56
void setEmitting(bool emit)
Definition: ParticleEffect.cpp:159
bool emit
Definition: ParticleEffect.h:31
Creates a ParticleEffect object that handles Particle objects.
Definition: ParticleEffect.h:19
std::vector< JAM_Particle * > particles
Definition: ParticleEffect.h:23
Creates an Vec2 structure with functions. Creates an Vec2 structure with overloaded operators to crea...
Definition: Vec2.h:9