diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2017-01-10 08:42:54 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2017-01-10 08:42:54 -0500 |
commit | bef28375cbaaa3f527b98b8c617fbfd5ca3a525a (patch) | |
tree | b1dbd24b17fd6d9bb26f4b915ec33d934e398947 /include | |
parent | 0aae714d4d894a4bfa9582c71ee8a1778260a047 (diff) |
particles are a lot better
Diffstat (limited to 'include')
-rw-r--r-- | include/components.hpp | 3 | ||||
-rw-r--r-- | include/particle.hpp | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/include/components.hpp b/include/components.hpp index 1deaf69..8e245a7 100644 --- a/include/components.hpp +++ b/include/components.hpp @@ -44,10 +44,11 @@ struct Direction { * @param x The velocity of the object on the x axis. * @param y The velocity of the object on the y axis. */ - Direction(float x = 0.0f, float y = 0.0f): x(x), y(y) {} + Direction(float x = 0.0f, float y = 0.0f): x(x), y(y), grounded(false) {} float x; /**< Velocity the object is moving in the x direction, this is added to the position */ float y; /**< Velocity the object is moving in the y direction, this is added to the position */ + bool grounded; }; /** diff --git a/include/particle.hpp b/include/particle.hpp index 3fcd409..92ab7e4 100644 --- a/include/particle.hpp +++ b/include/particle.hpp @@ -11,7 +11,8 @@ enum class ParticleType : char { Drop, Confetti, - SmallBlast + SmallBlast, + SmallPoof }; struct Particle { @@ -28,10 +29,10 @@ struct Particle { class ParticleSystem : public entityx::System<ParticleSystem> { private: std::vector<Particle> parts; - bool max; + unsigned int maximum; public: - ParticleSystem(int count = 2048, bool m = false); + ParticleSystem(unsigned int max = 2048); void add(const vec2& pos, const ParticleType& type, const int& timeleft = 3000, const unsigned char& color = 0); |