Undertale script viewer

← back to main script listing

gml_Object_obj_mettleg_l_Draw_0

(view raw script w/o annotations or w/e)
1
anim += 0.25;
2
if (on == 0)
3
    image_blend = c_white;
4
if (on == 1)
5
    image_blend = c_yellow;
6
draw_sprite_ext(sprite_index, image_index, x, y, 1, 1, 0, image_blend, 1);
7
if (collision_rectangle(x, y + 1, (x + sprite_width) - 5, y + 20, obj_heartshot, 0, 1))
8
{
9
    g = collision_rectangle(x, y + 1, (x + sprite_width) - 5, y + 20, obj_heartshot, 0, 1);
10
    with (g)
11
        instance_destroy();
12
    if (instance_exists(obj_ratingsmaster))
13
    {
14
        snd_play(snd_swallow);
15
        global.ratings += 5;
16
    }
17
    if (on == 0)
18
        on = 1;
19
    else
20
        on = 0;
21
}
22
if (on == 1)
23
{
24
    s -= 1;
25
    if (c == 0)
26
        x = xinit + (sin(s / sp) * sf);
27
    if (c == 1)
28
        x = xinit + (cos(s / sp) * sf);
29
}