Пример #1
0
 public bool IsInRangeOf(GameObject other, Range range)
 {
     if ((Game.GetRoom.IsObjectInRoomDirectly(this) || this is Player) &&
         (Game.GetRoom.IsObjectInRoomDirectly(other) || other is Player))
     {
         var area = Pathfinding.SpillGetPoints(Position, range.X, range.Y, true, true);
         return(Pathfinding.IsPointInBFSList(other.Position, area));
     }
     else
     {
         return(true);
     }
 }
Пример #2
0
        public override void Move(Direction direction)
        {
            var move        = Pathfinding.DirectionToPoint(direction);
            var newposition = Position + move;

            if (Pathfinding.IsPointInBFSList(newposition, MoveArea))
            {
                if (!moverun)
                {
                    moverun    = true;
                    startpoint = position;
                }

                position = newposition;
            }
        }