From 1811ec874d235d44a143c39307ac984b87fe3a8a Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 26 Apr 2022 11:37:44 +0200 Subject: Implemented simple scoring system --- TestStage.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'TestStage.cpp') diff --git a/TestStage.cpp b/TestStage.cpp index b851b0b..19703d2 100644 --- a/TestStage.cpp +++ b/TestStage.cpp @@ -5,6 +5,8 @@ #include #include "EnemyFactory.h" +#include "Globals.h" +#include "OverScreen.h" static constexpr Color DEEPSPACE {3, 5, 22, 255}; @@ -48,6 +50,15 @@ TestStage::update(const float dt) m_stats->total_bullets = m_const.m_bullets.size(); if (collided) m_stats->lifes--; } + bool all_done = true; + for (const auto& enemy : m_enemies) { + if (!enemy.gone()) { + all_done = false; + break; + } + } + if (all_done) + g_game.set(std::make_unique(m_stats)); } -- cgit v1.1