From bef28375cbaaa3f527b98b8c617fbfd5ca3a525a Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 10 Jan 2017 08:42:54 -0500 Subject: particles are a lot better --- include/components.hpp | 3 ++- include/particle.hpp | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'include') 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 { private: std::vector 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); -- cgit v1.2.3