Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checkLevel:function(animationDeferredsArray){
- var ballsCount = this.nestBox.getBallsCount();
- var birdCages = this.gameItemCollection.getCages();
- var birdCagesTotal = birdCages.length;
- if(!birdCagesTotal){
- var restItems = this.gameItemCollection.getAll();
- var nestDeferred = this.nestBox.flipRestBirds();
- var restItemsDeferreds = [];
- cc.each(restItems, function (item, index) {
- var letGoProcess = item.letGo({'index':index});
- restItemsDeferreds.push(letGoProcess);
- }, this);
- this.finishAnimationDeferreds = this.finishAnimationDeferreds.concat(animationDeferredsArray,[nestDeferred],restItemsDeferreds);
- this.runFinalAnimation();
- }else{
- if(!ballsCount){
- setTimeout(function(){
- this.showNeedMoreBirdAnimation();
- }.bind(this),this._showNeedMoreBirdPopupDelay);
- }
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement