How to change a scene depending on global variable

hi everyone

I’m kind of stuck and cant see how to do it, heres how i think it should work but do not know how to implement it;

i have 3 levels up to yet, when you get to the end of a level it brings up a new scene with your overall score aswell as level scores, but i have an arrow that the user clicks to go to next level but instead of having multiple scenes for the end of each level i want to do it using a global variable that i have called level detection, how it works is when i get to the end of the level it adds 1 to the initial value of level detection so when you click the arrow it looks at what number the variable is and takes you to the scene relevant to the value of the global variable, the problem i have is i have the conditions mouse is on object and left mouse is clicked but how do i implement it to take me to the relevant scene?

Any help would be much appreciated Thanks.

doesn’t matter iv done it, for those who also want to do this here’s how i did it;

1.) Renamed the Scenes Level 1, Level 2 and Level 3
2.) Create a global variable called level detection and set initial value to 1
3.) The sprite or whatever you have used to go to next level, add an action that adds 1 to the global variable level detection.
3.) On scores screen add an event with conditions, mouse on object arrow and left mouse pressed
4.) Add action go to scene then input the following "Level " + GlobalVariableString(level detection)

Basically how it works is when you finish level 1, it will add 1 to the global variable level detection making the value 2, then on the scores screen you will have the arrow taking you to scene Level and whatever the value of global variable level detection.

Hi Scott!

Actually GD comes packed with lots of examples, showing how to do some basic stuff (go to File/Open an example). I think you’ll save lots of times if you check those examples for answers (there is a specific one showing how to do this level stuff in a very similar way to how you finally solve it).

So, taking a tour for the available tutorials and examples of GD is not a bad idea and it’ll help you a lot.

Cheers! :wink: