Fix: Game Crashed nicht mehr wenn das PlayerProjectile das Fenster verlässt
This commit is contained in:
@@ -15,14 +15,14 @@ public class PlayerProjectile extends Actor
|
||||
public void act()
|
||||
{
|
||||
move(7);
|
||||
checkForEnemyCollision();
|
||||
if (!isProjectileOnScreen()){
|
||||
getWorld().removeObject(this);
|
||||
}
|
||||
checkForEnemyCollision();
|
||||
}
|
||||
|
||||
public void checkForEnemyCollision(){
|
||||
if (getOneIntersectingObject(Enemy.class) != null){
|
||||
if (getOneIntersectingObject(Enemy.class) != null){
|
||||
getWorld().removeObject(getOneIntersectingObject(Enemy.class));
|
||||
getWorld().removeObject(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user