Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_sneo_crusher_chase_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    init = 1;
4
    if (crushedObj != 1)
5
        offsetCap = (crushedObj == 2) ? 15 : 0;
6
}
7
if (vbounce == 1)
8
{
9
    if (y > bottomy)
10
    {
11
        y = bottomy - 1;
12
        vspeed = -abs(vspeed);
13
    }
14
    if (y < topy)
15
    {
16
        y = topy + 1;
17
        vspeed = abs(vspeed);
18
    }
19
}
20
siner += 0.4;
21
x = xstart + (sin(siner / 6) * 60);
22
shoottimer++;
23
if (shoottimer >= 54)
24
{
25
    var b = 0;
26
    repeat (3)
27
    {
28
        radialshot = instance_create(x, y, obj_collidebullet);
29
        with (radialshot)
30
            scr_bullet_init
scr_bullet_init

function scr_bullet_init() { grazed = 0; grazetimer = 0; destroyonhit = 1; target = 0; inv = 60; damage = 10; element = 0; grazepoints = 1; timepoints = 1; active = 1; updateimageangle = 0; }
();
31
        radialshot.sprite_index = spr_diamondbullet;
32
        radialshot.direction = point_direction(radialshot.x, radialshot.y, obj_heart.x + 10, obj_heart.y + 10);
33
        radialshot.image_angle = radialshot.direction;
34
        radialshot.image_xscale = 1;
35
        radialshot.image_yscale = 1;
36
        radialshot.image_blend = c_red;
37
        radialshot.active = 1;
38
        radialshot.speed = 3.5;
39
        radialshot.friction = -0.33 + b;
40
        radialshot.depth = depth - 1;
41
        radialshot.target = target;
42
        radialshot.damage = damage;
43
        radialshot.grazed = 0;
44
        radialshot.element = 6;
45
        shoottimer = 0;
46
        b += 0.07;
47
    }
48
}