diff options
author | Aki <please@ignore.pl> | 2022-04-18 23:50:31 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-04-18 23:50:31 +0200 |
commit | 78097b5496209b56cef9d7fc8d6c13e4c87e0eb1 (patch) | |
tree | 29ccba95bafd04b594938a7f55be61c52bf4f4cc /Enemy.h | |
parent | 5bb6b95fe71d33956491b98c29bf464a440ad221 (diff) | |
download | bullethell2022-78097b5496209b56cef9d7fc8d6c13e4c87e0eb1.zip bullethell2022-78097b5496209b56cef9d7fc8d6c13e4c87e0eb1.tar.gz bullethell2022-78097b5496209b56cef9d7fc8d6c13e4c87e0eb1.tar.bz2 |
Added simple behaviours for enemies
I don't quite like FallingAndOscillating approach. Perhaps it will be
better to just make it a list/vector in the enemy to allow for
composition.
Diffstat (limited to 'Enemy.h')
-rw-r--r-- | Enemy.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -4,18 +4,25 @@ #include <raylib.h> +#include "Behaviour.h" #include "Generator.h" class Enemy { public: - explicit Enemy(std::unique_ptr<Generator> generator = {}); + explicit Enemy(std::unique_ptr<Generator> generator); + Enemy( + std::shared_ptr<Vector2> position, + std::unique_ptr<Generator> generator, + std::unique_ptr<Behaviour> behaviour); void update(float dt); void draw(); void set_position(float x, float y); + void set_hold(float seconds); private: float m_hold; std::shared_ptr<Vector2> m_position; std::unique_ptr<Generator> m_generator; + std::unique_ptr<Behaviour> m_behaviour; }; |