コード例 #1
0
ファイル: World.cs プロジェクト: magpiearmy/PuzzleBoy
        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
ファイル: AIBehaviour.cs プロジェクト: magpiearmy/PuzzleBoy
 public AITurnBehaviour(NonPlayableCharacter npc) : base(npc)
 {
 }
コード例 #3
0
ファイル: AIBehaviour.cs プロジェクト: magpiearmy/PuzzleBoy
 public AIPacingBehaviour(NonPlayableCharacter npc) : base(npc)
 {
 }
コード例 #4
0
ファイル: AIBehaviour.cs プロジェクト: magpiearmy/PuzzleBoy
 public BaseNPCBehaviour(NonPlayableCharacter npc)
 {
     _npc = npc;
 }