Exemple #1
0
        public void ShowMainMenu()

        {
            Render();
            do
            {
                ConsoleKeyInfo pressedChar = Console.ReadKey(true);

                switch (pressedChar.Key)
                {
                case ConsoleKey.P:
                {
                    PlayerSelectionMenu playerSelectionMenu = new PlayerSelectionMenu();
                    playerSelectionMenu.ShowPlayerSelectionMenu();
                    break;
                }

                case ConsoleKey.C:
                {
                    CreditWindow creditWindow = new CreditWindow();
                    creditWindow.Render();
                    Console.ReadKey();
                    ShowMainMenu();
                    break;
                }

                case ConsoleKey.Q:
                {
                    Environment.Exit(0);
                    break;
                }
                }
            } while (checkingKeys);
        }
Exemple #2
0
        private void ShowCredit()
        {
            if (creditWindow == null)
            {
                creditWindow = new CreditWindow();
                gameWindows.Add(creditWindow);
            }

            creditWindow.Render();
        }
        public void ShowCreditMenu()
        {
            creditWindow = new CreditWindow(10, 10, 14, 14);
            creditWindow.Render();
            ConsoleKeyInfo pressedChar;

            do
            {
                pressedChar = Console.ReadKey(true);
            } while (pressedChar.Key != ConsoleKey.Enter);
            menuWindow.Render();
        }
    public void ShowCredits()
    {
        creditWindow.Render();

        int keyCode;

        do
        {
            keyCode = Console.ReadKey().Key.GetHashCode();
        } while (keyCode != 27 && keyCode != 13);

        ShowMenu();
    }
 private void CreditWindowControl()
 {
     creditWindow.Render();
     do
     {
         ConsoleKeyInfo pressedChar = Console.ReadKey(true);
         switch (pressedChar.Key)
         {
         case ConsoleKey.Escape:
         case ConsoleKey.Enter:
             //gameWindow = new GameWindow();
             gameWindow.Render();
             return;
         }
     } while (true);
 }
        static void Main()
        {
            Console.CursorVisible = false;

            GameWindow gameWindow = new GameWindow();

            gameWindow.Render();

            CreditWindow creditWindow = new CreditWindow();

            creditWindow.Render();

            Console.ReadKey();

            //GameController myGame = new GameController();
            //myGame.StartGame();
        }
Exemple #7
0
        public void ShowMenu()
        {
            ConsoleKeyInfo keyPressed;
            bool           NeedToRender = true;

            do
            {
                gameWindow.ActivateCurrentButtonSelection();
                gameWindow.Render();
                keyPressed = Console.ReadKey(true);
                switch (keyPressed.Key)
                {
                case ConsoleKey.LeftArrow:
                    gameWindow.SellectPrevMenuItem();
                    break;

                case ConsoleKey.RightArrow:
                    gameWindow.SellectNextMenuItem();
                    break;

                case ConsoleKey.Enter:
                    switch (gameWindow.GetCurrentSelection())
                    {
                    case 0:
                        StartGame();
                        break;

                    case 1:
                        crediteWindow.Render();
                        break;

                    case 2:
                        NeedToRender = false;
                        break;
                    }
                    break;

                case ConsoleKey.Escape:
                    NeedToRender = false;
                    break;
                }
            } while (NeedToRender);
        }
        public void ShowMenu()
        {
            ConsoleKeyInfo keyInfo;
            bool           needToShowApp = true;

            do
            {
                _creditWindow.Render();
                keyInfo = Console.ReadKey();

                switch (keyInfo.Key)
                {
                case ConsoleKey.Enter:
                    MenuWindowController menuWindowController = new MenuWindowController();
                    menuWindowController.ShowMenu();
                    break;

                default:
                    Console.WriteLine("Key not handled!");
                    break;
                }
            } while (needToShowApp);
        }
        public void ShowCreditWindow()
        {
            CreditWindow creditWindow = new CreditWindow();

            creditWindow.Render();
        }
 public void ShowCreditWindow()
 {
     creditWindow = new CreditWindow(28, 10, 60, 18, '%');
     creditWindow.Render();
     ActivateCreditMenu();
 }
        public void ChooseMeniuButton()
        {
            bool creditW = false;

            ConsoleKeyInfo pressedChar = Console.ReadKey();

            while (pressedChar.Key != ConsoleKey.End)
            {
                switch (pressedChar.Key)
                {
                case ConsoleKey.Escape:

                    // Console.SetCursorPosition(0, 0);
                    Console.Clear();
                    ShowMenu();
                    break;

                case ConsoleKey.Enter:

                    if (creditW)
                    {
                        creditW = false;
                        ShowMenu();
                    }

                    else
                    {
                        if (gameWindow.CheckActiveButton() == 0)
                        {
                            Console.Clear();
                            myGame.StartGame();
                        }
                        else if (gameWindow.CheckActiveButton() == 1)
                        {
                            Console.Clear();
                            creditWindow.Render();
                            creditW = true;
                        }
                        else if (gameWindow.CheckActiveButton() == 2)
                        {
                            Console.Clear();
                        }
                    }
                    break;


                case ConsoleKey.RightArrow:

                    gameWindow.Direction = true;
                    gameWindow.MoveMeniuItem();

                    break;

                case ConsoleKey.LeftArrow:
                    gameWindow.Direction = false;
                    gameWindow.MoveMeniuItem();

                    break;
                }
                pressedChar = Console.ReadKey();
            }
        }
 public void ShowCreditWindow()
 {
     _creditWindow.Render();
 }