Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_cavern_wall_Draw_0

(view raw script w/o annotations or w/e)
1
var _vol = obj_mike_controller.microphone_volume / 100;
2
var _xend = x + lengthdir_x(image_xscale, image_angle);
3
var _yend = y + lengthdir_y(image_xscale, image_angle);
4
if (_xend > 0 && x < room_width)
5
{
6
    if (next == -1)
7
    {
8
        draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, 1, image_angle, image_blend, image_alpha);
9
    }
10
    else
11
    {
12
        image_blend = merge_colour(c_black, c_gray, fade);
13
        if (obj_mike_minigame_controller.wave > 1)
14
            fade = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(fade, 1, 0.1);
15
        draw_set_colour(merge_colour(image_blend, c_blue, _vol));
16
        if (_vol > 0.1)
17
        {
18
            var _lines = 11;
19
            var _xx = x;
20
            var _yy = y;
21
            var _xx2 = _xx;
22
            var _yy2 = _yy;
23
            var _w = image_xscale / _lines;
24
            for (var _i = 0; _i < _lines; _i++)
25
            {
26
                _xx = _xx2 + lengthdir_x(_w, image_angle);
27
                _yy = _yy2 + lengthdir_y(_w, image_angle) + (sin(_i + (current_time / 60)) * _vol * 12 * sign(image_yscale));
28
                if (i_ex(next) && _i == (_lines - 1))
29
                {
30
                    _xx = next.x;
31
                    _yy = next.y;
32
                }
33
                d_line(_xx, _yy, _xx2, _yy2);
34
                _xx2 = _xx;
35
                _yy2 = _yy;
36
            }
37
        }
38
        else
39
        {
40
            d_line(x, y, _xend, _yend);
41
        }
42
    }
43
}