function enemy_flying_track2_ai()
{	
    var _target = noone;
    if instance_exists(global.player)
	{
		var _blocker = collision_line(x, y,
		global.player.x, global.player.y - 1, oParentObstacle, false, true);
		
        if distance_to_object(global.player) < range && _blocker == noone
            _target = global.player;
	}

    if _target != noone
    {
        var _dir = point_direction(x, y, _target.x, _target.y - 128);
        
        x_spd += lengthdir_x(acc, _dir);
        y_spd += lengthdir_y(acc, _dir);
        
        facing_x = sign(_target.x - x);
		
		set_sprite(sEnemyFlyingTrack);
    }
	else
	{
		if y_spd = 0
		{
			x_spd = 0;
			set_sprite(sEnemyFlyingTrackIdle);
		}
		
		x_spd = lerp(x_spd, 0, 0.01);
		y_spd += acc;
	}

    var _current_spd = point_distance(0, 0, x_spd, y_spd);
    if _current_spd > max_spd
	{
        var _scale = max_spd / _current_spd;
        x_spd *= _scale;
        y_spd *= _scale;
    }
	
	image_xscale = facing_x;
}