private void DrawHud()
        {
            ConsoleEx.WriteCoord(0, 21);
            ConsoleEx.WriteLine(game.GetWinMessage());

            Draw.Line(ConsoleEx.Width / 2, 0, ConsoleEx.Width / 2, ConsoleEx.Height, '│');

            ConsoleEx.WriteCoord(2, 24);
            if (game.CheckWin() == WinType.None)
            {
                ConsoleEx.WriteLine("R: Use ROCK");
                ConsoleEx.WriteLine("S: Use SCISSORS");
                ConsoleEx.WriteLine("P: Use PAPER");
            }
            else
            {
                ConsoleEx.WriteLine("ANY KEY: Reset");
            }
        }
Example #2
0
        private void UserInput()
        {
            if (Input.KeyPressed(Key.UP))
            {
                yCus--;
            }
            if (Input.KeyPressed(Key.DOWN))
            {
                yCus++;
            }
            if (Input.KeyPressed(Key.LEFT))
            {
                xCus--;
            }
            if (Input.KeyPressed(Key.RIGHT))
            {
                xCus++;
            }

            if (Input.KeyPressed(Key.RETURN))
            {
                if (game.CheckWin() == WinType.None)
                {
                    game.SetBrick(xCus, yCus);
                }
                else
                {
                    game.Reset();
                }
            }

            if (xCus < 0)
            {
                xCus = 0;
            }
            if (xCus >= game.Map.Size - 1)
            {
                xCus = game.Map.Size - 1;
            }

            if (yCus < 0)
            {
                yCus = 0;
            }
            if (yCus >= game.Map.Size - 1)
            {
                yCus = game.Map.Size - 1;
            }
        }