2nd explosion added. (40% chance to spawn)
BIN
res/images/explosion2_1.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
res/images/explosion2_10.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
res/images/explosion2_11.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
res/images/explosion2_12.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
res/images/explosion2_13.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
res/images/explosion2_14.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
res/images/explosion2_15.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
res/images/explosion2_2.png
Normal file
After Width: | Height: | Size: 946 B |
BIN
res/images/explosion2_3.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
res/images/explosion2_4.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
res/images/explosion2_5.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
res/images/explosion2_6.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
res/images/explosion2_7.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
res/images/explosion2_8.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
res/images/explosion2_9.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
66
src/de/teamteamteam/spacescooter/entity/ExplosionBig.java
Normal file
@ -0,0 +1,66 @@
|
||||
package de.teamteamteam.spacescooter.entity;
|
||||
|
||||
public class ExplosionBig extends Explosion {
|
||||
|
||||
private int count = 141;
|
||||
|
||||
public ExplosionBig(int x, int y) {
|
||||
super(x, y);
|
||||
}
|
||||
|
||||
public void update() {
|
||||
if (count >= 0) {
|
||||
count--;
|
||||
} else {
|
||||
this.remove();
|
||||
}
|
||||
switch (count) {
|
||||
case 150:
|
||||
this.setImage("images/explosion2_1.png");
|
||||
break;
|
||||
case 140:
|
||||
this.setImage("images/explosion2_2.png");
|
||||
break;
|
||||
case 130:
|
||||
this.setImage("images/explosion2_3.png");
|
||||
break;
|
||||
case 120:
|
||||
this.setImage("images/explosion2_4.png");
|
||||
break;
|
||||
case 110:
|
||||
this.setImage("images/explosion2_5.png");
|
||||
break;
|
||||
case 100:
|
||||
this.setImage("images/explosion2_6.png");
|
||||
break;
|
||||
case 90:
|
||||
this.setImage("images/explosion2_7.png");
|
||||
break;
|
||||
case 80:
|
||||
this.setImage("images/explosion2_8.png");
|
||||
break;
|
||||
case 70:
|
||||
this.setImage("images/explosion2_9.png");
|
||||
break;
|
||||
case 60:
|
||||
this.setImage("images/explosion2_10.png");
|
||||
break;
|
||||
case 50:
|
||||
this.setImage("images/explosion2_11.png");
|
||||
break;
|
||||
case 40:
|
||||
this.setImage("images/explosion2_12.png");
|
||||
break;
|
||||
case 30:
|
||||
this.setImage("images/explosion2_13.png");
|
||||
break;
|
||||
case 20:
|
||||
this.setImage("images/explosion2_14.png");
|
||||
break;
|
||||
case 10:
|
||||
this.setImage("images/explosion2_15.png");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -2,6 +2,7 @@ package de.teamteamteam.spacescooter.entity;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Random;
|
||||
|
||||
import de.teamteamteam.spacescooter.screen.Screen;
|
||||
import de.teamteamteam.spacescooter.utility.GameConfig;
|
||||
@ -79,11 +80,21 @@ public abstract class LivingEntity extends Entity implements Collidable {
|
||||
this.healthPoints -= damage;
|
||||
if (this.isAlive() == false) {
|
||||
if(GameConfig.DEBUG) System.out.println(this + " ist gestorben. RIP");
|
||||
Screen.currentScreen.addEntity(new Explosion(this.x, this.y));
|
||||
this.explode();
|
||||
//Screen.currentScreen.addEntity(new Explosion(this.x, this.y));
|
||||
this.remove();
|
||||
}
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
Random rnd = new Random();
|
||||
if (rnd.nextInt(10) < 7) {
|
||||
Screen.currentScreen.addEntity(new Explosion(this.x, this.y));
|
||||
} else {
|
||||
Screen.currentScreen.addEntity(new ExplosionBig(this.x, this.y));
|
||||
}
|
||||
}
|
||||
|
||||
public void setHealthPoints(int hp) {
|
||||
this.healthPoints = hp;
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import de.teamteamteam.spacescooter.control.Keyboard;
|
||||
import de.teamteamteam.spacescooter.entity.EnemyThree;
|
||||
import de.teamteamteam.spacescooter.entity.EnemyTwo;
|
||||
import de.teamteamteam.spacescooter.entity.Entity;
|
||||
import de.teamteamteam.spacescooter.entity.Explosion;
|
||||
import de.teamteamteam.spacescooter.entity.Player;
|
||||
|
||||
public class GameScreen extends Screen {
|
||||
@ -23,7 +22,6 @@ public class GameScreen extends Screen {
|
||||
this.entities.add(new EnemyThree(450, 100));
|
||||
this.entities.add(new EnemyTwo(750, 550));
|
||||
this.entities.add(new EnemyTwo(150, 250));
|
||||
this.entities.add(new Explosion(200, 200));
|
||||
}
|
||||
|
||||
@Override
|
||||
|