Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_climb_immobileeye_Draw_0

(view raw script w/o annotations or w/e)
1
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && keyboard_check_pressed(ord("V")))
2
    dodraw = !dodraw;
3
if (!dodraw)
4
    exit;
5
draw_self();
6
var kris = 27;
7
var goback = 0;
8
if (i_ex(kris))
9
{
10
    if (point_distance(x + 20, y + 20, kris.x, kris.y) > 160)
11
    {
12
        goback = 1;
13
    }
14
    else
15
    {
16
        var dirtokris = point_direction(x + 20, y + 20, kris.x, kris.y);
17
        eyex = lerp(eyex, lengthdir_x(4, dirtokris), 0.25);
18
        eyey = lerp(eyey, lengthdir_y(4, dirtokris), 0.25);
19
    }
20
}
21
else
22
{
23
    goback = 1;
24
}
25
if (goback == 1)
26
{
27
    eyex = lerp(eyex, 0, 0.1);
28
    eyey = lerp(eyey, 0, 0.1);
29
}
30
draw_sprite_ext(spr_pxwhite, 0, (x + 20) - 6, (y + 20) - 6, 12, 12, 0, c_white, 1);
31
draw_sprite_ext(spr_pxwhite, 0, -4 + x + 20 + eyex, -2 + y + 20 + eyey, 8, 4, 0, c_black, 1);
32
draw_sprite_ext(spr_pxwhite, 0, -4 + x + 20 + eyex + 2, (-2 + y + 20 + eyey) - 2, 4, 8, 0, c_black, 1);