#pragma once #include #include "util.hpp" #include "missile_hit_type.hpp" namespace game { /** * Explosion: just an effect which looks good. */ class Explosion { public: Explosion(size_t id, const glm::vec2 &pos, const glm::vec2 &missileVelocity, Hit hit, float maxAge=1.0); const size_t id; const Hit hit; // kind of the explosion depends on the hit type const glm::vec2 position; // position where it starts const glm::vec2 missileVelocity; // impact velocity of the missile float age; // age (in seconsd) of the explosion // age (in seconds) when the explosion is not visible // anymore and will disappear afterwards const float maxAge; const float maxRadius; // current radius depends on time. }; }