Beispiel #1
0
 public void Render(IGameRenderService gameService)
 {
     foreach (var block in _blocks)
     {
         block.Value.Render(gameService);
     }
 }
 public void Render(IGameRenderService gameService)
 {
     foreach (var chunk in _selectedChunks)
     {
         chunk.Render(gameService);
     }
 }
Beispiel #3
0
        public void Render(IGameRenderService gameService)
        {
            var currentPos = _drawPosition + _playerPosition;

            gameService.DrawImage(currentPos, _imageName);
            Inventory.GetActiveItem()?.Draw(gameService, _topLeft);
        }
Beispiel #4
0
        public void Render(IGameRenderService gameService)
        {
            uint lineHeight   = 18;
            var  basePosition = _drawPos.Add(0, -1);

            gameService.DrawToScreen(basePosition, lineHeight, "The current keyboard readout:");
            gameService.DrawToScreen(basePosition.Add(0, -0.5), lineHeight, $"Escape Key: {_escape}");
            gameService.DrawToScreen(basePosition.Add(0, -1), lineHeight, $"Left Key: {_left}");
            gameService.DrawToScreen(basePosition.Add(0, -1.5), lineHeight, $"Right Key: {_right}");
            gameService.DrawToScreen(basePosition.Add(0, -2), lineHeight, $"Up Key: {_up}");
            gameService.DrawToScreen(basePosition.Add(0, -4), lineHeight, $"Game Position: {_lastPosition}");
        }
        public void Render(IGameRenderService gameService)
        {
            switch (_visibleScreen)
            {
            case Screen.INVENTORY:
                _inventroyScreen.Render(gameService);
                break;

            case Screen.NONE:
                break;
            }
        }
Beispiel #6
0
        protected void DrawHealth(IGameRenderService gameService)
        {
            if (_health == MaxHealth)
            {
                return;
            }
            var center      = _positionOnScreen + new Position(0.5, 0.5);
            var percent     = 1.0 - ((double)_health / MaxHealth);
            var percentPos  = percent / 2;
            var topLeft     = center - new Position(percentPos, percentPos);
            var bottomRight = center + new Position(percentPos, percentPos);

            gameService.DrawRect(topLeft, bottomRight, Enums.Colors.White, true);
        }
Beispiel #7
0
        public void Render(IGameRenderService gameService)
        {
            gameService.DrawRect(_topLeft, _topLeft.Add(_inventory.MaxInventoryItems, 1), Enums.Colors.White, true);
            gameService.DrawToScreen(_topLeft.Add(0, -0.2), 20, "Inventory:");

            if (_inventory == null)
            {
                return;
            }

            for (var i = -1; i < _inventory.MaxInventoryItems; i++)
            {
                _inventory.GetItem(i)?.Draw(gameService, _topLeft.Add(i + 1, 0));
            }
        }
 public void Draw(IGameRenderService gameService, Position pos)
 {
     gameService.DrawImage(pos, IconPath);
     gameService.DrawToScreen(pos.Add(0.9, 0.9), 12, Enums.Colors.White, _stackSize.ToString(), true);
 }
Beispiel #9
0
 public void Render(IGameRenderService gameService)
 {
     _player.Render(gameService);
 }
Beispiel #10
0
 public override void Render(IGameRenderService gameService)
 {
     DrawImage(gameService, "Blocks/TreeBase");
 }
 public void Render(IGameRenderService gameService)
 {
     gameService.DrawToScreen(_position, 18, $"{FPS}", true);
 }
Beispiel #12
0
 public abstract void Render(IGameRenderService gameService);
Beispiel #13
0
 protected void DrawImage(IGameRenderService gameService, string imageName)
 {
     gameService.DrawImage(_positionOnScreen, imageName);
     DrawHealth(gameService);
 }
Beispiel #14
0
 public void Render(IGameRenderService gameService)
 {
     _counter.Render(gameService);
     _debugKeys.Render(gameService);
 }