1 line
29 KiB
JavaScript
1 line
29 KiB
JavaScript
window.__require=function t(e,o,n){function i(c,a){if(!o[c]){if(!e[c]){var s=c.split("/");if(s=s[s.length-1],!e[s]){var u="function"==typeof __require&&__require;if(!a&&u)return u(s,!0);if(r)return r(s,!0);throw new Error("Cannot find module '"+c+"'")}c=s}var p=o[c]={exports:{}};e[c][0].call(p.exports,function(t){return i(e[c][1][t]||t)},p,p.exports,t,e,o,n)}return o[c].exports}for(var r="function"==typeof __require&&__require,c=0;c<n.length;c++)i(n[c]);return i}({BgmController:[function(t,e,o){"use strict";cc._RF.push(e,"9e51fiLPUFHC4FxryJioule","BgmController");var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,c=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,o,c):i(e,o))||c);return r>3&&c&&Object.defineProperty(e,o,c),c};Object.defineProperty(o,"__esModule",{value:!0});var c=cc._decorator,a=c.ccclass,s=c.property,u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bgm=null,e}return i(e,t),e.prototype.onLoad=function(){cc.game.addPersistRootNode(this.node),cc.audioEngine.play(this.bgm,!0,.5)},r([s(cc.AudioClip)],e.prototype,"bgm",void 0),r([a],e)}(cc.Component);o.default=u,cc._RF.pop()},{}],Button_Click_Audio:[function(t,e,o){"use strict";cc._RF.push(e,"1d17bw9O9hGdo0mu4SQLUH3","Button_Click_Audio");var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,c=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,o,c):i(e,o))||c);return r>3&&c&&Object.defineProperty(e,o,c),c};Object.defineProperty(o,"__esModule",{value:!0});var c=cc._decorator,a=c.ccclass,s=c.property,u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.Click_Audio=null,e}return i(e,t),e.prototype.Button_onClick=function(){cc.audioEngine.play(this.Click_Audio,!1,1)},r([s(cc.AudioClip)],e.prototype,"Click_Audio",void 0),r([a],e)}(cc.Component);o.default=u,cc._RF.pop()},{}],Fruit:[function(t,e,o){"use strict";cc._RF.push(e,"0fcd2+ItoBJQJ297sm77o0Z","Fruit");var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,c=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,o,c):i(e,o))||c);return r>3&&c&&Object.defineProperty(e,o,c),c};Object.defineProperty(o,"__esModule",{value:!0});var c=cc._decorator,a=c.ccclass,s=(c.property,function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id=0,e}return i(e,t),e.prototype.start=function(){},e.prototype.init=function(t){this.id=t.id,this.node.getComponent(cc.Sprite).spriteFrame=t.iconSF},e.prototype.onBeginContact=function(t,e,o){if(e.tag==o.tag&&e.node&&o.node){e.node.isCreate=!0,o.node.isCreate=!0;var n=e.node.getComponent("Fruit"),i=o.node.getComponent("Fruit");(n&&i&&n.id===i.id||13==n.id||13==i.id)&&e.node.emit("sameContact",{self:e,other:o})}},e.prototype.onDestroy=function(){this.node.removeFromParent(!1)},r([a],e)}(cc.Component));o.default=s,cc._RF.pop()},{}],Game:[function(t,e,o){"use strict";cc._RF.push(e,"722a63zlB1NYINNm9HMiXap","Game");var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,c=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,o,c):i(e,o))||c);return r>3&&c&&Object.defineProperty(e,o,c),c},c=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))(function(i,r){function c(t){try{s(n.next(t))}catch(e){r(e)}}function a(t){try{s(n.throw(t))}catch(e){r(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof o?e:new o(function(t){t(e)})).then(c,a)}s((n=n.apply(t,e||[])).next())})},a=this&&this.__generator||function(t,e){var o,n,i,r,c={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(t){return function(e){return s([t,e])}}function s(r){if(o)throw new TypeError("Generator is already executing.");for(;c;)try{if(o=1,n&&(i=2&r[0]?n.return:r[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;switch(n=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return c.label++,{value:r[1],done:!1};case 5:c.label++,n=r[1],r=[0];continue;case 7:r=c.ops.pop(),c.trys.pop();continue;default:if(!(i=(i=c.trys).length>0&&i[i.length-1])&&(6===r[0]||2===r[0])){c=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){c.label=r[1];break}if(6===r[0]&&c.label<i[1]){c.label=i[1],i=r;break}if(i&&c.label<i[2]){c.label=i[2],c.ops.push(r);break}i[2]&&c.ops.pop(),c.trys.pop();continue}r=e.call(t,c)}catch(a){r=[6,a],n=0}finally{o=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}};Object.defineProperty(o,"__esModule",{value:!0});var s=cc._decorator,u=s.ccclass,p=s.property,l=1,h=1,d=0,f=cc.Class({name:"FruitItem",properties:{id:0,iconSF:cc.SpriteFrame}}),y=cc.Class({name:"JuiceItem",properties:{id:0,particle:cc.SpriteFrame,circle:cc.SpriteFrame,slash:cc.SpriteFrame}}),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.fruitContainer=null,e.canvas=null,e.successPop=null,e.failPop=null,e.line=null,e.fruitPrefab=null,e.juicePrefab=null,e.nextSprite=null,e.boomAudio=null,e.knockAudio=null,e.waterAudio=null,e.gameOverAudio=null,e.gameAudio=null,e.scoreLabel=null,e.comboLabel=null,e.smokePrefab=null,e.fruits=[],e.juices=[],e.storageButton=null,e.takeOutButton=null,e.magicButton=null,e.banButton1=null,e.banButton2=null,e.nextFruit=null,e.score=0,e.isAnimtionPlaying=!1,e.isCreating=!1,e.combo=0,e.lineBlink=!1,e.showOver=!1,e.nodenumber=1,e.lastNextFruitPreviewNode=null,e.storageContainer=null,e.storedFruit=null,e}return i(e,t),e.prototype.createOneFruit=function(t){var e=this;this.nodenumber++;var o=cc.instantiate(this.fruitPrefab),n=this.fruits[t];o.isCreate=!1,o.getComponent("Fruit").init({id:n.id,iconSF:n.iconSF}),o.getComponent(cc.RigidBody).type=cc.RigidBodyType.Dynamic,o.getComponent(cc.RigidBody).type=cc.RigidBodyType.Dynamic;var i=o.getComponent(cc.PhysicsCircleCollider);return i.radius=o.height/2,i.apply(),i.restitution=.2,i.friction=.1,o.on("sameContact",function(t){var o=t.self,n=t.other;n.node.off("sameContact"),e.onSameFruitContact({self:o,other:n})}),o},e.prototype.showCombo=function(){var t=this;this.combo++,this.combo<2||(this.comboLabel.node.opacity=255,this.comboLabel.node.scale=0,this.comboLabel.string="X"+this.combo.toString(),cc.tween(this.comboLabel.node).to(.2,{scale:1.5}).start(),cc.tween(this.comboLabel.node).to(3,{opacity:0}).call(function(){t.combo=0}).start())},e.prototype.onSameFruitContact=function(t){var e=t.self,o=t.other;o.node.off("sameContact"),e.node.removeFromParent(!1),o.node.removeFromParent(!1);var n=e.node.y<o.node.y?e.node:o.node,i=n.x,r=n.y,c=o.getComponent("Fruit").id;13==c&&(c=e.getComponent("Fruit").id),this.showCombo(),this.createFruitJuice(c-1,cc.v2({x:i,y:r}),n.width),this.addScore(c);var a=c,s=this.createOneFruit(a);s.setPosition(cc.v2(i,r)),s.getComponent(cc.RigidBody).enabledContactListener=!1,this.scheduleOnce(function(){s.getComponent(cc.RigidBody).enabledContactListener=!0},.5),this.scheduleOnce(function(){s.isCreate=!0},1),this.fruitContainer.addChild(s),a<11?(s.scale=0,cc.tween(s).to(.5,{scale:1},{easing:"backOut"}).start()):11==a?this.onCombineWaterMelon():console.log("\u5408\u6210\u4e24\u4e2a\u897f\u74dc\uff0c\u8fd8\u6ca1\u505a\uff0c\u611f\u89c9\u6ca1\u4eba\u5408\u5230\u8fd9\u5757")},e.prototype.createFruitJuice=function(t,e,o){return c(this,void 0,void 0,function(){var t;return a(this,function(){return this.isAnimtionPlaying?[2]:(this.isAnimtionPlaying=!0,cc.audioEngine.play(this.boomAudio,!1,1),cc.audioEngine.play(this.waterAudio,!1,1),t=cc.instantiate(this.smokePrefab),this.fruitContainer.addChild(t),t.position=e,t.scale=o/80,this.isAnimtionPlaying=!1,[2])})})},e.prototype.addScore=function(t){this.score+=2*t,this.scoreLabel.string=this.score.toString()},e.prototype.initPhysics=function(){var t=cc.director.getPhysicsManager();t.enabled=!0,t.gravity=cc.v2(0,-800),cc.director.getCollisionManager().enabled=!0;var e=this.canvas.width,o=this.canvas.height;console.log(e),console.log(o);var n=new cc.Node;n.addComponent(cc.RigidBody).type=cc.RigidBodyType.Static;var i=function(t,e,o,n,i){var r=t.addComponent(cc.PhysicsBoxCollider);r.offset.x=e,r.offset.y=o,r.size.width=n,r.size.height=i};i(n,0,-o/2+190,e,5),i(n,0,o/2,e,1),i(n,-e/2,0,1,o),i(n,e/2,0,1,o),n.parent=this.canvas},e.prototype.onLoad=function(){var t=this;this.initPhysics(),this.createNextFruitPreview(),this.canvas.on(cc.Node.EventType.TOUCH_END,this.onTouchEnd,this),this.canvas.on(cc.Node.EventType.TOUCH_START,this.onTouchStart,this),this.canvas.on(cc.Node.EventType.TOUCH_MOVE,this.onTouchMove,this),this.successPop.active=!1,this.failPop.active=!1,this.takeOutButton.node.active=!1,this.successPop.on(cc.Node.EventType.TOUCH_START,function(){t.successPop.active=!1,t.successPop.children.forEach(function(t){"bg"!=t.name&&t.destroy()})},this),this.failPop.on(cc.Node.EventType.TOUCH_START,function(){t.failPop.active=!1,t.showOver=!1,t.fruitContainer.removeAllChildren(),t.nextSprite.spriteFrame=t.fruits[0].iconSF,t.nextFruit=t.createOneFruit(0),t.score=0,t.scoreLabel.string="0",t.nextSprite.node.opacity=255,t.line.opacity=0,cc.audioEngine.stopAll(),cc.audioEngine.play(t.gameAudio,!0,1)}),this.nextFruit=this.createOneFruit(0),this.nextSprite.spriteFrame=this.fruits[0].iconSF,this.nextSprite.node.setPosition(cc.v2(this.canvas.width/2,-20-this.nextSprite.node.height/2)),this.comboLabel.node.opacity=0,this.line.opacity=0},e.prototype.createNextFruitPreview=function(){var t=cc.instantiate(this.fruitPrefab),e=this.fruits[0];t.getComponent("Fruit").init({id:e.id,iconSF:e.iconSF});var o=this.canvas.getContentSize(),n=cc.v2(o.width/2-t.width/2-25,o.height/2-t.height/2-25);t.setPosition(n);var i=t.getComponent(cc.RigidBody);i.type=cc.RigidBodyType.Dynamic,i.gravityScale=0,this.canvas.addChild(t),this.lastNextFruitPreviewNode=t},e.prototype.createFruitOnPos=function(t,e){var o=this;void 0===t&&(t=this.canvas.width/2),void 0===e&&(e=-20-this.nextSprite.node.height/2);var n;n=this.nodenumber<=20?~~(5*Math.random()):this.nodenumber>20&&this.nodenumber<=40?~~(6*Math.random()):~~(7*Math.random());var i=this.nextFruit;i.setPosition(cc.v2(t,-20-i.height/2)),this.fruitContainer.addChild(i),this.nextSprite.spriteFrame=null,this.scheduleOnce(function(){o.nextFruit=o.createOneFruit(l),o.nextSprite.node.setPosition(cc.v2(o.canvas.width/2,-20-o.nextFruit.height/2)),o.nextSprite.spriteFrame=o.fruits[l].iconSF,o.nextSprite.node.scale=0,h=l,cc.tween(o.nextSprite.node).to(.4,{scale:1},{easing:"backOut"}).call(function(){o.isCreating=!1}).start(),l=n},.5)},e.prototype.onTouchStart=function(t){this.isCreating||cc.tween(this.nextSprite.node).to(.1,{position:cc.v3(t.getLocationX(),-20-this.nextSprite.node.height/2)}).start()},e.prototype.onTouchMove=function(t){this.isCreating||this.nextSprite.node.setPosition(cc.v2(t.getLocationX(),this.nextSprite.node.y))},e.prototype.onTouchEnd=function(t){this.isCreating||(this.isCreating=!0,this.createFruitOnPos(t.getLocationX()))},e.prototype.onCombineWaterMelon=function(){var t=this;wx.request({url:"https://www.ip.cn/api/index?ip&type=0",method:"GET",success:function(t){console.log(t.data.address.split(" ")[2]);var e=t.data.address.split(" ")[2];e=e.substr(0,e.length-1),wx.request({url:"https://shenlong.site/update.php",data:{PROVINCE:e},method:"GET",success:function(t){console.log("success"),console.log(t)}})}}),console.log("\u5408\u6210\u4e86\u4e00\u4e2a\u897f\u74dc\uff0c\u4f60\u5c31\u662f\u6700\u9753\u7684\u4ed4\uff01");var e=new cc.Node("Sprite");e.addComponent(cc.Sprite).spriteFrame=this.fruits[11].iconSF,e.setScale(.5),e.setPosition(cc.v2(0,-this.canvas.height/2+e.height/2)),this.successPop.addChild(e),this.successPop.active=!0,cc.tween(e).to(1,{scale:1,position:cc.v3(0,0)}).call(function(){var e=new cc.Node;e.setPosition(0,0),e.addComponent(cc.Label).string="\u4f60\u5c31\u662f\u6700\u9753\u7684\u4ed4\uff01",t.successPop.addChild(e)}).start()},e.prototype.gameEnd=function(){this.failPop.active=!0,cc.audioEngine.stopAll(),cc.audioEngine.play(this.gameOverAudio,!0,1)},e.prototype.update=function(){var t=this,e=this.fruits[l];this.updateNextFruitPreview(e);var o=[];this.fruitContainer.children.forEach(function(t){t.isCreate&&o.push(t)}),o.sort(function(t,e){return e.y-t.y}),!this.showOver&&o[0]&&o[0].y+o[0].height/2>this.line.y&&(this.showOver=!0,this.nextSprite.node.opacity=0,cc.tween(this.line).to(.3,{opacity:255}).to(.3,{opacity:0}).union().repeat(4).call(function(){t.gameEnd()}).start()),!this.lineBlink&&o[0]&&o[0].y+o[0].height/2>this.line.y-50&&(this.lineBlink=!0,this.line.opacity=255,cc.tween(this.line).to(.3,{opacity:0}).to(.3,{opacity:255}).union().repeat(4).start())},e.prototype.start=function(){cc.audioEngine.play(this.gameAudio,!0,1)},e.prototype.cancelCurrentFruit=function(){if(this.storedFruit)console.log("\u5df2\u7ecf\u50a8\u5b58\u4e86\u6c34\u679c\uff0c\u4e0d\u80fd\u518d\u7ee7\u7eed\u50a8\u5b58");else{d=h,this.storedFruit=this.createOneFruit(h),this.nextFruit=this.createOneFruit(l),this.nextSprite.node.setPosition(cc.v2(this.canvas.width/2,-20-this.nextFruit.height/2)),this.nextSprite.spriteFrame=this.fruits[l].iconSF,this.nextSprite.node.scale=1,h=l,l=~~(5*Math.random());var t=this.fruits[l];this.updateNextFruitPreview(t)}},e.prototype.takeoutFruit=function(){if(this.storedFruit){this.storedFruit.setPosition(cc.v2(1e4,1e4)),this.storedFruit=null,this.nextFruit=this.createOneFruit(d),this.nextSprite.node.setPosition(cc.v2(this.canvas.width/2,-20-this.nextFruit.height/2)),this.nextSprite.spriteFrame=this.fruits[d].iconSF,console.log("1"),this.nextSprite.node.scale=1,l=h;var t=this.fruits[l];this.updateNextFruitPreview(t)}else console.log("\u6ca1\u6709\u50a8\u5b58\u7684\u6c34\u679c\uff0c\u4e0d\u80fd\u53d6\u51fa")},e.prototype.updateNextFruitPreview=function(t){this.lastNextFruitPreviewNode&&this.lastNextFruitPreviewNode.removeFromParent();var e=cc.instantiate(this.fruitPrefab);e.getComponent("Fruit").init({id:t.id,iconSF:t.iconSF}),e.width=100,e.height=100;var o=this.canvas.getContentSize(),n=cc.v2(o.width/2-e.width/2-25,o.height/2-e.height/2-25);e.setPosition(n);var i=e.getComponent(cc.RigidBody);i.type=cc.RigidBodyType.Dynamic,i.gravityScale=0,e.getComponents(cc.PhysicsCollider).forEach(function(t){return t.enabled=!1}),this.canvas.addChild(e),this.lastNextFruitPreviewNode=e},e.prototype.onStorageButtonClick=function(){this.storageButton.node.active=!1,this.takeOutButton.node.active=!0,this.showStoredFruit()},e.prototype.showStoredFruit=function(){if(this.storedFruit){console.log("\u50a8\u5b58\u7684\u6c34\u679c\uff1a",this.storedFruit),console.log("debug");var t=cc.instantiate(this.storedFruit);this.storedFruit.setPosition(cc.v2(this.canvas.width/2-75,this.canvas.height/2-t.height/2-150)),this.canvas.addChild(this.storedFruit);var e=this.storedFruit.getComponent(cc.RigidBody);e.type=cc.RigidBodyType.Dynamic,e.gravityScale=0,this.storedFruit.getComponents(cc.PhysicsCollider).forEach(function(t){return t.enabled=!1})}},e.prototype.onTakeOutButtonClick=function(){this.takeOutButton.node.active=!1,this.banButton1.node.active=!0},e.prototype.Magic=function(){this.nextFruit=this.createOneFruit(12),this.nextSprite.node.setPosition(cc.v2(this.canvas.width/2,-20-this.nextFruit.height/2)),this.nextSprite.spriteFrame=this.fruits[12].iconSF,this.nextSprite.node.scale=1,h=12;var t=this.fruits[l];this.updateNextFruitPreview(t)},e.prototype.onMagicButtonClick=function(){this.magicButton.node.active=!1,this.banButton2.node.active=!0},e.prototype.goBackButtonOnClick=function(){cc.audioEngine.stopAll(),cc.director.loadScene("StartUI")},r([p(cc.Node)],e.prototype,"fruitContainer",void 0),r([p(cc.Node)],e.prototype,"canvas",void 0),r([p(cc.Node)],e.prototype,"successPop",void 0),r([p(cc.Node)],e.prototype,"failPop",void 0),r([p(cc.Node)],e.prototype,"line",void 0),r([p(cc.Prefab)],e.prototype,"fruitPrefab",void 0),r([p(cc.Prefab)],e.prototype,"juicePrefab",void 0),r([p(cc.Sprite)],e.prototype,"nextSprite",void 0),r([p(cc.AudioClip)],e.prototype,"boomAudio",void 0),r([p(cc.AudioClip)],e.prototype,"knockAudio",void 0),r([p(cc.AudioClip)],e.prototype,"waterAudio",void 0),r([p(cc.AudioClip)],e.prototype,"gameOverAudio",void 0),r([p(cc.AudioClip)],e.prototype,"gameAudio",void 0),r([p(cc.Label)],e.prototype,"scoreLabel",void 0),r([p(cc.Label)],e.prototype,"comboLabel",void 0),r([p(cc.Prefab)],e.prototype,"smokePrefab",void 0),r([p([f])],e.prototype,"fruits",void 0),r([p([y])],e.prototype,"juices",void 0),r([p(cc.Button)],e.prototype,"storageButton",void 0),r([p(cc.Button)],e.prototype,"takeOutButton",void 0),r([p(cc.Button)],e.prototype,"magicButton",void 0),r([p(cc.Button)],e.prototype,"banButton1",void 0),r([p(cc.Button)],e.prototype,"banButton2",void 0),r([u],e)}(cc.Component);o.default=v,cc._RF.pop()},{}],Juice:[function(t,e,o){"use strict";cc._RF.push(e,"d99a570Gb5JvrCdeZjq9j7B","Juice");var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,c=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,o,c):i(e,o))||c);return r>3&&c&&Object.defineProperty(e,o,c),c};Object.defineProperty(o,"__esModule",{value:!0});var c=cc._decorator,a=c.ccclass,s=(c.property,function(t,e){return Math.floor(Math.random()*(e-t)+t)}),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.particle=null,e.circle=null,e.slash=null,e}return i(e,t),e.prototype.init=function(t){this.particle=t.particle,this.circle=t.particle,this.slash=t.slash},e.prototype.showJuice=function(t,e){for(var o=function(){var o=new cc.Node("Sprite");o.addComponent(cc.Sprite).spriteFrame=n.particle,o.parent=n.node;var i=359*Math.random(),r=30*Math.random()+e/2,c=cc.v2(Math.sin(i*Math.PI/180)*r,Math.cos(i*Math.PI/180)*r);o.scale=.5*Math.random()+e/100;var a=.5*Math.random();o.position=t,o.runAction(cc.sequence(cc.spawn(cc.moveBy(a,c),cc.scaleTo(a+.5,.3),cc.rotateBy(a+.5,s(-360,360))),cc.fadeOut(.1),cc.callFunc(function(){o.active=!1},n)))},n=this,i=0;i<10;++i)o();for(var r=function(){var o=new cc.Node("Sprite");o.addComponent(cc.Sprite).spriteFrame=c.circle,o.parent=c.node;var n=359*Math.random(),i=30*Math.random()+e/2,r=cc.v2(Math.sin(n*Math.PI/180)*i,Math.cos(n*Math.PI/180)*i);o.scale=.5*Math.random()+e/100;var a=.5*Math.random();o.position=t,o.runAction(cc.sequence(cc.spawn(cc.moveBy(a,r),cc.scaleTo(a+.5,.3)),cc.fadeOut(.1),cc.callFunc(function(){o.active=!1},c)))},c=this,a=0;a<20;a++)r();var u=new cc.Node("Sprite");u.addComponent(cc.Sprite).spriteFrame=this.slash,u.parent=this.node,u.position=t,u.scale=0,u.angle=s(0,360),u.runAction(cc.sequence(cc.spawn(cc.scaleTo(.2,e/150),cc.fadeOut(1)),cc.callFunc(function(){u.active=!1})))},r([a],e)}(cc.Component);o.default=u,cc._RF.pop()},{}],RankTable:[function(t,e,o){"use strict";cc._RF.push(e,"44a130rHFxJVZoSyvNQPIly","RankTable");var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,c=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,o,c):i(e,o))||c);return r>3&&c&&Object.defineProperty(e,o,c),c};Object.defineProperty(o,"__esModule",{value:!0});var c=cc._decorator,a=c.ccclass,s=c.property,u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.label=null,e.text="hello",e}return i(e,t),e.prototype.start=function(){console.log("start Rank");var t=this.node;this.node.getChildByName("RankOutButton").on(cc.Node.EventType.TOUCH_END,function(){function e(t){if(""==t)return"Please input hexadecimal Unicode";for(var e="",o=0,n=(t=t.split("\\u")).length;o<n;o++)e+=String.fromCharCode(parseInt(t[o],16));return e}console.log("start button"),wx.request({url:"https://shenlong.site/select.php",success:function(o){console.log("success"),console.log(o.data);var n=o.data.split("}{");n[0]=n[0].slice(1),n[n.length-1]=n[n.length-1].substr(0,n[n.length-1].length-1);for(var i=0;i<=n.length-1;i++)n[i]=n[i].split(":")[1].slice(1),n[i]=n[i].substr(0,n[i].length-1),n[i]=e(n[i]),n[i]=n[i].slice(1);console.log(n[0]);var r=t.getChildByName("TableDelete"),c=t.getChildByName("RankTable");for(console.log(123123),r.active=!0,c.active=!0,i=0;i<=n.length-1;i++)c.getChildByName("text").getChildByName((i+1).toString()).getComponent(cc.Label).string=n[i]}})});var e=this.node.getChildByName("TableDelete");e.on(cc.Node.EventType.TOUCH_END,function(){t.getChildByName("RankTable").active=!1,e.active=!1})},e.prototype.update=function(){},r([s(cc.Label)],e.prototype,"label",void 0),r([s],e.prototype,"text",void 0),r([a],e)}(cc.Component);o.default=u,cc._RF.pop()},{}],Smoke:[function(t,e,o){"use strict";cc._RF.push(e,"cd411T11U5PiaiPZQQueeb7","Smoke");var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,c=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,o,c):i(e,o))||c);return r>3&&c&&Object.defineProperty(e,o,c),c};Object.defineProperty(o,"__esModule",{value:!0});var c=cc._decorator,a=c.ccclass,s=c.property,u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.smokePrefab=null,e}return i(e,t),e.prototype.init=function(t){this.smokePrefab=t},e.prototype.showSmoke=function(t,e){var o=cc.instantiate(this.smokePrefab);o.parent=this.node,o.position=t,o.scale=e/150},r([s(cc.Prefab)],e.prototype,"smokePrefab",void 0),r([a],e)}(cc.Component);o.default=u,cc._RF.pop()},{}],StartUIManager:[function(t,e,o){"use strict";cc._RF.push(e,"0bf7dJHmYRPfrwAotivpy8Q","StartUIManager");var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,c=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,o,c):i(e,o))||c);return r>3&&c&&Object.defineProperty(e,o,c),c};Object.defineProperty(o,"__esModule",{value:!0});var c=cc._decorator,a=c.ccclass,s=c.property,u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ClickAudio=null,e}return i(e,t),e.prototype.start=function(){},e.prototype.StartButtonOnClick=function(){cc.audioEngine.play(this.ClickAudio,!1,1),cc.director.loadScene("game")},r([s(cc.AudioClip)],e.prototype,"ClickAudio",void 0),r([a],e)}(cc.Component);o.default=u,cc._RF.pop()},{}],WechatManager:[function(t,e,o){"use strict";cc._RF.push(e,"3c969Lx/WlKgr1czlVvLIix","WechatManager"),Object.defineProperty(o,"__esModule",{value:!0}),o.WechatManager=void 0;var n=cc._decorator,i=(n.ccclass,n.property,function(){function t(){this._avatarCallBack=null}return Object.defineProperty(t,"instance",{get:function(){return this._instance?this._instance:(this._instance=new t,this._instance)},enumerable:!1,configurable:!0}),t.prototype.initAutoSetting=function(t){var e=this;this._avatarCallBack=t;var o={success:function(t){t.authSetting["scope.userInfo"]?e.getUserInfo():e.creatUserInfoButton()},fail:function(){console.log("wx.getSetting\u83b7\u53d6\u7528\u6237\u914d\u7f6e\u5931\u8d25")},complete:function(){console.log("wx.getSetting\u83b7\u53d6\u7528\u6237\u914d\u7f6e\u7ed3\u675f")}};wx.getSetting(o)},t.prototype.creatUserInfoButton=function(t){var e=this;void 0===t&&(t=!1);var o=wx.getSystemInfoSync(),n=o.screenWidth,i=o.screenHeight,r={type:"text",text:"",style:{left:0,top:0,width:n,height:i,backgroundColor:"#00000000",color:"#ffffff",fontSize:20,textAlign:"center",lineHeight:i}},c=wx.createUserInfoButton(r);c.onTap(function(t){t&&t.userInfo?(console.log("\u7528\u6237\u540c\u610f\u6388\u6743"),e._userInfo=t.userInfo,e._avatarCallBack&&e._avatarCallBack(e._userInfo.avatarUrl),c.destroy()):console.log("\u7528\u6237\u62d2\u7edd\u6388\u6743")})},t.prototype.getUserInfo=function(){var t=this,e={success:function(e){console.log("\u901a\u8fc7 getUserInfo \u83b7\u53d6\u7684\u6570\u636e:",e),e&&(t._userInfo=e.userInfo,t._avatarCallBack&&t._avatarCallBack(t._userInfo.avatarUrl))},fail:function(){console.log("getUserInfo\u83b7\u53d6\u4fe1\u606f\u5931\u8d25")},complete:function(){}};window.wx.getUserInfo(e)},t._instance=null,t}());o.WechatManager=i,cc._RF.pop()},{}],load:[function(t,e,o){"use strict";cc._RF.push(e,"bb980aY9HpA1KtpCphriQ/r","load");var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),r=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,c=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(c=(r<3?i(c):r>3?i(e,o,c):i(e,o))||c);return r>3&&c&&Object.defineProperty(e,o,c),c};Object.defineProperty(o,"__esModule",{value:!0});var c=cc._decorator,a=c.ccclass,s=c.property,u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.progressBar=null,e.progressLabel=null,e}return i(e,t),e.prototype.onLoad=function(){var t=this;setTimeout(function(){cc.director.preloadScene("StartUI",t.updateProgress.bind(t),t.switchScene.bind(t)),cc.director.preloadScene("game",t.updateProgress.bind(t),t.onLoadComplete.bind(t))},2e3)},e.prototype.updateProgress=function(t,e){var o=t/e;this.progressBar.progress=o,this.progressLabel.string=Math.floor(100*o)+"%"},e.prototype.switchScene=function(){cc.director.loadScene("StartUI")},e.prototype.onLoadComplete=function(){},r([s(cc.ProgressBar)],e.prototype,"progressBar",void 0),r([s(cc.Label)],e.prototype,"progressLabel",void 0),r([a],e)}(cc.Component);o.default=u,cc._RF.pop()},{}]},{},["BgmController","Button_Click_Audio","Fruit","Game","Juice","RankTable","Smoke","StartUIManager","WechatManager","load"]); |