Step_0.gml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. _jump_p = ingame.kcp("Z");
  2. _jump_r = ingame.kcr("Z");
  3. _dash = ingame.kcp("C");
  4. _attack = ingame.kcp("X");
  5. _left = ingame.kc(vk_left);
  6. _right = ingame.kc(vk_right);
  7. _up = ingame.kc(vk_up);
  8. _down = ingame.kc(vk_down);
  9. _inventory = ingame.kcp("I");
  10. _focus = ingame.kcp("A");
  11. _return = ingame.kcp(vk_escape); // for debugging
  12. /*
  13. _newgame = title.kcp(vk_space);
  14. _continue = title.kcp(vk_enter);
  15. _quitgame = title.kcp(vk_escape);
  16. */
  17. _left_title = title.kcp(vk_left);
  18. _right_title = title.kcp(vk_right);
  19. _up_title = title.kcp(vk_up);
  20. _down_title = title.kcp(vk_down);
  21. _select = title.kcp("Z");
  22. _left_inv = inventory.kcp(vk_left);
  23. _right_inv = inventory.kcp(vk_right);
  24. _up_inv = inventory.kcp(vk_up);
  25. _down_inv = inventory.kcp(vk_down);
  26. _close = inventory.kcp("I") || inventory.kcp(vk_escape);
  27. /*
  28. if global.developer_mode && room == rTitle
  29. {
  30. if _newgame
  31. {
  32. if (title != undefined) autodel_handle("title");
  33. global.save_data = get_default_save_data();
  34. save_game_to_disk();
  35. load_game_from_disk();
  36. }
  37. if _continue
  38. {
  39. if (title != undefined) autodel_handle("title");
  40. load_game_from_disk();
  41. }
  42. if _quitgame
  43. game_end();
  44. }
  45. */
  46. if global.developer_mode && room != rTitle
  47. if _return
  48. {
  49. save_game_to_disk();
  50. room_goto(rTitle);
  51. with(global.camera) instance_destroy();
  52. with(global.player) instance_destroy();
  53. with(global.UI) instance_destroy();
  54. with(global.in_game_manager) instance_destroy();
  55. autoreg_handle("title", "title", 100);
  56. }
  57. if _up_title
  58. {
  59. menu_index--;
  60. if menu_index < 0
  61. menu_index = array_length(menu_options) - 1;
  62. }
  63. if _down_title
  64. {
  65. menu_index++;
  66. if menu_index >= array_length(menu_options)
  67. menu_index = 0;
  68. }
  69. for(var i = 0; i < array_length(menu_options); i++)
  70. {
  71. var _target = (i == menu_index) ? 1.2 : 1.0;
  72. option_scale[i] = lerp(option_scale[i], _target, lerp_speed);
  73. }
  74. if _select
  75. {
  76. var _func, _ripple;
  77. switch(menu_index)
  78. {
  79. case 0:
  80. autodel_handle("title");
  81. _func = function()
  82. {
  83. icl(oRippleExpand);
  84. load_game_from_disk();
  85. };
  86. _ripple = icl(oRippleShrink, 960, 540);
  87. _ripple.callback = _func;
  88. break;
  89. case 1:
  90. autodel_handle("title");
  91. _func = function()
  92. {
  93. icl(oRippleExpand);
  94. global.save_data = get_default_save_data();
  95. save_game_to_disk();
  96. load_game_from_disk();
  97. };
  98. _ripple = icl(oRippleShrink, 960, 600);
  99. _ripple.callback = _func;
  100. break;
  101. case 2: break;
  102. case 3: game_end(); break;
  103. }
  104. }
  105. animation_timer += 0.05;