Changed Chance to Spawn for Explosions

This commit is contained in:
Licht 2014-11-04 10:34:03 +01:00
parent 6b136e18e3
commit ec140905ee

View File

@ -81,14 +81,13 @@ public abstract class LivingEntity extends Entity implements Collidable {
if (this.isAlive() == false) { if (this.isAlive() == false) {
if(GameConfig.DEBUG) System.out.println(this + " ist gestorben. RIP"); if(GameConfig.DEBUG) System.out.println(this + " ist gestorben. RIP");
this.explode(); this.explode();
//Screen.currentScreen.addEntity(new Explosion(this.x, this.y));
this.remove(); this.remove();
} }
} }
private void explode() { private void explode() {
Random rnd = new Random(); Random rnd = new Random();
if (rnd.nextInt(10) < 7) { if (rnd.nextInt(99) < 70) {
Screen.currentScreen.addEntity(new Explosion(this.x, this.y)); Screen.currentScreen.addEntity(new Explosion(this.x, this.y));
} else { } else {
Screen.currentScreen.addEntity(new ExplosionBig(this.x, this.y)); Screen.currentScreen.addEntity(new ExplosionBig(this.x, this.y));