public void paint(Graphics g) {
        fillBackground(g);
        drawWalls(g);
        drawLives(g);
        drawPellets(g);
        drawScore(g);
        drawGhosts(g);
        drawPlayer(g);
        drawBorder(g);

        if (board.gameFrame != 0) {
            handleGameStartFrames();
            return;
        }

        if (game.pacmanDied()) {
            game.killPacman();
        }

        /* Eat pellets */
        else if (board.map.hasPellet(board.player.pelletX, board.player.pelletY)) {
            board.lastPelletEatenX = board.player.pelletX;
            board.lastPelletEatenY = board.player.pelletY;

            /* Play eating sound */
            board.sounds.nomNom();

            /* Increment pellets eaten value to track for end game */
            board.player.eatPellet();

            /* Increment the score */
            board.currScore += 50;

            /* If this was the last pellet */
            if (board.player.getPelletsEaten() == 173) {
                /* Demo mode can't get a high score */
                if (!board.demo) {
                    if (board.currScore > board.highScore) {
                        board.updateScore(board.currScore);
                    }
                    sounds.nomNomStop();
                    board.winScreenB = true;
                }
                else {
                    board.titleScreenB = true;
                }
                return;
            }
        }

        /* If we moved to a location without pellets, stop the sounds */
        else if ((board.player.pelletX != board.lastPelletEatenX || board.player.pelletY != board.lastPelletEatenY)
                || board.player.stopped) {
            /* Stop any pacman eating sounds */
            sounds.nomNomStop();
        }
    }