Пример #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
        public void Render()
        {
            BaseGame.Device.Clear(Color.Blue);

            backGround.Draw();

            //BasicGraphics.DrawRectangle( wall.BoundingBox, 3f, Color.Red, 0f );

            //BasicGraphics.DrawRectangle( mapSize, 3f, Color.Red, 0f );
            foreach (Vector2 keyPoint in ball.KeyPoints)
            {
                BaseGame.BasicGraphics.DrawPoint(Vector2.Transform(keyPoint, ball.TransMatrix), 1f, Color.Black, 0f);
            }
            BaseGame.BasicGraphics.DrawPoint(Vector2.Transform(wall1.KeyPoints[0], wall1.TransMatrix), 1f, Color.Black, 0f);
            BaseGame.BasicGraphics.DrawPoint(Vector2.Transform(wall2.KeyPoints[0], wall2.TransMatrix), 1f, Color.Black, 0f);
            BaseGame.BasicGraphics.DrawPoint(Vector2.Transform(wall3.KeyPoints[0], wall3.TransMatrix), 1f, Color.Black, 0f);


            GameManager.DrawManager.Draw();
            compass.Draw();
        }