Don't like ads? PRO users don't see any ads ;-)
Guest

All the areas I made changes to

By: KevinYoung on May 5th, 2012  |  syntax: None  |  size: 1.19 KB  |  hits: 46  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         public boolean jump(int maxHeight) {
  2.                 p.offsetYPos(-3);
  3.                 if(Player.getyPos() <= maxHeight){
  4.                         heightReached = true;
  5.                         return heightReached;
  6.                        
  7.                 }
  8.                 return false;
  9.                
  10.         }
  11.  
  12.         public boolean fall(){
  13.                 MainMenu.goUp = false;
  14.                
  15.                         if (Player.getyPos() >= maxHeight){
  16.                                 p.offsetYPos(3);
  17.                                
  18.                                
  19.                         }
  20.                 return true;
  21.         }
  22.     private boolean initDelay(double timer, double speed){
  23.         if(counter == timer){
  24.                 counter = 0;
  25.                 return true;
  26.         }
  27.         else{
  28.                 counter += speed;
  29.                 return false;
  30.         }
  31. }
  32.         public void update(){
  33.                 if(MainMenu.goUp){
  34.             if(initDelay(90, 1))
  35.                 jump(MainMenu.maxHeight);
  36.                         shouldContinue = jump(MainMenu.maxHeight);
  37.                 }
  38.                 if (shouldContinue){
  39.                         MainMenu.goUp = false;
  40.                         shouldContinue = fall();
  41.                 }
  42.                 if (shouldContinue){
  43.                         MainMenu.goDown = true;
  44.                         shouldContinue = true;
  45.                 }
  46.                         else if(counter > timer)
  47.                                 counter = timer;
  48.                         else
  49.                                 counter++;
  50.                
  51.                 if(MainMenu.goDown){
  52.                         if(initDelay(90, 1)){
  53.                                 fall();
  54.                                 counter = 0;
  55.                                 MainMenu.goDown = false;
  56.                         }
  57.                         else if(counter > timer)
  58.                                 counter = timer;
  59.                         else
  60.                                 counter++;
  61.                 }