var touch;!function(t){var e;!function(t){t[t.NONE=0]="NONE",t[t.GATE=1]="GATE",t[t.OBSTACLE=2]="OBSTACLE",t[t.DIAMOND=3]="DIAMOND",t[t.POWER_UP=4]="POWER_UP"}(e||(e={}));var a=function(){function a(a,i){this._scene=null,this._camera=null,this._speedWind=null,this._sprint=null,this._light=null,this._playerBall=null,this._playerBallScript=null,this._shadowParent=null,this._trailParent=null,this._buildParent=null,this._boxParent=null,this._powerupParent=null,this._planeParent=null,this._deadPointParent=null,this._diamondParent=null,this._nameParent=null,this._aiBalls=null,this._aiNameIndex=null,this._curBendTime=0,this._dstIndex=0,this._changeTime=0,this._curBendAngle=null,this._isIniting=!1,this._buildColorIndex=0,this._gameState=t.EGameState.WAIT,this._boxNextPosZ=0,this._buildPosZ=0,this._planePosZ=0,this._accPosZ=0,this._powerupZ=0,this._difficulty=0,this._blockCounter=0,this._nextDiamondPosZ=0,this._nextBlockType=e.NONE,this._cameraDownPosZ=100,this._isTouch=!1,this._touchPosX=0,this._moveDirePosX=0,this._main=null,this._loading=null,this._isReady=!1,this._planeCount=0,this._planeColorIndex=0,this._planeColor=null,this._planeColorLerp=0,this._main=a,this._scene=i,t.SkinManager.resetSkinIndex(),this.loadScene(),t.GameFactory.instance.isReady?this.onLoaded():t.GameModule.instance.on(t.GameEvent.FACTORY_READY,this,this.onLoaded)}return a.prototype.destroy=function(){Laya.stage.off(Laya.Event.MOUSE_DOWN,this,this.onMouseDown),Laya.stage.off(Laya.Event.MOUSE_UP,this,this.onMouseUp),Laya.stage.off(Laya.Event.MOUSE_UP,this,this.onMouseMove),this._main.off(t.GameEvent.DID_START_GAME,this,this.onStart),this._main.off(t.GameEvent.REVIVE,this,this.onRevive),this._main.off(t.GameEvent.RESET,this,this.onReset),this._main.off(t.GameEvent.RESTART,this,this.onRestart),this._main.off(t.GameEvent.BACK,this,this.onBackHome),this._main.off(t.GameEvent.START_AGAIN,this,this.onReset),this._main.off(t.GameEvent.CHANGE_SKIN,this,this.onChangeSkin),t.GameModule.instance.off(t.GameEvent.FACTORY_READY,this,this.onLoaded),this._main=null,t.SoundManager.stopMusic()},a.prototype.onLoaded=function(){null!=this._loading&&(this._loading.close("",!1),this._loading.destroy(),this._loading=null),this.initScene(),this.initBendAngle(),Laya.timer.frameLoop(1,this,this.onLoop),Laya.stage.on(Laya.Event.MOUSE_DOWN,this,this.onMouseDown),Laya.stage.on(Laya.Event.MOUSE_UP,this,this.onMouseUp),Laya.stage.on(Laya.Event.MOUSE_MOVE,this,this.onMouseMove),this._main.on(t.GameEvent.DID_START_GAME,this,this.onStart),this._main.on(t.GameEvent.REVIVE,this,this.onRevive),this._main.on(t.GameEvent.RESET,this,this.onReset),this._main.on(t.GameEvent.RESTART,this,this.onRestart),this._main.on(t.GameEvent.BACK,this,this.onBackHome),this._main.on(t.GameEvent.START_AGAIN,this,this.onReset),this._main.on(t.GameEvent.CHANGE_SKIN,this,this.onChangeSkin),this.onChangeSkin(),this._isReady=!0,this._main.event(t.GameEvent.GAME_SCENE_READY)},Object.defineProperty(a.prototype,"isReady",{get:function(){return this._isReady},enumerable:!1,configurable:!0}),a.prototype.onMouseDown=function(){this._isTouch=!0,this._touchPosX=Laya.stage.mouseX},a.prototype.onMouseUp=function(){this._isTouch=!1,this._moveDirePosX=0},a.prototype.onMouseMove=function(){},a.prototype.loadScene=function(){this._camera=new Laya.Camera(0,.1,100),this._scene.addChild(this._camera),this._camera.transform.rotate(new Laya.Vector3(-.05,0,0),!0,!0),this._camera.transform.position=new Laya.Vector3(0,1.5,7.5),this._camera.clearColor=null,this._aiBalls=Array(),Laya.stage.bgColor=t.MathUtil.vec4ToHexStr(t.SkinManager.curBgColor)},a.prototype.initScene=function(){this._light=new Laya.PointLight,this._light.transform.position=new Laya.Vector3(0,20,7.5),this._light.range=100,this._light.attenuation=new Laya.Vector3(0,0,0),this._light.name="MainLight",this._scene.addChild(this._light),this._shadowParent=new Laya.MeshSprite3D,this._shadowParent.name="ShadowParent",this._scene.addChild(this._shadowParent),this._trailParent=new Laya.MeshSprite3D,this._trailParent.name="TrailParent",this._scene.addChild(this._trailParent),this._playerBall=this.createBall(0,.25,3.5,!0),this._playerBallScript=this._playerBall.getComponentByType(t.BallScript),this._playerBallScript.ballSpeed=this._playerBallScript.getInitSpeed(),this._playerBallScript.setEventDispatcher(this._main),this._playerBall.name="PlayerBall",this._scene.addChild(this._playerBall),this._buildParent=new Laya.MeshSprite3D,this._buildParent.name="BuildingParent",this._scene.addChild(this._buildParent),this._boxParent=new Laya.MeshSprite3D,this._boxParent.name="ObstacleParent",this._scene.addChild(this._boxParent),this._diamondParent=new Laya.MeshSprite3D,this._diamondParent.name="DiamondParent",this._scene.addChild(this._diamondParent),this._powerupParent=new Laya.MeshSprite3D,this._powerupParent.name="PowerupParent",this._scene.addChild(this._powerupParent),this._planeParent=new Laya.MeshSprite3D,this._scene.addChild(this._planeParent),this._deadPointParent=new Laya.MeshSprite3D,this._scene.addChild(this._deadPointParent),this._nameParent=new Laya.MeshSprite3D,this._scene.addChild(this._nameParent),this._aiNameIndex=new Array,this._speedWind=t.GameFactory.instance.createSpeedWind(),this._speedWind.active=!1,this._scene.addChild(this._speedWind),this._boxNextPosZ=-55,this._buildPosZ=0,this._planePosZ=-40,this._accPosZ=-7,this._cameraDownPosZ=100,this._powerupZ=-t.GameData.instance.config.powerupGroup.start,this.createAI(),this.showBall(!1)},a.prototype.createSprintFx=function(){var t=this,e=Laya.Sprite3D.load("res/sprint_fx/zhizuohuoqiu.lh");e.on(Laya.Event.HIERARCHY_LOADED,null,function(){console.info("Sprint Loaded => ",e);var a=e.getChildByName("Particle System");a.transform.rotate(new Laya.Vector3(0,180,0),!1,!1),t._scene.addChild(a)})},a.prototype.createStoneParticles=function(){var e=this._scene,a=Laya.Sprite3D.load("res/Stone/Stone.lh");a.on(Laya.Event.HIERARCHY_LOADED,null,function(){console.info("Stone Loaded => ",a.getChildByName("Stone"));for(var i=a.getChildByName("Stone"),n=0;n<5;n++){var o=Laya.Sprite3D.instantiate(i);e.addChild(o),o.transform.position=new Laya.Vector3(-2+n,n%2*.5,-1);for(var r=o.transform.position.clone(),s=function(e){var a=o.getChildAt(e),i=a.transform.position,n=new Laya.Vector3;Laya.Vector3.subtract(i,r,n),Laya.Vector3.normalize(n,n),Laya.Vector3.scale(n,t.MathUtil.randomInt(15,25),n),Laya.Vector3.add(i,n,n),Laya.Tween.to(i,{x:n.x,y:n.y,z:n.z,update:new Laya.Handler(a,function(){a.transform.position=i})},1e3,Laya.Ease.linearIn,new Laya.Handler(o,function(){a.active=!1}),1e3)},l=0;l0?1:-1;var n=2;(n=2-.05*(35-Math.abs(this._playerBall.transform.position.z-this._cameraDownPosZ)))>2?n=2:n<1&&(n=1);var o=0;this._isTouch&&0!=e&&(o=5*-this._moveDirePosX*this._playerBallScript.ballSpeed/600);var r=-2.1>a?-2.1:a;this._playerBallScript.moveToX(r),this._playerBallScript.updateSideRotation(o),this._playerBallScript.update(t);var s=this._camera.transform.position.y,l=.75*n;Math.abs(l-s)>.1&&(l=s+.05*(l>s?1:-1)),this._camera.transform.rotation=new Laya.Quaternion(this._camera.transform.rotation.x,0,this._playerBall.transform.position.x/50,1),this._camera.transform.position=new Laya.Vector3(.5*this._playerBall.transform.position.x,l,this._playerBall.transform.position.z+4),this.updateFieldOfView(),this._speedWind.transform.position=new Laya.Vector3(0,this._camera.transform.position.y+.5,this._camera.transform.position.z-15),this._light.transform.position=new Laya.Vector3(0,20,this._camera.transform.position.z)},a.prototype._updateAIBalls=function(t){for(var e=0;et.GameDefine.FALL_BACK_LENGTH){r=!0;var s=new Laya.Vector3(Math.floor(4*Math.random()-2),.25,n.position.z-t.GameDefine.REBORN_POS+3*Math.random()),l=!0;this._renewAIBall(e,s,l)}return r},a.prototype._renewAIBall=function(e,a,i){var n=this._aiBalls[e].getComponentByType(t.BallScript),o=t.MathUtil.randomInt(0,t.GameConfig.SKIN_VIDEO.length-1),r=t.GameFactory.instance.getSkinTexture(o),s=Laya.Texture2D.load("res/tail/"+o+".png"),l=this.randomAIName(e);n.renew(a,i,r,s,l),!n.isSprintState&&a.z>this._playerBallScript.transform.position.z&&n.addSprintProgress(t.GameData.instance.config.speed.sprint_increase>10?t.GameData.instance.config.speed.sprint_increase:10)},a.prototype._checkPlayerAndAIBallPositions=function(e,a){var i=a.owner.getComponentByType(t.BallScript);a.position.z-e.position.z>0&&i.isAI&&i.isExceed&&(this._increaseExceedNum(1),i.isExceed=!1),a.position.z-e.position.z<0&&i.isAI&&!i.isExceed&&(this._increaseExceedNum(-1),i.isExceed=!0)},a.prototype._onGameState=function(t){if(this._updateBallAndCamera(t),GameBaseData.isMultiplePlayerMode&&this._updateAIBalls(t),this._updateWindSpeed(),this.updateBendAngle(),this._updateScoreAndDifficulty(t),GameBaseData.isMultiplePlayerMode)for(var e=0;ee.position.z&&(n.isExceed=!0,this._increaseExceedNum(1))}},a.prototype._updateWindSpeed=function(){var t=this._speedWind.getChildAt(0);if(this._playerBallScript.ballSpeed>=25){this._speedWind.active=!0;var e=7*(this._playerBallScript.ballSpeed-24);t.particleSystem.emission.emissionRate=e}else this._speedWind.active=!1,t.particleSystem.emission.emissionRate=0},a.prototype._onGameOverState=function(t){},a.prototype.onLoop=function(){if(this.isReady){var e=Laya.timer.delta/1e3;switch(this._updateWorld(e),this._recoverObjectPool(e),this._playerBallScript&&this._playerBallScript.gameOver&&this._onBallGameOver(),this._gameState){case t.EGameState.WAIT:this._onWaitState(e);break;case t.EGameState.GAME:this._onGameState(e);break;case t.EGameState.GAME_OVER:this._onGameOverState(e)}}},a.prototype.playBalldeadSound=function(){t.SoundManager.playSound("res/sounds/dead.mp3")},a.prototype.updateCameraDownPosZ=function(t,a){var i=t.type,n=t.num,o=t.z;t.block==e.DIAMOND&&(i=0);var r=0;switch(i){case 0:n>1&&Math.random()<.75*.6&&(r=3==n?a-4-o*(n-2):a-o*(n-2));break;case 1:n>1&&(r=3==n?a-4-o*(n-2):a-o*(n-2));break;case 5:case 6:r=1==n?a-4-o*(n-1):a-o*(n-1)}0!=r&&(this._cameraDownPosZ=r)},a.prototype.updateFieldOfView=function(){var t=90;this._playerBallScript.isSprintState&&(t=120),this._camera.fieldOfView>t&&(this._camera.fieldOfView-=.36),this._playerBallScript.ballSpeed>33?this._camera.fieldOfViewt&&(this._camera.fieldOfView=t)):this._camera.fieldOfView>60&&(this._camera.fieldOfView-=.36,this._camera.fieldOfView<60&&(this._camera.fieldOfView=60))},a.prototype._calculateLootParam=function(){return{block:e.DIAMOND,type:0,num:t.MathUtil.randomInt(15,20),z:2.5,x:t.MathUtil.randomInt(-1,1)}},a.prototype._getObstacleGap=function(){return 40>=this._difficulty?30:80>=this._difficulty?13:120>=this._difficulty?12:10},a.prototype._randomObstacleType=function(){return 40>=this._difficulty?Math.floor(3*Math.random()):80>=this._difficulty?Math.floor(4*Math.random()):120>=this._difficulty?Math.floor(5*Math.random()):Math.floor(9*Math.random())},a.prototype._getNormalObstacleType=function(){var t=0;if(40>=this._difficulty)t=0==Math.floor(2*Math.random())?0:2;else{var e=[];t=(e=80>=this._difficulty?[0,2,3]:120>=this._difficulty?[0,2,3,4]:[0,2,3,4,7,8])[Math.floor(e.length*Math.random())]}return t},a.prototype._getRandomGateType=function(){var t=1;if(this._difficulty<40)return t;var e=[1,5,6];return t=e[Math.floor(e.length*Math.random())]},a.prototype._getObstacleCountByType=function(t){return t<4?Math.floor(2*Math.random())+3:Math.floor(2*Math.random())+1},a.prototype._isObstacleGate=function(t){return 1==t||5==t||6==t},a.prototype._calculateObstacleParam=function(){var t=this._getNormalObstacleType();return{type:t,num:this._getObstacleCountByType(t),z:this._getObstacleGap(),block:e.OBSTACLE}},a.prototype._calculateGateParam=function(){var t=this._getRandomGateType();return{type:t,num:this._getObstacleCountByType(t),z:this._getObstacleGap(),block:e.OBSTACLE}},a.prototype._calculateNextBlockParam=function(){var a={block:e.NONE,type:0,num:0,z:0};switch(this._nextBlockType){case e.NONE:this._nextBlockType=e.OBSTACLE;break;case e.GATE:t.GameData.instance.config.diamondGroup.enabled&&this._playerBall.transform.position.z<=this._nextDiamondPosZ?this._nextBlockType=e.DIAMOND:this._nextBlockType=e.OBSTACLE;break;case e.DIAMOND:this._nextBlockType=e.GATE;break;case e.OBSTACLE:if(this._playerBall.transform.position.z<=this._nextDiamondPosZ)this._nextBlockType=e.GATE;else if(this._blockCounter>12){var i=this._randomObstacleType();this._isObstacleGate(i)?this._nextBlockType=e.GATE:this._nextBlockType=e.OBSTACLE}}return this._nextBlockType==e.GATE?(a=this._calculateGateParam(),this._blockCounter=0):this._nextBlockType==e.DIAMOND?(a=this._calculateLootParam(),this._blockCounter=0,this._nextDiamondPosZ-=500):a=this._calculateObstacleParam(),a},a.prototype.updateDiamond=function(t){if(t){var e=t.num,a=t.z;this._blockCounter+=e;for(var i=e;i>0;i--)this.createDiamond(t.x,.2,this._boxNextPosZ),this._boxNextPosZ-=a;var n=this._getObstacleGap();n<20&&(n=20),this._boxNextPosZ-=n}},a.prototype.updateBox=function(t){if(t){var e=t.type,a=t.num,i=t.z;this._blockCounter+=a;for(var n=a;n>0;n--){switch(e){case 0:var o=Math.floor(5*Math.random())-2;(0==o||1==o||-1==o)&&Math.random()<.25?this.createBox1():this.createBoxObstacle(o,.5,this._boxNextPosZ);break;case 1:this.createBox1();break;case 2:this.createBox2();break;case 3:this.createBox3();break;case 4:this.createBox8();break;case 5:this.createBox4();break;case 6:this.createBox5();break;case 7:this.createBox6();break;case 8:this.createBox7();break;default:console.warn("Unkown Type: ",e)}this._boxNextPosZ-=i}this._boxNextPosZ-=i}},a.prototype.createBox6=function(){for(var t=0==Math.floor(2*Math.random())?-2:1,e=1;4>=e;e++)this.createBoxObstacle(t,1*e-.5,this._boxNextPosZ),this.createBoxObstacle(t+1,1*e-.5,this._boxNextPosZ)},a.prototype.createBox7=function(){for(var t=Math.floor(4*Math.random())-2,e=2;-2<=e;e--)if(e!=t&&e!=t+1)for(var a=1;4>=a;a++)this.createBoxObstacle(e,1*a-.5,this._boxNextPosZ)},a.prototype.createBox4=function(){for(var t=0==Math.floor(2*Math.random())?-1:1,e=-2;2>=e;e++)this.createBoxObstacle(e,1.5,this._boxNextPosZ);this.createBoxObstacle(-2,.5,this._boxNextPosZ),this.createBoxObstacle(t,.5,this._boxNextPosZ),this.createBoxObstacle(2,.5,this._boxNextPosZ)},a.prototype.createBox5=function(){for(var t=0==Math.floor(2*Math.random())?-1:1,e=-2;2>=e;e++)this.createBoxObstacle(e,2.5,this._boxNextPosZ);this.createBoxObstacle(-2,1.5,this._boxNextPosZ),this.createBoxObstacle(t,1.5,this._boxNextPosZ),this.createBoxObstacle(2,1.5,this._boxNextPosZ),this.createBoxObstacle(-2,.5,this._boxNextPosZ),this.createBoxObstacle(t,.5,this._boxNextPosZ),this.createBoxObstacle(2,.5,this._boxNextPosZ)},a.prototype.createBox8=function(){var t=Math.floor(4*Math.random())-2,e=this._boxNextPosZ,a=this.createBoxObstacle(t,.5,e),i=new Laya.Vector4(1,0,0,1);a._$color=i,a.meshRender.material.setColor(i);var n=this.createBoxObstacle(t+1,.5,e);n._$color=i,n.meshRender.material.setColor(i),this.moveAnimation(a,3,Math.random()>.5,-2,2),this.moveAnimation(n,3,Math.random()>.5,-2,2)},a.prototype.createBox3=function(){var t=this.createBoxObstacle(Math.floor(5*Math.random())-2,.5,this._boxNextPosZ),e=new Laya.Vector4(1,0,0,1);t._$color=e,t.meshRender.material.setColor(e),this.moveAnimation(t,3,(Math.floor(2*Math.random()),!0),-2,2)},a.prototype.moveAnimation=function(t,e,a,i,n){t.timer.frameLoop(1,t,function(){a?(t.transform.position=new Laya.Vector3(t.transform.position.x+.017*e,t.transform.position.y,t.transform.position.z),t.transform.position.x>=n&&(a=!1)):(t.transform.position=new Laya.Vector3(t.transform.position.x-.017*e,t.transform.position.y,t.transform.position.z),t.transform.position.x<=i&&(a=!0))})},a.prototype.createBox2=function(){var t=0;t=0==Math.floor(2*Math.random())?-2:2;var e=Math.floor(4*Math.random())+1,a=!1;a=0!=Math.floor(5*Math.random());for(var i=1;i<=e;i++)this.createBoxObstacle(t,1*i-.5,this._boxNextPosZ);a&&1a;a++)this.createBoxObstacle(a,e-.5,this._boxNextPosZ)}else if(2==t){for(a=0;aa;a++)this.createBoxObstacle(a,e-.5,this._boxNextPosZ)}else if(0==t){for(a=0;aa;a++)this.createBoxObstacle(a,e-.5,this._boxNextPosZ)}},a.prototype.updateBendAngle=function(){this._curBendTime+=this._playerBallScript.ballSpeed/24*Laya.timer.delta,this._curBendTime>=this._changeTime&&(this._dstIndex=this.randomAngle(this._dstIndex),this._changeTime=t.GameDefine.BEND_TIMES[this._dstIndex],this._curBendTime=0);var e=this._curBendTime/this._changeTime,a=t.GameDefine.DST_ANGLES[this._dstIndex],i=new Laya.Vector4(0,0,0,0);Laya.Vector4.lerp(this._curBendAngle,a,e/20,i),this.setBendAngle(i)},a.prototype.randomAngle=function(e){var a=0;do{a=Math.floor(Math.random()*t.GameDefine.BEND_TIMES.length)}while(a==e);return a},a.prototype.updateBuilding=function(){var t=Math.floor(23*Math.random())-17;this.createBuilding(-7,Math.floor(23*Math.random())-17,this._buildPosZ),this.createBuilding(7,t,this._buildPosZ),this._buildPosZ-=20},a.prototype.updatePlane=function(){this.createPlane(0,0,this._planePosZ),this._planePosZ-=100},a.prototype._increaseExceedNum=function(e){e<0&&GameBaseData.currentMatch.exceed<=0||(GameBaseData.currentMatch.exceed+=e,GameBaseData.isMultiplePlayerMode&&(this._difficulty+=e),this._main.event(t.GameEvent.EXCEED_NUM_CHANGE,GameBaseData.currentMatch.exceed))},a.prototype._updateDistance=function(e){GameBaseData.currentMatch.distance=Math.floor(-1*this._playerBall.transform.position.z),GameBaseData.modelGoal>0&&GameBaseData.currentMatch.exceed>=GameBaseData.modelGoal?(GameBaseData.currentMatch.distance=GameBaseData.modelGoal,this._main.event(t.GameEvent.DISTANCE_CHANGE,GameBaseData.currentMatch.distance),this._onWin()):this._main.event(t.GameEvent.DISTANCE_CHANGE,GameBaseData.currentMatch.distance),GameBaseData.isMultiplePlayerMode||(this._difficulty=GameBaseData.modelDif+GameBaseData.currentMatch.distance/30)},a.prototype._onWin=function(){this._playerBallScript.gameOver=!0,Laya.timer.clear(this,this.onPlaneColor),this._main.event(t.GameEvent.DEAD),t.SoundManager.stopMusic(),this._gameState=t.EGameState.GAME_OVER,this._playerBallScript.ballSpeed=this._playerBallScript.getInitSpeed(),this._playerBallScript.showShadow(!1),this._speedWind.active=!1},a.prototype.createPlane=function(e,a,i){this._planeCount++,this._planeCount>=2&&(this._planeCount=0,this._planeColorIndex++,this._planeColorIndex>=t.SkinManager.PLANE_COLORS.length&&(this._planeColorIndex=0));var n=t.GameFactory.instance.createPlane(!1,{x:e,y:a,z:i}),o=n.meshRender.material;null==this._planeColor?(this._planeColor=t.SkinManager.PLANE_COLORS[this._planeColorIndex].clone(),o.setColor(this._planeColor)):(this._planeColorLerp=0,Laya.timer.frameLoop(1,this,this.onPlaneColor),Laya.Vector4.lerp(this._planeColor,t.SkinManager.getPlaneColor(this._planeColorIndex),this._planeColorLerp,this._planeColor),o.setColor(this._planeColor)),this._planeParent.addChild(n)},a.prototype.onPlaneColor=function(){this._planeColorLerp>=.3&&Laya.timer.clear(this,this.onPlaneColor),this._planeColorLerp+=.001,Laya.Vector4.lerp(this._planeColor,t.SkinManager.getPlaneColor(this._planeColorIndex),this._planeColorLerp,this._planeColor)},a.prototype.createDeadPoint=function(e,a){var i=t.GameFactory.instance.createDeadPoint(!1,e,a);return this._deadPointParent.addChild(i),i},a.prototype.createBuilding=function(e,a,i){var n=t.GameFactory.instance.createBuilding(!1);this._playerBall.transform.position.z<-100||(a=-14);var o=null,r=0;return this._buildColorIndex%6<2?(o=t.SkinManager.getBuildingColor(3*t.SkinManager.curSkinIndex+0),r=.02,n.name="build1"):this._buildColorIndex%6<4?(r=.04,o=t.SkinManager.getBuildingColor(3*t.SkinManager.curSkinIndex+1),n.name="build2"):(r=.05,o=t.SkinManager.getBuildingColor(3*t.SkinManager.curSkinIndex+2),n.name="build3"),Laya.Vector4.lerp(o,t.SkinManager.getPlaneColor(this._planeColorIndex),r,o),n.meshRender.material.setColor(o),this._buildColorIndex++,n.transform.position=new Laya.Vector3(e,a,i),this._buildParent.addChild(n),n},a.prototype.createAccelerateBlock=function(e,a,i){var n=t.GameFactory.instance.createAccelerateBlock(!1,{x:e,y:a,z:i});return this._powerupParent.addChild(n),n},a.prototype.createPowerup=function(){for(var e=t.MathUtil.randomInt(-2,2),a=t.MathUtil.randomInt(t.GameData.instance.config.powerupGroup.min,t.GameData.instance.config.powerupGroup.max),i=t.GameData.instance.config.powerupGroup.space,n=0;n0){t.GameFactory.POOL.OBSTACLE_BOX==e.getChildAt(i).name&&e.getChildAt(i).meshRender.material.setBendDistance(a);for(var n=0;n0){t.GameFactory.POOL.OBSTACLE_BOX==e.getChildAt(i).name&&e.getChildAt(i).meshRender.material.setBendOffset(a);for(var n=0;n ",this._difficulty),this._main.event(t.GameEvent.EXCEED_NUM_CHANGE,GameBaseData.currentMatch.exceed),this._main.event(t.GameEvent.DISTANCE_CHANGE,GameBaseData.currentMatch.distance),this._touchPosX=0,this._playerBallScript.gameOver=!1,this._playerBall.active=!0,this._playerBall.transform.position=new Laya.Vector3(0,.25,3.5),this._playerBall.transform.rotation=new Laya.Quaternion(0,0,0,1),this._playerBallScript.ballSpeed=this._playerBallScript.getInitSpeed(),this._playerBallScript.showTrail(!1),this._playerBallScript.showShadow(!0),this._playerBallScript.extraLife=0,this._playerBallScript.lifeProduceCounter=0,GameBaseData.isSinglePlayerMode?this._playerBallScript.maxLife=5:this._playerBallScript.maxLife=0,this.setBendAngle(new Laya.Vector4(0,0,0,0)),this._curBendTime=0,this._dstIndex=3,this._changeTime=2e3,this.setBendDistance(100),this._light.transform.position=new Laya.Vector3(0,20,7.5),t.SkinManager.curSkinIndex=(t.SkinManager.curSkinIndex+1)%2;var e=t.SkinManager.curFogColor;this._playerBallScript.setFogColor(e);for(var a=0;a