Exemple #1
0
  public void toggleMusic() {

    if (getPause()) {

      inGame.pause();
      intro.playLoop();
    } else {

      intro.pause();
      inGame.playLoop();
    }
  }
Exemple #2
0
 /*
 public void makeSmokeFireball()
 {
     if (delay > 100)
     {
         int randomNumber = Greenfoot.getRandomNumber(1000);
         if (randomNumber < 50)
         {
             SmokeFireball smokeFireball = new SmokeFireball();
             addObject(smokeFireball, 500, 475);
             delay = 0;
         }
         if (randomNumber >= 50 && randomNumber < 100)
         {
             SmokeFireball smokeFireball = new SmokeFireball();
             addObject(smokeFireball, 95, 661);
             delay = 0;
         }
         if (randomNumber >= 100 && randomNumber < 150)
         {
             SmokeFireball smokeFireball = new SmokeFireball();
             addObject(smokeFireball, 160, 493);
             delay = 0;
         }
         if (randomNumber >= 150 && randomNumber < 200)
         {
             SmokeFireball smokeFireball = new SmokeFireball();
             addObject(smokeFireball, 637, 423);
             delay = 0;
         }
         if (randomNumber >= 200 && randomNumber < 250)
         {
             SmokeFireball smokeFireball = new SmokeFireball();
             addObject(smokeFireball, 422, 285);
             delay = 0;
         }
     }
 }
 */
 public void checkDoor() // sean
     {
   if (ninja.checkInfernoDoor() == true) {
     burningSteppes.stop();
     Greenfoot.setWorld(new Inferno2(ninja));
   }
 }
Exemple #3
0
  public void act() // sean
      {

    if (!played) {
      burningSteppes.playLoop();
      played = !played;
    }
    // makeSmokeFireball();
    counterDelay++;
    if (Greenfoot.isKeyDown("h") && delay > 10) {
      clickSound.play();
      Menu menu = new Menu(getThisWorld());
      Greenfoot.setWorld(menu);
      delay = 0;
    }
    if (getObjects(Ninja.class).size() != 0 && counterDelay >= 10) {
      healthCounter.setValue(ninja.getNINJAHP());
      shurikenCounter.setValue(ninja.getSHURIKENNUMBER());
      powerCounter.setValue(ninja.getPOWERBAR());
      checkDoor();
      counterDelay -= 10;
      /**/
      // TEMPORAY FUNCTIONS FOR HAYDEN TO CHANGE LEVELS TO MAKE THEM /**/

      /**/
      // TEMPORAY FUNCTIONS FOR HAYDEN TO CHANGE LEVELS TO MAKE THEM /**/
    }
    delay++;
    fireballDelay++;
  }
Exemple #4
0
 public Inferno1(Ninja ninja) // sean
     {
   super();
   burningSteppes.setVolume(40);
   this.ninja = ninja;
   ninja.addPowerUp(4);
   prepare();
 }
Exemple #5
0
 public void gameover() { // Hayden
   ninja.setHP(ninja.getArmor());
   burningSteppes.stop();
   Greenfoot.setWorld(new Inferno1(ninja));
 }