/// @description Insert description here
// You can write your code in this editor
if hp<=0 then {if irandom(10)>5 then instance_create_depth(x,y,1,obj_heal) instance_destroy()}
if reload=0 then mp_potential_step_object(player.x,player.y,sped,obj_wall) else mp_potential_step_object(x-lengthdir_x(100,point_direction(player.x,player.y,x,y)),y-lengthdir_y(100,point_direction(player.x,player.y,x,y)),6,obj_wall)
if reload>0 then reload-=1
