Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_tower_dog_stilts_Step_0

(view raw script w/o annotations or w/e)
1
y = cameray() + 380 + yoffset;
2
yoffset += vsp;
3
vsp += grav;
4
if (con == 0)
5
{
6
    if ((image_index > 0.9 && image_index < 1.1) || (image_index > 3.9 && image_index < 4.1))
7
        snd_play_x(snd_bump, 0.6, 1.2);
8
    timer++;
9
    if ((timer % 30) == 0)
10
    {
11
        anim = instance_create(x + 15, y, obj_animation);
12
        anim.sprite_index = spr_sweat_anim;
13
        anim.image_xscale = -1;
14
        anim.image_yscale = 1;
15
        anim.image_speed = 1/3;
16
    }
17
    if (i_ex(obj_animation))
18
    {
19
        obj_animation.x = x + 15;
20
        obj_animation.y = y;
21
    }
22
}
23
if (con == 0 && x < (camerax() + 610) && obj_rotating_tower_controller_new.tower_falls_apart_con != 0)
24
{
25
    obj_rotating_tower_controller_new.tower_falls_apart_con = 0;
26
    obj_rotating_tower_controller_new.tower_falls_apart_i = 0;
27
    with (obj_rotating_tower_controller)
28
    {
29
        for (var i = 0; i < towerpiececount; i++)
30
            tower_piece_sprite_dog[i] = 4168;
31
    }
32
}
33
if (con == 0 && x < (camerax() + 220))
34
{
35
    snd_play_pitch(snd_slidewhistle, 1.3);
36
    snd_play_pitch(snd_pombark, 0.7);
37
    stilt = instance_create(x - 14, y + 880, obj_tower_dog_stilts2);
38
    stilt.image_xscale = 2;
39
    stilt.image_yscale = 2;
40
    stilt = instance_create(x + 10, y + 880, obj_tower_dog_stilts2);
41
    stilt.sprite_index = spr_dog_stilts_long3;
42
    stilt.image_xscale = 2;
43
    stilt.image_yscale = 2;
44
    sprite_index = spr_dog_climb1;
45
    image_index = 2;
46
    image_xscale = -2;
47
    image_speed = 0;
48
    hspeed = -4;
49
    timer = 0;
50
    con = 1;
51
}
52
if (con == 1)
53
{
54
    timer++;
55
    if (timer == 5)
56
    {
57
        dog = instance_create_depth(0, 0, depth - 10, obj_tower_dog);
58
        dog.draw_y = y + 20;
59
        dog.climbfaster = true;
60
        dog.depth = 99450;
61
        obj_rotating_tower_controller_new.endclimb = true;
62
        with (obj_climb_kris)
63
        {
64
            forceclimb = true;
65
            climb_finished = true;
66
        }
67
        with (obj_rotating_bullet)
68
            instance_destroy();
69
        with (obj_afterimage)
70
            instance_destroy();
71
        instance_destroy();
72
    }
73
    if (timer == 6)
74
        instance_destroy();
75
}