Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_mike_grabcat_Create_0

(view raw script w/o annotations or w/e)
1
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; }
();
2
image_alpha = 1;
3
if (!instance_exists(obj_heart))
4
    instance_destroy();
5
wall_destroy = 0;
6
image_blend = c_aqua;
7
if (x < (camerax() + (camerawidth() / 2)))
8
    side = 1;
9
else
10
    side = -1;
11
var d = point_direction(camerax() + (camerawidth() / 2), cameray() + (cameraheight() / 2), x, y);
12
x = xstart + lengthdir_x(150, d);
13
y = ystart + lengthdir_y(150, d);
14
for (var i = 0; i < 5; i++)
15
{
16
    last_x[i] = 0;
17
    last_y[i] = 0;
18
}
19
last_x[0] = x;
20
last_y[0] = y - 4;
21
thrown = 0;
22
throw_timer = 0;
23
throwing = 0;
24
image_speed = 0.5;
25
friction = 0.1;
26
wait = 0;
27
wait_max = 30;
28
xx = x;
29
yy = y;
30
action = 0;
31
xscale = side;
32
attack_side = choose(1, -1);
33
image_xscale = 1;
34
image_yscale = image_xscale;
35
alarm[0]
 = irandom_range(60, 90);
gml_Object_obj_mike_grabcat_Alarm_0.gml

if (action == 0) { hspeed = 0; friction = 0.25; action = 2; }