Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_poppup_bird_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (targetplayer)
4
    {
5
        xx += (obj_heart.x + 8);
6
        yy += (obj_heart.y + 8);
7
        xx = clamp(xx, obj_growtangle.x - (obj_growtangle.sprite_width / 2), (obj_growtangle.sprite_width / 2) + obj_growtangle.x);
8
        yy = clamp(yy, obj_growtangle.y - (obj_growtangle.sprite_height / 2), (obj_growtangle.sprite_height / 2) + obj_growtangle.y);
9
    }
10
    else
11
    {
12
        xx += obj_growtangle.x;
13
        yy += obj_growtangle.y;
14
    }
15
    direction = point_direction(x, y, xx, yy);
16
    if (targetplayer == 2)
17
        direction += random_range(-10, 10);
18
    if (x > xx)
19
        image_xscale = -1;
20
    if (abs(y - yy) > 40)
21
    {
22
        if (y > yy)
23
            image_speed *= 2;
24
        else
25
            image_speed = image_speed / 2;
26
    }
27
    init = 1;
28
    startdirection = direction;
29
}
30
if (timer == 0)
31
{
32
    topSpeed = speed;
33
    speed = 0;
34
}
35
if (slow)
36
    direction = startdirection + (sin(timer / 3) * 5);
37
if (timer >= (60 / slow))
38
{
39
    image_alpha -= 0.1;
40
    if (image_alpha == 0)
41
        instance_destroy();
42
}
43
else if (image_alpha < 1)
44
{
45
    image_alpha += 0.1;
46
}
47
if (speed < topSpeed)
48
    speed += (topSpeed / 4);
49
timer++;