diff options
author | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 19:27:35 +0100 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 19:27:49 +0100 |
commit | 17909d029c6a8872b2fddf4e171d7925bbbe9c5c (patch) | |
tree | cbb08af84cd68d24acc362d593a2048b0fa79689 /Simulation/Corpse.hpp |
Diffstat (limited to 'Simulation/Corpse.hpp')
-rw-r--r-- | Simulation/Corpse.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Simulation/Corpse.hpp b/Simulation/Corpse.hpp new file mode 100644 index 0000000..0153c24 --- /dev/null +++ b/Simulation/Corpse.hpp @@ -0,0 +1,28 @@ +#ifndef __CORPSE_HPP__ +#define __CORPSE_HPP__ + +#include "Entity.hpp" + +class Corpse : public Entity +{ +public: + void startup(SimBase *sim); + void update(); + void draw(); + + bool isCreated() const { return body ? true : false; } + bool toBeDestroyed = false; + + void setup(b2Vec2 pos, b2Vec2 lVel, float angle, float aVel); + +private: + void destroy(); + + unsigned lifetime = 0; + float energy = 0.f; + + friend class ContactListener; + friend class Guppie; +}; + +#endif // __CORPSE_HPP__ |