function enemy_flying_ai()
{
	x_spd = facing_x * x_base_spd;
	y_spd = facing_y * y_base_spd;
	
	var _dist_x = x_spd + sign(x_spd) * abs(sprite_width) * 0.25;
	var _dist_y = y_spd + sign(y_spd) * abs(sprite_height)* 0.25;
	
	if place_meeting(x + _dist_x, y, oParentSolid) ||
	place_meeting(x + _dist_x, y, oParentHazard) ||
	x + _dist_x > room_width || x + _dist_x < 0
        facing_x = -facing_x;
		
	if place_meeting(x, y + _dist_y, oParentSolid) ||
	place_meeting(x, y + _dist_y, oParentHazard) ||
	y + _dist_y > room_height || y + _dist_y < 0
        facing_y = -facing_y;
}