Add bonus sounds

This commit is contained in:
Felix Koppe
2024-12-09 04:07:52 +01:00
parent 9c7a13c568
commit 659fef6c50
7 changed files with 22 additions and 2 deletions

View File

@@ -178,7 +178,12 @@ private void handleGame(Notification notification) {
boardHandler.unshieldPiece(n.getPieceUuid());
} else if (notification instanceof PlayCardNotification n) {
if(n.getCard() == BonusCard.TURBO) {
app.getAcousticHandler().playSound(MdgaSound.TURBO);
guiHandler.turbo();
} else if(n.getCard() == BonusCard.SHIELD) {
app.getAcousticHandler().playSound(MdgaSound.SHIELD);
} else if(n.getCard() == BonusCard.SWAP) {
app.getAcousticHandler().playSound(MdgaSound.SWAP);
}
if(n.getColor() == ownColor) guiHandler.playCardOwn(n.getCard());
else guiHandler.playCardEnemy(n.getColor(), n.getCard());

View File

@@ -147,6 +147,15 @@ public void playSound(MdgaSound sound) {
case TANK_EXPLOSION:
assets.add(new SoundAssetDelayVolume(SoundAsset.EXPLOSION_1, 1.0f, 0f));
break;
case SHIELD:
assets.add(new SoundAssetDelayVolume(SoundAsset.SHIELD, 1.0f, 0f));
break;
case TURBO:
assets.add(new SoundAssetDelayVolume(SoundAsset.SPEED, 1.0f, 0f));
break;
case SWAP:
assets.add(new SoundAssetDelayVolume(SoundAsset.SWAP, 1.0f, 0f));
break;
default:
break;
}

View File

@@ -40,5 +40,8 @@ public enum MdgaSound {
MATRIX,
TURRET_ROTATE,
TANK_SHOOT,
TANK_EXPLOSION
TANK_EXPLOSION,
SHIELD,
TURBO,
SWAP,
}

View File

@@ -39,7 +39,10 @@ enum SoundAsset {
MATRIX("matrix.wav"),
CONNECTED("connected.wav"),
TURRET_ROTATE("turret_rotate.ogg"),
TANK_SHOOT("tank_shoot.ogg")
TANK_SHOOT("tank_shoot.ogg"),
SHIELD("shield.ogg"),
SPEED("speed.ogg"),
SWAP("swap.ogg"),
;