Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_sweet_dw_cyber_music_bullet_Draw_0

(view raw script w/o annotations or w/e)
1
image_speed = 0.25;
2
if (instance_exists(obj_mainchara))
3
{
4
    if (obj_mainchara.x >= 200 && move == 0)
5
    {
6
        snd_play(snd_rocket);
7
        snd_play_pitch(snd_rocket, 1.6);
8
        global.flag[428 saw_sweet] = 1;
9
        move = 1;
10
        hspeed = 2;
11
    }
12
}
13
sweettimer++;
14
y = yy - (sin(sweettimer / 8) * 6);
15
if (move == 0)
16
{
17
    x = xx - (sin(sweettimer / 16) * 10);
18
    draw_sprite_ext(spr_sweet_idle, image_index, x, y, 2, 2, 0, c_white, 1);
19
    draw_sprite_ext(spr_cutscene_cyber01_dj_table_hover, image_index, x - 54, y + 58, 2, 2, 0, c_white, 1);
20
}
21
if (move == 1)
22
{
23
    draw_sprite_ext(spr_sweet_dance, image_index, x, y, 2, 2, 0, c_white, 1);
24
    draw_sprite_ext(spr_cutscene_cyber01_dj_table_side, image_index, x - 54, y + 58, 2, 2, 0, c_white, 1);
25
    hspeed *= 1.1;
26
    yy -= 2;
27
}
28
if (x > (camerax() + 640 + (sprite_width * 2)))
29
    instance_destroy();