2025-03-11 00:23:54 +01:00
|
|
|
package game.gui;
|
|
|
|
|
|
|
|
import game.color.TextColor;
|
2025-03-11 10:26:48 +01:00
|
|
|
import game.gui.element.ActButton;
|
|
|
|
import game.gui.element.ActButton.Mode;
|
2025-03-16 17:45:08 +01:00
|
|
|
import game.gui.element.Label;
|
2025-03-11 00:23:54 +01:00
|
|
|
|
|
|
|
public class GuiGameOver extends Gui {
|
|
|
|
public static final GuiGameOver INSTANCE = new GuiGameOver();
|
|
|
|
|
|
|
|
private ActButton button;
|
|
|
|
private int timer;
|
|
|
|
|
|
|
|
private GuiGameOver() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void init(int width, int height) {
|
|
|
|
this.timer = 0;
|
|
|
|
this.add(new Label(0, 0, 200, 20, "Du bist gestorben!"));
|
|
|
|
this.add(new Label(0, 32, 200, 20, "Punktestand: " + TextColor.YELLOW + this.gm.thePlayer.experienceLevel));
|
2025-03-27 23:14:26 +01:00
|
|
|
this.button = this.add(new ActButton(0, 100, 200, 24, new ActButton.Callback() {
|
2025-03-11 00:23:54 +01:00
|
|
|
public void use(ActButton elem, Mode action) {
|
|
|
|
GuiGameOver.this.gm.thePlayer.respawnPlayer();
|
|
|
|
GuiGameOver.this.gm.displayGuiScreen(null);
|
|
|
|
}
|
|
|
|
}, "Wiederbeleben"));
|
|
|
|
this.shift();
|
|
|
|
this.button.enabled = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getTitle() {
|
|
|
|
return "Game over";
|
|
|
|
}
|
|
|
|
|
|
|
|
public void updateScreen() {
|
|
|
|
if(++this.timer >= 20)
|
|
|
|
this.button.enabled = true;
|
|
|
|
}
|
|
|
|
}
|