mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-08-01 06:17:40 +02:00
fixed bugs, game now compiles
This commit is contained in:
@@ -31,10 +31,6 @@ public class GameSound extends AbstractAppState implements GameEventListener {
|
||||
private static final Preferences PREFERENCES = getPreferences(GameSound.class);
|
||||
private static final String ENABLED_PREF = "enabled"; //NON-NLS
|
||||
|
||||
private AudioNode splashSound;
|
||||
private AudioNode shipDestroyedSound;
|
||||
private AudioNode explosionSound;
|
||||
|
||||
/**
|
||||
* Checks if sound is enabled in the preferences.
|
||||
*
|
||||
@@ -75,9 +71,6 @@ public class GameSound extends AbstractAppState implements GameEventListener {
|
||||
@Override
|
||||
public void initialize(AppStateManager stateManager, Application app) {
|
||||
super.initialize(stateManager, app);
|
||||
shipDestroyedSound = loadSound(app, "Sound/Effects/sunken.wav"); //NON-NLS
|
||||
splashSound = loadSound(app, "Sound/Effects/splash.wav"); //NON-NLS
|
||||
explosionSound = loadSound(app, "Sound/Effects/explosion.wav"); //NON-NLS
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,36 +93,10 @@ public class GameSound extends AbstractAppState implements GameEventListener {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plays the splash sound effect.
|
||||
*/
|
||||
public void splash() {
|
||||
if (isEnabled() && splashSound != null)
|
||||
splashSound.playInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plays the explosion sound effect.
|
||||
*/
|
||||
public void explosion() {
|
||||
if (isEnabled() && explosionSound != null)
|
||||
explosionSound.playInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plays sound effect when a ship has been destroyed.
|
||||
*/
|
||||
public void shipDestroyed() {
|
||||
if (isEnabled() && shipDestroyedSound != null)
|
||||
shipDestroyedSound.playInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receivedEvent(SoundEvent event) {
|
||||
switch (event.sound()) {
|
||||
case EXPLOSION -> explosion();
|
||||
case SPLASH -> splash();
|
||||
case DESTROYED_SHIP -> shipDestroyed();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -159,7 +159,7 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
||||
*/
|
||||
private AppSettings makeSettings() {
|
||||
final AppSettings settings = new AppSettings(true);
|
||||
settings.setTitle(lookup("Monopoly.name"));
|
||||
settings.setTitle(lookup("monopoly.name"));
|
||||
settings.setResolution(config.getResolutionWidth(), config.getResolutionHeight());
|
||||
settings.setFullscreen(config.fullScreen());
|
||||
settings.setUseRetinaFrameBuffer(config.useRetinaFrameBuffer());
|
||||
|
@@ -7,7 +7,6 @@ import com.simsilica.lemur.Label;
|
||||
import com.simsilica.lemur.style.ElementId;
|
||||
import pp.dialog.Dialog;
|
||||
import pp.monopoly.client.MonopolyApp;
|
||||
import pp.monopoly.client.StartMenu;
|
||||
|
||||
public class GameMenu extends Dialog {
|
||||
private final MonopolyApp app;
|
||||
@@ -17,7 +16,7 @@ public class GameMenu extends Dialog {
|
||||
*
|
||||
* @param app the MonopolyApp instance
|
||||
*/
|
||||
public SettingsMenu(MonopolyApp app) {
|
||||
public GameMenu(MonopolyApp app) {
|
||||
super(app.getDialogManager());
|
||||
this.app = app;
|
||||
|
||||
@@ -41,10 +40,6 @@ public class GameMenu extends Dialog {
|
||||
// You can add more settings components here, like checkboxes or sliders.
|
||||
}
|
||||
|
||||
public GameMenu(MonopolyApp app) {
|
||||
super(app.getDialogManager());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns to the StartMenu when the back button is clicked.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user