Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_corner_track_Step_0

(view raw script w/o annotations or w/e)
1
var rail_switch = false;
2
with (obj_mc_button)
3
{
4
    if (track_number == other.track_number && swit == true)
5
        rail_switch = true;
6
}
7
if (rail_switch == true)
8
{
9
    if (rotation == "top-left")
10
        rotation = "top-right";
11
    else if (rotation == "top-right")
12
        rotation = "bottom-right";
13
    else if (rotation == "bottom-right")
14
        rotation = "bottom-left";
15
    else if (rotation == "bottom-left")
16
        rotation = "top-left";
17
}
18
switch (rotation)
19
{
20
    case "top-right":
21
        sprite_index = spr_mc_corner_top_left;
22
        break;
23
    case "top-left":
24
        sprite_index = spr_mc_corner_top_right;
25
        break;
26
    case "bottom-right":
27
        sprite_index = spr_mc_corner_bottom_left;
28
        break;
29
    case "bottom-left":
30
        sprite_index = spr_mc_corner_bottom_right;
31
        break;
32
}