sCat
0
-1
0
0
_menu
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
///Initialize
event_inherited();
curOpt = file_exists(working_directory + "/save.sav");
opt[0] = "New Game";
opt[1] = "Continue";
opt[2] = "Settings";
if(os_browser == browser_not_a_browser) {
opt[3] = "Quit Game";
}
1
603
7
0
0
-1
2
self
0
0
1
///Activate options
if(menudepth == instance_number(_menu)) {
if(input_check_pressed(ACTION)) {
switch(curOpt) {
case 0: //New game
Controller.playTime = 0;
with(StoryController) {
state = 0;
for(var i = 6; i >= 0; i--) {
state[i] = 0;
}
progress[0] = 0;
}
dialog_var("PLAYERNAME", "");
instance_create(224, 96, Player);
inv_empty();
room_goto(rHome);
break;
case 1: //Continue
instance_create(0, 0, FileSelectMenu);
break;
case 2: //Settings
instance_create(0, 0, SettingsMenu);
break;
default: //Exit
game_end();
break;
}
input_clear(ACTION);
}
}
1
603
7
0
0
-1
2
self
0
0
1
///Cycle options
if(menudepth == instance_number(_menu)) {
if(input_check_pressed(UP)) {
curOpt = (curOpt + array_length_1d(opt) - 1) % array_length_1d(opt);
} else if(input_check_pressed(DOWN)) {
curOpt = (curOpt + 1) % array_length_1d(opt);
}
}
1
603
7
0
0
-1
2
self
0
0
1
///Prevent inheritance
1
603
7
0
0
-1
2
self
0
0
1
///Draw menu
if(menudepth == instance_number(_menu)) {
draw_set_alpha(1);
draw_set_font(fMenu);
if(os_browser != browser_not_a_browser) draw_set_font(fMenuHTML5);
draw_set_halign(fa_center);
draw_set_valign(fa_bottom);
draw_text(room_width / 2, room_height / 2 - view_hview[0] / 4, "cat");
for(var i = 0; i < array_length_1d(opt); i++) {
if(i == curOpt) {
draw_sprite( sprite_index,
image_index,
room_width / 2 - string_width(opt[i]) / 2 - 40,
room_height / 2 - (array_length_1d(opt) / 2) * 32 + i * 32);
draw_sprite( sprite_index,
image_index + 2,
room_width / 2 + string_width(opt[i]) / 2 + 8,
room_height / 2 - (array_length_1d(opt) / 2) * 32 + i * 32);
} else {
draw_set_color(c_black);
}
draw_text( room_width / 2,
room_height / 2 - (array_length_1d(opt) / 2) * 32 + (i + 1) * 32,
opt[i]);
}
draw_set_valign(fa_top);
}
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
0
0,0
16,16