if (collision_point(x+lengthdir_x(argument0, rot1), y+lengthdir_y(argument0, rot1), o_player_main, 0, 1) and !collision_line(x, y, x+lengthdir_x(argument0, rot1+90), y+lengthdir_y(argument0, rot1+90), o_block2, 0, 1))
{   //player detected - stop
    move = 0;
    alarm[0] = choose(60, 90, 120);
    aa = 1;
    exit;
};
if (collision_point(x+lengthdir_x(argument0, rot1+90), y+lengthdir_y(argument0, rot1+90), o_player_main, 0, 1) and !collision_line(x, y, x+lengthdir_x(argument0, rot1+90), y+lengthdir_y(argument0, rot1+90), o_block2, 0, 1))
{   //player detected left - wanna turn left
    move = 0;
    turn1 = -1;
    turn2 = -1;
    alarm[0] = 30;
    alarm[1] = 15;
    if fire != 0 alarm[2] = 16;
    aa = 2;
    exit;
};
if (collision_point(x+lengthdir_x(argument0, rot1-90), y+lengthdir_y(argument0, rot1-90), o_player_main, 0, 1) and !collision_line(x, y, x+lengthdir_x(argument0, rot1+90), y+lengthdir_y(argument0, rot1+90), o_block2, 0, 1))
{   //player detected right - wanna turn right
    move = 0;
    turn1 = 1;
    turn2 = 1;
    alarm[0] = 30;
    alarm[1] = 15;
    if fire != 0 alarm[2] = 16;
    aa = 3;
    exit;
};
