From 7e1081ff8f1297486e177bd716fecebb42c0182a Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 18 Apr 2022 10:36:19 +0200 Subject: Added base class for generators --- ExampleGenerator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ExampleGenerator.cpp') 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 -#include #include #include @@ -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& 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& 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) -- cgit v1.1