public void lvlClearMenu(Graphics g) { // Menu that shows up after a level has been cleared if (pause == true && lvlClear == true) { g.drawImage( new ImageIcon("InGameMenu/pauseBckgrnd.png").getImage(), 0, 0, this); // <Graphics stuff g.drawImage(new ImageIcon("InGameMenu/stageClearPic.png").getImage(), 100, 0, this); displayScore2(g, 115, 350, 185, 380, 110, 440, 110, 490); // Displays stats g.drawImage( resumeB.getPic(mx, my), resumeB.getX(), resumeB.getY(), this); // Draws resume button g.drawImage( menuB.getPic(mx, my), menuB.getX(), menuB.getY(), this); // Draws the back to menu button } }
// ------------------------------------------------------------------------------------------------------------------------------------ // In game menus public void pauseMenu(Graphics g) { // Pause menu if (pause == true && lvlClear == false) { g.setFont(scoreFont); g.setColor(Color.BLACK); g.drawImage(new ImageIcon("InGameMenu/pauseBckgrnd.png").getImage(), 0, 0, this); g.drawString("P A U S E D", 155, 200); displayScore2(g, 115, 350, 185, 380, 110, 440, 110, 490); // Displays stats g.drawImage( resumeB.getPic(mx, my), resumeB.getX(), resumeB.getY(), this); // Draws the resume button g.drawImage( menuB.getPic(mx, my), menuB.getX(), menuB.getY(), this); // Draws the back to menu button if (musicOn == true) { // Draws the mute or unmute button (based on if music is on or not) g.drawImage(muteB.getPic(mx, my), muteB.getX(), muteB.getY(), this); } if (musicOn == false) { g.drawImage(unmuteB.getPic(mx, my), unmuteB.getX(), unmuteB.getY(), this); } } }
public void gameOverMenu( Graphics g) { // CHANGE THIS TO INCLUDE HIGHSCORES AND STUFF AFTER TEXTFILES ARE MADE // Menu that shows up when user gets Game Over if (pause == true && die == true) { g.drawImage( new ImageIcon("InGameMenu/pauseBckgrnd.png").getImage(), 0, 0, this); // Graphics stuff g.setFont(scoreFont); g.setColor(Color.BLACK); g.drawImage(new ImageIcon("InGameMenu/GameOver.png").getImage(), 10, 200, this); displayScore2(g, 115, 350, 185, 385, 110, 440, 110, 490); // Shows stats g.drawImage(menuB.getPic(mx, my), menuB.getX(), menuB.getY(), this); // Draws menu button } }
// ------------------------------------------------------------------------------------------------------------------------------------------------------- // Graphics public void paintComponent(Graphics g) { if (pause == false) { // if the pause screen is paused then don't move anything and go to the pause // screen DrawEveryThing(g); displayScore(g, 10, 10, 80, 42, 300, 60, 300, 32); // shows the score drawPowerUpIcon(g); // draws the powerup icon g.drawImage( pauseB.getPic(mx, my), pauseB.getX(), pauseB.getY(), this); // Pause button in bottom right-head corner changeHeight(); // changes the height if (die) { showDieMenu(); } } else { pauseMenu( g); // draws the pause menu , lvlClearmenu or gameOverMenu depending what screen the user // wants to go to lvlClearMenu(g); gameOverMenu(g); } }