I have some code so the player can hit the "E" key and bring up a spell menu to select different spells. He then can hit "E" again to go back to the game. It uses room_persistent to keep the room alive as it switches from the Game room to the Menu room and back to the Game room.
In the player Step event:
if (keyboard_check_pressed(ord('E')))
{
global.mousedown = 0;
global.autofire = 0;
show_message(global.lastroom);
show_message(room);
global.lastroom = room;
show_message(global.lastroom);
room_set_persistent(room, true);
room_goto(room_stats);
}In the menu Step event:
if (keyboard_check_pressed(ord('E')) || keyboard_check_pressed(vk_escape))
{
show_message(global.lastroom);
room_set_persistent(room, true);
room_goto(global.lastroom);
}If I ran this code in Windows mode, in the HTML5 editor, it will work fine. When the show_message() boxes pop up, they will print out the room index (5) for global.lastroom, and they'll transition the player correctly.
But when I run this as an HTML5 game, it no longer works. Instead it puts a blank message (perhaps NULL) for the show_message() calls, and when it calls room_goto(global.lastroom) the player receives a black screen and nothing else works.
Does anyone have any ideas?



Find content
Not Telling
