From bbec07ab3de333649d14a64fa01f7e8ad6d56c58 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 18 Apr 2022 20:14:53 +0200 Subject: Added naive enemy This reminds me ECS a bit too much but I don't think I want to implement one right now... --- TestStage.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'TestStage.cpp') diff --git a/TestStage.cpp b/TestStage.cpp index b257cf6..cc90f19 100644 --- a/TestStage.cpp +++ b/TestStage.cpp @@ -1,10 +1,12 @@ #include "TestStage.h" +#include "ExampleGenerator.h" + TestStage::TestStage() : m_player {}, m_const {}, - m_generator {m_const.m_bullets} + m_enemy {std::make_unique(m_const.m_bullets)} { } @@ -13,7 +15,7 @@ void TestStage::update(const float dt) { m_player.update(dt); - m_generator.update(dt); + m_enemy.update(dt); m_const.update(dt); bool collided = m_player.collide(m_const.m_bullets); (void) collided; @@ -24,6 +26,7 @@ void TestStage::draw() { m_const.draw(); + m_enemy.draw(); m_player.draw(); } -- cgit v1.1