sHatchling
0
-1
-155
0
<undefined>
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
image_speed = 0.25;
targetx = x;
targety = y;
accel = 0.4;
maxspeed = 3;
followplayer = 1;
roaring = 0;
alarm[0] = 120 + random(100);
mealtimer = 0;
flash = 0;
chaseX = 0;
alarm1set = 0;
1
603
7
0
0
-1
2
self
0
0
1
chaseX = 1;
followplayer = 0;
1
603
7
0
0
-1
2
self
0
0
1
sfx_play(choose(sndHatchling,sndHatchling2,sndHatchling3,sndHatchling4));
alarm[0] = 300 + irandom(320);
roaring = 60;
/*sfx_play(sndHatchling);
1
603
7
0
0
-1
2
self
0
0
1
if (global.event[304] == 1 && distance_to_object(oA7Crystal1) < 120) {
tgtobj = instance_nearest(x, y, oA7Crystal1);
if (tgtobj != -4) {
targetx = tgtobj.x + 8;
targety = tgtobj.y + 8;
accel = 0.4;
maxspeed = 3.2;
if (mealtimer > 600) accel *= 2;
}
followplayer = 0;
}
else if (distance_to_object(oXPickup) < 150 ) {
if (chaseX == 1)
{
tgtobj = instance_nearest(x, y, oXPickup);
if (tgtobj != -4) {
targetx = tgtobj.x;
targety = tgtobj.y - 11;
accel = 0.4;
maxspeed = 3.2;
if (mealtimer > 600) accel *= 2;
}
followplayer = 0;
}
else if (alarm1set == 0)
{
alarm1set = 1;
alarm[1] = 45;
}
}
/*
else if (distance_to_object(oEnemy) < 120 ) {
if (chaseX == 1)
{
tgtobj = instance_nearest(x, y, oEnemy);
if (tgtobj != -4) {
targetx = tgtobj.x;
targety = tgtobj.y - 11;
accel = 0.4;
maxspeed = 3.2;
if (mealtimer > 600) accel *= 2;
}
followplayer = 0;
}
else if (alarm1set == 0)
{
alarm1set = 1;
alarm[1] = 90;
}
}
*/
else
{
followplayer = 1;
chaseX = 0;
alarm1set = 0;
}
if (followplayer) {
targetx = oCharacter.x;
targety = oCharacter.y - 30;
if (distance_to_point(oCharacter.x, oCharacter.y - 16) > 128) {
accel = 0.8;
maxspeed = 8;
}
if (distance_to_point(oCharacter.x, oCharacter.y - 16) > 64) {
accel = 0.6;
maxspeed = 6;
} else if (distance_to_point(oCharacter.x, oCharacter.y - 16) > 32) {
accel = 0.4;
maxspeed = 4;
} else {
accel = 0.3;
maxspeed = 2.5;
}
}
if (roaring > 0) {
roaring -= 1;
image_speed = 1;
} else if (image_speed > 0.25) image_speed -= 0.1;
if (flash > 0) flash -= 0.1;
gravity_direction = point_direction(x, y, targetx, targety);
gravity = accel;
if (speed > 4) speed = maxspeed;
mealtimer += 1;
1
603
7
0
0
-1
2
self
0
0
1
draw_self();
draw_set_blend_mode(bm_add);
draw_sprite_ext(sprite_index, -1, x, y, 1, 1, 0, -1, flash);
draw_set_blend_mode(bm_normal);
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
-1