Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_musical_ring_bullet_multiple_Draw_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    timer++;
4
    circle1alpha += 0.1;
5
    if (timer == 10)
6
    {
7
        con = 1;
8
        timer = 0;
9
    }
10
}
11
if (con == 1)
12
{
13
    circle2alpha = lerp(0, 1, bullettimer / bullettimermax);
14
    circle2radius = lerp(51, 31, bullettimer / bullettimermax);
15
    bullettimer++;
16
    if (bullettimer == bullettimermax)
17
    {
18
        if (bullettype == 0)
19
        {
20
            bul = instance_create(x, y, obj_musical_note_bullet);
21
            bul.sprite_index = spr_musical_notes;
22
            bul.direction = 20 + ((maxtimes - times) * 10) + angleoffset;
23
            bul.speed = 2;
24
            bul.friction = 0;
25
            bul = instance_create(x, y, obj_musical_note_bullet);
26
            bul.sprite_index = spr_musical_notes;
27
            bul.direction = -80 + ((maxtimes - times) * 10) + angleoffset;
28
            bul.speed = 2;
29
            bul.friction = 0;
30
        }
31
        times--;
32
        if (times < 0)
33
        {
34
            con = 3;
35
        }
36
        else
37
        {
38
            bullettimer = 0;
39
            con = 1;
40
            circle2alpha = 0;
41
            circle2radius = 75;
42
        }
43
        timer = 0;
44
    }
45
}
46
if (con == 3)
47
{
48
    timer++;
49
    circle1alpha += 0.2;
50
    circle2alpha -= 0.2;
51
    if (timer == 5)
52
        instance_destroy();
53
}
54
draw_set_alpha(circle1alpha);
55
draw_set_color(circle1color);
56
draw_sprite(spr_hatguy_head, 0, x, y);
57
scr_draw_circle_width_qb
scr_draw_circle_width_qb

function
scr_draw_circle_width_qb(arg0, arg1, arg2, arg3, arg4)
{ var xx = arg0; var yy = arg1; var radius = arg2; var width = arg3; var steps = arg4; var h = width / 2; draw_primitive_begin(pr_trianglelist); for (i = 0; i < steps; i += 1) { draw_vertex(xx + lengthdir_x(radius - h, (360 * i) / steps), yy + lengthdir_y(radius - h, (360 * i) / steps)); draw_vertex(xx + lengthdir_x(radius + h, (360 * i) / steps), yy + lengthdir_y(radius + h, (360 * i) / steps)); draw_vertex(xx + lengthdir_x(radius + h, (360 * (i + 1)) / steps), yy + lengthdir_y(radius + h, (360 * (i + 1)) / steps)); draw_vertex(xx + lengthdir_x(radius + h, (360 * (i + 1)) / steps), yy + lengthdir_y(radius + h, (360 * (i + 1)) / steps)); draw_vertex(xx + lengthdir_x(radius - h, (360 * (i + 1)) / steps), yy + lengthdir_y(radius - h, (360 * (i + 1)) / steps)); draw_vertex(xx + lengthdir_x(radius - h, (360 * i) / steps), yy + lengthdir_y(radius - h, (360 * i) / steps)); } draw_primitive_end(); }
(x, y, circle1radius, circle1width, 24);
58
draw_set_alpha(circle2alpha);
59
draw_set_color(c_white);
60
scr_draw_circle_width_qb
scr_draw_circle_width_qb

function
scr_draw_circle_width_qb(arg0, arg1, arg2, arg3, arg4)
{ var xx = arg0; var yy = arg1; var radius = arg2; var width = arg3; var steps = arg4; var h = width / 2; draw_primitive_begin(pr_trianglelist); for (i = 0; i < steps; i += 1) { draw_vertex(xx + lengthdir_x(radius - h, (360 * i) / steps), yy + lengthdir_y(radius - h, (360 * i) / steps)); draw_vertex(xx + lengthdir_x(radius + h, (360 * i) / steps), yy + lengthdir_y(radius + h, (360 * i) / steps)); draw_vertex(xx + lengthdir_x(radius + h, (360 * (i + 1)) / steps), yy + lengthdir_y(radius + h, (360 * (i + 1)) / steps)); draw_vertex(xx + lengthdir_x(radius + h, (360 * (i + 1)) / steps), yy + lengthdir_y(radius + h, (360 * (i + 1)) / steps)); draw_vertex(xx + lengthdir_x(radius - h, (360 * (i + 1)) / steps), yy + lengthdir_y(radius - h, (360 * (i + 1)) / steps)); draw_vertex(xx + lengthdir_x(radius - h, (360 * i) / steps), yy + lengthdir_y(radius - h, (360 * i) / steps)); } draw_primitive_end(); }
(x, y, circle2radius, circle2width, 24);
61
draw_set_alpha(1);