diff --git a/src/Events.pbi b/src/Events.pbi index f8eb235..022d1f1 100644 --- a/src/Events.pbi +++ b/src/Events.pbi @@ -30,13 +30,16 @@ Procedure HandleEventMenu() ; We go to the target game state If KeyboardReleased(#PB_Key_Return) Menu_GotoCurrent() - CurrentState.s = *ActiveMenu\Entries()\TargetState + CurrentState = *ActiveMenu\Entries()\TargetState *ActiveMenu.GameMenu = Menus(CurrentState) EndIf - ;KeyboardPushed(#PB_Key_Escape) Or + EndProcedure Procedure HandleEventRunningGame() - Debug "Game starts!!!" + If KeyboardReleased(#PB_Key_Escape) + CurrentState = "MAIN_MENU" + *ActiveMenu.GameMenu = Menus(CurrentState) + EndIf EndProcedure \ No newline at end of file diff --git a/src/Main.pb b/src/Main.pb index 422f25f..c79c44a 100644 --- a/src/Main.pb +++ b/src/Main.pb @@ -106,7 +106,7 @@ If OpenWindow(0, 0, 0, Screen\Width, Screen\Height, title, #PB_Window_ScreenCent ; Draw the stuff on the screen FlipBuffers() ClearScreen(RGB(0, 0, 0)) - If StartDrawing(ScreenOutput()) + If StartDrawing(ScreenOutput()) And CurrentState <> "QUIT" GameStates(CurrentState)\DrawFun() StopDrawing() EndIf