Пример #1
0
        public void Init()
        {
            //TEST: Load XML map
            TileMapParser parser = new TileMapParser(Path.Combine(Content.RootDirectory, "Levels/PuzzleBoyMap.tmx"), Content);

            _map = parser.LoadMap();
            SetStartPoint(_map.StartPoint);

            // For now we're just adding some objects into the world...
            Vector2        pos  = new Vector2(4, 4) * Tile.Size;
            ObtainableItem item = new ObtainableItem(this, pos);

            _map.Entities.Add(item);

            pos = new Vector2(10, 5) * Tile.Size;
            NonPlayableCharacter npc1 = new NonPlayableCharacter(this, pos);

            npc1.SetAIBehaviour(new AIPacingBehaviour(npc1));
            _map.Entities.Add(npc1);

            // Add the player entity
            _map.Entities.Add(_player);

            foreach (Entity entity in _map.Entities)
            {
                entity.Init();
                entity.LoadContent(_content);
            }
        }
Пример #2
0
 public AITurnBehaviour(NonPlayableCharacter npc) : base(npc)
 {
 }
Пример #3
0
 public AIPacingBehaviour(NonPlayableCharacter npc) : base(npc)
 {
 }
Пример #4
0
 public BaseNPCBehaviour(NonPlayableCharacter npc)
 {
     _npc = npc;
 }