Exemplo n.º 1
0
 private void Move()
 {
     if (Vector3d.SqrDistance(SceneObject.MainPlayer.Position, SceneObject.Position) > 5.ToLong())
     {
         SceneObject.AttributeManager.SetBase(AttributeType.Speed, SceneObject.GetAttributeValue(Logic.AttributeType.MaxSpeed));
         //Vector3d offset = new Vector3d(_npc.AlignmentX.ToLong(), 0, _npc.AlignmentY.ToLong());
         JPSAStar.active.GetPath(SceneObject.Position, SceneObject.MainPlayer.Position, _path);
         if (_path.Count > 1)
         {
             _pathIndex = 1;
             Vector3d moveDirection = (_path[_pathIndex] - SceneObject.Position).Normalize();
             SceneObject.Forward = moveDirection;
         }
     }
 }