From 7c9c492f1555bb84a43fc68a56f69c25b54e7346 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 18 Apr 2022 11:35:25 +0200 Subject: Separated Stage from GameScreen --- TestStage.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 TestStage.cpp (limited to 'TestStage.cpp') diff --git a/TestStage.cpp b/TestStage.cpp new file mode 100644 index 0000000..b257cf6 --- /dev/null +++ b/TestStage.cpp @@ -0,0 +1,35 @@ +#include "TestStage.h" + + +TestStage::TestStage() : + m_player {}, + m_const {}, + m_generator {m_const.m_bullets} +{ +} + + +void +TestStage::update(const float dt) +{ + m_player.update(dt); + m_generator.update(dt); + m_const.update(dt); + bool collided = m_player.collide(m_const.m_bullets); + (void) collided; +} + + +void +TestStage::draw() +{ + m_const.draw(); + m_player.draw(); +} + + +int +TestStage::total_bullets() const +{ + return m_const.m_bullets.size(); +} -- cgit v1.1