From 185f7d274863f80af86cf1006f0204cf7942d353 Mon Sep 17 00:00:00 2001 From: Andreas Ortmann Date: Fri, 30 Sep 2016 19:05:58 +0200 Subject: [PATCH] spawn explosions only when really hitting thingsn. --- game/state/state.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/game/state/state.cpp b/game/state/state.cpp index e0412c7..a487223 100644 --- a/game/state/state.cpp +++ b/game/state/state.cpp @@ -203,8 +203,15 @@ namespace game { continue; } + bool spawnExplosion = true; + switch(evt.hit) { case Hit::Planet: + // TODO: add black spot on the planet. + // TODO: if water planet, add waves + // TODO: if gas planet, add nice gas explosion effect + // and start burning on this spot for some time. + //std::cout<<"hit Planet" << std::endl; break; @@ -215,13 +222,16 @@ namespace game { case Hit::BorderOfUniverse: //std::cout<<"missile left the universe." << std::endl; + spawnExplosion = false; break; default: break; } - addExplosionFromHit(&evt); + if (spawnExplosion) { + addExplosionFromHit(&evt); + } if (missile->trace != nullptr) { missile->trace->finish();