Deltarune script viewer

← back to main script listing

gml_Object_obj_dbullet_maker_ch1_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_ch1.x + 8, obj_heart_ch1.y + 8);
6
        draw_sprite_ext(spr_diamondbullet_form_ch1, 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_ch1.x + 8, obj_heart_ch1.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_ch1(x, y, obj_regularbullet_ch1);
26
            if (instance_exists(mybul))
27
            {
28
                mybul.damage = damage;
29
                mybul.target = target;
30
                mybul.sprite_index = spr_diamondbullet_ch1;
31
                mybul.direction = futuredir;
32
                with (mybul)
33
                {
34
                    speed = 6;
35
                    image_angle = direction;
36
                }
37
            }
38
            times += 1;
39
            activetimer = 0;
40
        }
41
        if (activetimer >= 5 && times >= difficulty)
42
        {
43
            image_alpha -= 0.2;
44
            if (image_alpha <= 0)
45
                instance_destroy();
46
        }
47
    }
48
}
49
dont = 0;