F
#Frogglets ;-;
Guest
Hi all,
for this boss, i want it to go on the path until the cooldown is less then 0. Once that happens, it will shoot out a laser, then after a while the laser will destroy and it will continue on the path. I'm having trouble getting this all to work as with this code it just continues on the path and does not stop.
my code is:
image_angle = point_direction(x,y,obj_player.x,obj_player.y)-270
countdown = countdown - 1;
if countdown < 1
{
path_start(pth_boss2,5,path_action_reverse,true)
countdown = 99999;
}
cooldown = cooldown - 1;
if cooldown < 1
{
path_speed = 0;
laserc = laserc - 1;
if laserc < 1
{
instance_create_layer(x,y,"Bullets_Layer",obj_laserb);
audio_play_sound(snd_enemylaser,true,false)
laserc2 = 90;
laserc2 = laserc2 - 1;
laserc = 120;
}
}
laserc2 = laserc2 - 1;
if laserc2 < 0
{
cooldown = 600;
path_speed = 5;
laserc = 120;
with(obj_laserb)
{
instance_destroy();
}
laserc2 = 90;
}
if you know anything I can do to work around this it'll be greatly appreciated.
for this boss, i want it to go on the path until the cooldown is less then 0. Once that happens, it will shoot out a laser, then after a while the laser will destroy and it will continue on the path. I'm having trouble getting this all to work as with this code it just continues on the path and does not stop.
my code is:
image_angle = point_direction(x,y,obj_player.x,obj_player.y)-270
countdown = countdown - 1;
if countdown < 1
{
path_start(pth_boss2,5,path_action_reverse,true)
countdown = 99999;
}
cooldown = cooldown - 1;
if cooldown < 1
{
path_speed = 0;
laserc = laserc - 1;
if laserc < 1
{
instance_create_layer(x,y,"Bullets_Layer",obj_laserb);
audio_play_sound(snd_enemylaser,true,false)
laserc2 = 90;
laserc2 = laserc2 - 1;
laserc = 120;
}
}
laserc2 = laserc2 - 1;
if laserc2 < 0
{
cooldown = 600;
path_speed = 5;
laserc = 120;
with(obj_laserb)
{
instance_destroy();
}
laserc2 = 90;
}
if you know anything I can do to work around this it'll be greatly appreciated.