Пример #1
0
 public NavNode(NavMesh mesh, float x, float y)
 {
     Position = new Vector2(x,y) * MainGame.PIXEL_TO_METER;
     Neighbors = new List<NavNode>();
     Costs = new List<float>();
     Previous = new Dictionary<NavAgent, NavNode>();
     mesh.AddNode(this);
 }
Пример #2
0
 public NavAgent(AiPlayer bot)
     : base(MainGame.mainGame)
 {
     this.bot = bot;
     mesh = Map.navMesh;
     if (mesh == null) Console.WriteLine("New NavAgent NO MESH");
     else Console.WriteLine("New NavAgent OKAY");
     if (random == null) random = new Random();
     Game.Components.Add(this);
 }
Пример #3
0
 public static MapData LoadMap(World w, string name)
 {
     Console.WriteLine("Loading map: " + name);
     MapData data;
     if (name == "castle")
         data = LoadCastle(w);
     else if (name == "pillar")
         data = LoadPillar(w);
     else if (name == "octopus")
         data = LoadOctopus(w);
     else if (name == "graveyard")
         data = LoadGraveyard(w);
     else if (name == "clocktower")
         data = LoadClocktower(w);
     else if (name == "circus")
         data = LoadCircus(w);
     else
         data = LoadCastle(w);
     Map.navMesh = data.navmesh;
     return data;
 }