Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gigaprophecy_Draw_0

(view raw script w/o annotations or w/e)
1
var _cx = camerax();
2
var _cy = cameray();
3
var _t = time_seconds;
4
if (!surface_exists(surf_frontprophecies))
5
    surf_frontprophecies = surface_create(surf_width, surf_height);
6
if (!surface_exists(surf_parallax_close))
7
    surf_parallax_close = surface_create(surf_width * 0.5, surf_height * 0.5);
8
if (!surface_exists(surf_parallax_stars))
9
    MakeStarfield();
10
surface_set_target(surf_frontprophecies);
11
draw_clear_alpha(c_black, 0);
12
gpu_set_colorwriteenable(true, true, true, false);
13
draw_sprite_tiled_ext(sprite_blueswirly, 0, -(_cx + (_t * 15)) * 0.5, -(_cy + (_t * 15)) * 0.5, 1, 1, colour_bluenonsense, 1);
14
draw_set_blend_mode(bm_add);
15
draw_sprite_tiled_ext(spr_perlin_noise_looping, 0, -(_cx + (_t * 15)) * 0.5, -(_cy + (_t * 15)) * 0.5, 1, 1, colour_bluenonsense, 
scr_wave
scr_wave

function
scr_wave(arg0, arg1, arg2, arg3)
{ var a4 = (arg1 - arg0) * 0.5; return arg0 + a4 + (sin((((current_time * 0.001) + (arg2 * arg3)) / arg2) * (2 * pi)) * a4); }
(0, 0.4, 4, 0));
16
draw_set_blend_mode(bm_normal);
17
gpu_set_colorwriteenable(true, true, true, true);
18
gpu_set_colorwriteenable(false, false, false, true);
19
draw_set_blend_mode(bm_add);
20
for (var i = 0; i < 3; i++)
21
{
22
    with (obj_prophecy_mask)
23
    {
24
        if (lay == i)
25
        {
26
            x = floor(xstart + layer_get_x(layer));
27
            y = floor(ystart + layer_get_y(layer));
28
            if (x > (_cx - 200) && x < (_cx + 640 + 200) && y > (_cy - 200) && y < (_cy + 480 + 200))
29
            {
30
                var _tt = (_t * 1.25) + local_offset;
31
                var _relative_x = x - _cx;
32
                var _relative_y = y - _cy;
33
                var _xx = _relative_x;
34
                var _yy = _relative_y + (sin(_tt * pi) * 5);
35
                var _offset = 0;
36
                draw_sprite_ext(sprite_index, image_index, floor((_xx + _offset) * 0.5), floor((_yy + _offset) * 0.5), image_xscale, image_yscale, 0, image_blend, 1 - (lay * 0.15));
37
            }
38
        }
39
    }
40
}
41
draw_set_blend_mode(bm_normal);
42
gpu_set_colorwriteenable(true, true, true, true);
43
surface_reset_target();
44
draw_surface_tiled_ext(surf_parallax_stars, _cx * 0.9, _cy * 0.9, 2, 2, 16777215, 1);
45
draw_surface_stretched(surf_frontprophecies, _cx, _cy, 640, 480);