public void initGame() {
        JFrame frame = this;
        //  12x12 pixel square on the screen. Pac-Man’s screen resolution is 336 x 432 (plus five rows for status totaling 60),
        //      so this gives us a total board size of 28 x 30 tiles,
        frame.setMinimumSize(new Dimension(PacmanGame.WIDTH , PacmanGame.HEIGHT)); //Fixed resolution - Don't change, timing and graphics rely on this resolution.
        frame.setTitle("Pacman");
        g = frame.getContentPane().getGraphics();
        frame.getContentPane().add(gamePanel);
        currentRoom = new Room(level,score,lives,highscore); //Start at level one
        //if cheat is set to true then the current room object's 
        //boolean is also set to true
        if (cheat == true) {
          currentRoom.isCheatCodeEnabled = true;
        }
        gamePanel.room = currentRoom;
        frame.addKeyListener(this);
        frame.addKeyListener(currentRoom);
        frame.pack();
        frame.setVisible(true);
        while (running) {
            gameLoop();
            if(currentRoom.score > highscore){
                highscore = currentRoom.score;
                currentRoom.highscore = highscore;
            }
            if (currentRoom.numLives <= 0 && !currentRoom.pacman.dead){
                running = false;
                dead = true;
                highscore = currentRoom.highscore;
            }
            else if(currentRoom.dots.isEmpty()){
                level++;
                score = currentRoom.score;
                lives = currentRoom.numLives;
                running = false;
            }
        }
        //Final frame update to ensure game over is shown
        if (dead) {
            this.update(dt);
            this.repaint();
            //makes sure lives resets to three upon a game over
            lives = 3;
            long test = System.currentTimeMillis();
            while (System.currentTimeMillis() < test + 1500) {
                //do nothing
            }
            frame.getContentPane().remove(gamePanel);
            menuInit();

        }
        else{
            frame.getContentPane().remove(gamePanel);
            levelSplash();
        }
    }