Undertale script viewer

← back to main script listing

gml_Object_obj_heart_pl_Step_0

(view raw script w/o annotations or w/e)
1
if (x > global.idealborder[0] && obj_time.left)
2
    x -= 4;
3
if (x < (global.idealborder[1] - 16) && obj_time.right)
4
    x += 4;
5
if (y > global.idealborder[2] && obj_time.up)
6
    y -= 4;
7
if (y < (global.idealborder[3] - 16) && obj_time.down)
8
    y += 4;
9
shot = 0;
10
if (instance_exists(obj_heartshot) == 0 || charge < 0)
11
    shot = 1;
12
if (keyboard_check_pressed(ord("Z")) && shot == 1)
13
{
14
    instance_create(x + 4, y + 2, obj_heartshot);
15
    charge = 30;
16
}
17
charge -= 1;
18
global.testinv -= 1;
19
if (global.testinv > 0)
20
{
21
    image_speed = 1;
22
}
23
else
24
{
25
    image_speed = 0;
26
    image_index = 0;
27
}