• 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] Setting Game Options

J

jt_guevara

Guest
Hello everyone, great to meet you all.

I have a question on setting options for my game, such as difficulty and starting level. I have two rooms, one for the main menu and the other for the options menu. Inside the options menu, I have a control object called option_select_obj, which represents the cursor. Inside option_select_obj create event, I've initialized two global variables for the difficulty and the starting level with these values:

global.difficulty = 1;
global.level = 1;

These values can be changed, of course. I can take care of that on my own.

My question is, where can you initialize these values if a player just goes straight to start the game and avoids the options menu? Basically, set a default difficulty and level. I've tried to initialize them inside the main menu but that method cancels out the options changes each time I return there.
 

obscene

Member
The first object in your game should be some type of main controller object where all global variables are initialized. You can even put these all in a script and call the script from your first room's creation code.
 
J

jt_guevara

Guest
I've done exactly as you said. It worked! Thank you for the help!

Consider this thread solved!
 
D

dj_midknight

Guest
I declare all of my globals on the splash screen so before anything has a chance to touch them they have already been set to the default value. For other I have gone as far as to create macros to hold that value so in the even that I have changed the global, but need to reset to the oritinal value I can just reference the macro instead.
 
Top