Arcade Shooter
Emitter.h
1 
2 /* ██╗ ██╗ █████╗ ████████╗ █████╗ ███╗ ██╗ █████╗
3  ██║ ██╔╝ ██╔══██╗ ╚══██╔══╝ ██╔══██╗ ████╗ ██║ ██╔══██╗
4  █████╔╝ ███████║ ██║ ███████║ ██╔██╗ ██║ ███████║
5  ██╔═██╗ ██╔══██║ ██║ ██╔══██║ ██║╚██╗██║ ██╔══██║
6  ██║ ██╗ ██║ ██║ ██║ ██║ ██║ ██║ ╚████║ ██║ ██║
7  ╚═╝ ╚═╝ ╚═╝ ╚═╝/\ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝
8  /vvvvvvvvvvvvvvvvvvv \=========================================,
9  `^^^^^^^^^^^^^^^^^^^ /---------------------------------------"
10  Katana Engine \/ © 2012 - Shuriken Studios LLC */
11 
12 #pragma once
13 
14 namespace KatanaEngine
15 {
16 
18  class Emitter
19  {
20 
21  public:
22 
25  Emitter(ParticleManager *pManager);
26 
33  Emitter(ParticleManager *pManager, ParticleTemplate *pTemplate);
34 
42  Emitter(ParticleManager *pManager, ParticleTemplate *pTemplate, const int particlesPerSecond);
43 
44  virtual ~Emitter() { }
45 
49  virtual void Update(const GameTime *pGameTime);
50 
55  virtual void SetOutput(const float output) { m_output = output; }
56 
62  virtual void SetPosition(const Vector2 position);
63 
66  virtual void SetTemplate(ParticleTemplate *pTemplate) { m_pTemplate = pTemplate; }
67 
72  virtual void SetParticlesPerSecond(float particlesPerSecond) { m_particlesPerSecond = particlesPerSecond; }
73 
74 
75  private:
76 
77  float m_output;
78 
79  float m_leftoverParticles;
80 
81  int m_particlesPerSecond;
82 
83  ParticleManager *m_pManager;
84 
85  ParticleTemplate *m_pTemplate;
86 
87  Vector2 m_position;
88  Vector2 m_previousPosition;
89 
90  };
91 }
The source of output for a particle effect.
Definition: Emitter.h:18
virtual void SetTemplate(ParticleTemplate *pTemplate)
Sets the template that the particles will use to update and for initialization.
Definition: Emitter.h:66
Contains timing values for game updates and rendering.
Definition: GameTime.h:17
Manages the active particles in a particle system.
Definition: ParticleManager.h:18
Emitter(ParticleManager *pManager)
Instantiate a particle emitter object.
Definition: Emitter.cpp:16
Base class for particle templates which are used to control the updating of a corresponding particle ...
Definition: ParticleTemplate.h:17
Defines a vector with 2 components (x and y). This is additional information...
Definition: Vector2.h:18
virtual void SetOutput(const float output)
Sets the output percentage for the emitter.
Definition: Emitter.h:55
virtual void Update(const GameTime *pGameTime)
Called when the game has determined that game logic needs to be processed.
Definition: Emitter.cpp:32
virtual void SetPosition(const Vector2 position)
Sets the position of the emitter.
Definition: Emitter.cpp:54
virtual void SetParticlesPerSecond(float particlesPerSecond)
Sets the number of particles that will be emitted per second, when the output is set to one...
Definition: Emitter.h:72
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...
Definition: Animation.cpp:14