verschiedene schuesse
This commit is contained in:
parent
8a77a346e4
commit
0093078da7
@ -1,5 +1,6 @@
|
||||
package de.teamteamteam.spacescooter.entity;
|
||||
|
||||
import de.teamteamteam.spacescooter.screen.Screen;
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class Enemy extends ShootingEntity {
|
||||
@ -21,5 +22,13 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ 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 {
|
||||
|
||||
@ -48,6 +49,14 @@ 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;
|
||||
}
|
||||
|
@ -4,13 +4,13 @@ import de.teamteamteam.spacescooter.screen.Screen;
|
||||
|
||||
public abstract class ShootingEntity extends LivingEntity {
|
||||
|
||||
private int shootDelay;
|
||||
private int currentShootDelay;
|
||||
private int shootSpawnX;
|
||||
private int shootSpawnY;
|
||||
private int shootDirection;
|
||||
private int damageValue = 5;
|
||||
private int shootSpeed;
|
||||
protected int shootDelay;
|
||||
protected int currentShootDelay;
|
||||
protected int shootSpawnX;
|
||||
protected int shootSpawnY;
|
||||
protected int shootDirection;
|
||||
protected int damageValue = 5;
|
||||
protected int shootSpeed;
|
||||
|
||||
public ShootingEntity(int x, int y) {
|
||||
super(x, y);
|
||||
|
@ -0,0 +1,9 @@
|
||||
package de.teamteamteam.spacescooter.entity;
|
||||
|
||||
public class SingleBlueShot extends Shot {
|
||||
|
||||
public SingleBlueShot(int x, int y, int shootDirection, int shootSpeed, int damageValue) {
|
||||
super(x, y, shootDirection, shootSpeed, damageValue);
|
||||
this.setImage("images/shot02.png");
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package de.teamteamteam.spacescooter.entity;
|
||||
|
||||
public class SingleRedShot extends Shot {
|
||||
|
||||
public SingleRedShot(int x, int y, int shootDirection, int shootSpeed, int damageValue) {
|
||||
super(x, y, shootDirection, shootSpeed, damageValue);
|
||||
this.setImage("images/shot04.png");
|
||||
}
|
||||
}
|
@ -4,6 +4,6 @@ public class SingleShot extends Shot {
|
||||
|
||||
public SingleShot(int x, int y, int shootDirection, int shootSpeed, int damageValue) {
|
||||
super(x, y, shootDirection, shootSpeed, damageValue);
|
||||
this.setImage("images/shot.png");
|
||||
this.setImage("images/shot02.png");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user