Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dbullet_maker_Draw_0

(view raw script w/o annotations or w/e)
1
if (dont == 0)
2
{
3
    if (active == 0)
4
    {
5
        futuredir = point_direction(x, y, obj_heart.x + 8, obj_heart.y + 8);
6
        draw_sprite_ext(spr_diamondbullet_form, 0, x, y, 3 - (image_alpha * 2), 3 - (image_alpha * 2), futuredir, c_white, 1 - image_alpha);
7
        if (image_alpha < 1)
8
        {
9
            image_alpha += 0.1;
10
        }
11
        else
12
        {
13
            move_towards_point(obj_heart.x + 8, obj_heart.y + 8, 2);
14
            futuredir = direction;
15
            active = 1;
16
            speed = 0;
17
        }
18
    }
19
    draw_sprite_ext(sprite_index, 0, x, y, 2 - image_alpha, 2 - image_alpha, futuredir, c_white, image_alpha);
20
    if (active == 1)
21
    {
22
        activetimer += 1;
23
        if (activetimer >= 5 && times < difficulty)
24
        {
25
            mybul = instance_create(x, y, obj_regularbullet);
26
            if (i_ex(mybul))
27
            {
28
                mybul.grazepoints = grazepoints;
29
                mybul.damage = damage;
30
                mybul.target = target;
31
                mybul.sprite_index = spr_diamondbullet;
32
                mybul.direction = futuredir;
33
                with (mybul)
34
                {
35
                    speed = 6;
36
                    image_angle = direction;
37
                }
38
            }
39
            times += 1;
40
            activetimer = 0;
41
        }
42
        if (activetimer >= 5 && times >= difficulty)
43
        {
44
            image_alpha -= 0.2;
45
            if (image_alpha <= 0)
46
                instance_destroy();
47
        }
48
    }
49
}
50
dont = 0;