2016-09-27 16:23:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
2016-10-03 11:37:49 +00:00
|
|
|
#include "object.hpp"
|
2016-09-27 17:32:12 +00:00
|
|
|
|
2016-09-27 19:16:55 +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.
|
|
|
|
*/
|
2016-10-03 11:37:49 +00:00
|
|
|
class Explosion : public Object {
|
2016-09-27 17:32:12 +00:00
|
|
|
public:
|
2016-10-02 19:06:02 +00:00
|
|
|
Explosion(size_t id, const glm::vec2 &pos, const glm::vec2 &missileVelocity, Hit hit, float maxAge=1.0);
|
2016-09-27 16:23:58 +00:00
|
|
|
|
2016-09-27 19:16:55 +00:00
|
|
|
const Hit hit; // kind of the explosion depends on the hit type
|
2016-10-02 19:06:02 +00:00
|
|
|
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 16:23:58 +00:00
|
|
|
|
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;
|
2016-09-27 19:16:55 +00:00
|
|
|
const float maxRadius; // current radius depends on time.
|
2016-10-03 11:37:49 +00:00
|
|
|
|
|
|
|
//virtual void test() = 0;
|
2016-09-27 17:32:12 +00:00
|
|
|
};
|
|
|
|
}
|