// Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                // Clear the consoles for a new level
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();
                _inventoryConsole.Clear();

                // Draw everything to the map
                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole, DungeonMap);
                Player.DrawStats(_statConsole, _statWidth, _statHeight);
                Player.DrawInventory(_inventoryConsole);
                MessageLog.Draw(_messageConsole, _messageWidth, _messageHeight);

                // Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Beispiel #2
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            //don't redraw consoles if nothing changes
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();
                _inventoryConsole.Clear();
                DungeonMap.Draw(_mapConsole, _statConsole);
                //draw the player
                Player.Draw(_mapConsole, DungeonMap);
                //draw the status console
                Player.DrawStats(_statConsole);
                //draw the MessageLog
                MessageLog.Draw(_messageConsole);

                //Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                //tell RLNet to draw the console
                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Beispiel #3
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole, DungeonMap);
                MessageLog.Draw(_messageConsole);

                Player.DrawStats(_statConsole);

                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);

                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);

                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);

                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Beispiel #4
0
        //Event handler for RLNET's Render Event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            //Blit the sub consoles to the root console in the correct locations
            RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                           _rootConsole, 0, _inventoryHeight);
            RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                           _rootConsole, _mapWidth, 0);
            RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight,
                           _rootConsole, 0, _screenHeight - _inventoryHeight);
            RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                           _rootConsole, 0, 0);

            // Tell RLNET to draw the console
            _rootConsole.Draw();

            if (_renderRequired)
            {
                // Draws the Dungeon Map
                DungeonMap.Draw(_mapConsole);

                // Draws the player
                Player.Draw(_mapConsole, DungeonMap);

                _renderRequired = false;
            }
        }
 // Event handler for RLNET's Render event
 private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
 {
     /*
      * if (_renderRequired)
      * {
      *  // ... previous drawing code remains here
      *  // Blit the sub consoles to the root console in the correct locations
      *  RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
      *   _rootConsole, 0, _inventoryHeight);
      *  RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
      *    _rootConsole, _mapWidth, 0);
      *  RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
      *    _rootConsole, 0, _screenHeight - _messageHeight);
      *  RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight,
      *    _rootConsole, 0, 0);
      *  DungeonMap.Draw(_mapConsole);
      *  Player.Draw(_mapConsole, DungeonMap);
      *  _rootConsole.Draw();
      *  // Tell RLNET to draw the console that we set
      *  _renderRequired = false;
      * } This is commented out because it makes movement weird and sticky.  Optimization isn't bad anyway.
      */
     RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                    _rootConsole, 0, _inventoryHeight);
     RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                    _rootConsole, _mapWidth, 0);
     RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                    _rootConsole, 0, _screenHeight - _messageHeight);
     RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight,
                    _rootConsole, 0, 0);
     DungeonMap.Draw(_mapConsole);
     Player.Draw(_mapConsole, DungeonMap);
     _rootConsole.Draw();
 }
Beispiel #6
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole, DungeonMap);
                Player.DrawStats(_statConsole);
                MessageLog.Draw(_messageConsole);

                // Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                               _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                               _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                               _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight,
                               _rootConsole, 0, 0);

                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();

                // Don't bother redrawing all of the consoles if nothing has changed.
                _renderRequired = false;
            }
        }
Beispiel #7
0
        // Event handler for Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            //dont want to redraw all the time for no reason
            if (_renderRequired)
            {
                //clear all
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                // draw the map, this has to be first i think
                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole, DungeonMap);
                Player.DrawStats(_statConsole);
                MessageLog.Draw(_messageConsole);

                //combine all the smaller consoles to the main one
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                               _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                               _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                               _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight,
                               _rootConsole, 0, 0);
                _rootConsole.Draw();
            }
        }
    private IEnumerator OnRootConsoleRender()
    {
        while (Application.isPlaying)
        {
            if (_renderRequired)
            {
                for (int i = 0; i < MonsterStat.transform.childCount; i++)
                {
                    var go = MonsterStat.transform.GetChild(i).gameObject;
                    Destroy(go);
                }
//             _mapConsole.Clear();
//             _messageConsole.Clear();
//             _statConsole.Clear();
//             _inventoryConsole.Clear();
                DungeonMap.Draw();
                MessageLog.Draw();
                TargetingSystem.Draw();

                //_rootConsole.Draw();

                _renderRequired = false;
            }
            yield return(null);
        }
    }
Beispiel #9
0
        private static void RootConsole_Render(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                mazmorraConsole.Clear();
                estadisticaConsole.Clear();
                mensajeConsole.Clear();

                DungeonMap.Draw(mazmorraConsole, estadisticaConsole);
                Player.Draw(mazmorraConsole, DungeonMap);
                Player.DrawStats(estadisticaConsole);
                MessageLog.Draw(mensajeConsole);

                RLConsole.Blit(mazmorraConsole, 0, 0, mazmorraWidth, mazmorraHeight, rootConsole, 0, inventarioHeight);

                RLConsole.Blit(estadisticaConsole, 0, 0, estadisticasWidth, estadisticasHeight, rootConsole, mazmorraWidth, 0);

                RLConsole.Blit(mensajeConsole, 0, 0, mensajeWidth, mensajeHeight, rootConsole, 0, screenHeight - mensajeHeight);

                RLConsole.Blit(inventarioConsole, 0, 0, inventarioWidth, inventarioHeight, rootConsole, 0, 0);

                rootConsole.Draw();

                _renderRequired = false;
            }
        }
Beispiel #10
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole);
                Player.DrawStats(_statConsole);
                MessageLog.Draw(_messageConsole);


                if (!Globals.BuildingEntranceIsTriggered && !Globals.IsPlayerDead && !Globals.IsBossDead)
                {
                    // Blit the sub consoles to the root console in the correct locations
                    RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                                   _rootConsole, 0, 0);
                    RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                                   _rootConsole, _mapWidth, 0);
                    RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                                   _rootConsole, 0, _screenHeight - _messageHeight);
                }
                else if (Globals.BuildingEntranceIsTriggered)
                {
                    if (Globals.SheriffTriggered)
                    {
                        QuestMenu.CreateQuestMenu(_rootConsole);
                    }
                    else if (Globals.GenericMenuTriggered)
                    {
                        Menu.CreateMenu(_rootConsole);
                    }
                    else
                    {
                        Globals.BuildingEntranceIsTriggered = false;
                    }
                }
                else if (Globals.IsBossDead)
                {
                    WinMenu.CreateWinScreen(_rootConsole);
                }
                else if (Globals.IsPlayerDead)
                {
                    if (Player.Health <= 0)
                    {
                        DeathScreen.CreateDeathScreen(_rootConsole);
                    }
                    else
                    {
                        Globals.IsPlayerDead = false;
                    }
                }
                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();
                _renderRequired = false;
            }
        }
Beispiel #11
0
 private static void DrawConsoles()
 {
     DungeonMap.Draw(mapConsole, Stats);
     Player.Draw(mapConsole, DungeonMap);
     Player.DrawStats(Stats, 1);
     MessageLog.Draw(Messages);
     Player.Inventory.Draw(QuickBar);
 }
Beispiel #12
0
        //Event handler for RLNet render event
        private static void OnRootConsoleRender(object Sender, UpdateEventArgs e)
        {
            if (renderRequired)
            {
                mapConsole.Clear();
                statsConsole.Clear();
                inventoryConsole.Clear();
                armourConsole.Clear();

                statsConsole.SetBackColor(0, 0, statsWidth, statsHeight, Palette.AlternateLightest);
                statsConsole.Print(1, 1, Player.Name, Colors.TextHeading);
                statsConsole.Print(1, 2, "_____", Colors.TextHeading);

                statsConsole.Print(1, 21, "Enemies:", Colors.TextHeading);
                statsConsole.Print(1, 22, "________", Colors.TextHeading);

                inventoryConsole.SetBackColor(0, 0, inventoryWidth, inventoryHeight, Palette.PrimaryDarker);
                inventoryConsole.Print(1, 1, "Inventory", Colors.TextHeading);
                inventoryConsole.Print(1, 2, "_________", Colors.TextHeading);
                inventoryConsole.Print(1, 5, "Slot 1: " + Inventory.slot1, Colors.TextHeading);
                inventoryConsole.Print(1, 7, "Slot 2: " + Inventory.slot2, Colors.TextHeading);
                inventoryConsole.Print(1, 9, "Slot 3: " + Inventory.slot3, Colors.TextHeading);
                inventoryConsole.Print(1, 11, "Slot 4: " + Inventory.slot4, Colors.TextHeading);
                inventoryConsole.Print(1, 13, "Slot 5: " + Inventory.slot5, Colors.TextHeading);

                armourConsole.SetBackColor(0, 0, armourWidth, armourHeight, Palette.PrimaryDarker);
                armourConsole.Print(1, 1, "Armour", Colors.TextHeading);
                armourConsole.Print(1, 2, "______", Colors.TextHeading);
                Player.DrawArmour(armourConsole);


                //Draw the map subdivision to the screen
                DungeonMap.Draw(mapConsole, statsConsole);

                //Draw the player to the dungeon map
                Player.Draw(mapConsole, DungeonMap);
                Player.DrawStats(statsConsole);

                //Blits the subdivisions to the window
                //(https://en.wikipedia.org/wiki/Bit_blit)
                //Map
                RLConsole.Blit(mapConsole, 0, 0, mapWidth, mapHeight, rootConsole, 0, 0);
                //Messages
                RLConsole.Blit(messageConsole, 0, 0, messageWidth, messageHeight, rootConsole, inventoryWidth, (screenHeight - messageHeight));
                //Stats
                RLConsole.Blit(statsConsole, 0, 0, statsWidth, statsHeight, rootConsole, mapWidth, 0);
                //Inventory
                RLConsole.Blit(inventoryConsole, 0, 0, inventoryWidth, inventoryHeight, rootConsole, 0, mapHeight);
                //Armour
                RLConsole.Blit(armourConsole, 0, 0, armourWidth, armourHeight, rootConsole, screenWidth - armourWidth, screenHeight - armourHeight);

                //Tells RLNet to draw the console that we specified in rootConsole
                rootConsole.Draw();

                //After everything has rendered, don't render again until an update
                renderRequired = false;
            }
        }
Beispiel #13
0
    // Use this for initialization
    void Start()
    {
        Load();

        Init();

        MapGenerator mapGenerator = new MapGenerator(_width, _height, 20, 13, 7, _mapLevel);

        DungeonMap = mapGenerator.CreateMap();

        DungeonMap.Draw();
    }
Beispiel #14
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();
                _inventoryConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);

                Player.Draw(_mapConsole, DungeonMap);
                Player.DrawStats(_statConsole);
                Player.DrawInventory(_inventoryConsole);

                MessageLog.Draw(_messageConsole);
                _messageConsole.SetBackColor(0, 0, _messageWidth, _messageHeight, Swatch.DbDark);
                TargetingSystem.Draw(_mapConsole);

                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                if (IsInventoryScreenShowing)
                {
                    InventoryScreen.Draw(_rootConsole, Player.Inventory);
                }
                if (IsDialogScreenShowing)
                {
                    DialogScreen.Draw(_rootConsole);
                }
                if (IsShopSelectionScreenShowing)
                {
                    ShopSelectionScreen.Draw(_rootConsole);
                }
                if (IsBuyScreenShowing)
                {
                    BuyScreen.Draw(_rootConsole);
                }
                if (IsSellScreenShowing)
                {
                    SellScreen.Draw(_rootConsole, Player.Inventory);
                }

                _rootConsole.Draw();
                _renderRequired = false;
            }
        }
Beispiel #15
0
        /// <summary>
        /// Event handler for RLNET Render event
        /// </summary>
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            //Blit other console sections to the root console
            //Blit: Bit BLock Transfer
            RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _invHeight);
            RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
            RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
            RLConsole.Blit(_invConsole, 0, 0, _invWidth, _invHeight, _rootConsole, 0, 0);

            DungeonMap.Draw(_mapConsole);
            MessageLog.Draw(_messageConsole);
            InventoryLog.Draw(_invConsole);
            player.Draw(_mapConsole, DungeonMap);
            _rootConsole.Draw();
        }
Beispiel #16
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);
            RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
            RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);
            Player.Draw(_mapConsole, DungeonMap);

            _rootConsole.Draw();

            if (_renderRequired)
            {
                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole, DungeonMap);
                Player.DrawStats(_statConsole);
            }
        }
Beispiel #17
0
    private void LateUpdate()
    {
        if (_renderRequired)
        {
            for (int i = 0; i < MonsterStat.transform.childCount; i++)
            {
                var go = MonsterStat.transform.GetChild(i).gameObject;
                Destroy(go);
            }

            DungeonMap.Draw();
            MessageLog.Draw();
            TargetingSystem.Draw();

            _renderRequired = false;
        }
    }
Beispiel #18
0
        public void Draw()
        {
            renderer.EffectManager.GetBloomEffect().WriteRendererTarget(renderer.FogManager.CurrentColor());

            map.Draw();
            mapItemManager.Draw();      //アイテムの描画

            characterManager.Draw();
            pManager.Draw();

            renderer.EffectManager.GetBloomEffect().ReleaseRenderTarget();
            renderer.EffectManager.GetBloomEffect().Draw(renderer);

            background.Draw(renderer.FogManager.CurrentColor());

            DrawUI();
        }
Beispiel #19
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            RLConsole.Blit(inventoryConsole, 0, 0, inventoryWidth, inventoryHeigth, rootConsole, 0, 0);
            RLConsole.Blit(mapConsole, 0, 0, mapWidth, mapHeigth, rootConsole, 0, inventoryHeigth);
            RLConsole.Blit(logConsole, 0, 0, logWidth, logWidth, rootConsole, 0, inventoryHeigth + mapHeigth);
            RLConsole.Blit(statsConsole, 0, 0, statsWidth, statsHeigth, rootConsole, mapWidth, inventoryHeigth);

            dungeonMap.Draw(mapConsole);
            player.Draw(mapConsole, dungeonMap);

            if (spells.Count > 0)
            {
                spells.ForEach((f) => f.Draw());
            }

            rootConsole.Draw();
        }
Beispiel #20
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                DungeonMap.Draw(_mapConsole);
                Player.Draw(_mapConsole, DungeonMap);
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, _messageWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, 0);
                RLConsole.Blit(_statsConsole, 0, 0, _statsWidth, _statsHeight, _rootConsole, _mapWidth + _messageWidth, 0);
                RLConsole.Blit(_invConsole, 0, 0, _invWidth, _invHeight, _rootConsole, _mapWidth + _messageWidth, _statsHeight);
                // RLNET draw setted console
                _rootConsole.Draw();

                _renderRequired = false;
            }
            // throw new NotImplementedException();
        }
Beispiel #21
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                DungeonMap.Draw(_mapConsole);
                Player.Draw(_mapConsole, DungeonMap);
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                               _rootConsole, 0, _headerHeight);
                RLConsole.Blit(_headerConsole, 0, 0, _headerWidth, _headerHeight,
                               _rootConsole, 0, 0);
                Player.Draw(_mapConsole, DungeonMap);
                DungeonMap.Draw(_mapConsole);
                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Beispiel #22
0
    private IEnumerator Start()
    {
        yield return(new WaitUntil(() => RootConsole.s_Singleton.Initialized == true));

        active = true;
        Map.SetBackgroundColor(Palette.FloorBackground);
        Message.SetBackgroundColor(Swatch.DbDeepWater);
        Inventory.SetBackgroundColor(Swatch.DbWood);
        Stat.SetBackgroundColor(Swatch.DbOldStone);

        player     = new Player();
        commandSys = new CommandSystem();

        MapGenerator mapGen = new MapGenerator(Map.GetWidth(), Map.GetHeight());

        dunegonMap = mapGen.CreateMap();
        dunegonMap.Draw(Map);
    }
Beispiel #23
0
        protected override void Draw(GameTime gameTime)
        {
            if (_renderRequired)
            {
                GraphicsDevice.Clear(Color.Black);

                _mapConsole.CellData.Clear();
                _messageConsole.CellData.Clear();
                _statConsole.CellData.Clear();
                _inventoryConsole.CellData.Clear();

                MessageLog.Draw(_messageConsole);
                DungeonMap.Draw(_mapConsole, _statConsole, _inventoryConsole);
                MessageLog.Draw(_messageConsole);
                TargetingSystem.Draw(_mapConsole);

                base.Draw(gameTime);
            }
        }
Beispiel #24
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            /*Blit the sub consoles that I just created too the correct locations on the app
             * The parameters of a blit are
             * 1. the source console
             * 2. the x position 3. the y position
             * 4. The width 5. the height
             * 6. a destination console to blit to
             * 7. the blit destination of the top left corner of where we will blit to in the destination console
             */

            //if a render is required draw everything otherwise don't
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);

                //draw the player into the map
                player.Draw(_mapConsole, DungeonMap);

                player.DrawStats(_statConsole);

                messageLog.Draw(_messageConsole);

                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);

                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);

                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);

                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);


                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Beispiel #25
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            // Don't bother redrawing all of the consoles if nothing has changed.
            if (_renderRequired)
            {
                //Clear the consoles
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();
                _inventoryConsole.Clear();

                //Draw the dungeon map.
                DungeonMap.Draw(_mapConsole, _statConsole, _inventoryConsole);

                //draw the message log
                MessageLog.Draw(_messageConsole);

                TargetingSystem.Draw(_mapConsole);

                // Blit the sub consoles to the root console in the correct locations

                /* params
                 * - source console
                 * - x_pos
                 * - y_pos
                 * - width
                 * - height
                 * - destination console
                 * - x+y position of top left corner to blit in destination console */
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Beispiel #26
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.SetBackColor(0, 0, _mapWidth, _mapHeight, Colors.FloorBackground);
                _mapConsole.Print(1, 1, "Map", Colors.TextHeading);

                _messageConsole.SetBackColor(0, 0, _messageWidth, _messageHeight, Swatch.DbDeepWater);
                _messageConsole.Print(1, 1, "Messages", Colors.TextHeading);

                _statConsole.SetBackColor(0, 0, _statWidth, _statHeight, Swatch.DbOldStone);
                _statConsole.Print(1, 1, "Stats", Colors.TextHeading);

                _inventoryConsole.SetBackColor(0, 0, _inventoryWidth, _inventoryHeight, Swatch.DbWood);
                _inventoryConsole.Print(1, 1, "Inventory", Colors.TextHeading);

                // Draw the map
                DungeonMap.Draw(_mapConsole);

                // Draw player
                Player.Draw(_mapConsole, DungeonMap);

                // Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                               _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                               _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                               _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight,
                               _rootConsole, 0, 0);

                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Beispiel #27
0
        private static void OnGameRender(object sender, UpdateEventArgs e)
        {
            if (renderRequired)
            {
                mapConsole.Clear();
                statConsole.Clear();
                messageConsole.Clear();

                MessageLog.Draw(messageConsole);
                DungeonMap.Draw(mapConsole, statConsole);
                Player.Draw(mapConsole, DungeonMap);
                Player.DrawStats(statConsole);
                Player.DrawItems(inventoryConsole);

                RLConsole.Blit(mapConsole, 0, 0, mapWidth, mapHeight, rootConsole, 0, inventoryHeight);
                RLConsole.Blit(statConsole, 0, 0, statWidth, statHeight, rootConsole, mapWidth, 0);
                RLConsole.Blit(messageConsole, 0, 0, messageWidth, messageHeight, rootConsole, 0, screenHeight - messageHeight);
                RLConsole.Blit(inventoryConsole, 0, 0, inventoryWidth, inventoryHeight, rootConsole, 0, 0);

                rootConsole.Draw();
            }
            renderRequired = false;
        }
Beispiel #28
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                DungeonMap.Draw(_mapConsole);
                Player.Draw(_mapConsole, DungeonMap);
                NPC.Draw(_mapConsole, DungeonMap);
                MessageLog.Draw(_messageConsole);

                // Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _messageHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, 0);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, /*0*/ _mapWidth, /*0*/ _screenHeight - _statHeight);

                // This should draw to the Message Log...


                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Beispiel #29
0
        /// <summary>
        /// The rendering engine for the overworld.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnOverworldRender(object sender, UpdateEventArgs e)
        {
            // Don't bother redrawing all of the consoles if nothing has changed.
            if (_renderRequired)
            {
                mapConsole.Clear();
                statConsole.Clear();
                messageConsole.Clear();
                inventoryConsole.Clear();

                // Draw the map
                DungeonMap.Draw(mapConsole, statConsole);
                // Draw our player on the map subconsole
                Player.Draw(mapConsole, DungeonMap);
                // After we draw our player, draw our player's stats in the stats subconsole
                Player.DrawStats(statConsole);
                // Draw the player's inventory
                Player.DrawInventory(inventoryConsole);
                // Draw our message log
                MessageLog.Draw(messageConsole);
                // Refocus the camera
                CameraSystem.RefocusCamera();

                // Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(
                    statConsole,
                    0,
                    0,
                    Dimensions.StatWidth,
                    Dimensions.StatHeight,
                    console,
                    0,
                    0
                    );
                RLConsole.Blit(
                    messageConsole,
                    0,
                    0,
                    Dimensions.MessageWidth,
                    Dimensions.MessageHeight,
                    console,
                    0,
                    Dimensions.ScreenHeight - Dimensions.MessageHeight
                    );
                RLConsole.Blit(
                    inventoryConsole,
                    0,
                    0,
                    Dimensions.InventoryWidth,
                    Dimensions.InventoryHeight,
                    console,
                    Dimensions.MapWidth,
                    0
                    );
                RLConsole.Blit(
                    mapConsole,
                    CameraSystem.ViewportStartX,
                    CameraSystem.ViewportStartY,
                    Dimensions.MapWidth,
                    Dimensions.MapHeight,
                    console,
                    0,
                    Dimensions.StatHeight
                    );
                // Tell RLNET to draw the console that we set
                console.Draw();
            }
        }
Beispiel #30
0
        protected override void Draw(GameTime gameTime)
        {
            if (_renderRequired)
            {
                GraphicsDevice.Clear(Color.Black);

                _mapConsole.CellData.Clear();
                _messageConsole.CellData.Clear();
                _statConsole.CellData.Clear();
                _inventoryConsole.CellData.Clear();

                MessageLog.Draw(_messageConsole);

                DungeonMap.Draw(_mapConsole, _statConsole, _inventoryConsole);
                MapMessageLog.Draw(_mapConsole);
                MessageLog.Draw(_messageConsole);
                TargetingSystem.Draw(_mapConsole);


                _inventoryConsole.CellData.Print(0, 10, "________________________________________________________________________________", Color.Green);

                _messageConsole.CellData.Print(0, 0, "--------------------------------------------------------------------------------", Color.Green);

                _statConsole.CellData.Print(0, 0, "|", Color.Green);
                _statConsole.CellData.Print(0, 1, "|", Color.Green);
                _statConsole.CellData.Print(0, 2, "|", Color.Green);
                _statConsole.CellData.Print(0, 3, "|", Color.Green);
                _statConsole.CellData.Print(0, 4, "|", Color.Green);
                _statConsole.CellData.Print(0, 5, "|", Color.Green);
                _statConsole.CellData.Print(0, 6, "|", Color.Green);
                _statConsole.CellData.Print(0, 7, "|", Color.Green);
                _statConsole.CellData.Print(0, 8, "|", Color.Green);
                _statConsole.CellData.Print(0, 9, "|", Color.Green);
                _statConsole.CellData.Print(0, 10, "|", Color.Green);
                _statConsole.CellData.Print(0, 11, "|", Color.Green);
                _statConsole.CellData.Print(0, 12, "|", Color.Green);
                _statConsole.CellData.Print(0, 13, "|", Color.Green);
                _statConsole.CellData.Print(0, 14, "|", Color.Green);
                _statConsole.CellData.Print(0, 15, "|", Color.Green);
                _statConsole.CellData.Print(0, 16, "|", Color.Green);
                _statConsole.CellData.Print(0, 17, "|", Color.Green);
                _statConsole.CellData.Print(0, 18, "|", Color.Green);
                _statConsole.CellData.Print(0, 19, "|", Color.Green);
                _statConsole.CellData.Print(0, 20, "|", Color.Green);
                _statConsole.CellData.Print(0, 21, "|", Color.Green);
                _statConsole.CellData.Print(0, 22, "|", Color.Green);
                _statConsole.CellData.Print(0, 23, "|", Color.Green);
                _statConsole.CellData.Print(0, 24, "|", Color.Green);
                _statConsole.CellData.Print(0, 25, "|", Color.Green);
                _statConsole.CellData.Print(0, 26, "|", Color.Green);
                _statConsole.CellData.Print(0, 27, "|", Color.Green);
                _statConsole.CellData.Print(0, 28, "|", Color.Green);
                _statConsole.CellData.Print(0, 29, "|", Color.Green);
                _statConsole.CellData.Print(0, 30, "|", Color.Green);
                _statConsole.CellData.Print(0, 31, "|", Color.Green);
                _statConsole.CellData.Print(0, 32, "|", Color.Green);
                _statConsole.CellData.Print(0, 33, "|", Color.Green);
                _statConsole.CellData.Print(0, 34, "|", Color.Green);
                _statConsole.CellData.Print(0, 35, "|", Color.Green);
                _statConsole.CellData.Print(0, 36, "|", Color.Green);
                _statConsole.CellData.Print(0, 37, "|", Color.Green);
                _statConsole.CellData.Print(0, 38, "|", Color.Green);
                _statConsole.CellData.Print(0, 39, "|", Color.Green);
                _statConsole.CellData.Print(0, 40, "|", Color.Green);
                _statConsole.CellData.Print(0, 41, "|", Color.Green);
                _statConsole.CellData.Print(0, 42, "|", Color.Green);
                _statConsole.CellData.Print(0, 43, "|", Color.Green);
                _statConsole.CellData.Print(0, 44, "|", Color.Green);
                _statConsole.CellData.Print(0, 45, "|", Color.Green);
                _statConsole.CellData.Print(0, 46, "|", Color.Green);
                _statConsole.CellData.Print(0, 47, "|", Color.Green);
                _statConsole.CellData.Print(0, 48, "|", Color.Green);
                _statConsole.CellData.Print(0, 49, "|", Color.Green);
                _statConsole.CellData.Print(0, 50, "|", Color.Green);
                _statConsole.CellData.Print(0, 51, "|", Color.Green);
                _statConsole.CellData.Print(0, 52, "|", Color.Green);
                _statConsole.CellData.Print(0, 53, "|", Color.Green);
                _statConsole.CellData.Print(0, 54, "|", Color.Green);
                _statConsole.CellData.Print(0, 55, "|", Color.Green);
                _statConsole.CellData.Print(0, 56, "|", Color.Green);
                _statConsole.CellData.Print(0, 57, "|", Color.Green);
                _statConsole.CellData.Print(0, 58, "|", Color.Green);
                _statConsole.CellData.Print(0, 59, "|", Color.Green);

                _statConsole.CellData.Print(0, 1, "|", Color.Green);

                if (RogueGame._mapLevel == 1)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Desert Pass", Color.Tan);
                }
                else if (RogueGame._mapLevel == 2)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Cavern Base Level 1", Color.Red);
                }
                else if (RogueGame._mapLevel == 3)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Cavern Base Level 2", Color.Red);
                }
                else if (RogueGame._mapLevel == 4)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Cavern Base Level 3", Color.Red);
                }
                else if (RogueGame._mapLevel == 5)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Summoning Chambers", Color.Red);
                }



                base.Draw(gameTime);
            }
        }