Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_stick_press

(view raw script w/o annotations or w/e)
1
function scr_stick_press
scr_stick_press

function scr_stick_press() //gml_Script_scr_stick_press { down_stick = 0 left_stick = 0 up_stick = 0 right_stick = 0 if (gamepad_axis_value(0, gp_axislv) > global.gamepad_deadzone && global.down_pressed == 0) { down_stick = 1 global.down_pressed = 1 } else down_stick = 0 if (gamepad_axis_value(0, gp_axislv) < (-global.gamepad_deadzone) && global.up_pressed == 0) { up_stick = 1 global.up_pressed = 1 } else up_stick = 0 if (gamepad_axis_value(0, gp_axislh) < (-global.gamepad_deadzone) && global.left_pressed == 0) { left_stick = 1 global.left_pressed = 1 } else left_stick = 0 if (gamepad_axis_value(0, gp_axislh) > global.gamepad_deadzone && global.right_pressed == 0) { right_stick = 1 global.right_pressed = 1 } else right_stick = 0 if (gamepad_axis_value(0, gp_axislh) > (-global.gamepad_deadzone) && gamepad_axis_value(0, gp_axislh) < global.gamepad_deadzone) { global.left_pressed = 0 global.right_pressed = 0 } if (gamepad_axis_value(0, gp_axislv) > (-global.gamepad_deadzone) && gamepad_axis_value(0, gp_axislv) < global.gamepad_deadzone) { global.up_pressed = 0 global.down_pressed = 0 } }
() //gml_Script_scr_stick_press
2
{
3
    down_stick = 0
4
    left_stick = 0
5
    up_stick = 0
6
    right_stick = 0
7
    if (gamepad_axis_value(0, gp_axislv) > global.gamepad_deadzone && global.down_pressed == 0)
8
    {
9
        down_stick = 1
10
        global.down_pressed = 1
11
    }
12
    else
13
        down_stick = 0
14
    if (gamepad_axis_value(0, gp_axislv) < (-global.gamepad_deadzone) && global.up_pressed == 0)
15
    {
16
        up_stick = 1
17
        global.up_pressed = 1
18
    }
19
    else
20
        up_stick = 0
21
    if (gamepad_axis_value(0, gp_axislh) < (-global.gamepad_deadzone) && global.left_pressed == 0)
22
    {
23
        left_stick = 1
24
        global.left_pressed = 1
25
    }
26
    else
27
        left_stick = 0
28
    if (gamepad_axis_value(0, gp_axislh) > global.gamepad_deadzone && global.right_pressed == 0)
29
    {
30
        right_stick = 1
31
        global.right_pressed = 1
32
    }
33
    else
34
        right_stick = 0
35
    if (gamepad_axis_value(0, gp_axislh) > (-global.gamepad_deadzone) && gamepad_axis_value(0, gp_axislh) < global.gamepad_deadzone)
36
    {
37
        global.left_pressed = 0
38
        global.right_pressed = 0
39
    }
40
    if (gamepad_axis_value(0, gp_axislv) > (-global.gamepad_deadzone) && gamepad_axis_value(0, gp_axislv) < global.gamepad_deadzone)
41
    {
42
        global.up_pressed = 0
43
        global.down_pressed = 0
44
    }
45
}