Advertisement
Guest User

scr_NavigateStartMenu

a guest
Oct 14th, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Up and down will be used to change selected choice.
  2. if keyboard_check_pressed(vk_up){
  3.     selectedChoice -= 1;
  4. }
  5. else
  6. if keyboard_check_pressed(vk_down){
  7.     selectedChoice += 1;
  8. }
  9.  
  10. // see if the selected choice variable is higher or lower than the amount of choices we actually have defined.
  11. // if it's above, we loop around to the first choice. If it's below, loop around to the end of the choices.
  12. // because we changed the selected choice before we execute this part, we make sure here that we don't go "out of bounds".
  13. if selectedChoice > startChoices - 1
  14.     selectedChoice = 0;
  15. else if selectedChoice < 0
  16.     selectedChoice = startChoices - 1;
  17.    
  18. if keyboard_check_pressed(global.buttonAccept) { // Check to see which button we are on and either go to character select or exit the application.
  19.     if startChoiceArray[selectedChoice] == "Start" {
  20.         room_goto(room_CharSelect);
  21.         selectedChoice = 0;
  22.     }
  23.     else if startChoiceArray[selectedChoice] == "Quit Game"
  24.         game_end();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement