예제 #1
0
 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
   }
 }
예제 #2
0
 // ------------------------------------------------------------------------------------------------------------------------------------
 // Buttons clicked
 public void pauseClicked() {
   // Pauses game
   // Checks if pause button is clicked
   if (pauseB.clicked(mx, my, true) && pause == false) {
     clickedSound();
     pause = true;
   }
 }
예제 #3
0
  public void musicClicked() {
    // Mutes/unmutes music
    // checks to see if mute/unmute button is clicked
    if (muteB.clicked(mx, my, true) && pause == true && musicOn == true) {
      clickedSound();
      musicOn = false;
      clicked.stop();
      bckGrndMusic.stop();
      coinSound.stop();
      starSound.stop();
      bounce.stop();

    } else if (unmuteB.clicked(mx, my, true) && pause == true && musicOn == false) {
      clickedSound();
      musicOn = true;
      bckGrndMusic.loop();
    }
  }
예제 #4
0
 public void resumeClicked() {
   // Resumes game
   // Checks if resume button is clicked
   if (resumeB.clicked(mx, my, true) && pause == true && die == false) {
     clickedSound();
     pause = false;
     lvlClear = false;
   }
 }
예제 #5
0
 public void menuClicked() {
   // Returns to back menu
   // Checks to see if back button has been clicked
   if (menuB.clicked(mx, my, true) && pause == true) {
     clickedSound();
     screen = "menu";
     pause = false;
     die = false;
   }
 }
예제 #6
0
 // -------------------------------------------------------------------------------------------------------------------------------------------------------
 // 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);
   }
 }
예제 #7
0
 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
   }
 }
예제 #8
0
  // ------------------------------------------------------------------------------------------------------------------------------------
  // 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);
      }
    }
  }