示例#1
0
        public void Draw()
        {
            Background.Draw(_location);
            CursorGrid.Draw(CursorSize * _cursorPosition.ToVector2() + GridLocation + _location);
            _selectedItem?.Draw(_location + SelectedItemLocation);

            var dungeonManager = (DungeonManager)_agent.DungeonManager;
            var currentRoom    = _agent.DungeonManager.CurrentRoom.ToVector2();
            var visitedRooms   = dungeonManager.VisitedRooms;

            if (dungeonManager.CurrentRoomMapped)
            {
                PlayerMapDot.Draw(MapGridCoverSize * currentRoom + MapGridLocation + _location);
            }

            for (var row = 0; row < visitedRooms.Length; row++)
            {
                for (var col = 0; col < visitedRooms[row].Length; col++)
                {
                    if (!visitedRooms[row][col])
                    {
                        RoomCover.Draw(MapGridCoverSize * new Vector2(col, row) + MapGridLocation + _location);
                    }
                }
            }

            if (_agent.Player.Inventory.HasMap)
            {
                Map.Draw(MapLocation + _location);
            }
            if (_agent.Player.Inventory.HasCompass)
            {
                Compass.Draw(CompassLocation + _location);
            }
            if (_agent.Player.Inventory.HasArrow)
            {
                Arrow.Draw(ArrowLocation + GridLocation + _location);
            }
            if (_agent.Player.Inventory.HasBow)
            {
                Bow.Draw(BowLocation + GridLocation + _location);
            }
            if (_agent.Player.Inventory.HasBoomerang)
            {
                Boomerang.Draw(BoomerangLocation + GridLocation + _location);
            }
            if (_agent.Player.Inventory.BombCount >= 1)
            {
                Bomb.Draw(BombLocation + GridLocation + _location);
            }
        }
示例#2
0
 private void Start()
 {
     _cursorGrid  = FindObjectOfType <CursorGrid>();
     _gameManager = FindObjectOfType <GameManager>();
     _gameManager.GetEntities();
     for (int i = 0; i <= _gameManager.entities.Length - 1; i++)
     {
         if (_gameManager.entities[i] == this)
         {
             number = i;
         }
     }
     agent.enabled    = false;
     obstacle.enabled = true;
     if (number == _gameManager.turn)
     {
         StartTurn();
     }
 }
示例#3
0
        public void Draw()
        {
            Background.Draw(_location);
            if (_selectedItem != null)
            {
                if (_selectedItem.Width > 8)
                {
                    _selectedItem.Draw(_location + SelectedItemLocation16_16);
                }
                else
                {
                    _selectedItem.Draw(_location + SelectedItemLocation8_16);
                }
            }

            if (_agent.Player.Inventory.HasBoomerang)
            {
                Boomerang.Draw(BoomerangLocation + GridLocation + _location);
            }

            if (_agent.Player.Inventory.BombCount >= 1)
            {
                Bomb.Draw(BombLocation + GridLocation + _location);
            }

            if (_agent.Player.Inventory.ArrowLevel == Secondary.SilverArrow)
            {
                SilverArrow.Draw(ArrowLocation + GridLocation + _location);
            }
            else if (_agent.Player.Inventory.ArrowLevel == Secondary.Arrow)
            {
                Arrow.Draw(ArrowLocation + GridLocation + _location);
            }

            if (_agent.Player.Inventory.BowLevel == Secondary.FireBow)
            {
                FireBow.Draw(BowLocation + GridLocation + _location);
            }
            else if (_agent.Player.Inventory.BowLevel == Secondary.Bow)
            {
                Bow.Draw(BowLocation + GridLocation + _location);
            }

            if (_agent.Player.Inventory.Coins >= 2)
            {
                AlchemyCoin.Draw(CoinLocation + GridLocation + _location);
            }

            if (_agent.Player.Inventory.HasATWBoomerang)
            {
                ATWBoomerang.Draw(ATWBoomerangLocation + GridLocation + _location);
            }

            if (_agent.Player.Inventory.HasBombLauncher)
            {
                BombLauncher.Draw(BombLauncherLocation + GridLocation + _location);
            }

            DrawExtraItem(_slot7Sprite, Slot7Location);
            DrawExtraItem(_slot8Sprite, Slot8Location);

            CursorGrid.Draw(CursorSize * _cursorPosition.ToVector2() + GridLocation + _location);
        }
示例#4
0
 public void Update()
 {
     _slot7Sprite = UpdateExtraItemSprite(_agent.Player.Inventory.ExtraItem1);
     _slot8Sprite = UpdateExtraItemSprite(_agent.Player.Inventory.ExtraItem2);
     CursorGrid.Update();
 }
示例#5
0
 public void Update()
 {
     CursorGrid.Update();
 }