Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_spotlight_Step_0

(view raw script w/o annotations or w/e)
1
if (target == -4)
2
    exit;
3
if (!init)
4
{
5
    init = true;
6
    if (flip)
7
        center_angle = -15;
8
    target_sprite = target.sprite_index;
9
    if (auto_offset)
10
    {
11
        offset.x = (target.sprite_width / 2) - target.sprite_xoffset;
12
        offset.y = (target.sprite_height / 2) - target.sprite_yoffset;
13
    }
14
    if (auto_x)
15
        x = target.x + offset.x;
16
}
17
direction = point_direction(x, y, target.x + offset.x, target.y + offset.y);
18
direction = round(direction);
19
image_angle = direction - 270;