Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_tenna_smashcut_manager_Draw_73

(view raw script w/o annotations or w/e)
1
if (global.turntimer < 1)
2
{
3
    instance_destroy();
4
    exit;
5
}
6
if (!surface_exists(smash_surface))
7
    smash_surface = surface_create(640, 480);
8
surface_set_target(smash_surface);
9
draw_clear(c_black);
10
draw_surface(application_surface, 0, 0);
11
surface_reset_target();
12
var cut = obj_growtangle.y - cameray();
13
var cut2 = cameraheight() - cut;
14
timer2++;
15
var xoffset = 0;
16
if (timer2 == 1)
17
    xoffset = 10;
18
if (timer2 == 2)
19
    xoffset = -9;
20
if (timer2 == 3)
21
    xoffset = 8;
22
if (timer2 == 4)
23
    xoffset = -7;
24
if (timer2 == 5)
25
    xoffset = 6;
26
if (timer2 == 6)
27
    xoffset = -5;
28
if (timer2 == 7)
29
    xoffset = 4;
30
if (timer2 == 8)
31
    xoffset = -3;
32
if (timer2 == 9)
33
    xoffset = 2;
34
if (timer2 == 10)
35
    xoffset = -1;
36
if (timer2 == 11)
37
    xoffset = 0;
38
ossafe_fill_rectangle_color(camerax(), cameray(), camerax() + camerawidth(), cameray() + cameraheight(), c_black, c_black, c_black, c_black);
39
draw_surface_part(smash_surface, 0, 0, camerawidth(), cut, camerax() + xoffset + (sin(timer) * 24 * intensity), cameray());
40
draw_surface_part(smash_surface, 0, 0, camerawidth(), cut, (camerax() + xoffset + (sin(timer) * 24 * intensity)) - camerawidth(), cameray());
41
draw_surface_part(smash_surface, 0, 0, camerawidth(), cut, camerax() + xoffset + (sin(timer) * 24 * intensity) + camerawidth(), cameray());
42
draw_surface_part(smash_surface, 0, cut, camerawidth(), cut2, camerax() + xoffset + (cos(timer) * 24 * intensity), cameray() + cut);
43
draw_surface_part(smash_surface, 0, cut, camerawidth(), cut2, (camerax() + xoffset + (cos(timer) * 24 * intensity)) - camerawidth(), cameray() + cut);
44
draw_surface_part(smash_surface, 0, cut, camerawidth(), cut2, camerax() + xoffset + (cos(timer) * 24 * intensity) + camerawidth(), cameray() + cut);
45
bar_v = 
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; }
(bar_v, 0, bar_v * 0.5);
46
if (bar_v < 0.1)
47
    bar_v = 0;
48
var bar_height = bar_v * 0.5;
49
var bar_width = camerawidth() * 0.5;
50
if (bar_v > 0)
51
    ossafe_fill_rectangle_color(obj_growtangle.x - bar_width, obj_growtangle.y - bar_height, obj_growtangle.x + bar_width, obj_growtangle.y + bar_height, c_white, c_white, c_white, c_white);