コード例 #1
0
 private bool setMoving(bool newTarget)
 {
     if (puppet != null && pathIndex < path.Count)
     {
         int facingDirection2 = 2;
         if (CurrentPathX > 0)
         {
             facingDirection2 = 1;
         }
         else if (CurrentPathX < 0)
         {
             facingDirection2 = 3;
         }
         else if (CurrentPathY < 0)
         {
             facingDirection2 = 0;
         }
         else if (CurrentPathY > 0)
         {
             facingDirection2 = 2;
         }
         puppet.Halt();
         puppet.faceDirection(facingDirection2);
         if (CurrentPathX != 0 && CurrentPathY != 0)
         {
             pauseTime        = CurrentPathY;
             facingDirection2 = CurrentPathX % 4;
             puppet.faceDirection(facingDirection2);
             return(true);
         }
         puppet.setMovingInFacingDirection();
         if (newTarget)
         {
             target = new Vector2(puppet.Position.X + (float)(CurrentPathX * 64), puppet.Position.Y + (float)(CurrentPathY * 64));
         }
         return(true);
     }
     return(false);
 }