KlassischeKeplerKriege/game/state/explosion.hpp

29 lines
827 B
C++
Raw Normal View History

#pragma once
#include "object.hpp"
2016-09-27 17:32:12 +00:00
#include "util.hpp"
#include "missile_hit_type.hpp"
2016-09-27 17:32:12 +00:00
namespace game {
/**
* Explosion: just an effect which looks good.
*/
class Explosion : public Object {
2016-09-27 17:32:12 +00:00
public:
Explosion(size_t id, const glm::vec2 &pos, const glm::vec2 &missileVelocity, Hit hit, float maxAge=1.0);
const Hit hit; // kind of the explosion depends on the hit type
const glm::vec2 missileVelocity; // impact velocity of the missile
2016-09-27 17:32:12 +00:00
float age; // age (in seconsd) of the explosion
2016-09-27 17:32:12 +00:00
// 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.
//virtual void test() = 0;
2016-09-27 17:32:12 +00:00
};
}