Add sounds

This commit is contained in:
Felix Koppe
2024-12-05 17:11:07 +01:00
parent 4a7c23708c
commit ac5d7ed74b
10 changed files with 19 additions and 4 deletions

View File

@@ -149,7 +149,7 @@ else if(boardSelect != null) {
if (name.equals("Right")) {
isRotateRight = !isRotateRight;
}
if(name.equals("Testx") &&isPressed){
if(name.equals("Test") &&isPressed){
if(app.getView() instanceof GameView gameView){
if(p == null) {

View File

@@ -128,7 +128,7 @@ public void simpleInitApp() {
gameView = new GameView(this);
ceremonyView = new CeremonyView(this);
enter(MdgaState.MAIN);
enter(MdgaState.GAME);
}
/**

View File

@@ -113,9 +113,16 @@ public void playSound(MdgaSound sound) {
assets.add(new SoundAssetDelayVolume(SoundAsset.JET, 1.0f, 0.0f));
break;
case EXPLOSION:
assets.add(new SoundAssetDelayVolume(SoundAsset.EXP, 1.0f, 4f));
assets.add(new SoundAssetDelayVolume(SoundAsset.EXPLOSION_1, 1.0f, 4f));
assets.add(new SoundAssetDelayVolume(SoundAsset.EXPLOSION_2, 1.0f, 4f));
assets.add(new SoundAssetDelayVolume(SoundAsset.THUNDER, 1.0f, 4f));
break;
case LOSE:
assets.add(new SoundAssetDelayVolume(SoundAsset.LOSE, 1.0f, 0.0f));
break;
case BONUS:
assets.add(new SoundAssetDelayVolume(SoundAsset.BONUS, 1.0f, 0.0f));
break;
default:
break;
}

View File

@@ -33,4 +33,6 @@ public enum MdgaSound {
LEAVE,
JET,
EXPLOSION,
LOSE,
BONUS,
}

View File

@@ -29,8 +29,12 @@ enum SoundAsset {
ROBOT_READY("robotReady.wav"),
UNIT_READY("unitReady.wav"),
JET("jet-overhead.wav"),
EXP("exp.ogg"),
EXPLOSION_1("exp.ogg"),
EXPLOSION_2("exp2.ogg"),
THUNDER("thunder.ogg"),
UI90("ui90.ogg"),
BONUS("bonus.ogg"),
LOSE("lose.ogg"),
CONNECTED("connected.wav");
private final String path;

View File

@@ -9,6 +9,7 @@
import com.jme3.scene.control.AbstractControl;
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.animation.MoveControl;
import pp.mdga.client.animation.JetAnimation;
import pp.mdga.client.gui.DiceControl;
@@ -443,6 +444,7 @@ private void throwPiece(UUID uuid){
// Synchronisation oder Animation
pieceControl.rotateInit();
app.getAcousticHandler().playSound(MdgaSound.LOSE);
app.getModelSynchronize().animationEnd();
}