Deltarune script viewer

← back to main script listing

gml_Object_obj_bq_baseball_hits_boss_Step_0

(view raw script w/o annotations or w/e)
1
var floory = 240;
2
if (x < -20)
3
    instance_destroy();
4
if (state == 1)
5
{
6
    image_angle -= 4;
7
    throw_yspeed += grav;
8
    if (throw_yspeed > max_yspeed)
9
        throw_yspeed = max_syspeed;
10
    prevx = x;
11
    if (throw_xspeed < 0)
12
    {
13
        for (i = throw_xspeed; i < 0; i++)
14
        {
15
            x += i;
16
            break;
17
        }
18
    }
19
    if (throw_yspeed < 0)
20
    {
21
        for (i = throw_yspeed; i < 0; i++)
22
        {
23
            if ((y + i) < floory)
24
            {
25
                y += i;
26
                break;
27
            }
28
        }
29
    }
30
    if (throw_yspeed > 0)
31
    {
32
        for (i = throw_yspeed; i > 0; i--)
33
        {
34
            if ((y + i) < floory)
35
            {
36
                y += i;
37
                break;
38
            }
39
        }
40
    }
41
    if ((y + 1) > floory)
42
    {
43
        if (throw_yspeed > 0)
44
        {
45
            if (throw_yspeed > 0)
46
                throw_yspeed = -throw_yspeed * 0.5;
47
            if (throw_xspeed > 0)
48
                throw_xspeed -= min(0.5, throw_xspeed);
49
            else if (throw_xspeed < 0)
50
                throw_xspeed += min(0.5, abs(throw_xspeed));
51
        }
52
    }
53
}