Add fire shots for Player and Enemy.
This commit is contained in:
parent
1c10c8bce0
commit
981b2c7513
Binary file not shown.
Binary file not shown.
|
@ -75,6 +75,12 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
|||
SoundSystem.playSound("sounds/abgang.wav");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createShot() {
|
||||
super.createShot();
|
||||
SoundSystem.playSound("sounds/shot_fired1.wav");
|
||||
}
|
||||
|
||||
/**
|
||||
* On cleanup, unregister from the keyboard.
|
||||
*/
|
||||
|
|
|
@ -166,7 +166,7 @@ public abstract class ShootingEntity extends LivingEntity {
|
|||
/**
|
||||
* Internal method to actually spawn the fired Shots.
|
||||
*/
|
||||
private void createShot() {
|
||||
public void createShot() {
|
||||
new Shot(
|
||||
this.getX() + this.shootSpawnX,
|
||||
this.getY() + this.shootSpawnY,
|
||||
|
|
|
@ -2,6 +2,7 @@ package de.teamteamteam.spacescooter.entity.enemy;
|
|||
|
||||
import de.teamteamteam.spacescooter.entity.ShootingEntity;
|
||||
import de.teamteamteam.spacescooter.entity.shot.Shot;
|
||||
import de.teamteamteam.spacescooter.sound.SoundSystem;
|
||||
import de.teamteamteam.spacescooter.utility.Random;
|
||||
|
||||
public abstract class Enemy extends ShootingEntity {
|
||||
|
@ -23,6 +24,12 @@ public abstract class Enemy extends ShootingEntity {
|
|||
this.shoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createShot() {
|
||||
super.createShot();
|
||||
SoundSystem.playSound("sounds/shot_fired2.wav");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue