sunflowers-in-the-rain/objects/obj_title/Step_0.gml

70 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2022-06-10 23:20:49 -07:00
title_switch_timer -= 1;
if (title_switch_timer <= 0 && title_mode == TITLE_MODE_START_FADEIN ) {
title_mode = TITLE_MODE_START_READY;
}
if ( title_mode == TITLE_MODE_START_READY ) {
var input = scr_input_get(INPUT_ANY);
if (input) {
2022-06-12 23:20:11 -07:00
title_switch_timer = 50;
2022-06-10 23:20:49 -07:00
title_mode = TITLE_MODE_MENU_FADEIN;
}
}
if (title_switch_timer <= 0 && title_mode == TITLE_MODE_MENU_FADEIN ) {
title_mode = TITLE_MODE_MENU_READY;
}
if (title_mode == TITLE_MODE_MENU_READY ) {
2022-06-12 23:20:11 -07:00
menu_wait--;
2022-06-10 23:20:49 -07:00
var input_up = scr_input_get( INPUT_UP );
var input_down = scr_input_get( INPUT_DOWN );
var input_select = ( scr_input_get( INPUT_SHOT_LEFT ) || scr_input_get(INPUT_SHOT_RIGHT) );
if (input_up ) {
2022-06-12 23:20:11 -07:00
if (menu_wait < 0) {
menu_position--;
if (menu_position <= 0) {
menu_position = TITLE_MENU_CHOICES;
}
menu_wait = 30;
2022-06-10 23:20:49 -07:00
}
}
if (input_down) {
2022-06-12 23:20:11 -07:00
if (menu_wait < 0) {
menu_position++;
if (menu_position > TITLE_MENU_CHOICES ) {
menu_position = 1;
}
menu_wait = 30;
2022-06-10 23:20:49 -07:00
}
}
2022-06-12 23:20:11 -07:00
if ( input_select ) {
2022-06-10 23:20:49 -07:00
switch (menu_position) {
2022-06-12 23:20:11 -07:00
case TITLE_MENU_CHOICE_NEW_GAME: {
room_goto_next();
break;
}
case TITLE_MENU_CHOICE_EXIT_GAME: {
game_end();
2022-06-10 23:20:49 -07:00
break;
}
default: {
break;
}
}
}
}
2022-06-12 23:20:11 -07:00
2022-06-30 22:16:34 -07:00