1 |
scr_get_inputscr_get_inputfunction scr_get_input() //gml_Script_scr_get_input
{
if live_call()
return global.live_result;
scr_stick_press()
global.down_key = (keyboard_check(vk_down) || gamepad_button_check(0, gp_padd) || gamepad_axis_value(0, gp_axislv))
global.left_key = (keyboard_check(vk_left) || gamepad_button_check(0, gp_padl) || (-(gamepad_axis_value(0, gp_axislh))))
global.right_key = (keyboard_check(vk_right) || gamepad_button_check(0, gp_padr) || gamepad_axis_value(0, gp_axislh))
global.up_key = (keyboard_check(vk_up) || gamepad_button_check(0, gp_padu) || (-(gamepad_axis_value(0, gp_axislv))))
global.down_keyp = (keyboard_check_pressed(vk_down) || gamepad_button_check_pressed(0, gp_padd) || down_stick)
global.left_keyp = (keyboard_check_pressed(vk_left) || gamepad_button_check_pressed(0, gp_padl) || left_stick)
global.right_keyp = (keyboard_check_pressed(vk_right) || gamepad_button_check_pressed(0, gp_padr) || right_stick)
global.up_keyp = (keyboard_check_pressed(vk_up) || gamepad_button_check_pressed(0, gp_padu) || up_stick)
if ((gamepad_button_check_pressed(0, gp_padd)) + (gamepad_button_check_pressed(0, gp_padu)) + (gamepad_button_check_pressed(0, gp_padl)) + (gamepad_button_check_pressed(0, gp_padr)) + down_stick + left_stick + right_stick + up_stick + (gamepad_button_check_pressed(0, global.button1)) + (gamepad_button_check_pressed(0, global.button2)) + (gamepad_button_check_pressed(0, global.button3)) + instance_exists(obj_phone_controls))
global.using_gamepad = true
else if keyboard_check(vk_anykey)
global.using_gamepad = false
if global.using_gamepad
{
if (global.button1 == gp_face1)
global.action_key = "A"
else if (global.button1 == gp_face2)
global.action_key = "B"
else if (global.button1 == gp_face3)
global.action_key = "X"
else if (global.button1 == gp_face4)
global.action_key = "Y"
if (global.button2 == gp_face1)
global.cancel_key = "A"
else if (global.button2 == gp_face2)
global.cancel_key = "B"
else if (global.button2 == gp_face3)
global.cancel_key = "X"
else if (global.button2 == gp_face4)
global.cancel_key = "Y"
if (global.button3 == 32769)
global.pause_key = "A"
else if (global.button3 == 32770)
global.pause_key = "B"
else if (global.button3 == 32771)
global.pause_key = "X"
else if (global.button3 == 32772)
global.pause_key = "Y"
}
else
{
global.pause_key = "C"
global.action_key = "Z"
global.cancel_key = "X"
}
if instance_exists(obj_phone_controls)
{
global.down_key += obj_phone_controls.phn_down
global.left_key += obj_phone_controls.phn_left
global.right_key += obj_phone_controls.phn_right
global.up_key += obj_phone_controls.phn_up
global.down_keyp = sign(global.down_keyp + obj_phone_controls.phn_downp)
global.left_keyp = sign(global.left_keyp + obj_phone_controls.phn_leftp)
global.right_keyp = sign(global.right_keyp + obj_phone_controls.phn_rightp)
global.up_keyp = sign(global.up_keyp + obj_phone_controls.phn_upp)
}
} () |
2 |
if (obj_arcade_controller.arcade_lives <= 0) |
3 |
{ |
4 |
if (sprite_index != spr_arcade_mew_dies) |
5 |
{ |
6 |
var death_sound = choose(464, 465, 467, 468) |
7 |
audio_play_sound(death_sound, 1, 0) |
8 |
sprite_index = spr_arcade_mew_dies |
9 |
audio_stop_sound(snd_chargeshot_charge) |
10 |
if (instance_exists(obj_arcade_bullet) || instance_exists(obj_arcade_bullet_big)) |
11 |
{ |
12 |
with (obj_arcade_bullet) |
13 |
instance_destroy() |
14 |
with (obj_arcade_bullet_big) |
15 |
instance_destroy() |
16 |
} |
17 |
is_charging = false |
18 |
} |
19 |
if (!alarm[1]) |
20 |
alarm[1] = 90alarm[1]instance_destroy()
instance_deactivate_all(true)
instance_activate_object(obj_pl)
instance_activate_object(global.party_member)
instance_activate_object(obj_controller)
instance_activate_object(obj_radio)
instance_activate_object(obj_arcade_controller)
obj_arcade_controller.arcade_game_over = true
var game_over_sound = choose(469, 470, 471)
audio_play_sound(game_over_sound, 1, 0)
audio_stop_sound(mus_mew)
audio_stop_sound(mus_mew_boss) |
21 |
y += 1 |
22 |
return; |
23 |
} |
24 |
var arc_hsp = 0 |
25 |
var arc_vsp = 0 |
26 |
var arc_spd = 4 |
27 |
var x_min = 90 |
28 |
var x_max = 225 |
29 |
var y_min = 65 |
30 |
var y_max = 185 |
31 |
var shoot_cooldown = 15 |
32 |
if global.left_key |
33 |
arc_hsp = (-arc_spd) |
34 |
if global.right_key |
35 |
arc_hsp = arc_spd |
36 |
if global.up_key |
37 |
arc_vsp = (-arc_spd) |
38 |
if global.down_key |
39 |
arc_vsp = arc_spd |
40 |
if (keyboard_multicheck(0) && arc_can_shoot && (!arc_hurt)) |
41 |
{ |
42 |
if (arc_upgrade == "Shotgun") |
43 |
{ |
44 |
var bul1 = instance_create((x - 2), (y - 24), obj_arcade_bullet) |
45 |
var bul2 = instance_create((x + 2), (y - 24), obj_arcade_bullet) |
46 |
bul1.bul_hsp = 3 |
47 |
bul2.bul_hsp = -3 |
48 |
} |
49 |
instance_create(x, (y - 24), obj_arcade_bullet) |
50 |
arc_can_shoot = false |
51 |
if (arc_upgrade == "Rapid") |
52 |
shoot_cooldown = 5 |
53 |
arc_shoot_cd = shoot_cooldown |
54 |
} |
55 |
if (!arc_can_shoot) |
56 |
{ |
57 |
if (arc_shoot_cd > 0) |
58 |
arc_shoot_cd -= 1 |
59 |
else |
60 |
arc_can_shoot = true |
61 |
} |
62 |
charge_percentage = charge_time / charge_time_max |
63 |
if (keyboard_multicheck(0) && (!is_charging) && sprite_index != spr_heart_yellow_down) |
64 |
{ |
65 |
if (!alarm[2]) |
66 |
alarm[2] = 5 |
67 |
} |
68 |
if keyboard_multicheck_released(0) |
69 |
{ |
70 |
alarm[2] = -1 |
71 |
if (is_charging == true) |
72 |
{ |
73 |
is_charging = false |
74 |
charge_time = charge_time_max |
75 |
if (is_charged == true) |
76 |
{ |
77 |
var yy = y - 21 |
78 |
var xx = x - 2 |
79 |
if (image_angle == 90 || image_angle == 270) |
80 |
{ |
81 |
yy = y |
82 |
xx = x |
83 |
} |
84 |
var shot_big = instance_create_depth(xx, yy, -10000, obj_arcade_bullet_big) |
85 |
shot_big.direction = image_angle + 90 |
86 |
shot_big.image_angle = image_angle |
87 |
is_charged = false |
88 |
} |
89 |
} |
90 |
} |
91 |
if is_charging |
92 |
{ |
93 |
if (!audio_is_playing(snd_chargeshot_charge)) |
94 |
{ |
95 |
charge_sound = audio_play_sound(snd_chargeshot_charge, 1, 1) |
96 |
audio_sound_gain(charge_sound, 0.6, 0) |
97 |
audio_sound_pitch(charge_sound, 0.5) |
98 |
} |
99 |
if (charge_time > 0) |
100 |
charge_time -= 1 |
101 |
else if (!is_charged) |
102 |
{ |
103 |
var ready_sound = audio_play_sound(snd_undertale_flash, 1, 0) |
104 |
audio_sound_gain(ready_sound, 0.5, 0) |
105 |
instance_create_depth(x, y, (depth - 1), obj_arcade_charged) |
106 |
charged_overlay_alpha = 1 |
107 |
is_charged = true |
108 |
audio_sound_gain(charge_sound, 0, 500) |
109 |
} |
110 |
} |
111 |
else |
112 |
{ |
113 |
audio_stop_sound(charge_sound) |
114 |
is_charged = false |
115 |
} |
116 |
if audio_is_playing(charge_sound) |
117 |
{ |
118 |
var pitch_original = audio_sound_get_pitch(charge_sound) |
119 |
if (pitch_original < 0.99) |
120 |
audio_sound_pitch(charge_sound, (1 - 0.5 * charge_percentage)) |
121 |
else |
122 |
audio_sound_pitch(charge_sound, 1) |
123 |
} |
124 |
if (charged_overlay_alpha > 0) |
125 |
charged_overlay_alpha -= 0.1 |
126 |
if is_dashing |
127 |
{ |
128 |
var ghost = instance_create_depth(x, y, depth, obj_dash_ghost) |
129 |
ghost.sprite_index = sprite_index |
130 |
ghost.image_speed = 0 |
131 |
arc_hsp = move_x_dash * dash_speed |
132 |
arc_vsp = move_y_dash * dash_speed |
133 |
dash_timer-- |
134 |
if (dash_timer <= 0) |
135 |
is_dashing = false |
136 |
} |
137 |
else |
138 |
dash_timer = dash_distance |
139 |
if ((abs(arc_hsp) + abs(arc_hsp)) == 0) |
140 |
{ |
141 |
if keyboard_multicheck_pressed(1) |
142 |
dash_buffered = true |
143 |
if (keyboard_multicheck_released(1) && dash_buffered == true) |
144 |
dash_buffered = false |
145 |
} |
146 |
if ((keyboard_multicheck_pressed(1) || dash_buffered) && can_dash == true && (abs(arc_hsp) + abs(arc_vsp)) != 0) |
147 |
{ |
148 |
audio_play_sound(snd_yellow_soul_dash, 1, 0) |
149 |
dash_overlay = 1.1 |
150 |
move_x_dash = sign(arc_hsp) |
151 |
move_y_dash = sign(arc_vsp) |
152 |
is_dashing = true |
153 |
dash_buffered = false |
154 |
can_dash = false |
155 |
} |
156 |
if ((!can_dash) && (!is_dashing)) |
157 |
{ |
158 |
if (dash_delay > 0) |
159 |
dash_delay-- |
160 |
else |
161 |
{ |
162 |
dash_delay = dash_delay_max |
163 |
can_dash = true |
164 |
} |
165 |
} |
166 |
if (keyboard_multicheck_released(1) && is_dashing) |
167 |
is_dashing = false |
168 |
if (arc_hsp > 0) |
169 |
sprite_index = spr_arcade_mew_right |
170 |
else if (arc_hsp < 0) |
171 |
sprite_index = spr_arcade_mew_left |
172 |
else |
173 |
sprite_index = spr_arcade_mew |
174 |
if arc_hurt |
175 |
{ |
176 |
if (arc_blink_time > 0) |
177 |
arc_blink_time-- |
178 |
else |
179 |
{ |
180 |
if (image_alpha == 1) |
181 |
image_alpha = 0.5 |
182 |
else |
183 |
image_alpha = 1 |
184 |
arc_blink_time = 5 |
185 |
} |
186 |
if (arc_hurt_time > 0) |
187 |
arc_hurt_time-- |
188 |
else |
189 |
{ |
190 |
arc_hurt = false |
191 |
arc_hurt_time = 30 |
192 |
arc_blink_time = 0 |
193 |
} |
194 |
} |
195 |
x += arc_hsp |
196 |
x = clamp(x, x_min, x_max) |
197 |
y += arc_vsp |
198 |
y = clamp(y, y_min, y_max) |