text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4091a40e"],{"3f9e":function(t,i,e){"use strict";var s=function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{staticClass:"bird",style:{backgroundPositionX:t.num2strAddPx(this.backgroundPositionX)}})},n=[],o=e("83af"),p={data:function(){return{backgroundPositionX:0}},props:{},methods:{flapWings:function(){this.backgroundPositionX<=-60?this.backgroundPositionX=0:this.backgroundPositionX-=30},num2strAddPx:o["num2strAddPx"]}},r=p,a=(e("6fd0"),e("2877")),d=Object(a["a"])(r,s,n,!1,null,"a2c2c5fc",null);i["a"]=d.exports},"491e":function(t,i,e){"use strict";var s=e("feb6"),n=e.n(s);n.a},5895:function(t,i,e){},"6fd0":function(t,i,e){"use strict";var s=e("5895"),n=e.n(s);n.a},"9aeb":function(t,i,e){"use strict";e.r(i);var s=function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{staticClass:"playingGame",on:{click:t.handleGameClick}},[e("div",{staticClass:"score"},[t._v(t._s(t.score))]),e("div",{staticClass:"location"},[t._l(t.pipeData,(function(i,s){return e("div",{key:s,staticClass:"pipe"},[e("div",{staticClass:"pipeUp",style:{top:t.num2strAddPx(i.upY),left:t.num2strAddPx(i.left)}}),e("div",{staticClass:"pipeDown",style:{top:t.num2strAddPx(i.downY),left:t.num2strAddPx(i.left)}})])})),e("Bird",{ref:"Bird",class:{nojump:!0},style:{top:t.num2strAddPx(this.topOfBird)}})],2)])},n=[],o=e("3f9e"),p=e("83af"),r={data:function(){return{topOfBird:0,maxTopOfBird:50,minTopOfBird:0,dropStepY:0,bodyHeight:1e3,pipeYDistance:150,pipeData:[],pipeLength:10,score:0,currentPipeIndex:0,isClick:!1,pipeWidth:52,speedX:5}},components:{Bird:o["a"]},methods:{handleGameClick:function(){this.isClick||(this.isClick=!0),this.dropStepY=-10},droptopOfBird:function(){this.topOfBird+=++this.dropStepY},judgeKnock:function(){this.judgeBoundary(),this.judgePipe()},judgeBoundary:function(){(this.topOfBird<=this.minTop||this.topOfBird>=this.maxTop)&&this.failGame()},judgeSinglePipe:function(t){t.left<=30&&t.left>=-this.pipeWidth&&(this.topOfBird>=t.upY+852&&this.topOfBird+30<=t.downY||this.failGame())},judgePipe:function(){this.judgeSinglePipe(this.pipeData[this.currentPipeIndex])},isPassCurrentPipe:function(){return this.pipeData[this.currentPipeIndex].left<-67},failGame:function(){this.$emit("gameOver",!1,this.score)},createPipe:function(t){var i=Math.floor(Math.random()*(this.maxTop-70))+20,e=i-this.pipeYDistance-850;return{upY:e,downY:i,left:t}},pipeMove:function(){for(var t=0;t<this.pipeLength;t++)this.pipeData[t].left-=this.speedX},num2strAddPx:p["num2strAddPx"],addDeletePipe:function(){var t=this.pipeData.shift();this.pipeData.push(this.createPipe(t.left+300*this.pipeLength))}},props:{isStartGame:{type:Boolean,default:!0}},mounted:function(){this.bodyHeight=document.body.scrollHeight;for(var t=0;t<this.pipeLength;t++)this.pipeData.push(this.createPipe(300*(t+1)))},computed:{minTop:function(){return-(this.bodyHeight/2-10)},maxTop:function(){return this.bodyHeight/2+10},time30:function(){return this.$store.state.counter}},watch:{time30:function(t){this.$parent.moveBackground(this.speedX),this.isClick&&(this.pipeMove(),this.droptopOfBird(),this.pipeData[0].left<=-1e3&&(this.addDeletePipe(),this.currentPipeIndex--),this.judgeKnock(),this.isPassCurrentPipe()&&(this.score++,this.currentPipeIndex++)),t%10==0&&this.$refs.Bird.flapWings()}}},a=r,d=(e("491e"),e("2877")),u=Object(d["a"])(a,s,n,!1,null,"63b9831f",null);i["default"]=u.exports},feb6:function(t,i,e){}}]);
  //# sourceMappingURL=chunk-4091a40e.8a45f4fa.js.map