GML Room Help

G

GalGames

Guest
I've created a menu where there are 3 selections "Start" "Credits" and Quit".

The problem here is when I go to room "Credits" I can't go back to the menu. I tried to change codes but doesn't work and I need your help. Here are the codes:

Code:
switch(global.GameState)
{
    //Controles en modo incio
    case "start":
        if (keyAnyKey) global.GameState = "start_menu";
    break;
   
    //Controles de menú
    case "start_menu":
   
        if (keyUp)
        {
            if (numOption > 0) numOption--;
        }
       
        if (keyDown)
        {
            if (numOption < array_length_1d(arrMenu) - 1) numOption++;
        }
       
        if (keyAccept)
        {
            switch(numOption)
            {
                case 0:
                    room_goto(rm_game);
                    global.GameState = "Start";
                    break;
                case 1:
                    room_goto(rm_credits); //Créditos o Credits
                    global.GameState = "Credits";
                    break;
                case 2:
                    game_end(); //Quit
                    break;
            }
        }
}
Thanks you a lot. I use Game Maker Studio 1
 
M

maratae

Guest
You don't seem to have a case on your switch statement for "Credits". Might that be it?
 
Top