summaryrefslogtreecommitdiffhomepage
path: root/TestStage.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-22 01:11:24 +0200
committerAki <please@ignore.pl>2022-04-22 01:11:24 +0200
commit804e71083e4df85c4f0692553de3084f0ed4cd9a (patch)
tree6cfdf65ee7de9c14984677ca4a607b27d9080e00 /TestStage.cpp
parent7b8e199b0b6cccdf022bcd072bcdd8ab6c4072b1 (diff)
downloadbullethell2022-804e71083e4df85c4f0692553de3084f0ed4cd9a.zip
bullethell2022-804e71083e4df85c4f0692553de3084f0ed4cd9a.tar.gz
bullethell2022-804e71083e4df85c4f0692553de3084f0ed4cd9a.tar.bz2
Added Stats for lifes points and other kind of gameplay state
Diffstat (limited to 'TestStage.cpp')
-rw-r--r--TestStage.cpp12
1 files changed, 4 insertions, 8 deletions
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();
-}