#include "TestStage.h" #include #include #include "ExampleGenerator.h" TestStage::TestStage() : m_player {}, m_const {} { m_enemies.reserve(2); for (const float x : {200.f, 600.f}) { Enemy enemy(std::make_unique(m_const.m_bullets)); enemy.set_position(x, 20.f); m_enemies.push_back(std::move(enemy)); } } void TestStage::update(const float dt) { m_player.update(dt); for (auto& enemy : m_enemies) enemy.update(dt); m_const.update(dt); bool collided = m_player.collide(m_const.m_bullets); (void) collided; } void TestStage::draw() { m_const.draw(); for (auto& enemy : m_enemies) enemy.draw(); m_player.draw(); } int TestStage::total_bullets() const { return m_const.m_bullets.size(); }