Dragonfly  4.3
A text-based game engine
Firework.h
1 ///
2 /// A firework particle
3 ///
4 
5 #ifndef __FIREWORK_H__
6 #define __FIREWORK_H__
7 
8 // Engine include.
9 #include "Particle.h"
10 
11 namespace df {
12 
13 class Firework : public Particle {
14  private:
15  unsigned char m_r, m_g, m_b; ///< RBG values for drawing.
16  unsigned char m_initial_opacity; ///< Initial opacity when created.
17  int m_initial_age; ///< Initial age when created.
18  float m_initial_size; ///< Initial size when created.
19 
20  public:
21  /// Constructor, specifing size, age, opacity and rgb.
22  Firework(float size, int age, unsigned char opacity,
23  unsigned char r, unsigned char g, unsigned char b);
24 
25  /// Handle step events.
26  /// Return 0 if ignored, else 1.
27  int eventHandler(const Event *p_e);
28 };
29 
30 } // end of namespace df
31 
32 #endif //__FIREWORK_H__
int eventHandler(const Event *p_e)
Handle step events.
Firework(float size, int age, unsigned char opacity, unsigned char r, unsigned char g, unsigned char b)
Constructor, specifing size, age, opacity and rgb.
unsigned char m_initial_opacity
Initial opacity when created.
Definition: Firework.h:16
float m_initial_size
Initial size when created.
Definition: Firework.h:18
Definition: Particle.h:41
Definition: Firework.h:13
unsigned char m_b
RBG values for drawing.
Definition: Firework.h:15
Definition: Event.h:15
A 2-d bounding box.
Definition: Box.h:10
int m_initial_age
Initial age when created.
Definition: Firework.h:17