Guest User

Game Maker - Keyboard Menu Tutorial (Codes))

a guest
May 25th, 2013
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. obj_menu_start:
  2.  
  3. (This goes for all the obj_menu objects)
  4. image_index = 0
  5. image_speed = 0
  6.  
  7. Step:
  8.  
  9. if global.start = true{image_index = 1 image_speed = 0}
  10. if !global.start = true{image_index = 0 image_speed = 0}
  11.  
  12. obj_menu_help:
  13.  
  14. Step:
  15. if global.help = true{image_index = 1 image_speed = 0}
  16. if !global.help = true{image_index = 0 image_speed = 0}
  17.  
  18. obj_menu_quit
  19.  
  20. Step:
  21.  
  22. if global.quit = true{image_index = 1 image_speed = 0}
  23. if !global.quit = true{image_index = 0 image_speed = 0}
  24.  
  25. Obj_menu_control:
  26.  
  27. Create:
  28.  
  29. global.start = true
  30. global.help = false
  31. global.quit = false
  32.  
  33. Step:
  34.  
  35. if keyboard_check_pressed(vk_down) and global.start = true
  36. {
  37. global.start = false
  38. global.help = true
  39. }
  40.  
  41. else if keyboard_check_pressed(vk_up) and global.start = true
  42. {
  43. global.start = false
  44. global.quit = true
  45. }
  46.  
  47. else if keyboard_check_pressed(vk_down) and global.help = true
  48. {
  49. global.help = false
  50. global.quit = true
  51. }
  52.  
  53. else if keyboard_check_pressed(vk_up) and global.help = true
  54. {
  55. global.help = false
  56. global.start = true
  57. }
  58.  
  59. else if keyboard_check_pressed(vk_down) and global.quit = true
  60. {
  61. global.quit = false
  62. global.start = true
  63. }
  64.  
  65. else if keyboard_check_pressed(vk_up) and global.quit = true
  66. {
  67. global.quit = false
  68. global.help = true
  69. }
  70.  
  71. Keyboard Space:
  72.  
  73. if global.start = true {room_goto(main)}
  74. else if global.help = true {show_info()}
  75. else if global.quit = true {game_end()}
Advertisement
Add Comment
Please, Sign In to add comment