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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool spawnExplosion = true;
|
||||||
|
|
||||||
switch(evt.hit) {
|
switch(evt.hit) {
|
||||||
case Hit::Planet:
|
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;
|
//std::cout<<"hit Planet" << std::endl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -215,13 +222,16 @@ namespace game {
|
||||||
|
|
||||||
case Hit::BorderOfUniverse:
|
case Hit::BorderOfUniverse:
|
||||||
//std::cout<<"missile left the universe." << std::endl;
|
//std::cout<<"missile left the universe." << std::endl;
|
||||||
|
spawnExplosion = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
addExplosionFromHit(&evt);
|
if (spawnExplosion) {
|
||||||
|
addExplosionFromHit(&evt);
|
||||||
|
}
|
||||||
|
|
||||||
if (missile->trace != nullptr) {
|
if (missile->trace != nullptr) {
|
||||||
missile->trace->finish();
|
missile->trace->finish();
|
||||||
|
|
Loading…
Reference in a new issue