using UnityEngine;

public class SpitterWalk : MonoBehaviour 
{
    private void ChooseNewSpot(EnemyMovementController move)
    {
        float y = Mathf.Clamp(transform.position.y, -RoomSize.Height, RoomSize.Height);

        float sign = Random.Range(0f, 1f) > 0.5f ? 1 : -1;
        float x = transform.position.x + sign * Random.Range(5f, 10f);
        x = Mathf.Clamp(x, -RoomSize.Width, RoomSize.Width);

        move.TargetPos = new Vector2(x, y);
    }
}
