diff options
author | Aki <please@ignore.pl> | 2022-04-20 01:56:47 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-04-20 01:56:47 +0200 |
commit | 915dd2a9acda9c505ad82bd2dd8df282670ed5fd (patch) | |
tree | 8a8312ed102d16dc4a5a371c6d6c4af93a02bcac /EnemyFactory.cpp | |
parent | 97048f6c42ebcecd765403f51811cfb212952654 (diff) | |
download | bullethell2022-915dd2a9acda9c505ad82bd2dd8df282670ed5fd.zip bullethell2022-915dd2a9acda9c505ad82bd2dd8df282670ed5fd.tar.gz bullethell2022-915dd2a9acda9c505ad82bd2dd8df282670ed5fd.tar.bz2 |
Added another generator and enemy for testing purposes
Diffstat (limited to 'EnemyFactory.cpp')
-rw-r--r-- | EnemyFactory.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/EnemyFactory.cpp b/EnemyFactory.cpp index 8a51c3f..a154ae5 100644 --- a/EnemyFactory.cpp +++ b/EnemyFactory.cpp @@ -8,6 +8,7 @@ #include "Enemy.h" #include "ExampleGenerator.h" #include "FallingAndOscillating.h" +#include "WaveGenerator.h" Enemy @@ -20,7 +21,6 @@ EnemyFactory::make_example( auto position = std::make_shared<Vector2>(Vector2{x, y}); auto generator = std::make_shared<ExampleGenerator>(position, bullets); auto behaviour = std::make_shared<FallingAndOscillating>(position, generator); - generator->m_position = position; if (mirror) { generator->m_color = Color{100, 0, 255, 255}; generator->m_direction *= -1; @@ -30,3 +30,18 @@ EnemyFactory::make_example( enemy.m_hold = hold; return enemy; } + + +Enemy +EnemyFactory::make_waver( + ConstantVelocityBullet::Vector& bullets, + const float x, const float y, + const float hold) +{ + auto position = std::make_shared<Vector2>(Vector2{x, y}); + auto generator = std::make_shared<WaveGenerator>(position, bullets); + auto behaviour = std::make_shared<Falling>(position, generator); + Enemy enemy(position, generator, behaviour); + enemy.m_hold = hold; + return enemy; +} |