2022-04-21 04:51:56 -04:00
|
|
|
import Vec2 from "../../Wolfie2D/DataTypes/Vec2";
|
|
|
|
import Label from "../../Wolfie2D/Nodes/UIElements/Label";
|
|
|
|
import { UIElementType } from "../../Wolfie2D/Nodes/UIElements/UIElementTypes";
|
|
|
|
import Scene from "../../Wolfie2D/Scene/Scene";
|
|
|
|
import Color from "../../Wolfie2D/Utils/Color";
|
2022-04-23 22:34:17 -04:00
|
|
|
import { GameState } from "../sword_enums";
|
2022-04-23 22:06:52 -04:00
|
|
|
import InputWrapper from "../Tools/InputWrapper";
|
|
|
|
import MainMenu from "./MainMenu";
|
2022-04-21 04:51:56 -04:00
|
|
|
|
|
|
|
export default class GameOver extends Scene {
|
|
|
|
|
|
|
|
startScene() {
|
2022-04-23 22:34:17 -04:00
|
|
|
InputWrapper.setState(GameState.PAUSE);
|
2022-04-21 04:51:56 -04:00
|
|
|
const center = this.viewport.getCenter();
|
|
|
|
|
|
|
|
this.addUILayer("primary");
|
|
|
|
|
2022-04-23 22:06:52 -04:00
|
|
|
const gameOver = <Label>this.add.uiElement(UIElementType.LABEL, "primary", {position: new Vec2(center.x, center.y), text: "YOU DIED"});
|
|
|
|
gameOver.textColor = Color.RED;
|
|
|
|
gameOver.fontSize = 100;
|
|
|
|
|
|
|
|
const hint = <Label>this.add.uiElement(UIElementType.LABEL, "primary", {position: new Vec2(center.x, center.y + 100), text: "Click to go back to Main Menu"});
|
|
|
|
hint.textColor = Color.WHITE;
|
|
|
|
}
|
|
|
|
|
|
|
|
updateScene(){
|
|
|
|
if(InputWrapper.isLeftMouseJustPressed()){
|
|
|
|
this.sceneManager.changeToScene(MainMenu);
|
|
|
|
}
|
2022-04-21 04:51:56 -04:00
|
|
|
}
|
|
|
|
}
|