!function(e){function t(t){for(var s,a,_=t[0],E=t[1],T=t[2],n=0,C=[];n<_.length;n++)a=_[n],o[a]&&C.push(o[a][0]),o[a]=0;for(s in E)Object.prototype.hasOwnProperty.call(E,s)&&(e[s]=E[s]);for(u&&u(t);C.length;)C.shift()();return r.push.apply(r,T||[]),i()}function i(){for(var e,t=0;t32)&&(e.controls={touchPointX:t.x,touchPointY:t.y,touchHasBegan:!1,touchHasMoved:!0,touchHasEnded:!1,touchInsertCube:e.controls.touchInsertCube})}})},t.prototype.update=function(e,t){if(this.logic(e,t),this.boardHolder.update(e,t,this.cubeSelectedHolder.cubeSelected.typeCurrent,this.cubeSelectedHolder.cubeSelected.x,this.cubeSelectedHolder.cubeSelected.y,this.cubeSelectedHolder.cubeSelected.orientation,this.gameState,this.gameStateDelay),this.cubeBoardHolder.update(e,t),this.cubeSelectedHolder.update(e,t),this.cubeQueueHolder.update(e,t),this.tutorialHolder.update(e,t),this.hud.update(e,t),!_.IS_PRODUCTION&&this.controls.touchHasBegan&&this.controls.touchPointY>this.sys.canvas.height-100&&(this.controls.touchPointX<100&&(this.gameState=r.GAME_STATE_RESET),this.controls.touchPointX>this.sys.canvas.width-100)){var i=this.levelConfig.getLevelConfig(this.levelMode,this.levelIndex);i.data.seed=Math.floor(1e3*Math.random()),this.seedDebug.text="Seed: "+i.data.seed,this.gameState=r.GAME_STATE_RESET}},t.prototype.decreaseLevelTime=function(e){var t=e/1e3;this.levelData.time-=t,this.levelData.time<=this.levelData.timeWarning&&(this.levelData.timeWarning=Math.floor(this.levelData.time),this.hud.timeTick(),this.playSound(a.TIME_COUNTDOWN)),this.levelData.time<0&&(this.levelData.time=0)},t.prototype.checkLevelTime=function(){return this.levelData.time<=0},t.prototype.decreaseLevelCubesToGo=function(e){this.levelData.cubesToGo=this.levelData.cubesToGo-e,this.levelData.cubesToGo<0&&(this.levelData.cubesOvershot-=this.levelData.cubesToGo,this.levelData.cubesToGo=0)},t.prototype.checkLevelCubesToGo=function(){return this.levelData.cubesToGo<=0},t.prototype.checkLevelPerfect=function(){for(var e=0;e<_.CONST.GAME_CUBE_BOARD_SIZE_X*_.CONST.GAME_CUBE_BOARD_SIZE_Y*_.CONST.GAME_CUBE_BOARD_SIZE_Z;e++)if(this.cubeBoardHolder.getCubeBoardAtI(e).typeCurrent!=T.CubeType.CUBE_TYPE_EMPTY&&this.cubeBoardHolder.getCubeBoardAtI(e).typeCurrent!=T.CubeType.CUBE_TYPE_IMMOVABLE)return!1;return 0==this.levelData.cubesToGo&&this.levelData.gameMode!=o.GAME_MODE_TUTORIAL},t.prototype.seedMyRand=function(e){this.randomNumber=e%2147483647,this.randomNumber<=0&&(this.randomNumber+=2147483646)},t.prototype.myRand=function(){return this.randomNumber=16807*this.randomNumber%2147483647,Math.floor((this.randomNumber-1)/2147483646*65536)},t.prototype.setGameState=function(e,t){this.gameState=e,this.gameStateDelay=t||0},t.prototype.resetGame=function(){this.controls={touchPointX:0,touchPointY:0,touchHasBegan:!1,touchHasMoved:!1,touchHasEnded:!1,touchInsertCube:!1},this.levelData={name:"",version:0,seed:0,time:0,timeWarning:0,startTime:0,cubesToGo:0,totalCubesToGo:0,cubesOvershot:0,gameMode:o.GAME_MODE_STORY,world:0,level:0,isTimed:!0},this.levelProgress={score:0,totalScore:0,matchScore:0,baseScore:0,perfectBonus:0,extraTimeBonus:0,multipiler:1,stars:0,totalStars:0,chainLevel:0,cubeCount:0,cubeCenter:{x:0,y:0},lastStarCenter:{x:0,y:0},lastBigMatchCubeColor:T.CubeColor.CUBE_COLOR_NONE,previousStarRating:0,previousScore:0,starsInMatch:0,cubesFired:0,chains:0,bigMatchChains:0,cubisChains:0,cubeScore:0,bigMatchScore:0,cubisScore:0},this.gameState=r.GAME_STATE_MENU,this.gameStateDelay=0,this.gameTimerAvailable=!1,this.boardHolder.reset(),this.cubeBoardHolder.reset(),this.cubeSelectedHolder.reset(),this.cubeQueueHolder.reset(),this.tutorialHolder.reset(),this.hud.reset(),this.levelBuildSound=!0},t.prototype.loadLayout=function(e,t){var i=this.levelConfig.getLevelConfig(e,t),s=i.name,r=i.data.version,a=i.data.time,u=i.data.seed,n=i.data.cubestogo;this.levelData.gameMode=e==E.LevelType.LEVEL_TYPE_ARCADE?o.GAME_MODE_STORY:o.GAME_MODE_TUTORIAL,this.levelData.name=s,this.levelData.version=r,this.levelData.seed=u,this.levelData.time=a,this.levelData.startTime=a,this.levelData.cubesToGo=n,this.levelData.totalCubesToGo=n,this.levelData.level=t,this.levelData.world=e==E.LevelType.LEVEL_TYPE_ARCADE?0:_.CONST.TUTORIAL_INDEX,this.seedMyRand(u>0?u:1+Math.floor(65536*Math.random()));for(var C=0;C0?"Seed: "+u:"Seed: random")}var R=0;for(C=0;C1?(this.levelProgress.cubisChains++,this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_FIRST_CUBIS_MATCH,r.GAME_STATE_NONE)):this.levelProgress.cubeCount,this.levelProgress.cubeCount>3&&(this.levelProgress.bigMatchChains++,this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_FIRST_LONG_CHAIN_MATCH,r.GAME_STATE_NONE)),this.levelProgress.baseScore=0,this.levelProgress.matchScore=0,this.levelProgress.cubeCount=0,this.levelProgress.cubeCenter.x=0,this.levelProgress.cubeCenter.y=0,this.levelProgress.starsInMatch=0}},t.prototype.reportMoveEnd=function(){this.levelProgress.chainLevel=0;var e=this.levelProgress.multipiler;this.levelProgress.multipiler=1+this.levelProgress.stars,e!=this.levelProgress.multipiler&&this.levelData.cubesToGo&&this.hud.notify(_.CONST.GAME_NOTIFICATION_MULTIPLIER,this.levelProgress.multipiler)},t.prototype.reportGameEnd=function(e,t){e?(t&&(this.levelProgress.perfectBonus=Math.floor(_.CONST.GAME_SCORE_PERFECT_MULTIPILER*this.levelProgress.score/_.CONST.GAME_SCORE_TRESHOLD)*_.CONST.GAME_SCORE_TRESHOLD),this.levelData.isTimed?this.levelProgress.extraTimeBonus=Math.floor(1*Math.ceil(this.levelData.time)*_.CONST.GAME_SCORE_TIME_MULTIPILER/_.CONST.GAME_SCORE_TRESHOLD)*_.CONST.GAME_SCORE_TRESHOLD:this.levelProgress.extraTimeBonus=0,this.levelProgress.totalScore=this.levelProgress.score+this.levelProgress.perfectBonus+this.levelProgress.extraTimeBonus,this.levelData.gameMode==o.GAME_MODE_STORY&&(this.gameTimerAvailable=!1,this.levelConfig.levelComplete(this.levelMode,this.levelIndex))):(this.levelProgress.score=0,this.levelProgress.perfectBonus=0,this.levelProgress.extraTimeBonus=0,this.levelProgress.totalScore=0)},t.prototype.logic=function(e,t){var i=t/1e3;this.tutorialHolder.GameTutorialTouchHandle(this.controls.touchHasBegan,this.controls.touchHasMoved,this.controls.touchHasEnded,this.controls.touchPointX,this.controls.touchPointY)&&(this.playSound(a.CLICK),this.controls.touchHasBegan=!1,this.controls.touchHasMoved=!1,this.controls.touchHasEnded=!1,this.controls.touchInsertCube=!1);var s=this.tutorialHolder.GameTutorialLogic(t);if(s!=r.GAME_STATE_NONE&&(this.gameState=s,s!=r.GAME_STATE_OUT_OF_CUBES&&s!=r.GAME_STATE_PERFECT||this.GameSummaryShow()),!this.tutorialHolder.GameTutorialIsBlocked())if(this.gameState!=r.GAME_STATE_OUT_OF_TIME&&this.gameState!=r.GAME_STATE_OUT_OF_CUBES&&this.gameState!=r.GAME_STATE_OUT_OF_MOVES&&this.gameState!=r.GAME_STATE_NOTIFICATION&&this.gameState!=r.GAME_STATE_PERFECT&&this.gameState!=r.GAME_STATE_END_TUTORIAL&&0==U.ELPopUp.isActive&&this.gameTimerAvailable&&this.tutorialHolder.GameTutorialControlsCountTime(this.levelData.world)&&this.levelData.isTimed&&this.decreaseLevelTime(t),this.gameStateDelay>0)this.gameStateDelay-=i;else if(this.gameState==r.GAME_STATE_CUBE_BOARD_BUILD_ANIMATION){this.hud.isShown=!0,this.cubeQueueHolder.isShown=!0;var E=!0;this.cubeBoardHolder.cubeBoardBuildLogic(t);for(var u=0;u<_.CONST.GAME_CUBE_BOARD_SIZE_X*_.CONST.GAME_CUBE_BOARD_SIZE_Y*_.CONST.GAME_CUBE_BOARD_SIZE_Z;u++)if(this.cubeBoardHolder.getCubeBoardAtI(u).state!=T.CubeState.CUBE_STATE_IDLE){E=!1;break}E&&(this.gameState=r.GAME_STATE_CUBE_BOARD_SHAKE_ANIMATION,this.gameStateDelay=0,this.playSound(a.LEVEL_BUILD_STOP)),this.levelBuildSound&&(this.levelBuildSound=!1,this.playSound(a.LEVEL_BUILD_START))}else if(this.gameState==r.GAME_STATE_CUBE_BOARD_SHAKE_ANIMATION)this.gameState=r.GAME_STATE_LEVEL_TARGET,this.gameStateDelay=0,this.levelData.gameMode!=o.GAME_MODE_TUTORIAL&&this.tutorialHolder.GameTutorialGeneralEvent(_.CONST.GAME_TUTORIAL_EVENT_MESSAGE_BOTTOM,!1,"Match "+this.levelData.cubesToGo.toString()+" Cubes in "+this.hud.getTimeStringFromInt(Math.ceil(this.levelData.time))+" !",r.GAME_STATE_NONE);else if(this.gameState==r.GAME_STATE_LEVEL_TARGET)this.tutorialHolder.GameTutorialIsActive()||(this.gameState=r.GAME_STATE_HUD_ANIMATION,this.gameStateDelay=0);else if(this.gameState==r.GAME_STATE_HUD_ANIMATION)this.levelData.gameMode==o.GAME_MODE_TUTORIAL&&this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_LEVEL_START),this.gameState=r.GAME_STATE_LEVEL_START_TUTORIAL,this.gameStateDelay=0;else if(this.gameState==r.GAME_STATE_LEVEL_START_TUTORIAL)this.tutorialHolder.GameTutorialIsActive()||(this.gameState=r.GAME_STATE_GO_WAIT_ANIMATION,this.gameStateDelay=0);else if(this.gameState==r.GAME_STATE_GO_WAIT_ANIMATION)this.gameState=r.GAME_STATE_CUBE_BOARD_FIRST_CUBE_PREPARE,this.gameStateDelay=0;else if(this.gameState==r.GAME_STATE_CUBE_BOARD_FIRST_CUBE_PREPARE||this.gameState==r.GAME_STATE_CUBE_BOARD_NEXT_CUBE_PREPARE)if(this.checkLevelPerfect())this.gameState=r.GAME_STATE_END_TUTORIAL,this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_FIRST_LEVEL_PERFECT,r.GAME_STATE_PERFECT),this.gameStateDelay=0,this.cubeBoardHolder.prepareCubeBoardPerfect(),this.reportGameEnd(!0,!0),this.controls.touchHasBegan=!1,this.controls.touchHasMoved=!1,this.controls.touchHasEnded=!1;else if(this.checkLevelCubesToGo())this.gameState=r.GAME_STATE_END_TUTORIAL,this.cubeBoardHolder.prepareCubeBoardClean(),this.reportGameEnd(!0,!1),this.levelData.gameMode==o.GAME_MODE_TUTORIAL?this.tutorialHolder.GameTutorialGeneralEvent(_.CONST.GAME_TUTORIAL_EVENT_FIRST_LEVEL_COMPLETE,!1,"",r.GAME_STATE_OUT_OF_CUBES):(this.gameState=r.GAME_STATE_OUT_OF_CUBES,this.GameSummaryShow()),this.gameStateDelay=0,this.controls.touchHasBegan=!1,this.controls.touchHasMoved=!1,this.controls.touchHasEnded=!1;else{if(this.cubeQueueHolder.cubeQueueFixedForcedAvailable){for(u=0;u<_.CONST.GAME_CUBE_QUEUE_COLOR_NUM;u++)this.cubeQueueHolder.cubeQueueFixedForcedColor[u]=T.CubeColor.CUBE_COLOR_NONE;var n=0;for(u=0;u<_.CONST.GAME_CUBE_BOARD_SIZE_X*_.CONST.GAME_CUBE_BOARD_SIZE_Y*_.CONST.GAME_CUBE_BOARD_SIZE_Z;u++)this.cubeBoardHolder.getCubeBoardAtI(u).typeCurrent!=T.CubeType.CUBE_TYPE_NORMAL&&this.cubeBoardHolder.getCubeBoardAtI(u).typeCurrent!=T.CubeType.CUBE_TYPE_STAR&&this.cubeBoardHolder.getCubeBoardAtI(u).typeCurrent!=T.CubeType.CUBE_TYPE_FRACTURED&&this.cubeBoardHolder.getCubeBoardAtI(u).typeCurrent!=T.CubeType.CUBE_TYPE_DUAL&&this.cubeBoardHolder.getCubeBoardAtI(u).typeCurrent!=T.CubeType.CUBE_TYPE_FRACTURED_DUAL||(n++,this.cubeBoardHolder.getCubeBoardAtI(u).color0!=T.CubeColor.CUBE_COLOR_NONE&&(this.cubeQueueHolder.cubeQueueFixedForcedColor[this.cubeBoardHolder.getCubeBoardAtI(u).color0]=this.cubeBoardHolder.getCubeBoardAtI(u).color0,this.cubeQueueHolder.cubeQueueFixedForcedColorLast=this.cubeBoardHolder.getCubeBoardAtI(u).color0),this.cubeBoardHolder.getCubeBoardAtI(u).typeCurrent!=T.CubeType.CUBE_TYPE_DUAL&&this.cubeBoardHolder.getCubeBoardAtI(u).typeCurrent!=T.CubeType.CUBE_TYPE_FRACTURED_DUAL||this.cubeBoardHolder.getCubeBoardAtI(u).color1!=T.CubeColor.CUBE_COLOR_NONE&&(this.cubeQueueHolder.cubeQueueFixedForcedColor[this.cubeBoardHolder.getCubeBoardAtI(u).color1]=this.cubeBoardHolder.getCubeBoardAtI(u).color1,this.cubeQueueHolder.cubeQueueFixedForcedColorLast=this.cubeBoardHolder.getCubeBoardAtI(u).color1));if(0==_.CONST.GAME_CUBE_QUEUE_FORCED_COLOR_TYPE?n<=_.CONST.GAME_CUBE_QUEUE_FORCED_COLOR_TRESHOLD_BOARD&&(this.cubeQueueHolder.cubeQueueFixedForcedActive=!0):1==_.CONST.GAME_CUBE_QUEUE_FORCED_COLOR_TYPE?this.levelData.cubesToGo<=_.CONST.GAME_CUBE_QUEUE_FORCED_COLOR_TRESHOLD_CTG&&(this.cubeQueueHolder.cubeQueueFixedForcedActive=!0):2==_.CONST.GAME_CUBE_QUEUE_FORCED_COLOR_TYPE&&n<=_.CONST.GAME_CUBE_QUEUE_FORCED_COLOR_TRESHOLD_BOARD&&this.levelData.cubesToGo<=_.CONST.GAME_CUBE_QUEUE_FORCED_COLOR_TRESHOLD_CTG&&(this.cubeQueueHolder.cubeQueueFixedForcedActive=!0),this.cubeQueueHolder.cubeQueueFixedForcedActive&&0==n&&(this.cubeQueueHolder.cubeQueueFixedForcedColorLast!=T.CubeColor.CUBE_COLOR_NONE?this.cubeQueueHolder.cubeQueueFixedForcedColor[this.cubeQueueHolder.cubeQueueFixedForcedColorLast]=this.cubeQueueHolder.cubeQueueFixedForcedColorLast:this.cubeQueueHolder.cubeQueueFixedForcedColor[T.CubeColor.CUBE_COLOR_YELLOW]=T.CubeColor.CUBE_COLOR_YELLOW),this.cubeQueueHolder.cubeQueueFixedForcedActive){for(var h=0,S=-1,O=0;O<_.CONST.GAME_CUBE_QUEUE_COLOR_NUM;O++)this.cubeQueueHolder.cubeQueueFixedForcedColor[O]!=T.CubeColor.CUBE_COLOR_NONE&&(h++,S=O);for(u=0;u<_.CONST.GAME_CUBE_QUEUE_FIXED_SIZE;u++){var A=(this.cubeQueueHolder.cubeQueueFixedIndex+u)%_.CONST.GAME_CUBE_QUEUE_FIXED_SIZE;if(this.cubeQueueHolder.cubeQueueFixed[A].typeCurrent==T.CubeType.CUBE_TYPE_NORMAL||this.cubeQueueHolder.cubeQueueFixed[A].typeCurrent==T.CubeType.CUBE_TYPE_WEDGE||this.cubeQueueHolder.cubeQueueFixed[A].typeCurrent==T.CubeType.CUBE_TYPE_OSMOSIS){if(this.cubeQueueHolder.cubeQueueFixedForcedColor[this.cubeQueueHolder.cubeQueueFixed[A].color0]==T.CubeColor.CUBE_COLOR_NONE){var b=this.myRand()%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM;for(O=0;O<_.CONST.GAME_CUBE_QUEUE_COLOR_NUM;O++)if(this.cubeQueueHolder.cubeQueueFixedForcedColor[(O+b)%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM]!=T.CubeColor.CUBE_COLOR_NONE){this.cubeQueueHolder.cubeQueueFixed[A].color0=this.cubeQueueHolder.cubeQueueFixedForcedColor[(O+b)%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM];break}}}else if(this.cubeQueueHolder.cubeQueueFixed[A].typeCurrent==T.CubeType.CUBE_TYPE_DUAL)if(1==h)this.cubeQueueHolder.cubeQueueFixed[A].typeCurrent=T.CubeType.CUBE_TYPE_NORMAL,this.cubeQueueHolder.cubeQueueFixed[A].color0=this.cubeQueueHolder.cubeQueueFixedForcedColor[S],this.cubeQueueHolder.cubeQueueFixed[A].color1=T.CubeColor.CUBE_COLOR_NONE;else{if(this.cubeQueueHolder.cubeQueueFixedForcedColor[this.cubeQueueHolder.cubeQueueFixed[A].color0]==T.CubeColor.CUBE_COLOR_NONE)for(b=this.myRand()%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM,O=0;O<_.CONST.GAME_CUBE_QUEUE_COLOR_NUM;O++)if(this.cubeQueueHolder.cubeQueueFixedForcedColor[(O+b)%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM]!=T.CubeColor.CUBE_COLOR_NONE&&this.cubeQueueHolder.cubeQueueFixedForcedColor[(O+b)%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM]!=this.cubeQueueHolder.cubeQueueFixed[A].color1){this.cubeQueueHolder.cubeQueueFixed[A].color0=this.cubeQueueHolder.cubeQueueFixedForcedColor[(O+b)%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM];break}if(this.cubeQueueHolder.cubeQueueFixedForcedColor[this.cubeQueueHolder.cubeQueueFixed[A].color1]==T.CubeColor.CUBE_COLOR_NONE)for(b=this.myRand()%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM,O=0;O<_.CONST.GAME_CUBE_QUEUE_COLOR_NUM;O++)if(this.cubeQueueHolder.cubeQueueFixedForcedColor[(O+b)%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM]!=T.CubeColor.CUBE_COLOR_NONE&&this.cubeQueueHolder.cubeQueueFixedForcedColor[(O+b)%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM]!=this.cubeQueueHolder.cubeQueueFixed[A].color0){this.cubeQueueHolder.cubeQueueFixed[A].color1=this.cubeQueueHolder.cubeQueueFixedForcedColor[(O+b)%_.CONST.GAME_CUBE_QUEUE_COLOR_NUM];break}}}}}this.cubeSelectedHolder.cubeSelected.typeCurrent=this.cubeQueueHolder.cubeQueueFixed[this.cubeQueueHolder.cubeQueueFixedIndex].typeCurrent,this.cubeSelectedHolder.cubeSelected.color0=this.cubeQueueHolder.cubeQueueFixed[this.cubeQueueHolder.cubeQueueFixedIndex].color0,this.cubeSelectedHolder.cubeSelected.color1=this.cubeQueueHolder.cubeQueueFixed[this.cubeQueueHolder.cubeQueueFixedIndex].color1,this.cubeQueueHolder.cubeQueueFixedCube(this.cubeQueueHolder.cubeQueueFixedIndex),this.cubeQueueHolder.cubeQueueFixedIndex=this.cubeQueueHolder.cubeQueueFixedIndex<_.CONST.GAME_CUBE_QUEUE_FIXED_SIZE-1?this.cubeQueueHolder.cubeQueueFixedIndex+1:0,this.gameState==r.GAME_STATE_CUBE_BOARD_FIRST_CUBE_PREPARE?(this.gameState=r.GAME_STATE_CUBE_BOARD_FIRST_CUBE_ANIMATION,this.gameStateDelay=0):(this.gameState=r.GAME_STATE_CUBE_BOARD_NEXT_CUBE_ANIMATION,this.gameStateDelay=0),this.cubeSelectedHolder.cubeSelectedCirclePhase=this.cubeSelectedHolder.cubeSelected.y>=_.CONST.GAME_CUBE_BOARD_SIZE_Y?c.CubeSelectedCirclePhase.CUBE_SELECTED_CIRCLE_PHASE_2:c.CubeSelectedCirclePhase.CUBE_SELECTED_CIRCLE_PHASE_0,this.cubeSelectedHolder.cubeSelectedCircleAngle=0,this.cubeSelectedHolder.cubeSelectedCirclePosX=_.GAME_HUD_QUEUE_X(this),this.cubeSelectedHolder.cubeSelectedCirclePosY=_.GAME_HUD_QUEUE_Y(this),this.cubeSelectedHolder.cubeSelectedCircleLastX=_.GAME_HUD_QUEUE_X(this),this.cubeSelectedHolder.cubeSelectedCircleLastY=_.GAME_HUD_QUEUE_Y(this),this.cubeQueueHolder.cubeQueueOffset=_.CONST.GAME_HUD_QUEUE_OFFSET_X}else if(this.gameState==r.GAME_STATE_CUBE_BOARD_FIRST_CUBE_ANIMATION)this.tutorialHolder.GameTutorialControlsCanMove()&&(_.IS_TOUCH||(this.cubeSelectedHolder.setCubeSelectedPosition(this.controls.touchPointX,this.controls.touchPointY),this.cubeSelectedHolder.trackCubeSelectedPosition())),this.cubeSelectedHolder.cubeSelectedCirclePosX==this.cubeSelectedHolder.cubeSelectedCircleTargetX&&this.cubeSelectedHolder.cubeSelectedCirclePosY==this.cubeSelectedHolder.cubeSelectedCircleTargetY&&(this.gameState=r.GAME_STATE_CUBE_BOARD_PLAYER_ACTION,this.gameStateDelay=0,this.tutorialHolder.GameTutorialControlsAction(this.levelData.world,this.levelData.level,l.eGameTutorialEvent.GAME_TUTORIAL_CONTROLS_ACTION_TUTORIAL_START,-1,-1,this.levelData.cubesToGo),this.gameTimerAvailable=!0);else if(this.gameState==r.GAME_STATE_CUBE_BOARD_NEXT_CUBE_ANIMATION)this.tutorialHolder.GameTutorialControlsCanMove()&&(_.IS_TOUCH||this.cubeSelectedHolder.setCubeSelectedPosition(this.controls.touchPointX,this.controls.touchPointY),(this.controls.touchHasBegan||this.controls.touchHasMoved)&&this.cubeSelectedHolder.setCubeSelectedPosition(this.controls.touchPointX,this.controls.touchPointY)),this.cubeSelectedHolder.cubeSelectedCirclePosX==this.cubeSelectedHolder.cubeSelectedCircleTargetX&&this.cubeSelectedHolder.cubeSelectedCirclePosY==this.cubeSelectedHolder.cubeSelectedCircleTargetY&&(this.tutorialHolder.GameTutorialControlsAction(this.levelData.world,this.levelData.level,l.eGameTutorialEvent.GAME_TUTORIAL_CONTROLS_ACTION_NEW_CUBE,-1,-1,this.levelData.cubesToGo),this.checkCubeBoardInsertion()?(this.gameState=r.GAME_STATE_CUBE_BOARD_PLAYER_ACTION,this.gameStateDelay=0):(this.gameState=r.GAME_STATE_END_TUTORIAL,this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_FIRST_NO_MORE_MOVES,r.GAME_STATE_OUT_OF_MOVES),this.gameStateDelay=0,this.reportGameEnd(!1,!1),this.controls.touchHasBegan=!1,this.controls.touchHasMoved=!1,this.controls.touchHasEnded=!1)),this.cubeSelectedHolder.trackCubeSelectedPosition();else if(this.gameState==r.GAME_STATE_CUBE_BOARD_PLAYER_ACTION){if(this.tutorialHolder.GameTutorialControlsCanMove()&&(_.IS_TOUCH||this.cubeSelectedHolder.setCubeSelectedPosition(this.controls.touchPointX,this.controls.touchPointY)),this.checkLevelTime())this.gameState=r.GAME_STATE_END_TUTORIAL,this.gameStateDelay=0,this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_FIRST_TIME_OUT,r.GAME_STATE_OUT_OF_TIME),this.reportGameEnd(!1,!1),this.controls.touchHasBegan=!1,this.controls.touchHasMoved=!1,this.controls.touchHasEnded=!1;else if(this.controls.touchHasMoved)this.tutorialHolder.GameTutorialControlsCanMove()&&this.cubeSelectedHolder.setCubeSelectedPosition(this.controls.touchPointX,this.controls.touchPointY),_.IS_TOUCH||this.tutorialHolder.GameTutorialControlsAction(this.levelData.world,this.levelData.level,l.eGameTutorialEvent.GAME_TUTORIAL_CONTROLS_ACTION_CUBE_MOVE,this.cubeSelectedHolder.cubeSelected.x,this.cubeSelectedHolder.cubeSelected.y,this.levelData.cubesToGo);else if(this.controls.touchHasEnded){if(this.cubeSelectedHolder.cubeSelected.x==_.CONST.GAME_CUBE_BOARD_SIZE_X&&this.cubeSelectedHolder.cubeSelected.y==_.CONST.GAME_CUBE_BOARD_SIZE_Y&&(this.cubeSelectedHolder.cubeSelected.orientation=this.cubeSelectedHolder.cubeSelectedDesiredOrientation,this.cubeSelectedHolder.cubeSelectedDesiredOrientation==T.CubeOrientation.CUBE_ORIENTATION_RIGHT?this.cubeSelectedHolder.cubeSelected.x=_.CONST.GAME_CUBE_BOARD_SIZE_X-1:this.cubeSelectedHolder.cubeSelected.y=_.CONST.GAME_CUBE_BOARD_SIZE_Y-1),this.cubeSelectedHolder.cubeSelectedDesiredOrientation=this.cubeSelectedHolder.cubeSelected.orientation,this.cubeSelectedHolder.cubeSelectedDesiredTargetX=this.cubeSelectedHolder.cubeSelected.x,this.cubeSelectedHolder.cubeSelectedDesiredTargetY=this.cubeSelectedHolder.cubeSelected.y,_.IS_TOUCH&&this.tutorialHolder.GameTutorialControlsAction(this.levelData.world,this.levelData.level,l.eGameTutorialEvent.GAME_TUTORIAL_CONTROLS_ACTION_CUBE_MOVE,this.cubeSelectedHolder.cubeSelected.x,this.cubeSelectedHolder.cubeSelected.y,this.levelData.cubesToGo),this.controls.touchInsertCube){var d=!1,B=!1;this.cubeSelectedHolder.cubeSelected.typeCurrent==T.CubeType.CUBE_TYPE_LASER?B=!0:this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_RIGHT?d=this.cubeBoardHolder.checkInsertCubeBoard(this.cubeSelectedHolder.cubeSelectedDesiredTargetX,this.cubeSelectedHolder.cubeSelectedDesiredTargetY-1,this.cubeSelectedHolder.cubeSelected.typeCurrent,this.cubeSelectedHolder.cubeSelected.color0,this.cubeSelectedHolder.cubeSelected.color1,this.cubeSelectedHolder.cubeSelectedDesiredOrientation):this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_LEFT&&(d=this.cubeBoardHolder.checkInsertCubeBoard(this.cubeSelectedHolder.cubeSelectedDesiredTargetX-1,this.cubeSelectedHolder.cubeSelectedDesiredTargetY,this.cubeSelectedHolder.cubeSelected.typeCurrent,this.cubeSelectedHolder.cubeSelected.color0,this.cubeSelectedHolder.cubeSelected.color1,this.cubeSelectedHolder.cubeSelectedDesiredOrientation)),d?(this.levelProgress.cubesFired++,this.tutorialHolder.GameTutorialControlsAction(this.levelData.world,this.levelData.level,l.eGameTutorialEvent.GAME_TUTORIAL_CONTROLS_ACTION_TAP,-1,-1,this.levelData.cubesToGo),this.gameState=r.GAME_STATE_CUBE_BOARD_INSERT_CUBE,this.gameStateDelay=0):B?(this.levelProgress.cubesFired++,this.gameState=r.GAME_STATE_CUBE_BOARD_INSERT_LASER,this.gameStateDelay=0):(this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_FIRST_CANT_INSERT_CUBE,r.GAME_STATE_NONE),this.cubeSelectedHolder.cubeSelected.typeCurrent!=T.CubeType.CUBE_TYPE_NORMAL&&this.cubeSelectedHolder.cubeSelected.typeCurrent!=T.CubeType.CUBE_TYPE_DUAL||this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_NO_CUBE_PUSH_AT_EDGE,r.GAME_STATE_NONE),this.cubeSelectedHolder.cubeSelected.typeCurrent==T.CubeType.CUBE_TYPE_WEDGE&&(this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_RIGHT?this.cubeBoardHolder.getCubeBoardType(this.cubeSelectedHolder.cubeSelectedDesiredTargetX,this.cubeSelectedHolder.cubeSelectedDesiredTargetY-1,0)==T.CubeType.CUBE_TYPE_IMMOVABLE?this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_NO_CUBE_PUSH_AT_EDGE,r.GAME_STATE_NONE):this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_WEDGE_NO_LIFT_AT_EDGE,r.GAME_STATE_NONE):this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_LEFT&&(this.cubeBoardHolder.getCubeBoardType(this.cubeSelectedHolder.cubeSelectedDesiredTargetX-1,this.cubeSelectedHolder.cubeSelectedDesiredTargetY,0)==T.CubeType.CUBE_TYPE_IMMOVABLE||this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_WEDGE_NO_LIFT_AT_EDGE,r.GAME_STATE_NONE))),this.cubeSelectedHolder.cubeSelected.typeCurrent==T.CubeType.CUBE_TYPE_OSMOSIS&&(this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_RIGHT?this.cubeBoardHolder.getCubeBoardType(this.cubeSelectedHolder.cubeSelectedDesiredTargetX,this.cubeSelectedHolder.cubeSelectedDesiredTargetY-1,0)==T.CubeType.CUBE_TYPE_IMMOVABLE?this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_NO_CUBE_PUSH_AT_EDGE,r.GAME_STATE_NONE):this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_OSMOSIS_NO_LIFT_AT_EDGE,r.GAME_STATE_NONE):this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_LEFT&&(this.cubeBoardHolder.getCubeBoardType(this.cubeSelectedHolder.cubeSelectedDesiredTargetX-1,this.cubeSelectedHolder.cubeSelectedDesiredTargetY,0)==T.CubeType.CUBE_TYPE_IMMOVABLE?this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_NO_CUBE_PUSH_AT_EDGE,r.GAME_STATE_NONE):this.tutorialHolder.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_OSMOSIS_NO_LIFT_AT_EDGE,r.GAME_STATE_NONE))))}this.controls.touchHasEnded=!1,this.controls.touchInsertCube=!1}this.cubeSelectedHolder.trackCubeSelectedPosition()||(this.controls.touchInsertCube=!1)}else this.gameState==r.GAME_STATE_CUBE_BOARD_INSERT_CUBE?this.cubeSelectedHolder.trackCubeSelectedPosition()&&(this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_RIGHT?this.cubeBoardHolder.performInsertCubeBoard(this.cubeSelectedHolder.cubeSelected.x,this.cubeSelectedHolder.cubeSelected.y-1,this.cubeSelectedHolder.cubeSelected.typeCurrent,this.cubeSelectedHolder.cubeSelected.color0,this.cubeSelectedHolder.cubeSelected.color1,this.cubeSelectedHolder.cubeSelected.orientation):this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_LEFT&&this.cubeBoardHolder.performInsertCubeBoard(this.cubeSelectedHolder.cubeSelected.x-1,this.cubeSelectedHolder.cubeSelected.y,this.cubeSelectedHolder.cubeSelected.typeCurrent,this.cubeSelectedHolder.cubeSelected.color0,this.cubeSelectedHolder.cubeSelected.color1,this.cubeSelectedHolder.cubeSelected.orientation),this.cubeSelectedHolder.cubeSelected.typeCurrent==T.CubeType.CUBE_TYPE_BOMB?this.playSound(a.BOMB_SHOOT):this.playSound(a.CUBE_SHOOT),this.gameState=r.GAME_STATE_CUBE_BOARD_CHECK_ACTION,this.gameStateDelay=0):this.gameState==r.GAME_STATE_CUBE_BOARD_INSERT_LASER?this.cubeSelectedHolder.trackCubeSelectedPosition()&&(this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_RIGHT?this.cubeBoardHolder.performInsertCubeBoard(this.cubeSelectedHolder.cubeSelected.x,this.cubeSelectedHolder.cubeSelected.y-1,T.CubeType.CUBE_TYPE_LASER,this.cubeSelectedHolder.cubeSelected.color0,this.cubeSelectedHolder.cubeSelected.color1,this.cubeSelectedHolder.cubeSelected.orientation):this.cubeSelectedHolder.cubeSelected.orientation==T.CubeOrientation.CUBE_ORIENTATION_LEFT&&this.cubeBoardHolder.performInsertCubeBoard(this.cubeSelectedHolder.cubeSelected.x-1,this.cubeSelectedHolder.cubeSelected.y,T.CubeType.CUBE_TYPE_LASER,this.cubeSelectedHolder.cubeSelected.color0,this.cubeSelectedHolder.cubeSelected.color1,this.cubeSelectedHolder.cubeSelected.orientation),this.cubeBoardHolder.setCubeAnimation(this.cubeSelectedHolder.cubeSelected.x,this.cubeSelectedHolder.cubeSelected.y,0,C.CubeAnimationLayer.CUBE,C.CubeAnimationType.LASER_DISAPPEAR,T.CubeColor.CUBE_COLOR_NONE,T.CubeOrientation.CUBE_ORIENTATION_NONE,.64,.2,!1,0),this.playSound(a.LASER_SHOOT),this.gameState=r.GAME_STATE_CUBE_BOARD_CHECK_ACTION,this.gameStateDelay=.64):this.gameState==r.GAME_STATE_CUBE_BOARD_CHECK_ACTION?(this.cubeSelectedHolder.cubeSelected.typeCurrent=T.CubeType.CUBE_TYPE_NONE,this.cubeBoardHolder.cubeBoardMainLogic(t)):this.gameState==r.GAME_STATE_OUT_OF_TIME?(this.gameTimerAvailable=!1,this.hud.setMessage("OUT OF TIME"),_.IS_ICONSOLE?this.setGameState(r.GAME_STATE_AD_AFTER_LOST,3):this.setGameState(this.isGameClassic?r.GAME_STATE_EXIT_TO_MENU:r.GAME_STATE_RESET,3)):this.gameState==r.GAME_STATE_OUT_OF_CUBES?this.cubeBoardHolder.cubeBoardCleanLogic(t):this.gameState==r.GAME_STATE_OUT_OF_MOVES?(this.gameTimerAvailable=!1,this.hud.setMessage("OUT OF MOVES"),_.IS_ICONSOLE?this.setGameState(r.GAME_STATE_AD_AFTER_LOST,3):this.setGameState(this.isGameClassic?r.GAME_STATE_EXIT_TO_MENU:r.GAME_STATE_RESET,3)):this.gameState==r.GAME_STATE_PERFECT?this.cubeBoardHolder.cubeBoardPerfectLogic():this.gameState==r.GAME_STATE_NOTIFICATION||(this.gameState==r.GAME_STATE_END_TUTORIAL?this.tutorialHolder.stateAfterTutorial==r.GAME_STATE_OUT_OF_CUBES?this.cubeBoardHolder.cubeBoardCleanLogic(t):this.tutorialHolder.stateAfterTutorial==r.GAME_STATE_PERFECT&&this.cubeBoardHolder.cubeBoardPerfectLogic():this.gameState==r.GAME_STATE_RESET?(this.resetGame(),this.loadLayout(this.levelMode,this.levelIndex),this.prepareLayout(),this.menuButton.showButton()):this.gameState==r.GAME_STATE_MENU||(this.gameState==r.GAME_STATE_EXIT_TO_MENU?(this.hud.isShown=!1,this.cubeQueueHolder.isShown=!1,this.menuButton.hideButton(),this.resetGame(),this.mainMenu.showPopUp(),this.gameState=r.GAME_STATE_MENU,this.gameStateDelay=0):this.gameState==r.GAME_STATE_AD_AFTER_LOST&&this.adsShow(this.isGameClassic?r.GAME_STATE_EXIT_TO_MENU:r.GAME_STATE_RESET)))},t.prototype.GameSummaryShow=function(){this.cubeQueueHolder.isShown=!1;var e={totalCubes:this.levelData.totalCubesToGo+this.levelData.cubesOvershot,starCubes:this.levelProgress.stars,totalChains:this.levelProgress.chains,bigMatchChains:this.levelProgress.bigMatchChains,cubisChains:this.levelProgress.cubisChains,timeLeft:Math.ceil(this.levelData.time),cubeScore:this.levelProgress.cubeScore,bigMatchBonus:this.levelProgress.bigMatchScore,cubisBonus:this.levelProgress.cubisScore,timeBonus:this.levelProgress.extraTimeBonus,perfectBonus:this.levelProgress.perfectBonus,totalScore:this.levelProgress.totalScore,name:this.levelData.name};this.statsOfGame.showStatsPopUp(e,null,1500)},t.prototype.playSound=function(e){e>=0&&e0||u=0;l--)if(this.mainScene.cubeBoardHolder.getCubeBoardType(this.mainScene.cubeSelectedHolder.cubeSelected.x,l,0)!=r.CubeType.CUBE_TYPE_NONE&&this.mainScene.cubeBoardHolder.getCubeBoardType(this.mainScene.cubeSelectedHolder.cubeSelected.x,l,0)!=r.CubeType.CUBE_TYPE_EMPTY&&(this.mainScene.cubeSelectedHolder.cubeSelected.typeCurrent!=r.CubeType.CUBE_TYPE_NORMAL&&this.mainScene.cubeSelectedHolder.cubeSelected.typeCurrent!=r.CubeType.CUBE_TYPE_DUAL||this.mainScene.cubeBoardHolder.getCubeBoardType(this.mainScene.cubeSelectedHolder.cubeSelected.x,l,0)!=r.CubeType.CUBE_TYPE_FRACTURED&&this.mainScene.cubeBoardHolder.getCubeBoardType(this.mainScene.cubeSelectedHolder.cubeSelected.x,l,0)!=r.CubeType.CUBE_TYPE_FRACTURED_DUAL)){h=s.GetCubeBoardPosX(this.mainScene,this.mainScene.cubeSelectedHolder.cubeSelected.x+1,l,0);break}h-=C,this.spriteRowGuide.setCrop(0,0,h,286)}else{h=C-351;for(var S=s.CONST.GAME_CUBE_BOARD_SIZE_X-1;S>=0;S--)if(this.mainScene.cubeBoardHolder.getCubeBoardType(S,this.mainScene.cubeSelectedHolder.cubeSelected.y,0)!=r.CubeType.CUBE_TYPE_NONE&&this.mainScene.cubeBoardHolder.getCubeBoardType(S,this.mainScene.cubeSelectedHolder.cubeSelected.y,0)!=r.CubeType.CUBE_TYPE_EMPTY&&(this.mainScene.cubeSelectedHolder.cubeSelected.typeCurrent!=r.CubeType.CUBE_TYPE_NORMAL&&this.mainScene.cubeSelectedHolder.cubeSelected.typeCurrent!=r.CubeType.CUBE_TYPE_DUAL||this.mainScene.cubeBoardHolder.getCubeBoardType(S,this.mainScene.cubeSelectedHolder.cubeSelected.y,0)!=r.CubeType.CUBE_TYPE_FRACTURED&&this.mainScene.cubeBoardHolder.getCubeBoardType(S,this.mainScene.cubeSelectedHolder.cubeSelected.y,0)!=r.CubeType.CUBE_TYPE_FRACTURED_DUAL)){h=s.GetCubeBoardPosX(this.mainScene,S,this.mainScene.cubeSelectedHolder.cubeSelected.y+1,0);break}h=C-h,this.spriteRowGuide.setCrop(351-h,0,h,286)}this.spriteRowGuide.flipX=T!=r.CubeOrientation.CUBE_ORIENTATION_RIGHT,this.spriteRowGuide.setPosition(C+(T==r.CubeOrientation.CUBE_ORIENTATION_RIGHT?s.CONST.GAME_BOARD_ROW_GUIDE_START_X:351-s.CONST.GAME_BOARD_ROW_GUIDE_START_X-h),c+s.CONST.GAME_BOARD_ROW_GUIDE_START_Y),this.spriteRowGuide.setVisible(!0)}this.mainScene.tutorialHolder.tutorialControlsState==a.eGameTutorialControlsState.GAME_TUTORIAL_CONTROLS_STATE_DRAG1||this.mainScene.tutorialHolder.tutorialControlsState==a.eGameTutorialControlsState.GAME_TUTORIAL_CONTROLS_STATE_TAP1||this.mainScene.tutorialHolder.tutorialControlsState==a.eGameTutorialControlsState.GAME_TUTORIAL_CONTROLS_STATE_SECOND_DRAG1||this.mainScene.tutorialHolder.tutorialControlsState==a.eGameTutorialControlsState.GAME_TUTORIAL_CONTROLS_STATE_SECOND_TAP1||this.mainScene.tutorialHolder.tutorialControlsState==a.eGameTutorialControlsState.GAME_TUTORIAL_CONTROLS_STATE_DRAG2||this.mainScene.tutorialHolder.tutorialControlsState==a.eGameTutorialControlsState.GAME_TUTORIAL_CONTROLS_STATE_TAP2?(this.spriteTutorialMarker0.setVisible(!0),this.spriteTutorialMarker0.setPosition(s.GetCubeBoardPosX(this.mainScene,this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelected.y,0),s.GetCubeBoardPosY(this.mainScene,this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelected.y,0)+6),this.spriteTutorialMarker0.scaleY=.7,this.spriteTutorialMarker1.setVisible(!0),this.spriteTutorialMarker1.setPosition(s.GetCubeBoardPosX(this.mainScene,this.mainScene.tutorialHolder.tutorialControlsDragPoint[this.mainScene.tutorialHolder.pointIndex].x,this.mainScene.tutorialHolder.tutorialControlsDragPoint[this.mainScene.tutorialHolder.pointIndex].y,0),s.GetCubeBoardPosY(this.mainScene,this.mainScene.tutorialHolder.tutorialControlsDragPoint[this.mainScene.tutorialHolder.pointIndex].x,this.mainScene.tutorialHolder.tutorialControlsDragPoint[this.mainScene.tutorialHolder.pointIndex].y,0)+6),this.spriteTutorialMarker1.scaleY=.7):(this.spriteTutorialMarker0.visible&&this.spriteTutorialMarker0.setVisible(!1),this.spriteTutorialMarker1.visible&&this.spriteTutorialMarker1.setVisible(!1))},e.prototype.reset=function(){},e}();t.BoardHolder=T},1467:function(e,t,i){"use strict";var s=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=i(263),r=function(e){function t(t){return e.call(this,t)||this}return s(t,e),t.prototype.init=function(e){this.shell1=new Phaser.GameObjects.Sprite(this.scene,0,0,"board","back/Shell-bottom"),this.shell2=new Phaser.GameObjects.Sprite(this.scene,80,0,"board","back/Shell-top"),this.shell2.setOrigin(.88,.86),this.add(this.shell1),this.add(this.shell2),this.setPosition(this.scene.sys.canvas.width/2+e.x,this.scene.sys.canvas.height/2+e.y),this.particle=new o.ParticleEmiter(this.scene,"bubbleB"),this.particle.sourcePosition=this.particle.vector2fMake(this.scene.sys.canvas.width/2+e.x,this.scene.sys.canvas.height/2+e.y),this.tween1()},t.prototype.tween1=function(){var e=this;this.scene.tweens.add({targets:this.shell2,angle:10,ease:"Back.InOut",delay:2e3+4e3*Math.random(),duration:6500,onComplete:function(){e.tween2()}})},t.prototype.tween2=function(){var e=this;this.particle.stopParticleEmitter(),this.particle.startParticleEmiter();this.scene.tweens.add({targets:this.shell2,angle:-20,ease:"Back.InOut",delay:2e3+4e3*Math.random(),duration:8500,onComplete:function(){e.tween1()}})},t.prototype.preUpdate=function(e,t){this.particle.update(e,t)},t}(Phaser.GameObjects.Container);t.Shell=r},1468:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s,o=i(24),r=i(263),a=i(121),_=i(160),E=i(36),T=i(1469),u=i(540),n=i(1470),C=[0,-1,-1,-1,0,1,1,1,0,0,1,0,-1,-1,-1,0,1,1,0,1,0,-1,-1,-1,0,1,1,0,1,1,1,0,-1,-1,-1,0],c=[0,0,0,0,0,0,0,0,-1,-1,0,0,1,0,1,0,-1,0,0,0,0,0,0,0,-1,0,-1,0,-1,-1,0,0,0,0,0,0,-1,0,0,0,1,0,1,0,-1,-1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,-1,-1,0,0,1,0,1,0,-1,0,0,0,0,0,0,0,-1,-1,0,0,-1,0,-1,0,0,0,0,0,-1,0,0,0,1,0,1,0,-1,-1,0,0,1,0,0,0,0,0,0,0],h=[0,0,0,0,0,0,0,1,2,3,4,5,6,6,6,6,6,6,6,5,4,3,2,1,1,1,1,1,1,2,3,4,5,5,5,5,5,4,3,2,2,2,2,3,4,4,4,3,3,6,5,4,3,2,1,0,0,0,0,0,0,0,1,2,3,4,5,6,6,6,6,6,6,5,4,3,2,1,1,1,1,1,2,3,4,5,5,5,5,4,3,2,2,2,3,4,4,3,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,5,6,6,6,6,6,6,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,6,0,6,0,6,0,6,0,6,0,6,0,6,1,5,1,5,1,5,1,5,1,5,1,5,1,5,2,4,2,4,2,4,2,4,2,4,2,4,2,4,3,3,3,3,3,3,3,6,0,5,1,4,2,3,3,2,4,1,5,0,6,0,6,1,5,2,4,3,3,4,2,5,1,6,0,6,0,5,1,4,2,3,3,2,4,1,5,0,6,0,6,1,5,2,4,3,0,0,0,6,6,6,6,1,1,1,5,5,5,5,2,2,2,4,4,4,4,3,3,3,3,3,3,3,4,4,4,2,2,2,2,5,5,5,1,1,1,1,6,6,6,0,0,0,0,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,0,0,0,6,6,6,6,1,1,1,5,5,5,5,2,2,2,4,4,4,4,3,3,3,3,3,3,3,4,4,4,2,2,2,2,5,5,5,1,1,1,1,6,6,6,0,0,0,0,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,0,0,1,1,0,0,1,1,2,3,2,3,2,3,4,4,5,5,4,4,5,5,6,6,6,0,1,0,0,1,1,2,3,2,3,2,3,2,3,4,5,4,5,4,5,6,6,6,6,6,5,6,5,2,1,1,2,0,0,3,3,4,4,1,2,1,2,5,6,5,6,0,3,4,0,0,3,4,3,4,1,1,2,2,5,5,6,6,0,0,3,3,4,4,1,2,5,6,0,0,0,0,0,0,0,6,6,6,6,6,6,6,1,2,3,4,5,1,2,3,4,5,1,1,1,1,1,5,5,5,5,5,2,3,4,2,3,4,2,3,4,4,4,3,2,2,3,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,0,0,0,0,6,6,6,6,6,1,2,3,4,5,1,2,3,4,5,1,1,1,5,5,5,2,2,2,3,4,4,4,3,3],l=[6,5,4,3,2,1,0,0,0,0,0,0,0,1,2,3,4,5,6,6,6,6,6,6,5,4,3,2,1,1,1,1,1,2,3,4,5,5,5,5,4,3,2,2,2,3,4,4,3,0,0,0,0,0,0,0,1,2,3,4,5,6,6,6,6,6,6,6,5,4,3,2,1,1,1,1,1,1,2,3,4,5,5,5,5,5,4,3,2,2,2,2,3,4,4,4,3,3,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,0,5,1,4,2,3,3,2,4,1,5,0,6,0,6,1,5,2,4,3,3,4,2,5,1,6,0,6,0,5,1,4,2,3,3,2,4,1,5,0,6,0,6,1,5,2,4,3,0,6,0,6,0,6,0,6,0,6,0,6,0,6,1,5,1,5,1,5,1,5,1,5,1,5,1,5,2,4,2,4,2,4,2,4,2,4,2,4,2,4,3,3,3,3,3,3,3,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,0,0,0,6,6,6,6,1,1,1,5,5,5,5,2,2,2,4,4,4,4,3,3,3,3,3,3,3,4,4,4,2,2,2,2,5,5,5,1,1,1,1,6,6,6,0,0,0,0,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,1,3,5,0,2,4,6,0,0,0,6,6,6,6,1,1,1,5,5,5,5,2,2,2,4,4,4,4,3,3,3,3,3,3,3,4,4,4,2,2,2,2,5,5,5,1,1,1,1,6,6,6,0,0,0,0,6,5,6,5,2,1,1,2,0,0,3,3,4,4,1,2,1,2,5,6,5,6,0,3,4,0,0,3,4,3,4,1,1,2,2,5,5,6,6,0,0,3,3,4,4,1,2,5,6,0,0,1,1,0,0,1,1,2,3,2,3,2,3,4,4,5,5,4,4,5,5,6,6,6,0,1,0,0,1,1,2,3,2,3,2,3,2,3,4,5,4,5,4,5,6,6,6,6,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,0,0,0,0,6,6,6,6,6,1,2,3,4,5,1,2,3,4,5,1,1,1,5,5,5,2,2,2,3,4,4,4,3,3,0,0,0,0,0,0,0,6,6,6,6,6,6,6,1,2,3,4,5,1,2,3,4,5,1,1,1,1,1,5,5,5,5,5,2,3,4,2,3,4,2,3,4,4,4,3,2,2,3],S=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,0,0,0,0,0,0,0,7,7,7,7,7,7,7,14,14,14,14,14,14,14,21,21,21,21,21,21,21,28,28,28,28,28,28,28,35,35,35,35,35,35,35,42,42,42,42,42,42,42,0,0,0,0,0,0,0,7,7,7,7,7,7,7,14,14,14,14,14,14,14,21,21,21,21,21,21,21,28,28,28,28,28,28,28,35,35,35,35,35,35,35,42,42,42,42,42,42,42,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,48,39,4,22,28,2,46,0,24,32,15,40,23,42,37,43,16,47,45,19,17,5,14,34,21,13,11,6,35,12,1,8,3,9,44,30,41,27,18,10,25,38,33,29,31,20,7,36,26,48,39,4,22,28,2,46,0,24,32,15,40,23,42,37,43,16,47,45,19,17,5,14,34,21,13,11,6,35,12,1,8,3,9,44,30,41,27,18,10,25,38,33,29,31,20,7,36,26,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,0,0,0,0,0,0,0,5,5,5,5,5,5,5,10,10,10,10,10,15,15,15,15,15,20,20,20,20,20,25,25,25,25,25,30,30,30,35,35,35,36,37,38,39,40,42,44,46,48,0,0,0,0,0,0,0,5,5,5,5,5,5,5,10,10,10,10,10,15,15,15,15,15,20,20,20,20,20,25,25,25,25,25,30,30,30,35,35,35,36,37,38,39,40,42,44,46,48];!function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.CUBE=1]="CUBE",e[e.FOREGROUND=2]="FOREGROUND"}(s||(s={}));var O=function(){function e(e){this.cubeBoard=[],this.cubeAnimation=[],this.cubeParticle=[],this.starMatchParticleLaunch=!1,this.starMatchParticleX=0,this.starMatchParticleY=0,this.starMatchParticleZ=0,this.scoreText=[],this.playBombPiecesDropSound=!1,this.mainScene=e}return e.prototype.update=function(e,t){for(var i=0;io.CONST.GAME_CUBE_BOARD_SIZE_X-1||t<0||t>o.CONST.GAME_CUBE_BOARD_SIZE_Y-1||i<0||i>o.CONST.GAME_CUBE_BOARD_SIZE_Z-1?E.CubeType.CUBE_TYPE_NONE:this.getCubeBoard(e,t,i).typeCurrent},e.prototype.getCubeBoardColor0=function(e,t,i){return e<0||e>o.CONST.GAME_CUBE_BOARD_SIZE_X-1||t<0||t>o.CONST.GAME_CUBE_BOARD_SIZE_Y-1||i<0||i>o.CONST.GAME_CUBE_BOARD_SIZE_Z-1?E.CubeColor.CUBE_COLOR_NONE:this.getCubeBoard(e,t,i).color0},e.prototype.getCubeBoardColor1=function(e,t,i){return e<0||e>o.CONST.GAME_CUBE_BOARD_SIZE_X-1||t<0||t>o.CONST.GAME_CUBE_BOARD_SIZE_Y-1||i<0||i>o.CONST.GAME_CUBE_BOARD_SIZE_Z-1?E.CubeColor.CUBE_COLOR_NONE:this.getCubeBoard(e,t,i).color1},e.prototype.checkInsertCubeBoard=function(e,t,i,s,r,a){if(e<0||e>o.CONST.GAME_CUBE_BOARD_SIZE_X-1||t<0||t>o.CONST.GAME_CUBE_BOARD_SIZE_Y-1)return!1;if(i==E.CubeType.CUBE_TYPE_NONE)return!1;if(i==E.CubeType.CUBE_TYPE_NORMAL||i==E.CubeType.CUBE_TYPE_DUAL){if(this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_EMPTY)return!0;if(this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_FRACTURED||this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_FRACTURED_DUAL)return!0;if(a==E.CubeOrientation.CUBE_ORIENTATION_LEFT){if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e-1,t,0)==E.CubeType.CUBE_TYPE_EMPTY)return!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&(this.getCubeBoardType(e-1,t,0)==E.CubeType.CUBE_TYPE_FRACTURED||this.getCubeBoardType(e-1,t,0)==E.CubeType.CUBE_TYPE_FRACTURED_DUAL))return!0}else if(a==E.CubeOrientation.CUBE_ORIENTATION_RIGHT){if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t-1,0)==E.CubeType.CUBE_TYPE_EMPTY)return!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&(this.getCubeBoardType(e,t-1,0)==E.CubeType.CUBE_TYPE_FRACTURED||this.getCubeBoardType(e,t-1,0)==E.CubeType.CUBE_TYPE_FRACTURED_DUAL))return!0}}if(i==E.CubeType.CUBE_TYPE_FRACTURED)return!1;if(i==E.CubeType.CUBE_TYPE_FRACTURED_DUAL)return!1;if(i==E.CubeType.CUBE_TYPE_IMMOVABLE)return!1;if(i==E.CubeType.CUBE_TYPE_WEDGE){if(this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_EMPTY)return!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,1)==E.CubeType.CUBE_TYPE_EMPTY)return!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,1)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,1)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,2)==E.CubeType.CUBE_TYPE_EMPTY)return!0}if(i==E.CubeType.CUBE_TYPE_OSMOSIS){if(this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_EMPTY)return!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,1)==E.CubeType.CUBE_TYPE_EMPTY)return!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,1)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,1)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,2)==E.CubeType.CUBE_TYPE_EMPTY)return!0}return i==E.CubeType.CUBE_TYPE_LASER&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE||i==E.CubeType.CUBE_TYPE_BOMB&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE},e.prototype.performInsertCubeBoard=function(e,t,i,r,_,T){if(e<0||e>o.CONST.GAME_CUBE_BOARD_SIZE_X-1||t<0||t>o.CONST.GAME_CUBE_BOARD_SIZE_Y-1)return!1;if(i==E.CubeType.CUBE_TYPE_NONE)return!1;if(i==E.CubeType.CUBE_TYPE_NORMAL||i==E.CubeType.CUBE_TYPE_DUAL){if(this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_EMPTY)return this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT?E.CubeState.CUBE_STATE_MOVE_RIGHT:E.CubeState.CUBE_STATE_MOVE_LEFT,0,1),!0;if(this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_FRACTURED||this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_FRACTURED_DUAL)return this.mainScene.reportCubeScoreType(e,t,0,!1),this.mainScene.decreaseLevelCubesToGo(1),this.setCubeParticleFractureDestroyed(e,t,0,this.getCubeBoardColor0(e,t,0),this.getCubeBoardColor1(e,t,0),T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT),this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT?E.CubeState.CUBE_STATE_FRACTURE_RIGHT:E.CubeState.CUBE_STATE_FRACTURE_LEFT,0,1),this.mainScene.playSound(a.GameSound.CUBE_CRUMBLES),!0;if(T==E.CubeOrientation.CUBE_ORIENTATION_LEFT){if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e-1,t,0)==E.CubeType.CUBE_TYPE_EMPTY)return(n=this.getCubeBoard(e,t,0)).state=E.CubeState.CUBE_STATE_PUSH_LEFT,n.stateOffset=1,n.logicChecked=!0,this.swapCubeBoard(e,t,0,e-1,t,0),this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,E.CubeState.CUBE_STATE_PUSH_LEFT,0,1),this.mainScene.tutorialHolder.GameTutorialEvent(o.CONST.GAME_TUTORIAL_EVENT_FIRST_CUBE_PUSH),this.mainScene.playSound(a.GameSound.CUBE_COLLIDES),!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&(this.getCubeBoardType(e-1,t,0)==E.CubeType.CUBE_TYPE_FRACTURED||this.getCubeBoardType(e-1,t,0)==E.CubeType.CUBE_TYPE_FRACTURED_DUAL))return this.mainScene.reportCubeScoreType(e-1,t,0,!1),this.mainScene.decreaseLevelCubesToGo(1),(n=this.getCubeBoard(e,t,0)).state=E.CubeState.CUBE_STATE_PUSH_LEFT,n.stateOffset=1,n.logicChecked=!0,this.setCubeParticleFractureDestroyed(e-1,t,0,this.getCubeBoardColor0(e-1,t,0),this.getCubeBoardColor1(e-1,t,0),!1),this.clearCubeBoard(e-1,t,0),this.swapCubeBoard(e,t,0,e-1,t,0),this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,E.CubeState.CUBE_STATE_PUSH_LEFT,0,1),this.mainScene.tutorialHolder.GameTutorialEvent(o.CONST.GAME_TUTORIAL_EVENT_FIRST_CUBE_PUSH),this.mainScene.playSound(a.GameSound.CUBE_COLLIDES),this.mainScene.playSound(a.GameSound.CUBE_CRUMBLES),!0}else if(T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT){var n;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t-1,0)==E.CubeType.CUBE_TYPE_EMPTY)return(n=this.getCubeBoard(e,t,0)).state=E.CubeState.CUBE_STATE_PUSH_RIGHT,n.stateOffset=1,n.logicChecked=!0,this.swapCubeBoard(e,t,0,e,t-1,0),this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,E.CubeState.CUBE_STATE_PUSH_RIGHT,0,1),this.mainScene.tutorialHolder.GameTutorialEvent(o.CONST.GAME_TUTORIAL_EVENT_FIRST_CUBE_PUSH),this.mainScene.playSound(a.GameSound.CUBE_COLLIDES),!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&(this.getCubeBoardType(e,t-1,0)==E.CubeType.CUBE_TYPE_FRACTURED||this.getCubeBoardType(e,t-1,0)==E.CubeType.CUBE_TYPE_FRACTURED_DUAL))return this.mainScene.reportCubeScoreType(e,t-1,0,!1),this.mainScene.decreaseLevelCubesToGo(1),(n=this.getCubeBoard(e,t,0)).state=E.CubeState.CUBE_STATE_PUSH_RIGHT,n.stateOffset=1,n.logicChecked=!0,this.setCubeParticleFractureDestroyed(e,t-1,0,this.getCubeBoardColor0(e,t-1,0),this.getCubeBoardColor1(e,t-1,0),T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT),this.clearCubeBoard(e,t-1,0),this.swapCubeBoard(e,t,0,e,t-1,0),this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,E.CubeState.CUBE_STATE_PUSH_RIGHT,0,1),this.mainScene.tutorialHolder.GameTutorialEvent(o.CONST.GAME_TUTORIAL_EVENT_FIRST_CUBE_PUSH),this.mainScene.playSound(a.GameSound.CUBE_COLLIDES),!0}}if(i==E.CubeType.CUBE_TYPE_FRACTURED)return!1;if(i==E.CubeType.CUBE_TYPE_FRACTURED_DUAL)return!1;if(i==E.CubeType.CUBE_TYPE_IMMOVABLE)return!1;if(i==E.CubeType.CUBE_TYPE_WEDGE){if(this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_EMPTY)return this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT?E.CubeState.CUBE_STATE_MOVE_RIGHT:E.CubeState.CUBE_STATE_MOVE_LEFT,0,1),!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,1)==E.CubeType.CUBE_TYPE_EMPTY){var C=this.getCubeBoard(e,t,0);return C.state=E.CubeState.CUBE_STATE_WEDGE_LIFT_UP,C.stateOffset=1,C.logicChecked=!0,this.swapCubeBoard(e,t,0,e,t,1),this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT?E.CubeState.CUBE_STATE_WEDGE_RIGHT:E.CubeState.CUBE_STATE_WEDGE_LEFT,0,1),this.mainScene.playSound(a.GameSound.WEDGE_LIFT),!0}if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,1)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,1)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,2)==E.CubeType.CUBE_TYPE_EMPTY){var c=this.getCubeBoard(e,t,1);c.state=E.CubeState.CUBE_STATE_WEDGE_LIFT_UP,c.stateOffset=1,c.logicChecked=!0;var h=this.getCubeBoard(e,t,0);return h.state=E.CubeState.CUBE_STATE_WEDGE_LIFT_UP,h.stateOffset=1,h.logicChecked=!0,this.swapCubeBoard(e,t,1,e,t,2),this.swapCubeBoard(e,t,0,e,t,1),this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT?E.CubeState.CUBE_STATE_WEDGE_RIGHT:E.CubeState.CUBE_STATE_WEDGE_LEFT,0,1),this.mainScene.playSound(a.GameSound.WEDGE_LIFT),!0}}if(i==E.CubeType.CUBE_TYPE_OSMOSIS){if(this.getCubeBoardType(e,t,0)==E.CubeType.CUBE_TYPE_EMPTY)return this.setCubeBoard(e,t,0,i,E.CubeType.CUBE_TYPE_NONE,r,_,T,T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT?E.CubeState.CUBE_STATE_MOVE_RIGHT:E.CubeState.CUBE_STATE_MOVE_LEFT,0,1),!0;var l;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,1)==E.CubeType.CUBE_TYPE_EMPTY)return this.setCubeAnimation(e,t,0,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.OSMOSIS_CHANGE_COLOR,this.getCubeBoardColor0(e,t,0),T,0,.32,!1,.32),(l=this.getCubeBoard(e,t,0)).typeCurrent=l.typeCurrent==E.CubeType.CUBE_TYPE_STAR?E.CubeType.CUBE_TYPE_STAR:E.CubeType.CUBE_TYPE_NORMAL,l.color0=r,l.color1=E.CubeColor.CUBE_COLOR_NONE,l.state=E.CubeState.CUBE_STATE_OSMOSIS_LIFT_AND_GENERATE_WAIT,l.stateCounter=o.CONST.GAME_OSMOSIS_LIFTING_DELAY,l.logicChecked=!0,T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT?this.setCubeAnimation(e,t+1,0,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.OSMOSIS_SUCK,r,E.CubeOrientation.CUBE_ORIENTATION_RIGHT,0,.32,!0,.32):this.setCubeAnimation(e+1,t,0,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.OSMOSIS_SUCK,r,E.CubeOrientation.CUBE_ORIENTATION_LEFT,0,.32,!0,.32),this.mainScene.playSound(a.GameSound.OSMOSIS_LIFT),!0;if(this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,0)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,1)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(e,t,1)!=E.CubeType.CUBE_TYPE_IMMOVABLE&&this.getCubeBoardType(e,t,2)==E.CubeType.CUBE_TYPE_EMPTY)return this.setCubeAnimation(e,t,0,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.OSMOSIS_CHANGE_COLOR,this.getCubeBoardColor0(e,t,0),T,0,.32,!1,.32),(l=this.getCubeBoard(e,t,0)).typeCurrent=l.typeCurrent==E.CubeType.CUBE_TYPE_STAR?E.CubeType.CUBE_TYPE_STAR:E.CubeType.CUBE_TYPE_NORMAL,l.color0=r,l.color1=E.CubeColor.CUBE_COLOR_NONE,l.state=E.CubeState.CUBE_STATE_OSMOSIS_LIFT_AND_GENERATE_WAIT,l.stateCounter=o.CONST.GAME_OSMOSIS_LIFTING_DELAY,l.logicChecked=!0,T==E.CubeOrientation.CUBE_ORIENTATION_RIGHT?this.setCubeAnimation(e,t+1,0,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.OSMOSIS_SUCK,r,E.CubeOrientation.CUBE_ORIENTATION_RIGHT,0,.32,!0,.32):this.setCubeAnimation(e+1,t,0,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.OSMOSIS_SUCK,r,E.CubeOrientation.CUBE_ORIENTATION_LEFT,0,.32,!0,.32),this.mainScene.playSound(a.GameSound.OSMOSIS_LIFT),!0}if(i==E.CubeType.CUBE_TYPE_LASER)for(var S=0;S0&&(a.bombZ-=o.CONST.GAME_BOARD_BUILD_FALL_SPEED*t),a.bombZ<=0&&(a.bombZ=0,a.state=E.CubeState.CUBE_STATE_IDLE,this.setCubeAnimation(i,s,r,u.CubeAnimationLayer.FOREGROUND,u.CubeAnimationType.MATCH_FRAME,E.CubeColor.CUBE_COLOR_YELLOW,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.2,!0,0),this.setCubeAnimation(i,s,r,u.CubeAnimationLayer.FOREGROUND,u.CubeAnimationType.MATCH_FRAME_GLOW,E.CubeColor.CUBE_COLOR_YELLOW,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.2,!0,0)))}},e.prototype.prepareCubeBoardClean=function(){for(var e=Math.floor(65536*Math.random())%6,t=Math.floor(65536*Math.random())%o.CONST.GAME_CUBE_BOARD_CLEAR_PATTERN_NUM,i=t*o.CONST.GAME_CUBE_BOARD_CLEAR_PATTERN_LENGHT;i0)return!1;return!0},e.prototype.cubeBoardMainLogic=function(e){for(var t=e/1e3,i=!1,r=!1,T=0;T0?this.setCubeParticle(n,C,c,s.FOREGROUND,"matchCubis"):this.setCubeParticle(n,C,c,s.FOREGROUND,"matchNormal"),this.clearCubeBoard(n,C,c)}else if(h.state==E.CubeState.CUBE_STATE_MATCH_STAR){U=this.getCubeBoardColor0(n,C,c);this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.MATCH_CUBE,U,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.48,!1,.48),this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.FOREGROUND,u.CubeAnimationType.MATCH_FRAME,U,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.48,!0,.48),this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.FOREGROUND,u.CubeAnimationType.MATCH_FRAME_GLOW,U,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.48,!0,.48),this.mainScene.levelProgress.chainLevel>0?this.setCubeParticle(n,C,c,s.FOREGROUND,"matchCubis"):this.setCubeParticle(n,C,c,s.FOREGROUND,"matchNormal"),this.clearCubeBoard(n,C,c)}else if(h.state==E.CubeState.CUBE_STATE_MATCH_DUAL_0){U=this.getCubeBoardColor0(n,C,c);this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.MATCH_CUBE,U,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.48,!1,.48),this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.FOREGROUND,u.CubeAnimationType.MATCH_FRAME,U,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.48,!0,.48),this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.FOREGROUND,u.CubeAnimationType.MATCH_FRAME_GLOW,U,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.48,!0,.48),this.mainScene.levelProgress.chainLevel>0?this.setCubeParticle(n,C,c,s.FOREGROUND,"matchCubis"):this.setCubeParticle(n,C,c,s.FOREGROUND,"matchNormal"),h.typeCurrent==E.CubeType.CUBE_TYPE_FRACTURED_DUAL?h.typeCurrent=E.CubeType.CUBE_TYPE_FRACTURED:h.typeCurrent=E.CubeType.CUBE_TYPE_NORMAL,h.color0=h.color1,h.color1=E.CubeColor.CUBE_COLOR_NONE,h.state=E.CubeState.CUBE_STATE_IDLE}else if(h.state==E.CubeState.CUBE_STATE_MATCH_DUAL_1){U=this.getCubeBoardColor1(n,C,c);this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.MATCH_CUBE,U,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.48,!1,.48),this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.FOREGROUND,u.CubeAnimationType.MATCH_FRAME,U,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.48,!0,.48),this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.FOREGROUND,u.CubeAnimationType.MATCH_FRAME_GLOW,U,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.48,!0,.48),this.mainScene.levelProgress.chainLevel>0?this.setCubeParticle(n,C,c,s.FOREGROUND,"matchCubis"):this.setCubeParticle(n,C,c,s.FOREGROUND,"matchNormal"),h.typeCurrent==E.CubeType.CUBE_TYPE_FRACTURED_DUAL?h.typeCurrent=E.CubeType.CUBE_TYPE_FRACTURED:h.typeCurrent=E.CubeType.CUBE_TYPE_NORMAL,h.color1=E.CubeColor.CUBE_COLOR_NONE,h.state=E.CubeState.CUBE_STATE_IDLE}break;case E.CubeState.CUBE_STATE_BOMB_DETONATION_RIGHT:case E.CubeState.CUBE_STATE_BOMB_DETONATION_LEFT:if(h.stateCounter-=t,h.stateCounter<0){this.mainScene.playSound(a.GameSound.BOMB_EXPLOSION);var N=h.state==E.CubeState.CUBE_STATE_BOMB_DETONATION_RIGHT?E.CubeOrientation.CUBE_ORIENTATION_RIGHT:E.CubeOrientation.CUBE_ORIENTATION_LEFT,R=!1;for(T=0;T<9;T++)this.getCubeBoardType(n+this.getBombDetonationPosX(T,N),C+this.getBombDetonationPosY(T,N),0)!=E.CubeType.CUBE_TYPE_NONE&&(this.getCubeBoardType(n+this.getBombDetonationPosX(T,N),C+this.getBombDetonationPosY(T,N),0)==E.CubeType.CUBE_TYPE_IMMOVABLE?(o.CONST.GAME_IMMOVABLE_DECREASES_CUBES_TO_GO&&(this.mainScene.reportCubeScoreType(n+this.getBombDetonationPosX(T,N),C+this.getBombDetonationPosY(T,N),0,!1),this.mainScene.decreaseLevelCubesToGo(1)),R=!0):this.getCubeBoardType(n+this.getBombDetonationPosX(T,N),C+this.getBombDetonationPosY(T,N),0)!=E.CubeType.CUBE_TYPE_EMPTY&&(this.mainScene.reportCubeScoreType(n+this.getBombDetonationPosX(T,N),C+this.getBombDetonationPosY(T,N),0,!1),this.mainScene.decreaseLevelCubesToGo(1),R=!0),this.clearCubeBoard(n+this.getBombDetonationPosX(T,N),C+this.getBombDetonationPosY(T,N),0));for(T=0;T<9;T++)this.getCubeBoardType(n+this.getBombDetonationPosX(T,N),C+this.getBombDetonationPosY(T,N),1)!=E.CubeType.CUBE_TYPE_NONE&&this.getCubeBoardType(n+this.getBombDetonationPosX(T,N),C+this.getBombDetonationPosY(T,N),1)!=E.CubeType.CUBE_TYPE_EMPTY&&(this.mainScene.tutorialHolder.GameTutorialEvent(o.CONST.GAME_TUTORIAL_EVENT_FIRST_BOMB_THROW_CUBES),this.distributeCubeBoardBomb(n+this.getBombDetonationPosX(T,N),C+this.getBombDetonationPosY(T,N),T,N));this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.BOMB_GLOW,E.CubeColor.CUBE_COLOR_NONE,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.64,!1,0),this.setCubeAnimation(n,C,c,u.CubeAnimationLayer.CUBE,u.CubeAnimationType.BOMB_EXPLOSION,E.CubeColor.CUBE_COLOR_NONE,E.CubeOrientation.CUBE_ORIENTATION_NONE,0,.4,!1,.2),R&&(this.setCubeParticle(n,C,c,s.CUBE,"bombExplosion0"),this.setCubeParticle(n,C,c,s.CUBE,"bombExplosion1"))}break;case E.CubeState.CUBE_STATE_BOMB_DISTRIBUTION:this.playBombPiecesDropSound=!0,h.bombX>0?(h.bombX-=o.CONST.GAME_BOMB_BLAST_HORIZONTAL_SPEED*t,h.bombX<0&&(h.bombX=0)):(h.bombX+=o.CONST.GAME_BOMB_BLAST_HORIZONTAL_SPEED*t,h.bombX>0&&(h.bombX=0)),h.bombY>0?(h.bombY-=o.CONST.GAME_BOMB_BLAST_HORIZONTAL_SPEED*t,h.bombY<0&&(h.bombY=0)):(h.bombY+=o.CONST.GAME_BOMB_BLAST_HORIZONTAL_SPEED*t,h.bombY>0&&(h.bombY=0)),h.stateSpeed-=o.CONST.GAME_BOMB_BLAST_VERTICAL_ACCEL*t,h.bombZ+=h.stateSpeed*t,0==h.bombX&&0==h.bombY&&h.bombZ<=0&&(h.state=E.CubeState.CUBE_STATE_IDLE,h.bombX=0,h.bombY=0,h.bombZ=0);break;case E.CubeState.CUBE_STATE_LEVEL_BUILD:case E.CubeState.CUBE_STATE_LEVEL_CLEAN_BEGIN:case E.CubeState.CUBE_STATE_LEVEL_CLEAN_END:}}i&&(this.mainScene.levelProgress.chainLevel>=1?(this.mainScene.levelData.cubesToGo,this.mainScene.levelProgress.chainLevel%4==0?this.mainScene.playSound(a.GameSound.MATCH_CUBIS_4X):this.mainScene.levelProgress.chainLevel%4==3?this.mainScene.playSound(a.GameSound.MATCH_CUBIS_3X):this.mainScene.levelProgress.chainLevel%4==2?this.mainScene.playSound(a.GameSound.MATCH_CUBIS_2X):this.mainScene.levelProgress.chainLevel%4==1&&this.mainScene.playSound(a.GameSound.MATCH_CUBIS_1X)):this.mainScene.levelProgress.starsInMatch>0?this.mainScene.playSound(a.GameSound.MATCH_STAR):this.mainScene.playSound(a.GameSound.MATCH_NORMAL),0==this.mainScene.levelProgress.chainLevel&&this.mainScene.levelProgress.cubeCount>3&&(this.mainScene.levelData.cubesToGo,this.mainScene.playSound(a.GameSound.MATCH_BIG))),r&&this.mainScene.playSound(a.GameSound.CUBE_DROPS),this.starMatchParticleLaunch&&(this.starMatchParticleLaunch=!1,this.setCubeParticle(Math.floor(this.starMatchParticleX),Math.floor(this.starMatchParticleY),Math.floor(this.starMatchParticleZ),s.FOREGROUND,"matchStar"),this.mainScene.tutorialHolder.GameTutorialControlsAction(this.mainScene.levelData.world,this.mainScene.levelData.level,_.eGameTutorialEvent.GAME_TUTORIAL_CONTROLS_ACTION_STAR_NOTIFICATION,-1,-1,this.mainScene.levelData.cubesToGo));var L=!1;for(T=0;T0){L=!0;break}L||this.cubeBoardFallLogic()},e.prototype.cubeBoardFallLogic=function(){for(var e=!1,t=0;t=0;i--){for(s=o.CONST.GAME_CUBE_BOARD_SIZE_X-1;s>=0&&!(e=this.cubeBoardChainProceed(s,i,t));s--);if(e)break}if(e)break}var r=!1;for(s=0;s2){_>3&&0==this.mainScene.levelProgress.chainLevel&&(this.mainScene.levelProgress.lastBigMatchCubeColor=s);for(var T=0,u=0,n=0;n=o.CONST.GAME_CONTROLS_INDEX_DEPTH_STOP;a--)for(var _=o.CONST.GAME_CONTROLS_INDEX_START_Y;_i+o.CONST.GAME_CONTROLS_TEST_POINT_OFFSET_X0&&t>s+o.CONST.GAME_CONTROLS_TEST_POINT_OFFSET_Y)return this.cubeSelectedDesiredOrientation=r.CubeOrientation.CUBE_ORIENTATION_RIGHT,this.cubeSelectedDesiredTargetX=a,this.cubeSelectedDesiredTargetY=o.CONST.GAME_CUBE_BOARD_SIZE_Y,void(this.cubeSelectedDesiredTargetX<0?this.cubeSelectedDesiredTargetX=0:this.cubeSelectedDesiredTargetX>o.CONST.GAME_CUBE_BOARD_SIZE_X-1&&(this.cubeSelectedDesiredTargetX=o.CONST.GAME_CUBE_BOARD_SIZE_X-1));if(e>this.mainScene.sys.canvas.width/2+o.CONST.GAME_CONTROLS_START_X)for(_=o.CONST.GAME_CUBE_BOARD_SIZE_Y+o.CONST.GAME_CONTROLS_INDEX_DEPTH_START;_>=o.CONST.GAME_CONTROLS_INDEX_DEPTH_STOP;_--)for(a=o.CONST.GAME_CONTROLS_INDEX_START_X;as+o.CONST.GAME_CONTROLS_TEST_POINT_OFFSET_Y)return this.cubeSelectedDesiredOrientation=r.CubeOrientation.CUBE_ORIENTATION_LEFT,this.cubeSelectedDesiredTargetX=o.CONST.GAME_CUBE_BOARD_SIZE_X,this.cubeSelectedDesiredTargetY=_,void(this.cubeSelectedDesiredTargetY<0?this.cubeSelectedDesiredTargetY=0:this.cubeSelectedDesiredTargetY>o.CONST.GAME_CUBE_BOARD_SIZE_Y-1&&(this.cubeSelectedDesiredTargetY=o.CONST.GAME_CUBE_BOARD_SIZE_Y-1))}else{var T=o.PointMake(e,t);if(!o.IsLeftOfVector(this.vPoint0A,this.vPoint0B,T)||!o.IsLeftOfVector(this.vPoint1A,this.vPoint1B,T))return;if(o.IsLeftOfVector(this.vPoint0A,this.vPoint0B,T)&&o.IsLeftOfVector(this.vPoint1A,this.vPoint1B,T)){var u=e-o.GetCubeBoardPosX(this.mainScene,0,0,0)+o.CONST.GAME_CUBE_BOARD_SIZE_X*o.CONST.GAME_CONTROLS_OFFSET_X+o.CONST.GAME_CONTROLS_OFFSET_X/2;return(u=Math.floor(u/o.CONST.GAME_CONTROLS_OFFSET_X))==o.CONST.GAME_CUBE_BOARD_SIZE_X&&(u=o.CONST.GAME_CUBE_BOARD_SIZE_X-1),u<0&&(u=0),u>14&&(u=14),this.cubeSelectedDesiredOrientation=r.CubeOrientation.CUBE_ORIENTATION_RIGHT,this.cubeSelectedDesiredTargetX=u,this.cubeSelectedDesiredTargetY=o.CONST.GAME_CUBE_BOARD_SIZE_Y,void(u>7&&(this.cubeSelectedDesiredOrientation=r.CubeOrientation.CUBE_ORIENTATION_LEFT,this.cubeSelectedDesiredTargetX=o.CONST.GAME_CUBE_BOARD_SIZE_X,this.cubeSelectedDesiredTargetY=14-u))}}},e.prototype.trackCubeSelectedPosition=function(){return this.cubeSelectedDesiredOrientation==this.cubeSelected.orientation?this.cubeSelectedDesiredOrientation==r.CubeOrientation.CUBE_ORIENTATION_RIGHT?this.cubeSelectedDesiredTargetX=o.CONST.GAME_CONTROLS_TRACK_FASTER_TRESHOLD?this.cubeSelected.x-o.CONST.GAME_CONTROLS_TRACK_FASTER_SPEED:this.cubeSelected.x-1,this.cubeSelected.x=this.cubeSelected.x>this.cubeSelectedDesiredTargetX?this.cubeSelected.x:this.cubeSelectedDesiredTargetX):this.cubeSelectedDesiredTargetX>this.cubeSelected.x&&(this.cubeSelected.x=Math.abs(this.cubeSelectedDesiredTargetX-this.cubeSelected.x)>=o.CONST.GAME_CONTROLS_TRACK_FASTER_TRESHOLD?this.cubeSelected.x+o.CONST.GAME_CONTROLS_TRACK_FASTER_SPEED:this.cubeSelected.x+1,this.cubeSelected.x=this.cubeSelected.x=o.CONST.GAME_CONTROLS_TRACK_FASTER_TRESHOLD?this.cubeSelected.y-o.CONST.GAME_CONTROLS_TRACK_FASTER_SPEED:this.cubeSelected.y-1,this.cubeSelected.y=this.cubeSelected.y>this.cubeSelectedDesiredTargetY?this.cubeSelected.y:this.cubeSelectedDesiredTargetY):this.cubeSelectedDesiredTargetY>this.cubeSelected.y&&(this.cubeSelected.y=Math.abs(this.cubeSelectedDesiredTargetY-this.cubeSelected.y)>=o.CONST.GAME_CONTROLS_TRACK_FASTER_TRESHOLD?this.cubeSelected.y+o.CONST.GAME_CONTROLS_TRACK_FASTER_SPEED:this.cubeSelected.y+1,this.cubeSelected.y=this.cubeSelected.y=o.CONST.GAME_CONTROLS_TRACK_FASTER_TRESHOLD?this.cubeSelected.y+o.CONST.GAME_CONTROLS_TRACK_FASTER_SPEED:this.cubeSelected.y+1,this.cubeSelected.y=this.cubeSelected.y=o.CONST.GAME_CONTROLS_TRACK_FASTER_TRESHOLD?this.cubeSelected.x+o.CONST.GAME_CONTROLS_TRACK_FASTER_SPEED:this.cubeSelected.x+1,this.cubeSelected.x=this.cubeSelected.x=o.GAME_CUBE_SELECTED_PHASE_0_OFFSET_X(this.mainScene)&&(this.cubeSelectedCircleAngle=(this.cubeSelectedCirclePosX-o.GAME_CUBE_SELECTED_PHASE_0_OFFSET_X(this.mainScene))*(1.41*o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED*360)/((o.CONST.GAME_CUBE_SELECTED_PHASE_1_RADIUS_X+o.CONST.GAME_CUBE_SELECTED_PHASE_1_RADIUS_Y)*Math.PI*o.GAME_CUBE_SELECTED_PHASE_0_OFFSET_X(this.mainScene))+1.41*o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED*360/((o.CONST.GAME_CUBE_SELECTED_PHASE_1_RADIUS_X+o.CONST.GAME_CUBE_SELECTED_PHASE_1_RADIUS_Y)*Math.PI),this.cubeSelectedCirclePosX=o.GAME_CUBE_SELECTED_PHASE_0_OFFSET_X(this.mainScene),this.cubeSelectedCirclePhase=s.CUBE_SELECTED_CIRCLE_PHASE_1);else if(this.cubeSelectedCirclePhase==s.CUBE_SELECTED_CIRCLE_PHASE_1){var t=o.DEGREES_TO_RADIANS(90-this.cubeSelectedCircleAngle);this.cubeSelectedCirclePosX=o.GAME_CUBE_SELECTED_PHASE_0_OFFSET_X(this.mainScene)+Math.cos(t)*o.CONST.GAME_CUBE_SELECTED_PHASE_1_RADIUS_X,this.cubeSelectedCirclePosY=o.CONST.GAME_CUBE_SELECTED_PHASE_1_RADIUS_Y+Math.sin(t)*(o.GAME_HUD_QUEUE_Y(this.mainScene)-o.CONST.GAME_CUBE_SELECTED_PHASE_1_RADIUS_Y),this.cubeSelected.y==o.CONST.GAME_CUBE_BOARD_SIZE_Y?this.cubeSelectedCircleAngle>=201-4*this.cubeSelected.x&&(this.cubeSelectedCirclePhase=s.CUBE_SELECTED_CIRCLE_PHASE_2):this.cubeSelectedCircleAngle>=70+8*this.cubeSelected.y&&(this.cubeSelectedCirclePhase=s.CUBE_SELECTED_CIRCLE_PHASE_2),this.cubeSelectedCircleAngle+=1.41*o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED*360/((o.CONST.GAME_CUBE_SELECTED_PHASE_1_RADIUS_X+o.CONST.GAME_CUBE_SELECTED_PHASE_1_RADIUS_Y)*Math.PI)}else if(this.cubeSelectedCirclePhase==s.CUBE_SELECTED_CIRCLE_PHASE_2){var i=(this.cubeSelectedCircleTargetX-this.cubeSelectedCirclePosX)*o.CONST.GAME_CUBE_SELECTED_QUEUE_TARGET_DEACCEL*e,r=(this.cubeSelectedCircleTargetY-this.cubeSelectedCirclePosY)*o.CONST.GAME_CUBE_SELECTED_QUEUE_TARGET_DEACCEL*e;i>o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED?i=o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED:i<-o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED&&(i=-o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED),r>o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED?r=o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED:r<-o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED&&(r=-o.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED),Math.abs(i)1?1:this.alpha;for(var o=0;o1?1:this.alpha,this.setAlpha(this.alpha),this.timeText.setText(this.getTimeStringFromInt(Math.ceil(this.mainScene.levelData.time))),this.cubesText.setText(this.mainScene.levelData.cubesToGo.toString()),this.scoreText.setText((this.mainScene.levelProgress.score+this.mainScene.levelProgress.perfectBonus+this.mainScene.levelProgress.extraTimeBonus).toString()),this.scoreMultiplier.setText(this.mainScene.levelProgress.multipiler.toString()+"x")},t.prototype.init=function(){this.barSprite=this.mainScene.add.sprite(this.mainScene.sys.canvas.width/2-430,this.mainScene.sys.canvas.height/2-220,"HUD-ingame"),this.barSprite.setDepth(1e3),this.add(this.barSprite),this.levelText=this.mainScene.add.text(this.barSprite.x+36,this.barSprite.y-124,"",{fontFamily:"Calistoga",fontSize:"30px",color:"#fcf8de"}),this.levelText.setOrigin(.5,.5),this.levelText.visible=!1,this.levelText.setDepth(1e3),this.add(this.levelText),this.goalLabel=this.mainScene.add.text(this.barSprite.x,this.barSprite.y-58,"GOAL",{fontFamily:"Calistoga",fontSize:"22px",color:"#90f2f8"}),this.goalLabel.setOrigin(.5,.5),this.goalLabel.setDepth(1e3),this.add(this.goalLabel),this.timeText=this.mainScene.add.text(this.barSprite.x-110,this.barSprite.y,"",{fontFamily:"Calistoga",fontSize:"44px",color:"#ffdd9b"}),this.timeText.setOrigin(0,.5),this.timeText.setDepth(1e3),this.add(this.timeText),this.cubesText=this.mainScene.add.text(this.barSprite.x+70,this.barSprite.y,"",{fontFamily:"Calistoga",fontSize:"44px",color:"#ffdd9b"}),this.cubesText.setOrigin(.5,.5),this.cubesText.setDepth(1e3),this.add(this.cubesText),this.scoreLabel=this.mainScene.add.text(this.barSprite.x-20,this.barSprite.y+66,"SCORE",{fontFamily:"Calistoga",fontSize:"16px",color:"#90f2f8"}),this.scoreLabel.setOrigin(.5,.5),this.scoreLabel.setDepth(1e3),this.add(this.scoreLabel),this.scoreText=this.mainScene.add.text(this.barSprite.x-20,this.barSprite.y+91,"",{fontFamily:"Calistoga",fontSize:"28px",color:"#ffdd9b"}),this.scoreText.setOrigin(.5,.5),this.scoreText.setDepth(1e3),this.add(this.scoreText),this.scoreMultiplier=this.mainScene.add.text(this.barSprite.x+70,this.barSprite.y+80,"",{fontFamily:"Calistoga",fontSize:"30px",color:"#ffa300"}),this.scoreMultiplier.setOrigin(.5,.5),this.scoreMultiplier.setDepth(1e3),this.add(this.scoreMultiplier),this.notificationText=this.mainScene.add.bitmapText(0,0,"notificationFont","",40),this.notificationText.setOrigin(.75,1),this.notificationText.setDepth(1e3),this.notificationText.visible=!1,this.messageContainer=this.mainScene.add.container(this.mainScene.sys.canvas.width/2,this.mainScene.sys.canvas.height/2),this.messageContainer.add(new Phaser.GameObjects.Sprite(this.mainScene,0,0,"ui","tutorial-two"));this.messageText=new Phaser.GameObjects.Text(this.mainScene,0,0,"",{fontFamily:"Lalezar",fontSize:"90px",color:"#fff"}),this.messageText.setOrigin(.5,.5),this.messageContainer.add(this.messageText),this.messageContainer.visible=!1,this.messageContainer.setDepth(1e3),this.tutorialGroup=this.mainScene.add.container(this.mainScene.sys.canvas.width/2+60,this.mainScene.sys.canvas.height/2),this.tutorialX=new Phaser.GameObjects.Sprite(this.mainScene,310,-25,"ui","button-x"),this.tutorialFrame1=new Phaser.GameObjects.Sprite(this.mainScene,0,0,"ui","tutorial-one"),this.tutorialFrame2=new Phaser.GameObjects.Sprite(this.mainScene,0,0,"ui","tutorial-two"),this.tutorialGroup.add(this.tutorialFrame1),this.tutorialGroup.add(this.tutorialFrame2),this.tutorialGroup.add(this.tutorialX),this.tutorialGroup.setDepth(1e3);this.tutorialText=new Phaser.GameObjects.Text(this.mainScene,0,0,"",{fontFamily:"Lalezar",fontSize:"40px",color:"#fff",align:"center",wordWrap:{width:600}}),this.tutorialText.setOrigin(.5,.5),this.tutorialText.setDepth(900),this.tutorialText.visible=!1,this.tutorialGroup.add(this.tutorialText),this.tutorialGroup.visible=!1,this.tutorialArrow=this.mainScene.add.container(this.mainScene.sys.canvas.width/2,this.mainScene.sys.canvas.height/2);var e=new Phaser.GameObjects.Sprite(this.scene,0,0,"ui","PointingArrow");e.setOrigin(1,.5),this.scene.tweens.add({targets:e,x:{from:0,to:30},ease:"Cubic.InOut",duration:500,repeat:-1,yoyo:!0}),this.tutorialArrow.setDepth(1e3),this.tutorialArrow.add(e),this.tutorialArrow.visible=!1},t.prototype.reset=function(){this.levelText.visible=!1,this.notificationText.visible=!1,this.messageContainer.visible=!1,this.tutorialText.visible=!1,this.timeText.setPosition(this.barSprite.x-110,this.timeText.y),this.timeText.setOrigin(0,.5)},t.prototype.setLevel=function(e,t){this.levelText.setText((e==r.GameMode.GAME_MODE_STORY?"Level ":"Tutorial ")+(this.mainScene.levelData.level+1)),this.levelText.visible=!0},t.prototype.timeTick=function(){this.timeText.setPosition(this.barSprite.x-65,this.timeText.y),this.timeText.setOrigin(.5,.5);var e={targets:this.timeText,scale:{from:1.2,to:1},ease:"Sine.easeIn",delay:0,duration:200};this.mainScene.tweens.add(e)},t.prototype.notify=function(e,t){var i=this;if(e==o.CONST.GAME_NOTIFICATION_MULTIPLIER){this.notificationText.setText(t.toString()+"x"),this.notificationText.setPosition(this.mainScene.levelProgress.lastStarCenter.x,this.mainScene.levelProgress.lastStarCenter.y),this.notificationText.visible=!1,this.notificationText.alpha=0;var s={targets:this.notificationText,alpha:1,ease:"Sine.easeInOut",delay:200,duration:600,onStart:function(){i.notificationText.visible=!0},onComplete:function(){i.notificationText.visible=!1},yoyo:!0};this.mainScene.tweens.add(s)}},t.prototype.setMessage=function(e){this.messageText.setText(e),this.messageText.alpha=0,this.messageContainer.visible=!0,this.messageContainer.setPosition(this.tutorialLocation.x,this.mainScene.sys.canvas.height+400),this.scene.tweens.add({targets:this.messageContainer,y:this.mainScene.sys.canvas.height/2,ease:"Back.Out",duration:200}),this.scene.tweens.add({targets:this.messageText,alpha:1,ease:"Linear.In",delay:200,duration:200})},t.prototype.initTutorial=function(e,t,i,s){this.tutorialArrowPosition=i,this.tutorialArrowAngle=s,this.tutorialText.setText(t);var r=this.tutorialText.getWrappedText(t).length<2;switch(this.tutorialFrame1.visible=r,this.tutorialFrame2.visible=!r,e){case a.eGameTutorialType.GAME_TUTORIAL_TYPE_BOTTOM:this.tutorialX.visible=!0,this.tutorialLocation=o.PointMake(this.mainScene.sys.canvas.width/2+60,this.mainScene.sys.canvas.height/2);break;case a.eGameTutorialType.GAME_TUTORIAL_TYPE_CONTROLS:this.tutorialX.visible=!1,this.tutorialLocation=o.PointMake(this.mainScene.sys.canvas.width/2+60,this.mainScene.sys.canvas.height/2-130);break;case a.eGameTutorialType.GAME_TUTORIAL_TYPE_TOP:this.tutorialX.visible=!1,this.tutorialLocation=o.PointMake(this.mainScene.sys.canvas.width/2+60,this.mainScene.sys.canvas.height/2+300);break;case a.eGameTutorialType.GAME_TUTORIAL_TYPE_CENTER:this.tutorialX.visible=!1,this.tutorialLocation=o.PointMake(this.mainScene.sys.canvas.width/2+60,this.mainScene.sys.canvas.height/2)}},t.prototype.setTutorial=function(e,t){var i=this;switch(this.tutorialTween&&this.tutorialTween.remove(),this.tutorialTweenArrow&&this.tutorialTweenArrow.remove(),e){case a.eGameTutorialDisplayState.GAME_TUTORIAL_DISPLAY_STATE_OFF:this.tutorialText.visible=!1,this.tutorialGroup.visible=!1,this.tutorialArrow.visible=!1;break;case a.eGameTutorialDisplayState.GAME_TUTORIAL_DISPLAY_STATE_STAY:this.tutorialGroup.y=this.tutorialLocation.y,this.tutorialText.visible=!0,this.tutorialGroup.visible=!0,this.tutorialArrowPosition?this.tutorialArrow.visible=!0:this.tutorialArrow.visible=!1;break;case a.eGameTutorialDisplayState.GAME_TUTORIAL_DISPLAY_STATE_SCROLL_IN:this.tutorialText.visible=!1,this.tutorialGroup.visible=!0,this.tutorialGroup.setPosition(this.tutorialLocation.x,this.mainScene.sys.canvas.height+200),this.tutorialTween=this.scene.tweens.add({targets:this.tutorialGroup,y:this.tutorialLocation.y,ease:"Back.Out",duration:1e3*t,onComplete:function(){i.tutorialTween=void 0}}),this.tutorialArrowPosition?(this.tutorialArrow.setPosition(this.mainScene.sys.canvas.width/2+this.tutorialArrowPosition.x,this.mainScene.sys.canvas.height/2+this.tutorialArrowPosition.y),this.tutorialArrowAngle&&(this.tutorialArrow.angle=this.tutorialArrowAngle),this.tutorialArrow.visible=!0,this.tutorialArrow.alpha=0,this.tutorialTweenArrow=this.scene.tweens.add({targets:this.tutorialArrow,alpha:1,ease:"Linear.In",duration:1e3*t,onComplete:function(){i.tutorialTweenArrow=void 0}})):this.tutorialArrow.visible=!1;break;case a.eGameTutorialDisplayState.GAME_TUTORIAL_DISPLAY_STATE_SHOW_LINE:this.tutorialText.visible=!0,this.tutorialGroup.visible=!0,this.tutorialArrowPosition?this.tutorialArrow.visible=!0:this.tutorialArrow.visible=!1,this.tutorialText.alpha=0,this.tutorialTween=this.scene.tweens.add({targets:this.tutorialText,alpha:1,ease:"Linear.In",duration:1e3*t,onComplete:function(){i.tutorialTween=void 0}});break;case a.eGameTutorialDisplayState.GAME_TUTORIAL_DISPLAY_STATE_SCROLL_OUT:this.tutorialText.visible=!0,this.tutorialGroup.visible=!0,this.tutorialArrowPosition?(this.tutorialArrow.visible=!0,this.tutorialArrow.alpha=1,this.tutorialTweenArrow=this.scene.tweens.add({targets:this.tutorialArrow,alpha:0,ease:"Linear.In",duration:1e3*t,onComplete:function(){i.tutorialTweenArrow=void 0}})):this.tutorialArrow.visible=!1,this.tutorialTween=this.scene.tweens.add({targets:this.tutorialGroup,y:this.mainScene.sys.canvas.height+200,ease:"Back.In",duration:1e3*t,onComplete:function(){i.tutorialTween=void 0}})}},t.prototype.getTimeStringFromInt=function(e){return e%60<10?Math.floor(e/60)+":0"+e%60:Math.floor(e/60)+":"+e%60},t}(Phaser.GameObjects.Group);t.Hud=_},1478:function(e,t,i){"use strict";var s=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=i(24),r=i(72),a=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.mainScene=t,s}return s(t,e),t.prototype.init=function(){var t=this;e.prototype.init.call(this),this.addButton(new r.ELButton(this.scene,o.RectMake(150,120,280,100),function(){t.buttonArcade()},this.soundClick,"Play\nArcade","ui","main_menu/button-green")),this.addButton(new r.ELButton(this.scene,o.RectMake(-150,120,280,100),function(){t.buttonRandom()},this.soundClick,"Play\nClassic","ui","main_menu/button-pink")),this.addButton(new r.ELButton(this.scene,o.RectMake(0,240,280,100),function(){t.buttonHowToPlay()},this.soundClick,"How To Play","ui","main_menu/button-blue")),this.add(new Phaser.GameObjects.Sprite(this.scene,0,-130,"ui","logo"))},t.prototype.buttonArcade=function(){var e=this;this.hidePopUp(function(){e.mainScene.levelConfig.tutorialComplete?e.mainScene.playArcade.showPopUp():e.mainScene.confirmExit.showConfirmPopUp("Learn how to play Cubis first?",function(t){e.buttonLearnArcade(t)})})},t.prototype.buttonRandom=function(){var e=this;this.hidePopUp(function(){e.mainScene.levelConfig.tutorialComplete?e.mainScene.buttonPlayRandom():e.mainScene.confirmExit.showConfirmPopUp("Learn how to play Cubis first?",function(t){e.buttonLearnRandom(t)})})},t.prototype.buttonHowToPlay=function(){var e=this;this.hidePopUp(function(){e.mainScene.howToPlayMenu.showPopUp()})},t.prototype.buttonLearnArcade=function(e){0==e?this.mainScene.buttonPlayTutorial(!1,!0):this.mainScene.playArcade.showPopUp()},t.prototype.buttonLearnRandom=function(e){0==e?this.mainScene.buttonPlayTutorial(!0,!0):this.mainScene.buttonPlayRandom()},t}(i(83).ELPopUp);t.MainMenuPopUp=a},1479:function(e,t,i){"use strict";var s=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=i(24),r=i(72),a=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.mainScene=t,s.pages=[],s.page=0,s.init2(),s}return s(t,e),t.prototype.initPage=function(e,t){var i=new Phaser.GameObjects.Container(this.scene);i.add(new Phaser.GameObjects.Sprite(this.scene,0,-25,"htp",e));var s=new Phaser.GameObjects.Text(this.scene,0,-300,"HOW TO PLAY",{fontFamily:"Calistoga",fontSize:"30px",color:"#ffdd9b"});s.setOrigin(.5,.5),i.add(s);var o=new Phaser.GameObjects.Text(this.scene,0,-270,t,{fontFamily:"Calistoga",fontSize:"22px",color:"#90f2f8"});return o.setOrigin(.5,.5),i.add(o),i.visible=!1,i},t.prototype.init2=function(){var e=this;this.addButton(new r.ELButton(this.scene,o.RectMake(290,-300,100,100),function(){e.buttonClose()},this.soundClick,void 0,"ui","button-x")),this.addButton(new r.ELButton(this.scene,o.RectMake(0,260,200,100),function(){e.buttonPlayTutorial()},this.soundClick,"Play Tutorial","ui","main_menu/button-blue")),this.addButton(new r.ELButton(this.scene,o.RectMake(150,260,100,55),function(){e.buttonNext()},this.soundClick,void 0,"ui","level_menu/button-arrow-right")),this.addButton(new r.ELButton(this.scene,o.RectMake(-150,260,100,55),function(){e.buttonPrev()},this.soundClick,void 0,"ui","level_menu/button-arrow-left")),this.pages.push(this.initPage("tha_basics_inside","The BASICS")),this.pages.push(this.initPage("the_cubes_inside","The CUBES")),this.pages.push(this.initPage("specials_inside","SPECIALS")),this.pages.push(this.initPage("tips_tricks_inside","TIPS & TRICKS"));for(var t=0;t=4)e=3;else{this.page=e;for(var i=0;i=this.mainScene.levelConfig.getLevelCount(E.LevelType.LEVEL_TYPE_ARCADE)/25)e=this.mainScene.levelConfig.getLevelCount(E.LevelType.LEVEL_TYPE_ARCADE)/25;else{this.page=e;for(var i=0;i0&&(this.messageText=u[e]),0==e&&(this.messageText=T[this.mainScene.levelData.level]);var i=void 0,s=void 0;t!=_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_METTER&&t!=_.CONST.GAME_TUTORIAL_EVENT_FIRST_LEVEL_COMPLETE||(i=_.PointMake(-260,-220),s=180),t==_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_RATING_STAR&&(i=_.PointMake(-320,-140),s=180),t==_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_DRAG1&&(i=_.PointMake(-160,70),s=-40),t!=_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_TAP1&&t!=_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_SHOT_AGAIN||(i=_.PointMake(-10,-60),s=-40),t==_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_SECOND_DRAG1&&(i=_.PointMake(370,10),s=220),t==_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_SECOND_TAP1&&(i=_.PointMake(220,-120),s=220),t==_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_DRAG2&&(i=_.PointMake(320,40),s=220),t==_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_TAP2&&(i=_.PointMake(170,-90),s=220),this.mainScene.hud.initTutorial(this.type,this.messageText,i,s),this.mainScene.hud.setTutorial(this.dState,this.dCount);break}e++}0==this.currentTutorialFlag&&this.stateAfterTutorial!=E.GameState.GAME_STATE_NONE&&this.GameTutorialSetNextState(this.stateAfterTutorial)}},e.prototype.GameTutorialHideMessage=function(){this.dState=a.GAME_TUTORIAL_DISPLAY_STATE_SCROLL_OUT,this.dCount=.5,this.mainScene.hud.setTutorial(this.dState,this.dCount)},e.prototype.GameTutorialTouchHandle=function(e,t,i,s,r){if(this.currentTutorialFlag&&(this.type==o.GAME_TUTORIAL_TYPE_CENTER||this.currentTutorialFlag==_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_METTER||this.currentTutorialFlag==_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_RATING_STAR))if(e||t)this.isPressed=!0;else if(i&&this.dState0)this.dCount-=t,this.dCount<0&&(this.dCount=0);else{switch(this.dCount=0,this.dState){case a.GAME_TUTORIAL_DISPLAY_STATE_SCROLL_OUT:this.dState=a.GAME_TUTORIAL_DISPLAY_STATE_OFF,this.currentTutorialFlag==_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_RATING_STAR&&this.GameTutorialControlsAction(this.mainScene.levelData.world,this.mainScene.levelData.level,r.GAME_TUTORIAL_CONTROLS_ACTION_NOTIFICATION_END,-1,-1,this.mainScene.levelData.cubesToGo);break;case a.GAME_TUTORIAL_DISPLAY_STATE_STAY:this.currentTutorialFlag!=_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_DRAG1&&this.currentTutorialFlag!=_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_TAP1&&this.currentTutorialFlag!=_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_SECOND_DRAG1&&this.currentTutorialFlag!=_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_SECOND_TAP1&&this.currentTutorialFlag!=_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_DRAG2&&this.currentTutorialFlag!=_.CONST.GAME_TUTORIAL_EVENT_MESSAGE_BOTTOM&&this.currentTutorialFlag!=_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_TAP2&&(this.dState=a.GAME_TUTORIAL_DISPLAY_STATE_SCROLL_OUT,this.dCount=.5);break;case a.GAME_TUTORIAL_DISPLAY_STATE_SCROLL_IN:this.dState=a.GAME_TUTORIAL_DISPLAY_STATE_SHOW_LINE,this.dCount=.25;break;case a.GAME_TUTORIAL_DISPLAY_STATE_SHOW_LINE:this.dState=a.GAME_TUTORIAL_DISPLAY_STATE_STAY,this.dCount=n[this.currentTutorialIndex],this.currentTutorialFlag==_.CONST.GAME_TUTORIAL_EVENT_FIRST_LEVEL_COMPLETE&&this.GameTutorialSetNextState(this.stateAfterTutorial);break;default:this.isBlocking&=~this.currentTutorialFlag,this.currentTutorialFlag=0,this.GameTutorialShow()}this.mainScene.hud.setTutorial(this.dState,this.dCount)}if(this.dState==a.GAME_TUTORIAL_DISPLAY_STATE_SCROLL_OUT||this.dState==a.GAME_TUTORIAL_DISPLAY_STATE_OFF){var i=this.tgameState;return this.tgameState!=E.GameState.GAME_STATE_NONE&&(this.tgameState=E.GameState.GAME_STATE_NONE),i}return E.GameState.GAME_STATE_NONE},e.prototype.GameTutorialControlsAction=function(e,t,i,o,T,u){var n=this;if(e!=_.CONST.TUTORIAL_INDEX)return this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_DONE,!0;switch(this.tutorialControlsState){case s.GAME_TUTORIAL_CONTROLS_STATE_NONE:return 0==t?(this.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_DRAG1),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_DRAG1,this.pointIndex=0):(this.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_DRAG2),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_DRAG2,this.pointIndex=1),!0;case s.GAME_TUTORIAL_CONTROLS_STATE_DRAG1:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_CUBE_MOVE&&this.tutorialControlsDragPoint[this.pointIndex].x==o&&this.tutorialControlsDragPoint[this.pointIndex].y==T&&(this.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_TAP1),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_TAP1,this.fingerFrame=0,this.GameTutorialHideMessage(),this.mainScene.cubeSelectedHolder.cubeSelected.x=this.tutorialControlsDragPoint[this.pointIndex].x,this.mainScene.cubeSelectedHolder.cubeSelected.y=this.tutorialControlsDragPoint[this.pointIndex].y,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredOrientation=this.mainScene.cubeSelectedHolder.cubeSelected.orientation,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetX=this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetY=this.mainScene.cubeSelectedHolder.cubeSelected.y),!1;case s.GAME_TUTORIAL_CONTROLS_STATE_BEFORE_SECOND_DRAG1:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_NEW_CUBE&&(this.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_SECOND_DRAG1),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_SECOND_DRAG1,this.pointIndex=2),!0;case s.GAME_TUTORIAL_CONTROLS_STATE_SECOND_DRAG1:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_CUBE_MOVE&&this.tutorialControlsDragPoint[this.pointIndex].x==o&&this.tutorialControlsDragPoint[this.pointIndex].y==T&&(this.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_SECOND_TAP1),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_SECOND_TAP1,this.fingerFrame=0,this.GameTutorialHideMessage(),this.mainScene.cubeSelectedHolder.cubeSelected.x=this.tutorialControlsDragPoint[this.pointIndex].x,this.mainScene.cubeSelectedHolder.cubeSelected.y=this.tutorialControlsDragPoint[this.pointIndex].y,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredOrientation=this.mainScene.cubeSelectedHolder.cubeSelected.orientation,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetX=this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetY=this.mainScene.cubeSelectedHolder.cubeSelected.y),!1;case s.GAME_TUTORIAL_CONTROLS_STATE_TAP1:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_TAP&&(this.GameTutorialHideMessage(),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_METTER),this.mainScene.cubeSelectedHolder.cubeSelected.x=this.tutorialControlsDragPoint[this.pointIndex].x,this.mainScene.cubeSelectedHolder.cubeSelected.y=this.tutorialControlsDragPoint[this.pointIndex].y,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredOrientation=this.mainScene.cubeSelectedHolder.cubeSelected.orientation,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetX=this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetY=this.mainScene.cubeSelectedHolder.cubeSelected.y,!0;case s.GAME_TUTORIAL_CONTROLS_STATE_SECOND_TAP1:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_TAP&&(this.GameTutorialHideMessage(),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_CONTINUE),this.mainScene.cubeSelectedHolder.cubeSelected.x=this.tutorialControlsDragPoint[this.pointIndex].x,this.mainScene.cubeSelectedHolder.cubeSelected.y=this.tutorialControlsDragPoint[this.pointIndex].y,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredOrientation=this.mainScene.cubeSelectedHolder.cubeSelected.orientation,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetX=this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetY=this.mainScene.cubeSelectedHolder.cubeSelected.y,!0;case s.GAME_TUTORIAL_CONTROLS_STATE_DRAG2:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_CUBE_MOVE&&this.tutorialControlsDragPoint[this.pointIndex].x==o&&this.tutorialControlsDragPoint[this.pointIndex].y==T&&(this.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_TAP2),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_TAP2,this.fingerFrame=0,this.GameTutorialHideMessage(),this.mainScene.cubeSelectedHolder.cubeSelected.x=this.tutorialControlsDragPoint[this.pointIndex].x,this.mainScene.cubeSelectedHolder.cubeSelected.y=this.tutorialControlsDragPoint[this.pointIndex].y,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredOrientation=this.mainScene.cubeSelectedHolder.cubeSelected.orientation,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetX=this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetY=this.mainScene.cubeSelectedHolder.cubeSelected.y),!1;case s.GAME_TUTORIAL_CONTROLS_STATE_TAP2:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_TAP&&(this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_STAR_RATING,this.GameTutorialHideMessage()),this.mainScene.cubeSelectedHolder.cubeSelected.x=this.tutorialControlsDragPoint[this.pointIndex].x,this.mainScene.cubeSelectedHolder.cubeSelected.y=this.tutorialControlsDragPoint[this.pointIndex].y,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredOrientation=this.mainScene.cubeSelectedHolder.cubeSelected.orientation,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetX=this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelectedDesiredTargetY=this.mainScene.cubeSelectedHolder.cubeSelected.y,!1;case s.GAME_TUTORIAL_CONTROLS_STATE_METTER:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_TAP&&this.GameTutorialHideMessage(),i==r.GAME_TUTORIAL_CONTROLS_ACTION_MATCH&&(this.GameTutorialGeneralEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_METTER,!0,"",E.GameState.GAME_STATE_NONE),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_BEFORE_SECOND_DRAG1),!0;case s.GAME_TUTORIAL_CONTROLS_STATE_CONTINUE:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_NEW_CUBE&&(this.GameTutorialGeneralEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_COMPLEATE,!1,"",E.GameState.GAME_STATE_NONE),this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_DONE),!0;case s.GAME_TUTORIAL_CONTROLS_STATE_STAR_RATING:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_STAR_NOTIFICATION&&this.mainScene.time.delayedCall(500,function(){n.dState!=a.GAME_TUTORIAL_DISPLAY_STATE_SCROLL_OUT&&n.dState==a.GAME_TUTORIAL_DISPLAY_STATE_STAY&&n.GameTutorialHideMessage(),n.GameTutorialGeneralEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_RATING_STAR,!0,"",E.GameState.GAME_STATE_NONE),n.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_STAR_ARROW},[],this),!0;case s.GAME_TUTORIAL_CONTROLS_STATE_STAR_ARROW:return i==r.GAME_TUTORIAL_CONTROLS_ACTION_NOTIFICATION_END&&(this.tutorialControlsState=s.GAME_TUTORIAL_CONTROLS_STATE_DONE,this.GameTutorialEvent(_.CONST.GAME_TUTORIAL_EVENT_CONTROLS_GET_STAR)),!0;case s.GAME_TUTORIAL_CONTROLS_STATE_DONE:default:return!0}},e.prototype.GameTutorialControlsCanTap=function(){return this.tutorialControlsState!=s.GAME_TUTORIAL_CONTROLS_STATE_DRAG1&&this.tutorialControlsState!=s.GAME_TUTORIAL_CONTROLS_STATE_TAP1&&this.tutorialControlsState!=s.GAME_TUTORIAL_CONTROLS_STATE_SECOND_DRAG1&&this.tutorialControlsState!=s.GAME_TUTORIAL_CONTROLS_STATE_SECOND_TAP1&&this.tutorialControlsState!=s.GAME_TUTORIAL_CONTROLS_STATE_DRAG2&&this.tutorialControlsState!=s.GAME_TUTORIAL_CONTROLS_STATE_TAP2||(this.tutorialControlsState==s.GAME_TUTORIAL_CONTROLS_STATE_TAP1||this.tutorialControlsState==s.GAME_TUTORIAL_CONTROLS_STATE_SECOND_TAP1||this.tutorialControlsState==s.GAME_TUTORIAL_CONTROLS_STATE_TAP2)&&this.dState==a.GAME_TUTORIAL_DISPLAY_STATE_STAY},e.prototype.GameTutorialControlsCountTime=function(e){return e!=_.CONST.TUTORIAL_INDEX},e.prototype.GameTutorialControlsCanMove=function(){return this.tutorialControlsState!=s.GAME_TUTORIAL_CONTROLS_STATE_TAP1&&this.tutorialControlsState!=s.GAME_TUTORIAL_CONTROLS_STATE_SECOND_TAP1&&this.tutorialControlsState!=s.GAME_TUTORIAL_CONTROLS_STATE_TAP2},e}();t.TutorialHolder=c},24:function(e,t,i){"use strict";function s(e){return e.sys.canvas.width/2-80}Object.defineProperty(t,"__esModule",{value:!0}),t.IS_TOUCH=!1,window.addEventListener("touchstart",function(){t.IS_TOUCH=!0}),t.IS_PRODUCTION=!0,t.IS_ICONSOLE=!0,t.PointMake=function(e,t){return{x:e||0,y:t||0}},t.RectMake=function(e,t,i,s){return{x:e||0,y:t||0,w:i||0,h:s||0}},t.IsLeftOfVector=function(e,t,i){return(t.x-e.x)*(i.y-e.y)-(t.y-e.y)*(i.x-e.x)>0},t.GetCubeBoardPosX=function(e,i,s,o){return e.sys.canvas.width/2+t.CONST.GAME_CUBE_BOARD_START_X+t.CONST.GAME_CUBE_BOARD_OFFSET_X*i-t.CONST.GAME_CUBE_BOARD_OFFSET_X*s},t.GetCubeBoardPosY=function(e,i,s,o){return e.sys.canvas.height/2+t.CONST.GAME_CUBE_BOARD_START_Y+t.CONST.GAME_CUBE_BOARD_OFFSET_Y*s+t.CONST.GAME_CUBE_BOARD_OFFSET_Y*i-t.CONST.GAME_CUBE_BOARD_OFFSET_Z*o},t.DEGREES_TO_RADIANS=function(e){return e*(Math.PI/180)},t.formatDigit=function(e,t,i,s){t=isNaN(t=Math.abs(t))?2:t,i=void 0===i?".":i,s=void 0===s?",":s;var o=e<0?"-":"",r=String(parseInt(e=Math.abs(Number(e)||0).toFixed(t))),a=(a=r.length)>3?a%3:0;return o+(a?r.substr(0,a)+s:"")+r.substr(a).replace(/(\decSep{3})(?=\decSep)/g,"$1"+s)+(t?i+Math.abs(e-r).toFixed(t).slice(2):"")},t.GAME_HUD_QUEUE_X=s,t.GAME_HUD_QUEUE_Y=function(e){return e.sys.canvas.height/2-340},t.GAME_CUBE_SELECTED_PHASE_0_OFFSET_X=function(e){return s(e)+3*t.CONST.GAME_CUBE_SELECTED_QUEUE_SPEED},t.CONST={GAME_MATCHING_PRIORITY:1,GAME_SECOND_IN_FRAMES:25,GAME_IMMOVABLE_DECREASES_CUBES_TO_GO:!0,GAME_CUBE_QUEUE_FORCED_COLOR_TYPE:2,GAME_CUBE_QUEUE_FORCED_COLOR_TRESHOLD_BOARD:3,GAME_CUBE_QUEUE_FORCED_COLOR_TRESHOLD_CTG:100,GAME_HUD_TIMER_WARNING_TRESHOLD:15,GAME_LEVEL_TIME_REDUCTION:0,GAME_CUBE_SLIDING_SPEED:23.75,GAME_CUBE_FRACTURING_SPEED:.55*25,GAME_CUBE_PUSHING_SPEED:8.75,GAME_WEDGE_LIFTING_SPEED:8.75,GAME_OSMOSIS_LIFTING_SPEED:8.75,GAME_BOMB_BLAST_HORIZONTAL_SPEED:1.5,GAME_BOMB_BLAST_VERTICAL_SPEED:40,GAME_BOARD_BUILD_FALL_SPEED:40,GAME_BOARD_CUBE_CLEAR_SPEED:75,GAME_CUBE_FLOAT_SPEED:75,GAME_CUBE_FALLING_ACCEL:193.75,GAME_BOMB_BLAST_VERTICAL_ACCEL:.14*25*25,GAME_CUBE_FLOAT_AMPLITUDE:1.8,GAME_CUBE_MATCH_DELAY:0,GAME_CUBE_FALLING_DELAY:0,GAME_OSMOSIS_LIFTING_DELAY:0,GAME_LASER_DESTRUCTION_DELAY:0,GAME_BOMB_DETONATION_DELAY:.04,GAME_CUBE_STAR_SHIMMER_DELAY:50,GAME_CUBE_STAR_SHIMMER_VARIANCE_DELAY:125,GAME_QUEUE_COLOR_CHANGE_ANIM_TIME:15,GAME_CONTROLS_START_X:66,GAME_CONTROLS_START_Y:-256,GAME_CONTROLS_OFFSET_X:39,GAME_CONTROLS_OFFSET_Y:32,GAME_CONTROLS_INDEX_START_X:6,GAME_CONTROLS_INDEX_STOP_X:14,GAME_CONTROLS_INDEX_START_Y:6,GAME_CONTROLS_INDEX_STOP_Y:14,GAME_CONTROLS_INDEX_DEPTH_START:1,GAME_CONTROLS_INDEX_DEPTH_STOP:-3,GAME_CONTROLS_TEST_POINT_OFFSET_X0:-2,GAME_CONTROLS_TEST_POINT_OFFSET_X1:2,GAME_CONTROLS_TEST_POINT_OFFSET_Y:5,GAME_CONTROLS_TRACK_FASTER_TRESHOLD:2,GAME_CONTROLS_TRACK_FASTER_SPEED:2,GAME_BOARD_ROW_GUIDE_START_X:142,GAME_BOARD_ROW_GUIDE_START_Y:-100,GAME_CUBE_BOARD_SIZE_X:7,GAME_CUBE_BOARD_SIZE_Y:7,GAME_CUBE_BOARD_SIZE_Z:3,GAME_CUBE_BOARD_START_X:66,GAME_CUBE_BOARD_START_Y:-256,GAME_CUBE_BOARD_OFFSET_X:39,GAME_CUBE_BOARD_OFFSET_Y:32,GAME_CUBE_BOARD_OFFSET_Z:35,GAME_LEVEL_BUILD_PARAM_0:38,GAME_LEVEL_BUILD_PARAM_1:7.5,GAME_LEVEL_BUILD_PARAM_2:30,GAME_LEVEL_BUILD_PARAM_3:20,GAME_LEVEL_BUILD_PARAM_4:24,GAME_LEVEL_BUILD_PARAM_OFFSET_0:5.857,GAME_LEVEL_BUILD_PARAM_OFFSET_1:-14.143,GAME_LEVEL_BUILD_PARAM_OFFSET_2:0,GAME_LEVEL_BUILD_PARAM_OFFSET_3:0,GAME_CUBE_BOARD_BUILD_PATTERN_NUM:4,GAME_CUBE_BOARD_BUILD_PATTERN_0:0,GAME_CUBE_BOARD_BUILD_PATTERN_1:1,GAME_CUBE_BOARD_BUILD_PATTERN_2:2,GAME_CUBE_BOARD_BUILD_PATTERN_3:3,GAME_CUBE_BOARD_CLEAR_PATTERN_NUM:14,GAME_CUBE_BOARD_CLEAR_PATTERN_LENGHT:49,GAME_CUBE_BOARD_CLEAR_PATTERN_FRAME_TIME:10,GAME_CUBE_SELECTED_QUEUE_SPEED:60,GAME_CUBE_SELECTED_QUEUE_TIME:1,GAME_CUBE_SELECTED_QUEUE_TARGET_DEACCEL:17.5,GAME_CUBE_SELECTED_QUEUE_TARGET_REACH_DIFF:6,GAME_CUBE_SELECTED_PHASE_1_RADIUS_X:300,GAME_CUBE_SELECTED_PHASE_1_RADIUS_Y:340,GAME_CUBE_QUEUE_FIXED_SIZE:256,GAME_CUBE_QUEUE_RANDOM_SIZE:64,GAME_CUBE_QUEUE_COLOR_NUM:6,GAME_CUBE_QUEUE_NUM:3,GAME_HUD_QUEUE_OFFSET_X:-80,GAME_SCORE_TRESHOLD:5,GAME_SCORE_NORMAL_CUBE_SCORE:10,GAME_SCORE_STAR_CUBE_SCORE:200,GAME_SCORE_CUBIS_MULTIPILER:1,GAME_SCORE_BIG_MATCH_MULTIPILER:.5,GAME_SCORE_PERFECT_MULTIPILER:.25,GAME_SCORE_TIME_MULTIPILER:40,GAME_SCORE_TEXT_DELAY_TIME:.15,GAME_SCORE_TEXT_LIFE_TIME:.5,GAME_SCORE_TEXT_BLEND_TIME:.8,GAME_SCORE_TEXT_VERTICAL_SPEED:.8,TUTORIAL_INDEX:-2,GAME_TUTORIAL_EVENT_LEVEL_START:1,GAME_TUTORIAL_EVENT_FIRST_CUBE_PUSH:2,GAME_TUTORIAL_EVENT_FIRST_NO_CUBE_PUSH:4,GAME_TUTORIAL_EVENT_FIRST_CUBIS_MATCH:8,GAME_TUTORIAL_EVENT_FIRST_STAR_CUBE_MATCH:16,GAME_TUTORIAL_EVENT_FIRST_LONG_CHAIN_MATCH:32,GAME_TUTORIAL_EVENT_FIRST_CUBE_FRACTURE:64,GAME_TUTORIAL_EVENT_FIRST_BOMB_THROW_CUBES:128,GAME_TUTORIAL_EVENT_FIRST_CUBIS_MATCH_DUAL_CUBE:256,GAME_TUTORIAL_EVENT_FIRST_WEDGE_NO_LIFT:512,GAME_TUTORIAL_EVENT_FIRST_OSMOSIS_NO_LIFT:1024,GAME_TUTORIAL_EVENT_FIRST_CANT_INSERT_CUBE:2048,GAME_TUTORIAL_EVENT_FIRST_LEVEL_COMPLETE:4096,GAME_TUTORIAL_EVENT_FIRST_LEVEL_PERFECT:8192,GAME_TUTORIAL_EVENT_FIRST_TIME_OUT:16384,GAME_TUTORIAL_EVENT_FIRST_NO_MORE_MOVES:32768,GAME_TUTORIAL_EVENT_NO_CUBE_PUSH_AT_EDGE:65536,GAME_TUTORIAL_EVENT_WEDGE_NO_LIFT_AT_EDGE:1<<17,GAME_TUTORIAL_EVENT_OSMOSIS_NO_LIFT_AT_EDGE:1<<18,GAME_TUTORIAL_EVENT_CONTROLS_DRAG1:1<<19,GAME_TUTORIAL_EVENT_CONTROLS_TAP1:1<<20,GAME_TUTORIAL_EVENT_CONTROLS_SHOT_AGAIN:1<<21,GAME_TUTORIAL_EVENT_CONTROLS_METTER:1<<22,GAME_TUTORIAL_EVENT_CONTROLS_COMPLEATE:1<<23,GAME_TUTORIAL_EVENT_CONTROLS_DRAG2:1<<24,GAME_TUTORIAL_EVENT_CONTROLS_TAP2:1<<25,GAME_TUTORIAL_EVENT_CONTROLS_RATING_STAR:1<<26,GAME_TUTORIAL_EVENT_CONTROLS_GET_STAR:1<<27,GAME_TUTORIAL_EVENT_MESSAGE_BOTTOM:1<<28,GAME_TUTORIAL_EVENT_CONTROLS_SECOND_DRAG1:1<<29,GAME_TUTORIAL_EVENT_CONTROLS_SECOND_TAP1:1<<30,GAME_TUTORIAL_EVENT_ALL:(1<<31)-1,GAME_TUTORIAL_EVENT_COUNT:31,GAME_CUBE_ANIMATION_SIZE_X:8,GAME_CUBE_ANIMATION_SIZE_Y:8,GAME_CUBE_ANIMATION_SIZE_Z:3,GAME_CUBE_ANIMATION_SIZE_K:2,GAME_NOTIFICATION_MULTIPLIER:2}},263:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t,i){this.emitterType=0,this.sourcePosition=this.vector2fMake(),this.sourcePositionVariance=this.vector2fMake(),this.angle=0,this.angleVariance=0,this.speed=0,this.speedVariance=0,this.radialAcceleration=0,this.tangentialAcceleration=0,this.radialAccelVariance=0,this.tangentialAccelVariance=0,this.gravity=this.vector2fMake(),this.particleLifespan=0,this.particleLifespanVariance=0,this.startColor=this.color4fMake(),this.startColorVariance=this.color4fMake(),this.finishColor=this.color4fMake(),this.finishColorVariance=this.color4fMake(),this.startParticleSize=0,this.startParticleSizeVariance=0,this.finishParticleSize=0,this.finishParticleSizeVariance=0,this.maxParticles=0,this.particleCount=0,this.emissionRate=0,this.emitCounter=0,this.elapsedTime=0,this.duration=0,this.rotationStart=0,this.rotationStartVariance=0,this.rotationEnd=0,this.rotationEndVariance=0,this.updateRate=0,this.blendFuncSource=0,this.blendFuncDestination=0,this.maxRadius=0,this.maxRadiusVariance=0,this.radiusSpeed=0,this.minRadius=0,this.rotatePerSecond=0,this.rotatePerSecondVariance=0,this.active=!1,this.particles=[],this.spriteDepth=0,this.currentScene=e,this.resourceKey=t,this.spriteDepth=i||0,this.parseParticleConfig(e.cache.text.get(t))}return e.prototype.destroy=function(){for(;this.particles.length>0;){var e=this.particles.pop();void 0!==e&&e.sprite.destroy()}},e.prototype.setupArrays=function(){this.destroy(),this.active=!0,this.particleCount=0,this.elapsedTime=0},e.prototype.particleMake=function(e){var t={position:this.vector2fMake(),angle:0,color:this.color4fMake(),degreesPerSecond:0,deltaColor:this.color4fMake(),direction:this.vector2fMake(),particleSize:0,particleSizeDelta:0,radialAcceleration:0,radius:0,radiusDelta:0,rotation:0,rotationDelta:0,startPos:this.vector2fMake(),tangentialAcceleration:0,timeToLive:0,sprite:this.currentScene.add.sprite(0,0,e)};return t.sprite.setActive(!1),t.sprite.setVisible(!1),t.sprite.setDepth(this.spriteDepth),t.sprite.blendMode=1==this.blendFuncDestination?Phaser.BlendModes.ADD:Phaser.BlendModes.NORMAL,t},e.prototype.vector2fMake=function(e,t){return{x:e||0,y:t||0}},e.prototype.color4fMake=function(e,t,i,s){return{red:e||0,green:t||0,blue:i||0,alpha:s||0}},e.prototype.vector2fSub=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},e.prototype.vector2fAdd=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},e.prototype.vector2fMultiply=function(e,t){return{x:e.x*t,y:e.y*t}},e.prototype.vector2fDot=function(e,t){return e.x*t.x+e.y*t.y},e.prototype.vector2fLength=function(e){return Math.sqrt(this.vector2fDot(e,e))},e.prototype.vector2fNormalize=function(e){return this.vector2fMultiply(e,1/this.vector2fLength(e))},e.prototype.stringFromChildElementNamed=function(e,t,i){var s=i.indexOf(e),o=i.indexOf(t,s+e.length),r=i.indexOf('"',o+2+t.length);return i.substring(o+2+t.length,r)},e.prototype.numberFromChildElementNamed=function(e,t){return+this.stringFromChildElementNamed(e,"value",t)},e.prototype.vector2fFromChildElementNamed=function(e,t){return{x:+this.stringFromChildElementNamed(e,"x",t),y:+this.stringFromChildElementNamed(e,"y",t)}},e.prototype.color4fFromChildElementNamed=function(e,t){return{red:+this.stringFromChildElementNamed(e,"red",t),green:+this.stringFromChildElementNamed(e,"green",t),blue:+this.stringFromChildElementNamed(e,"blue",t),alpha:+this.stringFromChildElementNamed(e,"alpha",t)}},e.prototype.RANDOM_MINUS_1_TO_1=function(){return 2*Math.random()-1},e.prototype.RANDOM_MINUS_0_TO_1=function(){return Math.random()},e.prototype.CLAMP=function(e,t,i){return ei?i:e},e.prototype.DEGREES_TO_RADIANS=function(e){return e*Math.PI/180},e.prototype.parseParticleConfig=function(e){this.emitterType=this.numberFromChildElementNamed("emitterType",e),this.sourcePosition=this.vector2fFromChildElementNamed("sourcePosition",e),this.sourcePositionVariance=this.vector2fFromChildElementNamed("sourcePositionVariance",e),this.speed=this.numberFromChildElementNamed("speed",e),this.speedVariance=this.numberFromChildElementNamed("speedVariance",e),this.particleLifespan=this.numberFromChildElementNamed("particleLifeSpan",e),this.particleLifespanVariance=this.numberFromChildElementNamed("particleLifespanVariance",e),this.angle=this.numberFromChildElementNamed("angle",e),this.angleVariance=this.numberFromChildElementNamed("angleVariance",e),this.gravity=this.vector2fFromChildElementNamed("gravity",e),this.radialAcceleration=this.numberFromChildElementNamed("radialAcceleration",e),this.tangentialAcceleration=this.numberFromChildElementNamed("tangentialAcceleration",e),this.startColor=this.color4fFromChildElementNamed("startColor",e),this.startColorVariance=this.color4fFromChildElementNamed("startColorVariance",e),this.finishColor=this.color4fFromChildElementNamed("finishColor",e),this.finishColorVariance=this.color4fFromChildElementNamed("finishColorVariance",e),this.maxParticles=this.numberFromChildElementNamed("maxParticles",e),this.startParticleSize=this.numberFromChildElementNamed("startParticleSize",e),this.startParticleSizeVariance=this.numberFromChildElementNamed("startParticleSizeVariance",e),this.finishParticleSize=this.numberFromChildElementNamed("finishParticleSize",e),this.finishParticleSizeVariance=this.numberFromChildElementNamed("FinishParticleSizeVariance",e),this.duration=this.numberFromChildElementNamed("duration",e),this.blendFuncSource=this.numberFromChildElementNamed("blendFuncSource",e),this.blendFuncDestination=this.numberFromChildElementNamed("blendFuncDestination",e),this.maxRadius=this.numberFromChildElementNamed("maxRadius",e),this.maxRadiusVariance=this.numberFromChildElementNamed("maxRadiusVariance",e),this.radiusSpeed=this.numberFromChildElementNamed("radiusSpeed",e),this.minRadius=this.numberFromChildElementNamed("minRadius",e),this.rotatePerSecond=this.numberFromChildElementNamed("rotatePerSecond",e),this.rotatePerSecondVariance=this.numberFromChildElementNamed("rotatePerSecondVariance",e),this.rotationStart=this.numberFromChildElementNamed("rotationStart",e),this.rotationStartVariance=this.numberFromChildElementNamed("rotationStartVariation",e),this.rotationEnd=this.numberFromChildElementNamed("rotationEnd",e),this.rotationEndVariance=this.numberFromChildElementNamed("rotationEndVariance",e),this.updateRate=60,this.emissionRate=this.maxParticles/this.particleLifespan},e.prototype.stopParticleEmitter=function(){this.active=!1,this.elapsedTime=0,this.emitCounter=0},e.prototype.startParticleEmiter=function(){this.setupArrays()},e.prototype.isAlive=function(){return this.active||this.particleCount>0},e.prototype.scale=function(e){this.speed*=e,this.speedVariance*=e,this.gravity.x*=e,this.gravity.y*=e,this.startParticleSize*=e,this.startParticleSizeVariance*=e,this.finishParticleSize*=e,this.finishParticleSizeVariance*=e,this.radiusSpeed*=e,this.sourcePositionVariance.x*=e,this.sourcePositionVariance.y*=e,this.maxRadius*=e,this.maxRadiusVariance*=e,this.minRadius*=e},e.prototype.addParticle=function(){return!(this.particleCount>=this.maxParticles)&&(this.particles.push(this.particleMake(this.resourceKey)),this.initParticle(this.particles[this.particleCount]),this.particleCount++,!0)},e.prototype.initParticle=function(e){e.sprite.setActive(!0),e.sprite.setVisible(!0),e.position.x=this.sourcePosition.x+this.sourcePositionVariance.x*this.RANDOM_MINUS_1_TO_1(),e.position.y=-(this.sourcePosition.y+this.sourcePositionVariance.y*this.RANDOM_MINUS_1_TO_1()),e.startPos.x=this.sourcePosition.x,e.startPos.y=-this.sourcePosition.y;var t=this.DEGREES_TO_RADIANS(this.angle+this.angleVariance*this.RANDOM_MINUS_1_TO_1()),i=this.vector2fMake(Math.cos(t),Math.sin(t)),s=this.speed+this.speedVariance*this.RANDOM_MINUS_1_TO_1();e.direction=this.vector2fMultiply(i,s),e.radius=this.maxRadius+this.maxRadiusVariance*this.RANDOM_MINUS_1_TO_1(),e.radiusDelta=this.maxRadius/this.particleLifespan*(1/this.updateRate),e.angle=this.DEGREES_TO_RADIANS(this.angle+this.angleVariance*this.RANDOM_MINUS_1_TO_1()),e.degreesPerSecond=this.DEGREES_TO_RADIANS(this.rotatePerSecond+this.rotatePerSecondVariance*this.RANDOM_MINUS_1_TO_1()),e.radialAcceleration=this.radialAcceleration,e.tangentialAcceleration=this.tangentialAcceleration,e.timeToLive=Math.max(0,this.particleLifespan+this.particleLifespanVariance*this.RANDOM_MINUS_1_TO_1());var o=this.startParticleSize+this.startParticleSizeVariance*this.RANDOM_MINUS_1_TO_1(),r=this.finishParticleSize+this.finishParticleSizeVariance*this.RANDOM_MINUS_1_TO_1();e.particleSizeDelta=(r-o)/e.timeToLive*(1/this.updateRate),e.particleSize=Math.max(0,o);var a=this.color4fMake(this.startColor.red+this.startColorVariance.red*this.RANDOM_MINUS_1_TO_1(),this.startColor.green+this.startColorVariance.green*this.RANDOM_MINUS_1_TO_1(),this.startColor.blue+this.startColorVariance.blue*this.RANDOM_MINUS_1_TO_1(),this.startColor.alpha+this.startColorVariance.alpha*this.RANDOM_MINUS_1_TO_1()),_=this.color4fMake(this.finishColor.red+this.finishColorVariance.red*this.RANDOM_MINUS_1_TO_1(),this.finishColor.green+this.finishColorVariance.green*this.RANDOM_MINUS_1_TO_1(),this.finishColor.blue+this.finishColorVariance.blue*this.RANDOM_MINUS_1_TO_1(),this.finishColor.alpha+this.finishColorVariance.alpha*this.RANDOM_MINUS_1_TO_1());e.color=a,e.deltaColor.red=(_.red-a.red)/e.timeToLive*(1/this.updateRate),e.deltaColor.green=(_.green-a.green)/e.timeToLive*(1/this.updateRate),e.deltaColor.blue=(_.blue-a.blue)/e.timeToLive*(1/this.updateRate),e.deltaColor.alpha=(_.alpha-a.alpha)/e.timeToLive*(1/this.updateRate);var E=this.rotationStart+this.rotationStartVariance*this.RANDOM_MINUS_1_TO_1(),T=this.rotationEnd+this.rotationEndVariance*this.RANDOM_MINUS_1_TO_1();e.rotation=E,e.rotationDelta=(T-E)/e.timeToLive},e.prototype.update=function(e,t){var i=t/1e3;if(this.active&&this.emissionRate>0){var s=1/this.emissionRate;for(this.emitCounter+=i;this.particleCounts;)this.addParticle(),this.emitCounter-=s;this.elapsedTime+=i,-1!=this.duration&&this.duration0){if(1==this.emitterType){r.angle+=r.degreesPerSecond*i,r.radius-=r.radiusDelta;var a=this.vector2fMake();a.x=this.sourcePosition.x-Math.cos(r.angle)*r.radius,a.y=-(this.sourcePosition.y-Math.sin(r.angle)*r.radius),r.position=a,r.radius0?r.particleSize:0,r.particleSize>0?r.particleSize:0),r.sprite.tint=(255*(r.color.red>1?1:r.color.red)<<16)+(255*(r.color.green>1?1:r.color.green)<<8)+255*(r.color.blue>1?1:r.color.blue),r.sprite.rotation=r.angle,o++}else{if(o!=this.particleCount-1){var n=this.particles[o];this.particles[o]=this.particles[this.particleCount-1],this.particles[this.particleCount-1]=n}this.particles[this.particleCount-1].sprite.destroy(),this.particles.splice(this.particleCount-1,1),this.particleCount--}}},e}();t.ParticleEmiter=s},36:function(e,t,i){"use strict";var s,o,r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.CUBE_TYPE_NONE=-1]="CUBE_TYPE_NONE",e[e.CUBE_TYPE_EMPTY=0]="CUBE_TYPE_EMPTY",e[e.CUBE_TYPE_NORMAL=1]="CUBE_TYPE_NORMAL",e[e.CUBE_TYPE_STAR=2]="CUBE_TYPE_STAR",e[e.CUBE_TYPE_DUAL=3]="CUBE_TYPE_DUAL",e[e.CUBE_TYPE_FRACTURED=4]="CUBE_TYPE_FRACTURED",e[e.CUBE_TYPE_FRACTURED_DUAL=5]="CUBE_TYPE_FRACTURED_DUAL",e[e.CUBE_TYPE_IMMOVABLE=6]="CUBE_TYPE_IMMOVABLE",e[e.CUBE_TYPE_WEDGE=7]="CUBE_TYPE_WEDGE",e[e.CUBE_TYPE_OSMOSIS=8]="CUBE_TYPE_OSMOSIS",e[e.CUBE_TYPE_LASER=9]="CUBE_TYPE_LASER",e[e.CUBE_TYPE_BOMB=10]="CUBE_TYPE_BOMB"}(s=t.CubeType||(t.CubeType={})),function(e){e[e.CUBE_COLOR_NONE=-1]="CUBE_COLOR_NONE",e[e.CUBE_COLOR_YELLOW=0]="CUBE_COLOR_YELLOW",e[e.CUBE_COLOR_BLUE=1]="CUBE_COLOR_BLUE",e[e.CUBE_COLOR_RED=2]="CUBE_COLOR_RED",e[e.CUBE_COLOR_GREEN=3]="CUBE_COLOR_GREEN",e[e.CUBE_COLOR_ORANGE=4]="CUBE_COLOR_ORANGE",e[e.CUBE_COLOR_PURPLE=5]="CUBE_COLOR_PURPLE"}(o=t.CubeColor||(t.CubeColor={})),function(e){e[e.CUBE_ORIENTATION_NONE=-1]="CUBE_ORIENTATION_NONE",e[e.CUBE_ORIENTATION_RIGHT=0]="CUBE_ORIENTATION_RIGHT",e[e.CUBE_ORIENTATION_LEFT=1]="CUBE_ORIENTATION_LEFT"}(r=t.CubeOrientation||(t.CubeOrientation={})),function(e){e[e.CUBE_STATE_NONE=-1]="CUBE_STATE_NONE",e[e.CUBE_STATE_IDLE=0]="CUBE_STATE_IDLE",e[e.CUBE_STATE_MOVE_RIGHT=1]="CUBE_STATE_MOVE_RIGHT",e[e.CUBE_STATE_MOVE_LEFT=2]="CUBE_STATE_MOVE_LEFT",e[e.CUBE_STATE_FRACTURE_RIGHT=3]="CUBE_STATE_FRACTURE_RIGHT",e[e.CUBE_STATE_FRACTURE_LEFT=4]="CUBE_STATE_FRACTURE_LEFT",e[e.CUBE_STATE_PUSH_RIGHT=5]="CUBE_STATE_PUSH_RIGHT",e[e.CUBE_STATE_PUSH_LEFT=6]="CUBE_STATE_PUSH_LEFT",e[e.CUBE_STATE_WEDGE_RIGHT=7]="CUBE_STATE_WEDGE_RIGHT",e[e.CUBE_STATE_WEDGE_LEFT=8]="CUBE_STATE_WEDGE_LEFT",e[e.CUBE_STATE_WEDGE_LIFT_UP=9]="CUBE_STATE_WEDGE_LIFT_UP",e[e.CUBE_STATE_OSMOSIS_LIFT_AND_GENERATE_WAIT=10]="CUBE_STATE_OSMOSIS_LIFT_AND_GENERATE_WAIT",e[e.CUBE_STATE_OSMOSIS_LIFT_UP=11]="CUBE_STATE_OSMOSIS_LIFT_UP",e[e.CUBE_STATE_LASER_SHOT=12]="CUBE_STATE_LASER_SHOT",e[e.CUBE_STATE_FALL_WAIT=13]="CUBE_STATE_FALL_WAIT",e[e.CUBE_STATE_FALL_PROCESS=14]="CUBE_STATE_FALL_PROCESS",e[e.CUBE_STATE_MATCH_NORMAL=15]="CUBE_STATE_MATCH_NORMAL",e[e.CUBE_STATE_MATCH_STAR=16]="CUBE_STATE_MATCH_STAR",e[e.CUBE_STATE_MATCH_DUAL_0=17]="CUBE_STATE_MATCH_DUAL_0",e[e.CUBE_STATE_MATCH_DUAL_1=18]="CUBE_STATE_MATCH_DUAL_1",e[e.CUBE_STATE_BOMB_DETONATION_RIGHT=19]="CUBE_STATE_BOMB_DETONATION_RIGHT",e[e.CUBE_STATE_BOMB_DETONATION_LEFT=20]="CUBE_STATE_BOMB_DETONATION_LEFT",e[e.CUBE_STATE_BOMB_DISTRIBUTION=21]="CUBE_STATE_BOMB_DISTRIBUTION",e[e.CUBE_STATE_LEVEL_BUILD=22]="CUBE_STATE_LEVEL_BUILD",e[e.CUBE_STATE_LEVEL_CLEAN_BEGIN=23]="CUBE_STATE_LEVEL_CLEAN_BEGIN",e[e.CUBE_STATE_LEVEL_CLEAN_END=24]="CUBE_STATE_LEVEL_CLEAN_END"}(t.CubeState||(t.CubeState={}));var a=function(){function e(){this.typeLast=s.CUBE_TYPE_NONE,this.typeCurrent=s.CUBE_TYPE_NONE,this.color0=o.CUBE_COLOR_NONE,this.color1=o.CUBE_COLOR_NONE,this.color0Last=o.CUBE_COLOR_NONE,this.color1Last=o.CUBE_COLOR_NONE,this.orientation=r.CUBE_ORIENTATION_NONE,this.orientationLast=r.CUBE_ORIENTATION_NONE,this.spriteIndex=0,this.spriteIndexLast=0}return e.prototype.init=function(e,t,i){this.mainScene=e,this.sprite0=new Phaser.GameObjects.Sprite(e,t,i,"cubeGeneric"),this.sprite0.setActive(!1),this.sprite0.setVisible(!1),this.sprite1=new Phaser.GameObjects.Sprite(e,t,i,"cubeGeneric"),this.sprite1.setActive(!1),this.sprite1.setVisible(!1),e.add.existing(this.sprite0),e.add.existing(this.sprite1)},e.prototype.update=function(e,t){var i=t/1e3;if(this.spriteIndex+=30*i,this.typeLast!=this.typeCurrent||this.color0Last!=this.color0||this.color1Last!=this.color1||this.orientationLast!=this.orientation||this.typeLast==s.CUBE_TYPE_OSMOSIS&&this.spriteIndexLast!=this.spriteIndex||this.typeLast==s.CUBE_TYPE_LASER&&this.spriteIndexLast!=this.spriteIndex||this.typeLast==s.CUBE_TYPE_BOMB&&this.spriteIndexLast!=this.spriteIndex)switch(this.typeLast=this.typeCurrent,this.color0Last=this.color0,this.color1Last=this.color1,this.orientationLast=this.orientation,this.spriteIndexLast=this.spriteIndex,this.typeCurrent){case s.CUBE_TYPE_NONE:case s.CUBE_TYPE_EMPTY:this.sprite0.visible&&this.sprite0.setVisible(!1),this.sprite1.visible&&this.sprite1.setVisible(!1);break;case s.CUBE_TYPE_NORMAL:this.sprite0.setVisible(!0),this.sprite0.setFrame("normal/normal_"+this.color0),this.sprite1.visible&&this.sprite1.setVisible(!1);break;case s.CUBE_TYPE_STAR:this.sprite0.setVisible(!0),this.sprite0.setFrame("star/star_"+this.color0),this.sprite1.visible&&this.sprite1.setVisible(!1);break;case s.CUBE_TYPE_DUAL:this.sprite0.setVisible(!0),this.sprite0.setFrame("dual/dual_"+(this.orientation==r.CUBE_ORIENTATION_LEFT?"left_":"right_")+"top_"+(this.orientation==r.CUBE_ORIENTATION_LEFT?this.color1:this.color0)),this.sprite1.setVisible(!0),this.sprite1.setFrame("dual/dual_"+(this.orientation==r.CUBE_ORIENTATION_LEFT?"left_":"right_")+"bottom_"+(this.orientation==r.CUBE_ORIENTATION_LEFT?this.color0:this.color1));break;case s.CUBE_TYPE_FRACTURED:this.sprite0.setVisible(!0),this.sprite0.setFrame("fractured/fractured_"+this.color0),this.sprite1.visible&&this.sprite1.setVisible(!1);break;case s.CUBE_TYPE_FRACTURED_DUAL:this.sprite0.setVisible(!0),this.sprite0.setFrame("fractured_dual/fractured_dual_"+(this.orientation==r.CUBE_ORIENTATION_LEFT?"left_":"right_")+"top_"+(this.orientation==r.CUBE_ORIENTATION_LEFT?this.color1:this.color0)),this.sprite1.setVisible(!0),this.sprite1.setFrame("fractured_dual/fractured_dual_"+(this.orientation==r.CUBE_ORIENTATION_LEFT?"left_":"right_")+"bottom_"+(this.orientation==r.CUBE_ORIENTATION_LEFT?this.color0:this.color1));break;case s.CUBE_TYPE_IMMOVABLE:this.sprite0.setVisible(!0),this.sprite0.setFrame("immovable/immovable"),this.sprite1.visible&&this.sprite1.setVisible(!1);break;case s.CUBE_TYPE_WEDGE:this.sprite0.setVisible(!0),this.sprite0.setFrame("wedge/wedge_"+(this.orientation==r.CUBE_ORIENTATION_LEFT?"left_":"right_")+this.color0),this.sprite1.visible&&this.sprite1.setVisible(!1);break;case s.CUBE_TYPE_OSMOSIS:this.spriteIndex=this.spriteIndex%20,this.sprite0.setVisible(!0),this.sprite0.setFrame("osmosis/osmosis_"+this.color0+"_"+(this.spriteIndex<10?"0"+Math.floor(this.spriteIndex):Math.floor(this.spriteIndex))),this.sprite1.visible&&this.sprite1.setVisible(!1);break;case s.CUBE_TYPE_LASER:this.spriteIndex=this.spriteIndex%39,this.sprite0.setVisible(!0),this.sprite0.setFrame("laser/laser_"+(this.spriteIndex<10?"0"+Math.floor(this.spriteIndex):Math.floor(this.spriteIndex))),this.sprite1.visible&&this.sprite1.setVisible(!1);break;case s.CUBE_TYPE_BOMB:this.spriteIndex=this.spriteIndex%24,this.sprite0.setVisible(!0),this.sprite0.setFrame("bomb/bomb_"+(this.spriteIndex<10?"0"+Math.floor(this.spriteIndex):Math.floor(this.spriteIndex))),this.sprite1.visible&&this.sprite1.setVisible(!1)}},e.prototype.setPosition=function(e,t){this.sprite0.setPosition(e,t),this.sprite1.setPosition(e,t)},e}();t.Cube=a},539:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s,o=i(36);!function(e){e[e.LEVEL_TYPE_ARCADE=0]="LEVEL_TYPE_ARCADE",e[e.LEVEL_TYPE_PUZZLE=1]="LEVEL_TYPE_PUZZLE",e[e.LEVEL_TYPE_TUTORIAL=2]="LEVEL_TYPE_TUTORIAL"}(s=t.LevelType||(t.LevelType={}));var r=function(){function e(e){this.mainScene=e,this.currentLevel=0,this.tutorialComplete=!1}return e.prototype.init=function(){this.json=this.mainScene.cache.json.get("levels"),this.jsonTutorial=this.mainScene.cache.json.get("tutorial");var e=localStorage.getItem("level");this.currentLevel=null!=e?parseInt(e):0;var t=localStorage.getItem("tutorial_complete");this.tutorialComplete="true"===t},e.prototype.levelComplete=function(e,t){e==s.LEVEL_TYPE_ARCADE&&t+1>this.currentLevel&&(this.currentLevel=t+1,this.save())},e.prototype.save=function(){localStorage.setItem("level",""+this.currentLevel),localStorage.setItem("tutorial_complete",this.tutorialComplete?"true":"false")},e.prototype.getLevelSet=function(e){for(var t=0;ti;)t-=i;for(;t<0;)t+=i;return this._getLevelConfig(this.getLevelSet(e),t)},e.prototype.decodeType=function(e){switch(e){case"normal":return o.CubeType.CUBE_TYPE_NORMAL;case"star":return o.CubeType.CUBE_TYPE_STAR;case"dual":return o.CubeType.CUBE_TYPE_DUAL;case"fractured":return o.CubeType.CUBE_TYPE_FRACTURED;case"immovable":return o.CubeType.CUBE_TYPE_IMMOVABLE;case"wedge":return o.CubeType.CUBE_TYPE_WEDGE;case"osmosis":return o.CubeType.CUBE_TYPE_OSMOSIS;case"laser":return o.CubeType.CUBE_TYPE_LASER;case"bomb":return o.CubeType.CUBE_TYPE_BOMB}return o.CubeType.CUBE_TYPE_NONE},e.prototype.decodeColor=function(e){switch(e){case 0:return o.CubeColor.CUBE_COLOR_YELLOW;case 1:return o.CubeColor.CUBE_COLOR_BLUE;case 2:return o.CubeColor.CUBE_COLOR_RED;case 3:return o.CubeColor.CUBE_COLOR_GREEN;case 4:return o.CubeColor.CUBE_COLOR_ORANGE;case 5:return o.CubeColor.CUBE_COLOR_PURPLE}return o.CubeColor.CUBE_COLOR_NONE},e.prototype.decodeOrientation=function(e){switch(e){case 0:return o.CubeOrientation.CUBE_ORIENTATION_LEFT;case 1:return o.CubeOrientation.CUBE_ORIENTATION_RIGHT}return o.CubeOrientation.CUBE_ORIENTATION_NONE},e}();t.LevelConfig=r},540:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s,o,r=i(24),a=i(36);!function(e){e[e.CUBE=0]="CUBE",e[e.FOREGROUND=1]="FOREGROUND"}(s=t.CubeAnimationLayer||(t.CubeAnimationLayer={})),function(e){e[e.NONE=-1]="NONE",e[e.MATCH_CUBE=0]="MATCH_CUBE",e[e.WEDGE_TO_NORMAL=1]="WEDGE_TO_NORMAL",e[e.OSMOSIS_TO_NORMAL=2]="OSMOSIS_TO_NORMAL",e[e.OSMOSIS_SUCK=3]="OSMOSIS_SUCK",e[e.OSMOSIS_CHANGE_COLOR=4]="OSMOSIS_CHANGE_COLOR",e[e.OSMOSIS_BUILD_UP=5]="OSMOSIS_BUILD_UP",e[e.LASER_BEAM=6]="LASER_BEAM",e[e.LASER_BEAM_EMPTY=7]="LASER_BEAM_EMPTY",e[e.LASER_GLOW=8]="LASER_GLOW",e[e.LASER_CUBE_GLOW=9]="LASER_CUBE_GLOW",e[e.LASER_CUBE_SHIMMER=10]="LASER_CUBE_SHIMMER",e[e.LASER_DESTRUCTION=11]="LASER_DESTRUCTION",e[e.LASER_DISAPPEAR=12]="LASER_DISAPPEAR",e[e.BOMB_EXPLOSION=13]="BOMB_EXPLOSION",e[e.BOMB_GLOW=14]="BOMB_GLOW",e[e.MATCH_FRAME=15]="MATCH_FRAME",e[e.MATCH_FRAME_GLOW=16]="MATCH_FRAME_GLOW",e[e.PATTERN=17]="PATTERN",e[e.PATTERN_GLOW=18]="PATTERN_GLOW"}(o=t.CubeAnimationType||(t.CubeAnimationType={}));var _=function(){function e(e,t,i,_,E,T,u,n,C,c,h,l){this.layer=s.CUBE,this.x=0,this.y=0,this.z=0,this.type=o.NONE,this.delay=0,this.timeTotal=0,this.timeCurrent=0,this.color=a.CubeColor.CUBE_COLOR_NONE,this.orientation=a.CubeOrientation.CUBE_ORIENTATION_NONE,this.isBlocking=!1,this.isAlive=!0,this.lock=0,this.mainScene=e,this.x=t,this.y=i,this.z=_,this.layer=E,this.type=T,this.delay=u,this.timeTotal=n,this.timeCurrent=0,this.color=C,this.orientation=c,this.isBlocking=h,this.lock=l,this.sprite=new Phaser.GameObjects.Sprite(e,r.GetCubeBoardPosX(this.mainScene,this.x,this.y,this.z),r.GetCubeBoardPosY(this.mainScene,this.x,this.y,this.z),"cubeAnimation"),this.sprite.setCrop(),this.sprite.setActive(!1),this.sprite.setVisible(!1),this.sprite.setDepth(100*E+3*(this.x+this.y)+2*this.z+1),e.add.existing(this.sprite)}return e.prototype.destroy=function(){this.sprite&&this.sprite.destroy(),this.isAlive=!1},e.prototype.update=function(e,t){var i=e/1e3,s=t/1e3;if(this.type!=o.NONE)if(this.delay>0)this.delay-=s;else{if(this.timeTotal>0){var _=this.timeCurrent/this.timeTotal;switch(this.type){case o.MATCH_CUBE:this.sprite.setVisible(!0),this.sprite.setFrame("cube_match/cube_match_"+this.color),this.sprite.flipX=!1,this.sprite.scale=Math.cos(Math.PI/2*_),this.sprite.alpha=1,this.sprite.blendMode=Phaser.BlendModes.NORMAL;break;case o.WEDGE_TO_NORMAL:this.sprite.setVisible(!0),this.sprite.setFrame("wedge_to_normal/wedge_to_normal_"+(this.orientation==a.CubeOrientation.CUBE_ORIENTATION_LEFT?"left_":"right_")+this.color+"_"+Math.floor(7*_)),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=1,this.sprite.blendMode=Phaser.BlendModes.NORMAL;break;case o.OSMOSIS_TO_NORMAL:this.sprite.setVisible(!0),this.sprite.setFrame("osmosis_to_normal/osmosis_to_normal_"+this.color+"_"+Math.floor(9*_)),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=1;break;case o.OSMOSIS_SUCK:this.sprite.setVisible(!0),this.sprite.setFrame("osmosis_suck/osmosis_suck_"+this.color+"_"+Math.floor(9*_)),this.sprite.flipX=this.orientation==a.CubeOrientation.CUBE_ORIENTATION_LEFT,this.sprite.scale=1,this.sprite.blendMode=Phaser.BlendModes.NORMAL;break;case o.OSMOSIS_CHANGE_COLOR:this.sprite.setVisible(!0),this.sprite.setFrame("osmosis_change_color/osmosis_change_color_"+Math.floor(10*_)),this.sprite.flipX=this.orientation==a.CubeOrientation.CUBE_ORIENTATION_LEFT,this.sprite.scale=1,this.sprite.blendMode=Phaser.BlendModes.NORMAL;break;case o.OSMOSIS_BUILD_UP:this.sprite.setVisible(!0),this.sprite.setFrame("osmosis_build_up/osmosis_build_up_"+this.color+"_"+Math.floor(10*_)),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=1,this.sprite.blendMode=Phaser.BlendModes.NORMAL;break;case o.LASER_BEAM:case o.LASER_BEAM_EMPTY:var E=30*i%4;if(this.sprite.setVisible(!0),this.sprite.setFrame("laser_beam/laser_beam_"+Math.floor(E)),this.sprite.flipX=this.orientation==a.CubeOrientation.CUBE_ORIENTATION_LEFT,this.sprite.scale=1,this.sprite.alpha=Math.cos(Math.PI/2*_),this.sprite.blendMode=Phaser.BlendModes.LUMINOSITY,this.orientation==a.CubeOrientation.CUBE_ORIENTATION_RIGHT){C=(n=r.GetCubeBoardPosX(this.mainScene,this.x,this.type==o.LASER_BEAM_EMPTY?this.y-1:this.y,this.z)+15)-(C=r.GetCubeBoardPosX(this.mainScene,this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelected.y,0));var T=r.GetCubeBoardPosY(this.mainScene,this.x,this.type==o.LASER_BEAM_EMPTY?this.y-1:this.y,this.z)-25,u=r.GetCubeBoardPosY(this.mainScene,this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelected.y,0);u-=T,this.sprite.setCrop(447-C,0,C,u),this.sprite.setPosition(r.GetCubeBoardPosX(this.mainScene,this.x,this.type==o.LASER_BEAM_EMPTY?this.y-1:this.y,this.z)-210,r.GetCubeBoardPosY(this.mainScene,this.x,this.type==o.LASER_BEAM_EMPTY?this.y-1:this.y,this.z)+180)}else{var n=r.GetCubeBoardPosX(this.mainScene,this.type==o.LASER_BEAM_EMPTY?this.x-1:this.x,this.y,this.z)-15,C=r.GetCubeBoardPosX(this.mainScene,this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelected.y,0);C-=n;T=r.GetCubeBoardPosY(this.mainScene,this.type==o.LASER_BEAM_EMPTY?this.x-1:this.x,this.y,this.z)-25,u=r.GetCubeBoardPosY(this.mainScene,this.mainScene.cubeSelectedHolder.cubeSelected.x,this.mainScene.cubeSelectedHolder.cubeSelected.y,0);u-=T,this.sprite.setCrop(0,0,C,u),this.sprite.setPosition(r.GetCubeBoardPosX(this.mainScene,this.type==o.LASER_BEAM_EMPTY?this.x-1:this.x,this.y,this.z)+210-447+C,r.GetCubeBoardPosY(this.mainScene,this.type==o.LASER_BEAM_EMPTY?this.x-1:this.x,this.y,this.z)+180)}break;case o.LASER_GLOW:this.sprite.setVisible(!0),this.sprite.setFrame("laser_glow/laser_glow"),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=Math.cos(Math.PI*_),this.sprite.blendMode=Phaser.BlendModes.ADD;break;case o.LASER_CUBE_GLOW:this.sprite.setVisible(!0),this.sprite.setFrame("laser_cube_glow/laser_cube_glow"),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=Math.cos(6*Math.PI*_),this.sprite.blendMode=Phaser.BlendModes.ADD;break;case o.LASER_CUBE_SHIMMER:this.sprite.setVisible(!0),this.sprite.setFrame("laser_cube_shimmer/laser_cube_shimmer"),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=Math.sin(Math.PI/2*_),this.sprite.blendMode=Phaser.BlendModes.ADD;break;case o.LASER_DESTRUCTION:E=Math.floor(13*_);this.sprite.setVisible(!0),this.sprite.setFrame("laser_destruction/laser_destruction_"+(E<10?"0"+E:E)),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=1,this.sprite.blendMode=Phaser.BlendModes.NORMAL;break;case o.LASER_DISAPPEAR:this.sprite.setVisible(!0),this.sprite.setFrame("laser_disappear/laser_disappear"),this.sprite.flipX=!1,this.sprite.scale=Math.cos(Math.PI/2*_),this.sprite.alpha=1,this.sprite.blendMode=Phaser.BlendModes.NORMAL;break;case o.BOMB_EXPLOSION:this.sprite.setVisible(!0),this.sprite.setFrame("bomb_explosion/bomb_explosion_"+Math.floor(10*_)),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=1,this.sprite.blendMode=Phaser.BlendModes.NORMAL;break;case o.BOMB_GLOW:this.sprite.setVisible(!0),this.sprite.setFrame("bomb_glow/bomb_glow"),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=Math.cos(Math.PI/2*_),this.sprite.blendMode=Phaser.BlendModes.ADD;break;case o.MATCH_FRAME:case o.PATTERN:this.type==o.PATTERN&&this.sprite.setPosition(this.sprite.x,this.sprite.y-100*s),this.sprite.setVisible(!0),this.sprite.setFrame("match_frame/match_frame_"+this.color),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=Math.cos(Math.PI/2*_),this.sprite.blendMode=Phaser.BlendModes.NORMAL;break;case o.MATCH_FRAME_GLOW:case o.PATTERN_GLOW:this.type==o.PATTERN_GLOW&&this.sprite.setPosition(this.sprite.x,this.sprite.y-100*s),this.sprite.setVisible(!0),this.sprite.setFrame("match_frame_glow/match_frame_glow_"+this.color),this.sprite.flipX=!1,this.sprite.scale=1,this.sprite.alpha=Math.cos(Math.PI/2*_),this.sprite.blendMode=Phaser.BlendModes.ADD}}this.timeCurrent<=this.timeTotal&&(this.timeCurrent+=s),this.timeCurrent>=this.timeTotal&&this.destroy()}this.lock>0&&(this.lock-=s)},e}();t.CubeAnimation=_},541:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i(542);var s=i(1463),o=i(121),r=i(24),a={type:Phaser.AUTO,scale:{mode:Phaser.Scale.FIT,parent:"canvas",autoCenter:Phaser.Scale.CENTER_BOTH,width:1280,height:800,max:{width:1280,height:800}},render:{transparent:!0},scene:[s.PreloaderScene,o.MainScene]};r.IS_ICONSOLE&&(console.log("iConsole.game.ready()"),iConsole.game.ready({soundOnOff:!0,pauseable:!0}).result(function(){_.scene.start("MainScene")}));var _=new Phaser.Game(a);0==r.IS_ICONSOLE&&_.scene.start("PreloaderScene"),r.IS_ICONSOLE&&(iConsole.game.onEvent("soundOff",function(){_.sound.mute=!0}),iConsole.game.onEvent("soundOn",function(){_.sound.mute=!1}))},72:function(e,t,i){"use strict";var s=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=i(24),r=function(e){function t(t,i,s,r,a,_,E){var T=e.call(this,t)||this;return T.rect=o.RectMake(),T.text=null,T.pressed=!1,T.isShown=!1,T.init(i,a,_,E),T.callback=s,T.soundClick=r,T}return s(t,e),t.prototype.init=function(e,t,i,s){if(this.rect=e,this.setSize(e.w,e.h),i){var o=new Phaser.GameObjects.Sprite(this.scene,0,"button-green-menu"===s?7:10,i,s);this.add(o)}else this.add(new Phaser.GameObjects.Rectangle(this.scene,0,0,e.w,e.h,16711680));void 0!=t&&(this.text=new Phaser.GameObjects.Text(this.scene,0,0,t,{fontFamily:"Lalezar",fontSize:"32px",align:"center",wordWrap:{width:e.w-20}}),this.text.setShadow(0,3,"#444",3),this.text.setStroke("#444",3),this.text.setOrigin(.5,.5),this.add(this.text)),this.depth=1e3,this.setPosition(e.x,e.y),this.scene.add.existing(this),this.reset()},t.prototype.setText=function(e){this.text&&this.text.setText(e)},t.prototype.reset=function(){this.scale=0,this.isShown=!1},t.prototype.showButton=function(e,t){var i=this;if(void 0===e&&(e=null),void 0===t&&(t=0),!this.isShown){this.reset();var s={targets:this,scale:1,ease:"Sine.easeOut",delay:t,duration:200,onComplete:function(){e&&e(),i.setTouchActive(!0)}};this.scene.tweens.add(s);this.isShown=!0}},t.prototype.hideButton=function(e,t){void 0===e&&(e=null),void 0===t&&(t=0),this.setTouchActive(!1);var i={targets:this,scale:0,ease:"Sine.easeIn",delay:t,duration:200,onComplete:function(){e&&e()}};this.scene.tweens.add(i);this.isShown=!1},t.prototype.setTouchActive=function(e){var t=this;e?(this.setInteractive(),this.on("pointerdown",function(){t.pointerDown()}),this.on("pointerup",function(){t.pointerUp()}),this.on("pointerout",function(){t.pointerOut()})):this.removeInteractive()},t.prototype.pointerDown=function(){this.pressed=!0},t.prototype.pointerOut=function(){this.pressed=!1},t.prototype.pointerUp=function(){this.pressed&&(this.callback&&this.callback(),this.soundClick.play()),this.pressed=!1},t.prototype.preUpdate=function(e,t){this.setPosition(this.rect.x,this.rect.y+(this.pressed?4:0))},t}(Phaser.GameObjects.Container);t.ELButton=r},83:function(e,t,i){"use strict";var s=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,i,s){void 0===s&&(s={});var o=e.call(this,t)||this;return o.buttons=[],o.soundTransform=i.st,o.soundPopUp=i.sp,o.soundClick=i.cl,s.texture||(s.texture="ui"),s.frame||(s.frame="popup-background"),o.options=s,o.isPopUpActive=!1,o.init(),o}return s(t,e),t.prototype.init=function(){this.add(new Phaser.GameObjects.Sprite(this.scene,0,5,this.options.texture,this.options.frame)),this.depth=1e3,this.scene.add.existing(this),this.reset()},t.prototype.addButton=function(e){this.buttons.push(e),this.add(e)},t.prototype.reset=function(){this.setPosition(this.scene.sys.canvas.width/2,this.scene.sys.canvas.height/2+this.scene.sys.canvas.height);for(var e=0;e