private void moveElevator() {

      if ((elevator.wasTargetOfLastCollision()&&elevatorCountdown--<=0)||
          (elevatorPosition!=-90f&&elevatorPosition!=-180f)) {

         float tempElevator=elevatorPosition+elevatorOffset;
         float tempOffset=elevatorOffset;

         if (tempElevator<-180f) {
            tempOffset=-180f-elevatorPosition;
            elevatorCountdown=50;
            elevatorOffset*=-1f;
         } else {
            if (tempElevator>-90f) {
               tempOffset=-90f-elevatorPosition;
               elevatorCountdown=50;
               elevatorOffset*=-1f;
            }
         }
         elevatorPosition+=tempOffset;
         elevator.translate(0, tempOffset, 0);
      }
   }