Exemplo n.º 1
0
        /// <summary>
        /// Menu constructor
        /// </summary>
        public Menu()
        {
            sp = new Sprite();    // Iniciates the "Sprite" "sp"
            kR = new KeyReader(); // Iniciates the "KeyReader" "kR"

            selectionY   = 17;    // Set the value of "selectionY" to 17
            playSelected = true;  // Set the value of "playSelected" to true

            LoadMenu();           // Calls the LoadMenu method
            RenderMenu();         // Calls the RenderMenu method
        }
Exemplo n.º 2
0
        /// <summary>
        /// Public Game constructor
        /// </summary>
        /// <param name="kr">Key Reader</param>
        public Game(KeyReader kr)
        {
            // Inicializes the variable level
            level = new Level();
            // Inicializes pacMan passing in the given attributes
            pacMan = new PacMan(51, 25, Direction.Right);
            // Inicializes ghost1 using in the given attributes
            ghost1 = new Ghost(1, 39, 21, ConsoleColor.Red, Direction.Right, pacMan);
            // Inicializes ghost2 using in the given attributes
            ghost2 = new Ghost(2, 46, 21, ConsoleColor.Green, Direction.Left, pacMan);
            // Inicializes ghost3 using in the given attributes
            ghost3 = new Ghost(3, 56, 21, ConsoleColor.Cyan, Direction.Right, pacMan);
            // Inicializes ghost4 using in the given attributes
            ghost4 = new Ghost(4, 63, 21, ConsoleColor.Magenta, Direction.Left, pacMan);
            // Sets kR to be equal to the recieved as an argument
            kR = kr;

            // Calls the GameLoop method
            GameLoop();
        }