From 804e71083e4df85c4f0692553de3084f0ed4cd9a Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 22 Apr 2022 01:11:24 +0200 Subject: Added Stats for lifes points and other kind of gameplay state --- TestStage.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'TestStage.cpp') diff --git a/TestStage.cpp b/TestStage.cpp index fdd833d..e6ff74a 100644 --- a/TestStage.cpp +++ b/TestStage.cpp @@ -24,7 +24,10 @@ TestStage::update(const float dt) enemy.update(dt); m_const.update(dt); bool collided = m_player.collide(m_const.m_bullets); - (void) collided; + if (m_stats) { + m_stats->total_bullets = m_const.m_bullets.size(); + if (collided) m_stats->lifes--; + } } @@ -36,10 +39,3 @@ TestStage::draw() enemy.draw(); m_player.draw(); } - - -int -TestStage::total_bullets() const -{ - return m_const.m_bullets.size(); -} -- cgit v1.1