spawn explosions only when really hitting thingsn.
This commit is contained in:
parent
5a4e6aaaed
commit
185f7d2748
1 changed files with 11 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue