diff --git a/src/de/teamteamteam/spacescooter/entity/Enemy.java b/src/de/teamteamteam/spacescooter/entity/Enemy.java index 90e8a1a..e8e7174 100644 --- a/src/de/teamteamteam/spacescooter/entity/Enemy.java +++ b/src/de/teamteamteam/spacescooter/entity/Enemy.java @@ -1,6 +1,4 @@ package de.teamteamteam.spacescooter.entity; - -import de.teamteamteam.spacescooter.screen.Screen; import java.util.Random; public abstract class Enemy extends ShootingEntity { @@ -22,13 +20,5 @@ public abstract class Enemy extends ShootingEntity { this.shoot(); } - @Override - protected void shoot() { - if(this.currentShootDelay == 0) { - Screen.currentScreen.addEntity(new SingleRedShot(this.x + this.shootSpawnX, this.y + this.shootSpawnY, this.shootDirection, this.shootSpeed, this.damageValue)); - this.currentShootDelay = this.shootDelay; - } - } - } diff --git a/src/de/teamteamteam/spacescooter/entity/Player.java b/src/de/teamteamteam/spacescooter/entity/Player.java index eea1117..5bdc48b 100644 --- a/src/de/teamteamteam/spacescooter/entity/Player.java +++ b/src/de/teamteamteam/spacescooter/entity/Player.java @@ -3,7 +3,6 @@ package de.teamteamteam.spacescooter.entity; import java.awt.event.KeyEvent; import de.teamteamteam.spacescooter.control.Keyboard; import de.teamteamteam.spacescooter.utility.GameConfig; -import de.teamteamteam.spacescooter.screen.Screen; public class Player extends ShootingEntity { @@ -46,14 +45,6 @@ public class Player extends ShootingEntity { } - @Override - protected void shoot() { - if(this.currentShootDelay == 0) { - Screen.currentScreen.addEntity(new SingleBlueShot(this.x + this.shootSpawnX, this.y + this.shootSpawnY, this.shootDirection, this.shootSpeed, this.damageValue)); - this.currentShootDelay = this.shootDelay; - } - } - public void setCanMove(boolean canMove){ this.canMove = canMove; } diff --git a/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java b/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java index dbff426..910eb82 100644 --- a/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java +++ b/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java @@ -4,13 +4,13 @@ import de.teamteamteam.spacescooter.screen.Screen; public abstract class ShootingEntity extends LivingEntity { - protected int shootDelay; - protected int currentShootDelay; - protected int shootSpawnX; - protected int shootSpawnY; - protected int shootDirection; - protected int damageValue = 5; - protected int shootSpeed; + private int shootDelay; + private int currentShootDelay; + private int shootSpawnX; + private int shootSpawnY; + private int shootDirection; + private int damageValue = 5; + private int shootSpeed; public ShootingEntity(int x, int y) { super(x, y); @@ -24,7 +24,7 @@ public abstract class ShootingEntity extends LivingEntity { protected void shoot() { if(this.currentShootDelay == 0) { - Screen.currentScreen.addEntity(new SingleShot(this.x + this.shootSpawnX, this.y + this.shootSpawnY, this.shootDirection, this.shootSpeed, this.damageValue)); + Screen.currentScreen.addEntity(new SingleBlueShot(this.x + this.shootSpawnX, this.y + this.shootSpawnY, this.shootDirection, this.shootSpeed, this.damageValue)); this.currentShootDelay = this.shootDelay; } }