menu_x += (menu_x_target - menu_x) / menu_speed;
//Keyboard Controls
if (menu_control)
{
if(keyboard_check_pressed(vk_up))
{
menu_cursor ++;
if (menu_cursor >= menu_items) menu_cursor = 0;
audio_play_sound(snd_MenuPip, 10, false);
}
}
if (menu_control)
{
if(keyboard_check_pressed(vk_down))
{
menu_cursor --;
if (menu_cursor < 0) menu_cursor = menu_items - 1;
audio_play_sound(snd_MenuPip, 10, false);
}
//Menu press
if (keyboard_check_pressed(vk_space))
{
menu_x_target = gui_width + 200;
menu_committed = menu_cursor;
menu_control = false;
audio_play_sound(snd_MenuSelect, 10, false);
}
}
//SWORD
{
switch (menu_committed)
{
case 4:
{
{
switch (room)
{
case roomShipSelect:
room_goto(roomShipColorSword);
break
}
}
}
}
}
//BLAST
{
switch (menu_committed)
{
case 3:
{
{
switch (room)
{
case roomShipSelect:
room_goto(roomShipColorBlast);
break
}
}
}
}
}
//SNIPE
{
switch (menu_committed)
{
case 2:
{
{
switch (room)
{
case roomShipSelect:
room_goto(roomShipColorSnipe);
break
}
}
}
}
}
//GHOST
{
switch (menu_committed)
{
case 1:
{
{
switch (room)
{
case roomShipSelect:
room_goto(roomShipColorGhost);
break
}
}
}
}
}
//BACK
{
{
switch (menu_committed)
{
case 0:
{
{
switch (room)
{
case roomShipSelect:
room_goto(roomMenu);
break //End
}
}
}
}
}
}
[/CODE
This menu takes you to the color select screen, when you pick a color, the global variable for the player is set to a specific number. That number is used to determine what ship to spawn in after a level is selected
Color Select Menu:
[CODE]
menu_x += (menu_x_target - menu_x) / menu_speed;
//Keyboard Controls
if (menu_control)
{
if(keyboard_check_pressed(vk_up))
{
menu_cursor ++;
if (menu_cursor >= menu_items) menu_cursor = 0;
audio_play_sound(snd_MenuPip, 10, false);
}
}
if (menu_control)
{
if(keyboard_check_pressed(vk_down))
{
menu_cursor --;
if (menu_cursor < 0) menu_cursor = menu_items - 1;
audio_play_sound(snd_MenuPip, 10, false);
}
//Menu press
if (keyboard_check_pressed(vk_space))
{
menu_x_target = gui_width + 200;
menu_committed = menu_cursor;
menu_control = false;
audio_play_sound(snd_MenuSelect, 10, false);
}
}
//THUNDER
{
switch (menu_committed)
{
case 4:
{
{
switch (room)
{
case roomShipColorSword:
global.p1ship = 11;
room_goto(roomStageSelect);
break
}
}
}
}
}
//BLAZE
{
switch (menu_committed)
{
case 3:
{
{
switch (room)
{
case roomShipColorSword:
global.p1ship = 12;
room_goto(roomStageSelect);
break
}
}
}
}
}
//AZURE
{
switch (menu_committed)
{
case 2:
{
{
switch (room)
{
case roomShipColorSword:
global.p1ship = 13;
room_goto(roomStageSelect);
break
}
}
}
}
}
//MYTHRIL
{
switch (menu_committed)
{
case 1:
{
{
switch (room)
{
case roomShipColorSword:
global.p1ship = 14;
room_goto(roomStageSelect);
break
}
}
}
}
}
//BACK
{
{
switch (menu_committed)
{
case 0:
{
{
switch (room)
{
case roomShipColorSword:
room_goto(roomShipSelect);
break //End
}
}
}
}
}
}
[/CODE