Step_0.gml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. if !global.altcontrol
  2. {
  3. _jump_p = ingame.kcp("Z");
  4. _jump_r = ingame.kcr("Z");
  5. _dash = ingame.kcp("C");
  6. _attack = ingame.kcp("X");
  7. _left = ingame.kc(vk_left);
  8. _right = ingame.kc(vk_right);
  9. _up = ingame.kc(vk_up);
  10. _down = ingame.kc(vk_down);
  11. _inventory = ingame.kcp("I");
  12. _focus = ingame.kcp("A");
  13. _pause = ingame.kcp(vk_escape);
  14. }
  15. else
  16. {
  17. _jump_p = ingame.kcp("J");
  18. _jump_r = ingame.kcr("J");
  19. _dash = ingame.kcp("L");
  20. _attack = ingame.kcp("K");
  21. _left = ingame.kc("A");
  22. _right = ingame.kc("D");
  23. _up = ingame.kc("W");
  24. _down = ingame.kc("S");
  25. _inventory = ingame.kcp("I");
  26. _focus = ingame.kcp("U");
  27. _pause = ingame.kcp(vk_escape);
  28. }
  29. _up_title = title.kcp(vk_up) || title.kcp("W");
  30. _down_title = title.kcp(vk_down) || title.kcp("S");
  31. _left_title = title.kcp(vk_left) || title.kcp("A");
  32. _right_title = title.kcp(vk_right) || title.kcp("D");
  33. _select_title = title.kcp("Z") || title.kcp("J");
  34. _left_inv = inventory.kcp(vk_left);
  35. _right_inv = inventory.kcp(vk_right);
  36. _up_inv = inventory.kcp(vk_up);
  37. _down_inv = inventory.kcp(vk_down);
  38. _close_inv = inventory.kcp("I") || inventory.kcp(vk_escape);
  39. _save_pause = pause.kcp("Z");
  40. _close_pause = pause.kcp("X") || pause.kcp(vk_escape);
  41. if room != rTitle
  42. exit;
  43. if _up_title
  44. {
  45. menu_index--;
  46. if menu_index < 0
  47. menu_index = array_length(menu_options) - 1;
  48. }
  49. if _down_title
  50. {
  51. menu_index++;
  52. if menu_index >= array_length(menu_options)
  53. menu_index = 0;
  54. }
  55. for(var i = 0; i < array_length(menu_options); i++)
  56. {
  57. var _target = (i == menu_index) ? 1.0 : 0.8;
  58. option_scale[i] = lerp(option_scale[i], _target, lerp_speed);
  59. }
  60. if _select_title
  61. {
  62. var _func, _ripple;
  63. switch(menu_index)
  64. {
  65. case 0:
  66. if !file_exists("ddmyx_save.dat")
  67. break;
  68. autodel_handle("title");
  69. _func = function()
  70. {
  71. icl(oRippleExpand);
  72. load_game_from_disk();
  73. };
  74. _ripple = icl(oRippleShrink, RES_W / 2, RES_H / 2);
  75. _ripple.callback = _func;
  76. break;
  77. case 1:
  78. autodel_handle("title");
  79. _func = function()
  80. {
  81. icl(oRippleExpand);
  82. global.save_data = get_default_save_data();
  83. save_game_to_disk();
  84. load_game_from_disk();
  85. };
  86. _ripple = icl(oRippleShrink, RES_W / 2, RES_H / 2);
  87. _ripple.callback = _func;
  88. break;
  89. case 4: game_end(); break;
  90. }
  91. }
  92. if (_left_title || _right_title || _select_title) && menu_index == 3
  93. global.altcontrol = !global.altcontrol;
  94. menu_options[3] = global.altcontrol ? "控制-WASD" : "控制-方向键";
  95. animation_timer += 0.05;