This commit is contained in:
Jan Philipp Timme 2014-11-04 14:40:12 +01:00
commit 97a1195faa
3 changed files with 8 additions and 27 deletions

View File

@ -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;
}
}
}

View File

@ -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;
}

View File

@ -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;
}
}