Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. checkLevel:function(animationDeferredsArray){
  2.        
  3.         var ballsCount = this.nestBox.getBallsCount();
  4.         var birdCages = this.gameItemCollection.getCages();
  5.         var birdCagesTotal = birdCages.length;
  6.        
  7.         if(!birdCagesTotal){
  8.            
  9.             var restItems = this.gameItemCollection.getAll();
  10.             var nestDeferred = this.nestBox.flipRestBirds();
  11.            
  12.             var restItemsDeferreds = [];
  13.            
  14.             cc.each(restItems, function (item, index) {
  15.                 var letGoProcess =  item.letGo({'index':index});
  16.                 restItemsDeferreds.push(letGoProcess);
  17.             }, this);
  18.            
  19.             this.finishAnimationDeferreds = this.finishAnimationDeferreds.concat(animationDeferredsArray,[nestDeferred],restItemsDeferreds);
  20.             this.runFinalAnimation();
  21.            
  22.         }else{
  23.             if(!ballsCount){
  24.                 setTimeout(function(){
  25.                     this.showNeedMoreBirdAnimation();
  26.                 }.bind(this),this._showNeedMoreBirdPopupDelay);
  27.             }
  28.         }
  29.     },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement