Deltarune script viewer

← back to main script listing

gml_Object_obj_traffic_car_Draw_0

(view raw script w/o annotations or w/e)
1
downframetimer++;
2
animsiner++;
3
if (downframetimer >= 3)
4
{
5
    if (downframe == 0)
6
        downframe = 1;
7
    else
8
        downframe = 0;
9
    downframetimer = 0;
10
}
11
if (walkdir == "down")
12
{
13
    draw_sprite_ext(spr_traffic_car_legs, animsiner / 6, x, y + (downframe * 2), image_xscale, image_yscale, 0, c_white, image_alpha);
14
    draw_sprite_ext(sprite_index, image_index, x + walkx, y + (downframe * 4) + walky, image_xscale, image_yscale, 0, c_white, image_alpha);
15
}
16
if (walkdir == "right")
17
{
18
    draw_sprite_ext(spr_traffic_car_side_legs_only, animsiner / 6, x, (y + (downframe * 2)) - 32, image_xscale, image_yscale, 0, c_white, image_alpha);
19
    draw_sprite_ext(spr_traffic_car_side, image_index, x + walkx, y + (downframe * 4) + walky, image_xscale, image_yscale, 0, c_white, image_alpha);
20
}
21
if (walkdir == "left")
22
{
23
    draw_sprite_ext(spr_traffic_car_side_legs_only, animsiner / 6, sprite_width + x, (y + (downframe * 2)) - 32, -image_xscale, image_yscale, 0, c_white, image_alpha);
24
    draw_sprite_ext(spr_traffic_car_side, image_index, sprite_width + x + walkx, y + (downframe * 4) + walky, -image_xscale, image_yscale, 0, c_white, image_alpha);
25
}
26
if (walking == 1)
27
{
28
    walklerp += (0.01 + (walklerp / 2));
29
    if (walklerp >= 1)
30
        walklerp = 1;
31
}
32
else
33
{
34
    if (walklerp >= 0)
35
        walklerp *= 0.85;
36
    if (abs(walklerp) < 0.02)
37
        walklerp = 0;
38
    if (abs(walkx) < 0.02)
39
        walkx = 0;
40
    if (abs(walky) < 0.02)
41
        walky = 0;
42
}
43
walkx = sin(animsiner / 4) * walklerp * 2;
44
walky = lerp(0, walklerp, -26);
45
if (alwayswalking == 1)
46
    walky = -26;