Exemplo n.º 1
0
    public bool MoveToDirection(Utils.PolarDirection dir)
    {
        if (_movementPoints <= 0)
        {
            Debug.Log("Cannot move. Insufficient movementPoints");
            return(false);
        }

        Vector2Int newMapPosition = _mapPosition + Utils.ToCoordIncrement(dir);

        if (!Utils.IsOnMap(newMapPosition))
        {
            Debug.Log("Cannot move out of the map");
            return(false);
        }

        --_movementPoints;
        _direction   = dir;
        _mapPosition = newMapPosition;
        return(true);
    }
Exemplo n.º 2
0
 public void Rotate(Utils.PolarDirection dir)
 {
     _direction = dir;
 }