summaryrefslogtreecommitdiffhomepage
path: root/ExampleGenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ExampleGenerator.cpp')
-rw-r--r--ExampleGenerator.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/ExampleGenerator.cpp b/ExampleGenerator.cpp
index 7f4d41b..bcead95 100644
--- a/ExampleGenerator.cpp
+++ b/ExampleGenerator.cpp
@@ -1,7 +1,6 @@
#include "ExampleGenerator.h"
#include <cmath>
-#include <vector>
#include <utility>
#include <raylib.h>
@@ -9,7 +8,8 @@
#include "Bullets.h"
-ExampleGenerator::ExampleGenerator() :
+ExampleGenerator::ExampleGenerator(ConstantVelocityBullet::Vector& bullets) :
+ m_bullets {bullets},
m_delay {0},
m_interval {0.2f},
m_cone {0.3f},
@@ -22,7 +22,7 @@ ExampleGenerator::ExampleGenerator() :
void
-ExampleGenerator::update(const float dt, std::vector<ConstantVelocityBullet>& bullets)
+ExampleGenerator::update(const float dt)
{
m_delay += dt;
if (m_delay > m_interval) {
@@ -38,7 +38,7 @@ ExampleGenerator::update(const float dt, std::vector<ConstantVelocityBullet>& bu
bullet.velocity.y = sin * m_speed;
bullet.position.x = m_origin.x + cos * m_shift;
bullet.position.y = m_origin.y + sin * m_shift;
- bullets.push_back(std::move(bullet));
+ m_bullets.push_back(std::move(bullet));
}
m_segments += 3;
if (m_segments > 20)