summaryrefslogtreecommitdiffhomepage
path: root/TestStage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TestStage.cpp')
-rw-r--r--TestStage.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/TestStage.cpp b/TestStage.cpp
index 2ce4118..e6406f8 100644
--- a/TestStage.cpp
+++ b/TestStage.cpp
@@ -3,7 +3,10 @@
#include <memory>
#include <utility>
+#include <raylib.h>
+
#include "ExampleGenerator.h"
+#include "FallingAndOscillating.h"
TestStage::TestStage() :
@@ -11,12 +14,17 @@ TestStage::TestStage() :
m_const {}
{
m_enemies.reserve(2);
- for (const float x : {300.f, 500.f}) {
+ 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);
- if (x > 400.f)
+ auto behaviour = std::make_unique<FallingAndOscillating>();
+ if (x > 410.f) {
generator->m_direction *= -1;
- Enemy enemy(std::move(generator));
- enemy.set_position(x, 100.f);
+ 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));
}
}