29 lines
625 B
C++
29 lines
625 B
C++
|
#ifndef HOLESOME_COLLECTABLE_SIMULATION_HPP
|
||
|
#define HOLESOME_COLLECTABLE_SIMULATION_HPP
|
||
|
|
||
|
|
||
|
#include <box2d/box2d.h>
|
||
|
#include "../../game_object.h"
|
||
|
#include "../../collectables/collectable.hpp"
|
||
|
|
||
|
class CollectableSimulation : public GameObject
|
||
|
{
|
||
|
public:
|
||
|
explicit CollectableSimulation(const std::shared_ptr<Collectable> &collectable);
|
||
|
|
||
|
void physicsUpdate() override;
|
||
|
|
||
|
std::shared_ptr<Collectable> getCollectable() const;
|
||
|
|
||
|
private:
|
||
|
std::shared_ptr<b2World> world;
|
||
|
b2Body* body;
|
||
|
|
||
|
std::shared_ptr<Collectable> collectable;
|
||
|
|
||
|
void updateGroundHole();
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //HOLESOME_COLLECTABLE_SIMULATION_HPP
|