diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java b/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java index 0e3aac4..fad2d2e 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java @@ -38,13 +38,16 @@ public abstract class Enemy extends ShootingEntity { */ public void update() { super.update(); + + // enemy has fully left the screen ..to the left! + if(this.getX() + this.getWidth() < 0){ + this.remove(); + return; + } + if(willShoot == true){ this.shoot(); } - // ToDo: ??? - if(this.getX() < 0-this.getWidth()) { - this.remove(); - } } /** diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyThree.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyThree.java index 1836b3b..b455d63 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyThree.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyThree.java @@ -47,9 +47,6 @@ public class EnemyThree extends Enemy{ public void update() { super.update(); this.setPosition(this.getX()-1, this.getY()); - if(this.getX() < 0-getWidth()){ - this.remove(); - } Player player = GameScreen.getPlayer(); if(this.getY() < player.getY()){ this.newY += ySpeed; diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java index 38c5a64..65c3352 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java @@ -24,9 +24,6 @@ public class EnemyTwo extends Enemy{ public void update() { super.update(); this.setPosition(this.getX()-1, this.getY()); - if(this.getX() < 0-getWidth()){ - this.remove(); - } } @Override diff --git a/src/de/teamteamteam/spacescooter/level/Level.java b/src/de/teamteamteam/spacescooter/level/Level.java index 3f3d22e..b9241ee 100644 --- a/src/de/teamteamteam/spacescooter/level/Level.java +++ b/src/de/teamteamteam/spacescooter/level/Level.java @@ -90,7 +90,8 @@ public final class Level { //If the rule matches the current time, spawn the configured Entity in the configured amount: for(int i=0; i