Dragonfly 4.20
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
11namespace df {
12
13class 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) override;
28};
29
30} // end of namespace df
31
32#endif //__FIREWORK_H__
Definition: Event.h:15
Definition: Firework.h:13
int m_initial_age
Initial age when created.
Definition: Firework.h:17
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_b
RBG values for drawing.
Definition: Firework.h:15
int eventHandler(const Event *p_e) override
Handle step events.
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:38
An animation for a sprite.
Definition: Animation.h:15