spawn explosions only when really hitting thingsn.

This commit is contained in:
Andreas Ortmann 2016-09-30 19:05:58 +02:00
parent 5a4e6aaaed
commit 185f7d2748

View file

@ -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();