diff --git a/src/shattered_sword/Scenes/GameLevel.ts b/src/shattered_sword/Scenes/GameLevel.ts index 77f49e2..8326222 100644 --- a/src/shattered_sword/Scenes/GameLevel.ts +++ b/src/shattered_sword/Scenes/GameLevel.ts @@ -40,6 +40,7 @@ import GameOver from "./GameOver"; import Porcelain from "./Porcelain"; import Tutorial from "./Tutorial"; import Greatwall from "./Greatwall"; +import MainMenu from "./MainMenu"; // TODO /** @@ -125,6 +126,7 @@ export default class GameLevel extends Scene { protected pauseInput: TextInput; protected pauseSubmit: Label; protected pauseCheatText: Label; + protected mainMenuButton: Button; protected rmg: RandomMapGenerator; protected map: TiledTilemapData; @@ -406,6 +408,11 @@ export default class GameLevel extends Scene { if (event.type === "cheat") { this.enableCheat(); } + if(event.type === "MainMenu"){ + this.viewport.setZoomLevel(1); + this.sceneManager.changeToScene(MainMenu, {}); + InputWrapper.enableInput(); + } } if (this.gameStateStack.peek() === GameState.STORY) { if (InputWrapper.isNextJustPressed() && this.gameStateStack.peek() === GameState.STORY) { @@ -543,6 +550,7 @@ export default class GameLevel extends Scene { this.receiver.subscribe("startTimer"); this.receiver.subscribe("endStory"); this.receiver.subscribe("nextLevel"); + this.receiver.subscribe("MainMenu"); } // TODO - @@ -678,6 +686,16 @@ export default class GameLevel extends Scene { this.pauseSubmit.onClickEventId = "cheat"; this.pauseSubmit.borderWidth = 3; + this.mainMenuButton =