コード例 #1
0
 public void Move(int xTile, int yTile)
 {
     if (information.HitPoints > 0)
     {
         if (pathfinding.SetGoal((int)position.X, (int)position.Y, xTile, yTile))
         {
             path = pathfinding.DiscoverPath();
             if (path.Last().x == 49 && path.Last().y == 49)
             {
                 //
             }
             else
             {
                 if (path.Count > 0)
                 {
                     transition = true;
                     goal       = new Vector2(path.First().x * 32, path.First().y * 32);
                     path.RemoveAt(0);
                 }
                 else
                 {
                     position = new Vector2(xTile * 32, yTile * 32);
                 }
             }
         }
     }
 }