direction=image_angle
if life<1 instance_destroy()
//do:1=target the base only do:2=target turrets do:3=go away
if instance_exists(obj_turret_parent)
{
turret=instance_nearest(x,y,obj_turret_parent)
point=instance_nearest(x,y,object19)
if do_=3
{
scr_grad_turn(point,2)
}
if do_=2
{
scr_grad_turn(turret,5)
if canshoot=true and distance_to_object(turret)<350
{
canshoot=false
canshoot2=true
alarm[2]=15
bul=instance_create(x+lengthdir_x(20,image_angle),y+lengthdir_y(20,image_angle),obj_enemy_bullet)
bul.move1=turret.x
bul.move2=turret.y
bul.direction=random(10)+image_angle-5
if canshoot2=true and distance_to_object(turret)<350
{
canshoot2=false
alarm[1]=15
bul=instance_create(x+lengthdir_x(20,image_angle),y+lengthdir_y(20,image_angle),obj_enemy_bullet2)
bul.move1=turret.x
bul.move2=turret.y
bul.direction=random(10)+image_angle-5}}}
if do_=1
{
scr_grad_turn(object8,5)
if canshoot=true and distance_to_object(object8)<350
{
canshoot=false
canshoot2=true
alarm[2]=15
bul=instance_create(x+lengthdir_x(20,image_angle),y+lengthdir_y(20,image_angle),obj_enemy_bullet)
bul.move1=turret.x
bul.move2=turret.y
bul.direction=random(10)+image_angle-5
if canshoot2=true and distance_to_object(turret)<350
{
canshoot2=false
alarm[1]=15
bul=instance_create(x+lengthdir_x(20,image_angle),y+lengthdir_y(20,image_angle),obj_enemy_bullet2)
bul.move1=turret.x
bul.move2=turret.y
bul.direction=random(10)+image_angle-5}}}
} |
Bookmarks