From 78097b5496209b56cef9d7fc8d6c13e4c87e0eb1 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 18 Apr 2022 23:50:31 +0200 Subject: 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. --- Oscillating.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Oscillating.h (limited to 'Oscillating.h') diff --git a/Oscillating.h b/Oscillating.h new file mode 100644 index 0000000..d596e0f --- /dev/null +++ b/Oscillating.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "Behaviour.h" +#include "Generator.h" + + +class Oscillating : virtual public Behaviour +{ +public: + Oscillating(); + void update(float dt, Vector2& position, Generator& generator) override; + void set_phase(float phase); +private: + float m_phase; + float m_shift; +}; -- cgit v1.1