Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_ceroba_bullet_particle_controller_Step_2

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
with (obj_battle_enemy_attack_bullet_2)
4
{
5
    var inbetween_particles = 2
6
    var x_dif = x - xprevious
7
    var y_dif = y - yprevious
8
    var x_start = xprevious
9
    var y_start = yprevious
10
    var x_inc = x_dif / inbetween_particles
11
    var y_inc = y_dif / inbetween_particles
12
    for (var i = 0; i < inbetween_particles; i++)
13
    {
14
        var x_new = x_start + x_inc
15
        var y_new = y_start + y_inc
16
        var dir = point_direction(x_start, y_start, x_new, y_new)
17
        part_type_orientation(global.pt_trail_outer, dir, dir, 0, 0, 0)
18
        part_particles_create(global.ps_outer, x_new, y_new, global.pt_trail_outer, 1)
19
        x_start = x_new
20
        y_start = y_new
21
    }
22
}
23
with (obj_battle_enemy_attack_bullet_residue)
24
{
25
    inbetween_particles = 1
26
    x_dif = x - xprevious
27
    y_dif = y - yprevious
28
    x_start = xprevious
29
    y_start = yprevious
30
    x_inc = x_dif / inbetween_particles
31
    y_inc = y_dif / inbetween_particles
32
    for (i = 0; i < inbetween_particles; i++)
33
    {
34
        x_new = x_start + x_inc
35
        y_new = y_start + y_inc
36
        dir = point_direction(x_start, y_start, x_new, y_new)
37
        part_type_orientation(global.pt_trail_small, dir, dir, 0, 0, 0)
38
        part_particles_create(global.ps_outer, x_new, y_new, global.pt_trail_small, 1)
39
        x_start = x_new
40
        y_start = y_new
41
    }
42
}