Step_0.gml 3.5 KB

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