• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[SOLVED]Persistence problem?

In my game there is a level, then a map, and then a level, and so on. I'm trying to fix some code for when the first level (first room) gets beat and you are on the map (the second room). I want to be able click an "X" on the map room and have it take me back to the first room. I also have a third room marked with a green X on the map. When the green X is clicked on, that level loads up. But I'd like to do the first room over again if possible. But when I click on the black "X" to go back to the first level, it just restarts the map room and doesn't go back to the first room. I think this has something to do with the persistence of the rooms.

My code is very simple.
Code:
///clicking for levels

if (mouse_check_button_released(mb_left))
{
    
    if mouse_x < 378 && mouse_x > 350 && mouse_y > 439 && mouse_y < 459
    {
        show_debug_message("Going to first level");
        room_goto(FirstLevel)
        room_persistent = false;
        room_goto(FirstLevel)
    
    }
    
}

if (mouse_check_button_released(mb_left))
{
    
    if mouse_x < 390 && mouse_x > 340  && mouse_y > 320  && mouse_y < 370
    {
        
        room_goto(SecondLevel)
    
    }
    
}
 
Top