public void paint(Graphics g) {
        //the objects created above are made clickable with the mouseClicked method
        super.paint(g);
        final Graphics2D g2d = (Graphics2D) g;
        g2d.setColor(Color.white);
        g2d.setFont(new Font("Courier", Font.BOLD, 60));

        g2d.drawImage(MenuBG, 0, 0, this);
        g2d.drawImage(BackImage, 10, 10, this);


        g2d.setColor(Color.red);
        //checks if the game is single player and prints different things if it is
        if (Menu.isSingle()) {
            g2d.drawString("You died! Try again!", 200, 380);
            g2d.draw(PlayAgain);
            g2d.setFont(new Font("Courier", Font.BOLD, 60));
            g2d.drawString("Play Again?", PlayAgain.x + 30, PlayAgain.y + 70);
            addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent me) {
                    System.out.println(me);
                    //returns to the main menu
                    if (me.getX() > Back.x && me.getX() < Back.x + Back.width && me.getY() > Back.y && me.getY() < Back.y + Back.height) {
                        Fighters.newMenu();
                        tries++;
                        Fighters.cd.show(Fighters.contentPane, "menu");

                    }
                    //re runs single player if the user clicks the button
                    if (me.getX() > PlayAgain.x && me.getX() < PlayAgain.x + PlayAgain.width && me.getY() > PlayAgain.y && me.getY() < PlayAgain.y + PlayAgain.height) {
                        Fighters.newGame();
                        tries++;
                        Fighters.cd.show(Fighters.contentPane, "game");

                    }
                }
            });


        }
    }