Hi guys!
I would like to make a simple pause menu with changing form a persistant room to the pause-room.
I also made the obj_inputDevice and the obj_player persistant, to have control in the pause room.
Strangely the step event of the obj_inputDevice is not executed anymore, althougt the debugger
shows instances of the player and the inputDevice in the pause room.
thats my code:
When i press pause in the game, game maker executes Case A, then Case B, then Case A and so on...
any ideas?
I would like to make a simple pause menu with changing form a persistant room to the pause-room.
I also made the obj_inputDevice and the obj_player persistant, to have control in the pause room.
Strangely the step event of the obj_inputDevice is not executed anymore, althougt the debugger
shows instances of the player and the inputDevice in the pause room.
thats my code:
GML:
/// obj_player
// ---------------------
// get the latest state of the inputDevice (gamepad) assuming that the step-event of this device is periodically executed
btn_pause = scr_inputDevice_checkButton(e_inputDeviceButton.start, e_inputDeviceButtonState.posEdge)
if (btn_pause) // this variable stays always true, when changed to pause room (step-event of inputDevice isn't executed anymore)
{
btn_pause = false
if (room != rm_pause)
{
// CASE A: Go to pause room
global.pause = true
room_persistent = true
global.roomBeforePause = room
room_goto(rm_pause)
exit
}
else
{
// CASE B: Go back from pause room
global.pause = false
room_goto(global.roomBeforePause)
global.roomBeforePause = noone
room_persistent = false
exit
}
}
any ideas?