Beispiel #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            player = new Player(new Vector2(400, 300), "Player1");
            ListHolder.Instance.NPCList = new List<NPC>();
            ListHolder.Instance.WallList = new List<Wall>();
            ListHolder.Instance.setGame(this);
            ListHolder.Instance.player = player;

            //initialize map npc spawns
            MakeNPCList(levelOneLayout);
            pathfinding = new Pathfinding(level1);
            ListHolder.Instance.setPathFinder(pathfinding);
            //path = pathfinding.FindPath(startPoint, endPoint);
            //newPath = pathfinding.FindPath(TSP, TEP);

            Vector2 start = new Vector2(startPoint.X*50, startPoint.Y*50);
            Vector2 end = new Vector2(endPoint.X * 50, endPoint.Y * 50);
            npcMover = new NPC(start, "NPC");

               // pathEndPoint = new GameObject(Content.Load<Texture2D>("endPoint"),end);

            base.Initialize();
        }
Beispiel #2
0
 public void setPathFinder(Pathfinding NewPathFinding)
 {
     PathFinder = NewPathFinding;
 }