Master Cabalist
Member
I have a small block of code that isn't executing. If I remove the check:
The debug statement prints out 2 like it is supposed to. This has me puzzled.
if (global.lastLevel == 2)
it executes. I do a test debug message statement before the code:
GML:
show_debug_message("Passed Ex mouse check button");
show_debug_message("lastLEvel value check is " + string(global.lastLevel));
if (global.lastLevel == 2)
Code:
//CLICK ON TO ENTER LEVEL
/*!!!!!!!!!!!!!*/
//Grasslands
if (mouse_check_button_released(mb_left))
{
//Forest of Anguish
if mouse_x < 390 && mouse_x > 340 && mouse_y > 320 && mouse_y < 370
{
if global.lastLevel == 1
{
global.completed_level1 = true
global.lastLevel = 2
show_debug_message("lastLevel value is " + string(global.lastLevel));
global.game_map = 7;
room_goto(SecondLevel)
}
}
}
//go to level 3
//Avalanche
if (mouse_check_button_released(mb_left))
{
show_debug_message("Passed Ex mouse check button");
show_debug_message("lastLEvel value check is " + string(global.lastLevel));
if (global.lastLevel == 2)
{
if mouse_x < 580 && mouse_x > 515 && mouse_y > 289 && mouse_y < 337
{
show_debug_message("Passed border lines Ex")
//global.game_map = 6;
global.completed_level2 = true
global.game_map = 20;
global.lastLevel = 3
room_goto(ThirdLevel)
}
}
}