summaryrefslogtreecommitdiffhomepage
path: root/TestStage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TestStage.cpp')
-rw-r--r--TestStage.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/TestStage.cpp b/TestStage.cpp
index e6406f8..d858fcb 100644
--- a/TestStage.cpp
+++ b/TestStage.cpp
@@ -5,28 +5,19 @@
#include <raylib.h>
-#include "ExampleGenerator.h"
-#include "FallingAndOscillating.h"
+#include "EnemyFactory.h"
TestStage::TestStage() :
m_player {},
m_const {}
{
- m_enemies.reserve(2);
- for (const float x : {350.f, 450.f, 400.f}) {
- auto position = std::make_shared<Vector2>(Vector2{x, 100.f});
- auto generator = std::make_unique<ExampleGenerator>(m_const.m_bullets);
- auto behaviour = std::make_unique<FallingAndOscillating>();
- if (x > 410.f) {
- generator->m_direction *= -1;
- behaviour->set_phase(1.f);
- }
- Enemy enemy(position, std::move(generator), std::move(behaviour));
- if (x > 390.f && x < 410.f)
- enemy.set_hold(20.f);
- m_enemies.push_back(std::move(enemy));
- }
+ m_enemies.reserve(5);
+ m_enemies.push_back(std::move(EnemyFactory::make_example(m_const.m_bullets, 300, -10, 0)));
+ m_enemies.push_back(std::move(EnemyFactory::make_example(m_const.m_bullets, 500, -10, 0, true)));
+ m_enemies.push_back(std::move(EnemyFactory::make_example(m_const.m_bullets, 400, -10, 10)));
+ m_enemies.push_back(std::move(EnemyFactory::make_example(m_const.m_bullets, 550, -10, 20)));
+ m_enemies.push_back(std::move(EnemyFactory::make_example(m_const.m_bullets, 250, -10, 20, true)));
}