Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ow_viromaze2_viro_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    if (instance_exists(obj_mainchara) && point_in_rectangle(obj_mainchara.x, obj_mainchara.y, 740, 280, 780, 440))
4
    {
5
        con = 1;
6
        x += sprite_width;
7
        image_xscale = 2;
8
        timer = shotSpeed - 2;
9
        speed = 1;
10
    }
11
}
12
if (con == 1)
13
{
14
    direction = point_direction(x + (sprite_width / 2), y + (sprite_height / 2), obj_mainchara.x + 10, obj_mainchara.y + 20);
15
    speed = 4;
16
    timer++;
17
    if (timer >= shotSpeed)
18
    {
19
        spear = instance_create(x + (sprite_width / 2), y + 65, obj_virospear);
20
        spear.direction = point_direction(spear.x, spear.y, obj_mainchara.x + 10, obj_mainchara.y + 20);
21
        spear.image_angle = spear.direction;
22
        spear.depth = depth - 20;
23
        shotSpeed = random(20) + 50;
24
        timer = 0;
25
    }
26
}
27
if (con == 3)
28
{
29
    direction = point_direction(x, y, obj_mainchara.x, obj_mainchara.y);
30
    direction *= 180;
31
    speed = 8;
32
    con = 4;
33
}