fixed JailState

This commit is contained in:
Johannes Schmelz
2024-12-01 15:50:09 +01:00
parent 5143e21ba6
commit f2a6888fb2
5 changed files with 101 additions and 65 deletions

View File

@@ -25,6 +25,7 @@ import pp.monopoly.model.fields.GateField;
import pp.monopoly.notification.EventCardEvent;
import pp.monopoly.notification.GameEventListener;
import pp.monopoly.notification.PopUpEvent;
import pp.monopoly.notification.Sound;
import pp.monopoly.notification.UpdatePlayerView;
/**
@@ -47,7 +48,7 @@ public class TestWorld implements GameEventListener {
this.app = app;
this.playerHandler = app.getGameLogic().getPlayerHandler(); // Hole den PlayerHandler
app.getGameLogic().addListener(this);
cameraController = new CameraController(app.getCamera(), playerHandler); // Übergebe PlayerHandler
cameraController = new CameraController(app.getCamera()); // Übergebe PlayerHandler
}
/**
@@ -288,7 +289,7 @@ public class TestWorld implements GameEventListener {
}
});
}
}, 5000); // Verzögerung in Millisekunden
}, 2500); // Verzögerung in Millisekunden
} else if (event.msg().equals("Winner")) {
new WinnerPopUp(app).open();
} else if (event.msg().equals("Looser")) {
@@ -304,9 +305,12 @@ public class TestWorld implements GameEventListener {
timer.schedule(new TimerTask() {
@Override
public void run() {
app.enqueue(() -> new EventCardPopup(app, event.description()).open());
app.enqueue(() -> {
app.getGameLogic().playSound(Sound.EVENT_CARD);
new EventCardPopup(app, event.description()).open();
});
}
}, 5000); // 5 Sekunden Verzögerung für Event-Popups
}, 2500); // 5 Sekunden Verzögerung für Event-Popups
}