Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_background_el_bailador_test_yellow_Draw_0

(view raw script w/o annotations or w/e)
1
for (j = 0; j < 2; j++)
2
{
3
    if (osc_horizontal == true)
4
    {
5
        m_time_elapsed += time_increase
6
        if (m_time_elapsed >= time_max)
7
        {
8
            m_time_elapsed = 0
9
            m_sign_modifier = (-m_sign_modifier)
10
        }
11
    }
12
    if (osc_vertical == true)
13
    {
14
        m_time_elapsed_v += time_increase_v
15
        if (m_time_elapsed_v >= time_max_v)
16
        {
17
            m_time_elapsed_v = 0
18
            m_sign_modifier_v = (-m_sign_modifier_v)
19
        }
20
    }
21
}
22
if (scroll_horizontal == true)
23
{
24
    scroll_ind_total_x += scroll_ind_inc_x
25
    if (scroll_ind_total_x >= scroll_ind_max_x)
26
    {
27
        while (scroll_ind_total_x >= scroll_ind_max_x)
28
        {
29
            scroll_current_x += pixel_dim
30
            if (scroll_current_x >= sprite_width)
31
                scroll_current_x -= sprite_width
32
            else if (scroll_current_x < 0)
33
                scroll_current_x += sprite_width
34
            scroll_ind_total_x -= scroll_ind_max_x
35
        }
36
    }
37
}
38
else
39
{
40
    scroll_current_x = 0
41
    scroll_ind_total_x = 0
42
}
43
if (scroll_vertical == true)
44
{
45
    scroll_ind_total_y += scroll_ind_inc_y
46
    if (scroll_ind_total_y >= scroll_ind_max_y)
47
    {
48
        while (scroll_ind_total_y >= scroll_ind_max_y)
49
        {
50
            scroll_current_y += pixel_dim
51
            if (scroll_current_y >= sprite_height)
52
                scroll_current_y -= sprite_height
53
            else if (scroll_current_y < 0)
54
                scroll_current_y += sprite_height
55
            scroll_ind_total_y -= scroll_ind_max_y
56
        }
57
    }
58
}
59
else
60
{
61
    scroll_current_y = 0
62
    scroll_ind_total_y = 0
63
}
64
if (interlaced_x == true)
65
    int_s_current_x = int_s_default_x
66
else
67
    int_s_current_x = 1
68
if (interlaced_y == true)
69
    int_s_current_y = int_s_default_y
70
else
71
    int_s_current_y = 1
72
sign_modifier = m_sign_modifier
73
time_elapsed = m_time_elapsed
74
sign_modifier_v = m_sign_modifier_v
75
time_elapsed_v = m_time_elapsed_v + scroll_current_y / pixel_dim
76
while (time_elapsed_v >= time_max_v)
77
{
78
    time_elapsed_v -= time_max_v
79
    sign_modifier_v = (-sign_modifier_v)
80
}
81
for (i = 0; i < sprite_height; i += pixel_dim)
82
{
83
    scroll_temp_x = scroll_current_x
84
    if (scroll_temp_x >= sprite_width)
85
        scroll_temp_x -= sprite_width
86
    else if (scroll_temp_x < 0)
87
        scroll_temp_x += sprite_width
88
    scroll_temp_y = scroll_current_y + i
89
    if (scroll_temp_y >= sprite_height)
90
        scroll_temp_y -= sprite_height
91
    else if (scroll_temp_y < 0)
92
        scroll_temp_y += sprite_height
93
    if (osc_horizontal == true || osc_vertical == true)
94
    {
95
        if (osc_horizontal == true)
96
        {
97
            game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
98
            animation_disjoint_x = sign_modifier * (max_rise - game_maker_cannot_do_math)
99
            time_elapsed += time_increase
100
            if (time_elapsed >= time_max)
101
            {
102
                time_elapsed = 0
103
                sign_modifier = (-sign_modifier)
104
            }
105
        }
106
        else
107
            animation_disjoint_x = 0
108
        var anim_dj_y_last = animation_disjoint_y
109
        if (osc_vertical == true)
110
        {
111
            game_maker_cannot_do_math = power((time_elapsed_v / (time_max_v / 2 * (1 / sqrt(max_rise_v))) - sqrt(max_rise_v)), 2)
112
            animation_disjoint_y = sign_modifier_v * (max_rise_v - game_maker_cannot_do_math)
113
            if (interlaced_y == false)
114
            {
115
                time_elapsed_v += time_increase_v
116
                if (time_elapsed_v >= time_max_v)
117
                {
118
                    time_elapsed_v = 0
119
                    sign_modifier_v = (-sign_modifier_v)
120
                }
121
            }
122
        }
123
        else
124
            animation_disjoint_y = 0
125
        animation_disjoint_x = pixel_dim * (floor(0.5 + animation_disjoint_x / pixel_dim))
126
        animation_disjoint_y = pixel_dim * (floor(0.5 + animation_disjoint_y / pixel_dim))
127
        event_user(0)
128
        if (i == 0)
129
            var for_end = 0
130
        else
131
            for_end = animation_disjoint_y - anim_dj_y_last
132
        if (for_end < 0)
133
            for_end = 0
134
        for (k = 0; k <= for_end; k++)
135
        {
136
            for (l = 0; l <= 1; l++)
137
            {
138
                var par_y = draw_top + i + int_s_current_y * animation_disjoint_y - pixel_dim * k
139
                image_alpha = (par_y - alpha_top + 1) * ((alpha_max - alpha_min) / (alpha_bottom - alpha_top + 1))
140
                if (image_alpha > alpha_max)
141
                    image_alpha = alpha_max
142
                else if (image_alpha < alpha_min)
143
                    image_alpha = alpha_min
144
                draw_sprite_part_ext(sprite_index, image_index, par_left[l], scroll_temp_y, par_width[l], pixel_dim, par_x[l], par_y, image_xscale, image_yscale, c_black, 1)
145
                draw_sprite_part_ext(sprite_index, image_index, par_left[l], scroll_temp_y, par_width[l], pixel_dim, par_x[l], par_y, image_xscale, image_yscale, c_white, (image_alpha * alpha_base))
146
            }
147
        }
148
    }
149
    int_s_last_y = int_s_current_y
150
    if (interlaced_x == true)
151
        int_s_current_x = (-int_s_current_x)
152
    if (interlaced_y == true)
153
        int_s_current_y = (-int_s_current_y)
154
}