diff --git a/game/state/explosion.hpp b/game/state/explosion.hpp index 2cf92ef..9a37296 100644 --- a/game/state/explosion.hpp +++ b/game/state/explosion.hpp @@ -1,17 +1,28 @@ #pragma once -#if 0 +/** + * Explosion: just an effect which looks good. + */ class Explosion { public: enum class Kind { - Normal, - MissileWithShip + MissileExplodesInSpace, // missile explode in free space + MissileAgainstPlanet, // explosion of missile when it hits a planet + MissileAgainstShip // bigger explosion: missile hits a ship which explodes with it }; - glm::vec2 position; + Explosion(const glm::vec2 &pos, Kind kind, float maxAge=1.0) + : position(pos), kind(kind), age(0.0), maxAge(maxAge) + { + } - Explosion(Kind kind); + const Kind kind; // kind of the explosion + const glm::vec2 position; // position where it starts + float age; // age (in seconsd) of the explosion -public: + // age (in seconds) when the explosion is not visible + // anymore and will disappear afterwards + const float maxAge; }; + #endif diff --git a/game/state/trace.cpp b/game/state/trace.cpp new file mode 100644 index 0000000..e69de29 diff --git a/game/state/trace.hpp b/game/state/trace.hpp new file mode 100644 index 0000000..e69de29