Add fire shots for Player and Enemy.

This commit is contained in:
Jan Philipp Timme 2014-11-11 15:04:27 +01:00
parent 1c10c8bce0
commit 981b2c7513
5 changed files with 14 additions and 1 deletions

BIN
res/sounds/shot_fired1.wav Normal file

Binary file not shown.

BIN
res/sounds/shot_fired2.wav Normal file

Binary file not shown.

View File

@ -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.
*/

View File

@ -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,

View File

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