Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ch2_scene10_arcade_bg_Draw_0

(view raw script w/o annotations or w/e)
1
draw_set_alpha(image_alpha);
2
draw_rectangle_color(x1, y1, x2, y2, c_black, c_black, c_black, c_black, 0);
3
draw_set_alpha(1);
4
if (con == 0)
5
{
6
    repeat (5)
7
    {
8
        if (x1 > camerax())
9
            x1 -= 2.66;
10
        if (y1 > cameray())
11
            y1 -= 2;
12
        if (x2 < (camerax() + 640))
13
            x2 += 2.66;
14
        if (y2 < (cameray() + 480))
15
            y2 += 2.66;
16
    }
17
    timer++;
18
    if (timer <= 30)
19
    {
20
        obj_ch2_scene10.kr_actor.y = lerp(su_y_save, cameray() + 370, timer / 30);
21
        obj_ch2_scene10.kr_actor.depth = -19999;
22
        obj_ch2_scene10.su_actor.y = lerp(su_y_save, cameray() + 370, timer / 30);
23
        obj_ch2_scene10.su_actor.depth = -19999;
24
        obj_ch2_scene10.ra_actor.y = lerp(ra_y_save, cameray() + 430, timer / 30);
25
        obj_ch2_scene10.ra_actor.depth = -19998;
26
        obj_ch2_scene10.qu_actor.y = lerp(qu_y_save, cameray() + 370, timer / 30);
27
        obj_ch2_scene10.qu_actor.depth = -19998;
28
    }
29
    if (timer >= 60)
30
    {
31
        con = 1;
32
        timer = 0;
33
    }
34
}
35
if (con == 1.5)
36
{
37
    depth = 4;
38
    instance_create(288, 192, o_boxingcontroller);
39
    instance_create(206, 60, o_boxingqueen);
40
    instance_create(64, 96, obj_3d_bg_effect);
41
    con = 2;
42
}
43
if (con == 1)
44
{
45
    depth = 4;
46
    instance_create(x, y, obj_ch2_scene10_arcade_fg);
47
    con = 1.5;
48
}
49
if (con == 3)
50
{
51
    image_alpha -= 0.1;
52
    timer++;
53
    if (timer == 10)
54
    {
55
        with (obj_ch2_scene10)
56
alarm[0]
57
    }
58
    if (timer == 12)
59
    {
60
        with (obj_ch2_scene10)
61
        {
62
            with (obj_marker)
63
                instance_destroy();
64
        }
65
    }
66
    if (timer <= 10)
67
    {
68
        obj_ch2_scene10.kr_actor.x = lerp(261, 261, timer / 10);
69
        obj_ch2_scene10.kr_actor.y = lerp(cameray() + 370, 143, timer / 10);
70
        obj_ch2_scene10.kr_actor.sprite_index = spr_krisu_dark;
71
        obj_ch2_scene10.su_actor.x = lerp(282, 282, timer / 10);
72
        obj_ch2_scene10.su_actor.y = lerp(cameray() + 370, 143, timer / 10);
73
        obj_ch2_scene10.su_actor.sprite_index = spr_susie_walk_up_dw;
74
        obj_ch2_scene10.su_actor.depth = obj_ch2_scene10.kr_actor.depth - 1;
75
        obj_ch2_scene10.ra_actor.x = lerp(231, 231, timer / 10);
76
        obj_ch2_scene10.ra_actor.y = lerp(cameray() + 370, 147, timer / 10);
77
        obj_ch2_scene10.ra_actor.sprite_index = spr_ralsei_walk_up;
78
        obj_ch2_scene10.ra_actor.depth = obj_ch2_scene10.kr_actor.depth - 1;
79
        obj_ch2_scene10.qu_actor.x = lerp(325, 325, timer / 10);
80
        obj_ch2_scene10.qu_actor.y = lerp(cameray() + 370, 90, timer / 10);
81
        obj_ch2_scene10.qu_actor.sprite_index = spr_queen_walk_up;
82
    }
83
    if (timer >= 15)
84
    {
85
        instance_destroy();
86
        with (obj_ch2_scene10_arcade_fg2)
87
            instance_destroy();
88
    }
89
}
90
if (con == 2)
91
{
92
    if (punch_r_timer > 0)
93
    {
94
        punch_r_timer -= 1;
95
        obj_ch2_scene10.kr_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back_punch_right;
96
        obj_ch2_scene10.su_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back_punch_right;
97
        var rand = punch_r_timer;
98
        obj_ch2_scene10.kr_actor.y = (cameray() + 370) - rand;
99
        obj_ch2_scene10.su_actor.y = (cameray() + 370) - rand;
100
    }
101
    else if (punch_l_timer > 0)
102
    {
103
        punch_l_timer -= 1;
104
        obj_ch2_scene10.kr_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back_punch_left;
105
        obj_ch2_scene10.su_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back_punch_left;
106
        var rand = punch_l_timer;
107
        obj_ch2_scene10.kr_actor.y = (cameray() + 370) - rand;
108
        obj_ch2_scene10.su_actor.y = (cameray() + 370) - rand;
109
    }
110
    else if (dodge_r_timer > 0)
111
    {
112
        dodge_r_timer -= 1;
113
        obj_ch2_scene10.kr_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back_dodge_right;
114
        obj_ch2_scene10.su_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back_dodge_right;
115
        var rand = dodge_r_timer;
116
        obj_ch2_scene10.kr_actor.x = kr_x_save + rand;
117
        obj_ch2_scene10.su_actor.x = su_x_save + rand;
118
    }
119
    else if (dodge_l_timer > 0)
120
    {
121
        dodge_l_timer -= 1;
122
        obj_ch2_scene10.kr_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back_dodge_left;
123
        obj_ch2_scene10.su_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back_dodge_left;
124
        var rand = dodge_l_timer;
125
        obj_ch2_scene10.kr_actor.x = kr_x_save - rand;
126
        obj_ch2_scene10.su_actor.x = su_x_save - rand;
127
    }
128
    else if (dodge_d_timer > 0)
129
    {
130
        dodge_d_timer -= 1;
131
        obj_ch2_scene10.kr_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back;
132
        obj_ch2_scene10.su_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back;
133
        var rand = dodge_d_timer;
134
        obj_ch2_scene10.kr_actor.y = cameray() + 370 + rand;
135
        obj_ch2_scene10.su_actor.y = cameray() + 370 + rand;
136
    }
137
    else
138
    {
139
        obj_ch2_scene10.kr_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back;
140
        obj_ch2_scene10.su_actor.sprite_index = spr_cutscene_10_susie_kris_t_pose_back;
141
    }
142
}