TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tb_particle_emitter.hpp
1 
9 #ifndef TurtleBrains_ParticleEmitter_hpp
10 #define TurtleBrains_ParticleEmitter_hpp
11 
12 #include <turtle_brains/graphics/unstable/tb_particle_manager.hpp>
13 #include <turtle_brains/graphics/tb_graphic_list.hpp>
14 
15 #include <turtle_brains/core/tb_types.hpp>
16 #include <turtle_brains/math/tb_vector.hpp>
17 
18 #include <list>
19 
20 namespace TurtleBrains
21 {
22  namespace Graphics
23  {
24  namespace Unstable
25  {
31  class ParticleEmitter : public Graphic
32  {
33  public:
34  ParticleEmitter(const tbCore::tbString& particleSheet, const tbCore::tbString& emitterName);
35  virtual ~ParticleEmitter(void);
36 
37  void StartEmitter(void);
38  void StopEmitter(void);
39 
40  void SetVelocity(const tbMath::Vector2& velocity) { mVelocity = velocity; }
41  protected:
42  virtual void OnUpdate(const float deltaTime) override;
43  virtual void OnRender(void) const override;
44 
45  private:
46  tbImplementation::Particle CreateEmittedParticle(void);
47 
48  tbCore::uint32 mLifeTimer; //If this is 60000 the emitter will never shutoff!
49  tbCore::uint32 mSpawnTimer;
50  tbMath::Vector2 mVelocity;
51 
52  const tbCore::tbString mParticleSheet;
53  const tbCore::tbString mEmitterName;
54  EmitterDefinition mEmitterDefinition;
55  };
56 
58  } /* namespace Unstable */
59  }; /* namespace Graphics */
60 }; /* namespace TurtleBrains */
61 
63 
64 #endif /* TurtleBrains_ParticleEmitter_hpp */
Definition: tb_vector.hpp:48
Give the GameScene and Entities something to display, Text, Sprites and AnimatedSprites help bring th...
Here is some information about the primary namespace.
Definition: tb_application_dialog.hpp:21
uint32_t uint32
Unsigned integer with a size of 32 bits. Supports values from 0 to 4294967295, (2^32 - 1)...
Definition: tb_types.hpp:28
std::string tbString
Definition: tb_string.hpp:335