You just finished level ".concat(_5.currentLevel+1,"/").concat(_R()," and picked those upgrades so far :
").concat(_d(),'
\n \n \n '),[4,_q({title:"Pick an upgrade "+(e?"("+(e+1)+")":""),actions:i,text:"
\n You caught ".concat(_5.score-_5.levelStartScore," coins ").concat(o," out of ").concat(_5.levelSpawnedCoins," in ").concat(Math.round(_5.levelTime/1e3)," seconds").concat(r,".\n You missed ").concat(_5.levelMisses," times ").concat(n,". \n ").concat(r&&o&&n&&"Impressive, keep it up !"||(r||o||n)&&"Well done !"||"Try to catch all coins, never miss the bricks or clear the level under 30s to gain additional choices and upgrades.","\n
\n')});var c=(null===(r=function(_,e){for(var t=_.length;--t;)if(e(_[t],t,_))return _[t]}(l,function(_){return _.threshold<=s}))||void 0===r?void 0:r.threshold)||0,u=l.find(function(_){return _.threshold>s});if(u){var h=(null==u?void 0:u.threshold)-c,d=s-c;e+="Score ".concat(u.threshold-s," more points to reach the next unlock.");var b=(d/h).toFixed(2);i+='\n
This is a test run, score is not recorded permanently
":"","\n
Upgrades picked so far :
\n
").concat(_d(),"
\n "),allowClose:!0,actions:[{text:"Resume",help:"Return to your run",value:function(){}},{text:"Restart",help:"Start a brand new run.",value:function(){_6({levelToAvoid:_m().name})}}]})];case 1:return(_=e.sent())&&_(),[2]}})})).apply(this,arguments)}function _F(){return _U.apply(this,arguments)}function _U(){return(_U=m(function(){var _,e,t,r,o,n,i,s,a,l;return W(this,function(c){switch(c.label){case 0:_o(!0),e=[{text:"Resume",help:"Return to your run",value:function(){}},{text:"Starting perk",help:"Try perks and levels you unlocked",value:function(){(function(){_N.apply(this,arguments)})()}}],t=!0,r=!1,o=void 0;try{for(n=function(){var _=s.value;E[_]&&e.push({disabled:E[_].disabled(),icon:_X(_)?C["icon:checkmark_checked"]:C["icon:checkmark_unchecked"],text:E[_].name,help:E[_].help,value:function(){(function(_){_I[_]=!_X(_);try{localStorage.setItem("breakout-settings-enable-"+_,JSON.stringify(_I[_]))}catch(_){console.warn(_)}E[_].afterChange()})(_),_F()}})},i=Object.keys(E)[Symbol.iterator]();!(t=(s=i.next()).done);t=!0)n()}catch(_){r=!0,o=_}finally{try{t||null==i.return||i.return()}finally{if(r)throw o}}return a=(_=Math).max.apply(_,k(H.map(function(_){return _.threshold}))),(document.fullscreenEnabled||document.webkitFullscreenEnabled)&&(null!==document.fullscreenElement?e.push({text:"Exit Fullscreen",icon:C["icon:exit_fullscreen"],help:"Might not work on some machines",value:function(){_0()}}):e.push({icon:C["icon:fullscreen"],text:"Fullscreen",help:"Might not work on some machines",value:function(){_0()}})),e.push({text:"Sandbox mode",help:_x()\n Made in France by Renan LE CARO. \n Privacy Policy\n F-Droid\n Google Play\n itch.io \n Gitlab\n Web version\n HackerNews\n v.'.concat(L,"\n \n ")})];case 1:return(l=c.sent())&&l(),[2]}})})).apply(this,arguments)}function _N(){return(_N=m(function(){var _,e,t,r,o;return W(this,function(n){switch(n.label){case 0:return _=_x(),t=Math.round((e=k(H.sort(function(_,e){return _.threshold-e.threshold}).map(function(e){var t=e.name,r=e.id,o=e.threshold,n=e.icon,i=e.fullHelp;return{text:t,help:_>=o?i:"Unlocks at total score ".concat(o,"."),disabled:_=e.threshold;return{text:e.name,help:t?"A ".concat(e.size,"x").concat(e.size," level with ").concat(e.bricks.filter(function(_){return _}).length," bricks"):"Unlocks at total score ".concat(e.threshold,"."),disabled:!t,value:{level:e.name},icon:C[e.name]}})))).filter(function(_){return!_.disabled}).length/e.length*100),[4,_q({title:"You unlocked ".concat(t,"% of the game."),text:"\n
Your total score is ".concat(_,". Below are all the upgrades and levels the games has to offer.\n ").concat(t<100?"The greyed out ones can be unlocked by increasing your total score. The total score increases every time you score in game.":"","
\n "),textAfterButtons:"
\nYour high score is ".concat(_5.highScore,". \nClick an item above to start a run with it.\n
"),actions:e,allowClose:!0})];case 1:if(!(r=n.sent()))return[3,4];if(o=!_5.currentLevel)return[3,3];return[4,_q({title:"Restart run to try this item?",text:"You're about to start a new run with the selected unlocked item, is that really what you wanted ? ",actions:[{value:!0,text:"Restart game to test item"},{value:!1,text:"Cancel"}]})];case 2:o=n.sent(),n.label=3;case 3:o&&_6(r),n.label=4;case 4:return[2]}})})).apply(this,arguments)}function _Y(_,e){return Math.sqrt(Math.pow(_.x-e.x,2)+Math.pow(_.y-e.y,2))}function _J(){return"hsl(".concat(2*Math.round(_5.levelTime/4)%360,",100%,70%)")}function _K(_,e,t,r){var o=_Y(_,e),n=_5.gameZoneWidth/2;if(!(o>n)){var i=(_.x-e.x)/o,s=(_.y-e.y)/o,a=-t*(n-o)/(1.2*n)/3*Math.min(500,_5.levelTime)/500;r&&void 0!==e.vx&&void 0!==e.vy&&(e.vx+=i*a,e.vy+=s*a),_.vx-=i*a,_.vy-=s*a,_5.flashes.push({type:"particle",duration:100,time:_5.levelTime,size:_5.coinSize/2,color:_J(),ethereal:!0,x:_.x,y:_.y,vx:-(10*i)+_.vx+(Math.random()-.5)*2,vy:-(10*s)+_.vy+(Math.random()-.5)*2}),r&&void 0!==e.vx&&void 0!==e.vy&&_5.flashes.push({type:"particle",duration:100,time:_5.levelTime,size:_5.coinSize/2,color:_J(),ethereal:!0,x:e.x,y:e.y,vx:10*i+e.vx+(Math.random()-.5)*2,vy:10*s+e.vy+(Math.random()-.5)*2})}}function _$(){_X("record")&&(null==i?void 0:i.state)==="recording"&&(null==i||i.pause())}function _Q(){_X("record")&&i&&(null==i||i.stop(),i=null)}function _0(){try{if(null!==document.fullscreenElement)document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen();else{var _=document.documentElement;_.requestFullscreen?_.requestFullscreen():_.webkitRequestFullscreen&&_.webkitRequestFullscreen()}}catch(_){console.warn(_)}}_E.addEventListener("click",function(_){_.preventDefault(),_V()}),document.addEventListener("visibilitychange",function(){document.hidden&&_o(!0)}),null===(n=document.getElementById("menu"))||void 0===n||n.addEventListener("click",function(_){_.preventDefault(),_F()});var _1={ArrowLeft:0,ArrowRight:0,Shift:0};function _2(_,e){_1[_]=e,_5.keyboardPuckSpeed=(_1.ArrowRight-_1.ArrowLeft)*(1+2*_1.Shift)*_5.gameZoneWidth/50}function _4(_){var e=_x(),t=(null==_?void 0:_.level)?O.filter(function(e){return e.name===(null==_?void 0:_.level)}):[],r=O.filter(function(_){return e>=_.threshold}).filter(function(e){return e.name!==(null==_?void 0:_.level)}).filter(function(e){return e.name!==(null==_?void 0:_.levelToAvoid)}).sort(function(){return Math.random()-.5}),o=t.concat(r.slice(0,10).sort(function(_,e){return _.sortKey-e.sortKey})),n=y({},N(H),(null==_?void 0:_.perks)||{}),i={runLevels:o,currentLevel:0,perks:n,puckWidth:200,baseSpeed:12,combo:1,gridSize:12,running:!1,puckPosition:400,pauseTimeout:null,canvasWidth:0,canvasHeight:0,offsetX:0,offsetXRoundedDown:0,gameZoneWidth:0,gameZoneWidthRoundedUp:0,gameZoneHeight:0,brickWidth:0,needsRender:!0,score:0,lastScoreIncrease:-1e3,lastExplosion:-1e3,highScore:parseFloat(localStorage.getItem("breakout-3-hs")||"0"),balls:[],ballsColor:"white",bricks:[],flashes:[],coins:[],levelStartScore:0,levelMisses:0,levelSpawnedCoins:0,lastPlayedCoinGrab:0,MAX_COINS:400,MAX_PARTICLES:600,puckColor:"#FFF",ballSize:20,coinSize:14,puckHeight:20,totalScoreAtRunStart:e,isCreativeModeRun:U(n)>1,pauseUsesDuringRun:0,keyboardPuckSpeed:0,lastTick:performance.now(),lastTickDown:0,runStatistics:{started:Date.now(),levelsPlayed:0,runTime:0,coins_spawned:0,score:0,bricks_broken:0,misses:0,balls_lost:0,puck_bounces:0,upgrades_picked:1,max_combo:1,max_level:0},lastOffered:{},levelTime:0,autoCleanUses:0};if(Y(i),!U(i.perks)){var s=_g(i).filter(function(_){return _.giftable}),a=_X("easy")&&"slow_down"||s[Math.floor(Math.random()*s.length)].id;n[a]=1,_y(i,a)}var l=!0,c=!1,u=void 0;try{for(var h,d=H[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var b=h.value;i.perks[b.id]&&_y(i,b.id)}}catch(_){c=!0,u=_}finally{try{l||null==d.return||d.return()}finally{if(c)throw u}}return i}document.addEventListener("keydown",function(_){"f"!==_.key.toLowerCase()||_.ctrlKey||_.metaKey?_.key in _1&&_2(_.key,1):_0()," "===_.key&&!_Z&&(_5.running?_o(!0):_r(),_.preventDefault())}),document.addEventListener("keyup",(e=m(function(_){var e,t,r,o,n;return W(this,function(i){if(n=document.querySelector("button:focus"),_.key in _1)_2(_.key,0);else if("ArrowDown"===_.key&&(null==n?void 0:null===(e=n.nextElementSibling)||void 0===e?void 0:e.tagName)==="BUTTON")null==n||null===(t=n.nextElementSibling)||void 0===t||t.focus();else if("ArrowUp"===_.key&&(null==n?void 0:null===(r=n.previousElementSibling)||void 0===r?void 0:r.tagName)==="BUTTON")null==n||null===(o=n.previousElementSibling)||void 0===o||o.focus();else if("Escape"===_.key&&_D)_D();else if("Escape"===_.key&&_5.running)_o(!0);else if("m"!==_.key.toLowerCase()||_Z){if("s"!==_.key.toLowerCase()||_Z){if("r"!==_.key.toLowerCase()||_Z)return[2];_6({levelToAvoid:_m().name})}else _V()}else _F();return _.preventDefault(),[2]})}),function(_){return e.apply(this,arguments)}));var _5=_4({});function _6(_){Object.assign(_5,_4(_)),_$(),_p(0)}_6({}),_s(),function _(){_a();var e=performance.now();if(_5.puckWidth=_5.gameZoneWidth/12*(3-_5.perks.smaller_puck+_5.perks.bigger_puck),_5.keyboardPuckSpeed&&_v(_5.puckPosition+_5.keyboardPuckSpeed),_5.running){_5.levelTime+=e-_5.lastTick,_5.runStatistics.runTime+=e-_5.lastTick,_5.runStatistics.max_combo=Math.max(_5.runStatistics.max_combo,_5.combo);var t,r,o,n,i,u=Math.min(4,(e-_5.lastTick)/(1e3/60));u*=+!!_5.running,_5.coins=_5.coins.filter(function(_){return!_.destroyed}),_5.balls=_5.balls.filter(function(_){return!_.destroyed});var h=_5.bricks.filter(function(_){return _&&"black"!==_}).length;if(_5.levelTime>_5.lastTickDown+1e3&&_5.perks.hot_start&&(_5.lastTickDown=_5.levelTime,t=_5.perks.hot_start,r=_5.puckPosition,o=_5.gameZoneHeight-2*_5.puckHeight,n=_5.combo,_5.combo=Math.max(K(_5),_5.combo-t),(i=Math.max(0,n-_5.combo))&&(A.comboDecrease(),void 0!==r&&void 0!==o&&_5.flashes.push({type:"text",text:"-"+i,time:_5.levelTime,color:"red",x:r,y:o,duration:300,size:_5.puckHeight}))),h<=_5.perks.skip_last&&!_5.autoCleanUses&&(_5.bricks.forEach(function(_,e){_&&_z(e,_5.balls[0],!0)}),_5.autoCleanUses++),h||_5.coins.length){if(_5.running||_5.levelTime){var d=!1,b=Math.round(_5.coinSize/2);if(_5.coins.forEach(function(_){if(!_.destroyed){if(_5.perks.coin_magnet){var e=u*(_5.puckPosition-_.x)/(100+Math.pow(_.y-_5.gameZoneHeight,2)+Math.pow(_.x-_5.puckPosition,2))*_5.perks.coin_magnet*100;_.vx+=e,_.sa-=e/10}var t=1-(.03*_5.perks.viscosity+.005)*u;_.vy*=t,_.vx*=t,_.vx>7*_5.baseSpeed&&(_.vx=7*_5.baseSpeed),_.vx<-7*_5.baseSpeed&&(_.vx=-7*_5.baseSpeed),_.vy>7*_5.baseSpeed&&(_.vy=7*_5.baseSpeed),_.vy<-7*_5.baseSpeed&&(_.vy=-7*_5.baseSpeed),_.a+=_.sa,_.vy+=u*_.weight*.8;var r=Math.abs(_.sx)+Math.abs(_.sx),o=_w(_,_.size/2,u);_.y>_5.gameZoneHeight-b-_5.puckHeight&&_.y<_5.gameZoneHeight+_5.puckHeight+_.vy&&Math.abs(_.x-_5.puckPosition)_5.highScore&&!_5.isCreativeModeRun&&(_5.highScore=_5.score,localStorage.setItem("breakout-3-hs",_5.score.toString())),_X("basic")||_5.flashes.push({type:"particle",duration:100+50*Math.random(),time:_5.levelTime,size:_5.coinSize/2,color:_.color,x:_.previousX,y:_.previousY,vx:(_5.canvasWidth-_.x)/100,vy:-_.y/100,ethereal:!0}),Date.now()-_5.lastPlayedCoinGrab>16&&(_5.lastPlayedCoinGrab=Date.now(),A.coinCatch(_.x)),_5.runStatistics.score+=_.points):_.y>_5.canvasHeight+b&&(_.destroyed=!0,_5.perks.compound_interest&&$(_5,_.x,_.y));var n=function(_){var e,t=_.size/2,r=_.x,o=_.y,n=_.previousX,i=_.previousY,s=_W(n,o,t),a=_W(r,i,t),l=void 0===s&&void 0===a&&_W(r,o,t)||void 0;if(void 0!==s||void 0!==l){_.y=_.previousY,_.vy*=-1;var c=_5.bricks[_f(r-t,o+t)],u=_5.bricks[_f(r+t,o+t)];c&&!u&&(_.vx+=1,_.sa-=1),!c&&u&&(_.vx-=1,_.sa+=1)}return(void 0!==a||void 0!==l)&&(_.x=_.previousX,_.vx*=-1),null!==(e=null!=s?s:a)&&void 0!==e?e:l}(_);_5.perks.metamorphosis&&void 0!==n&&_5.bricks[n]&&_.color!==_5.bricks[n]&&"black"!==_5.bricks[n]&&!_.coloredABrick&&(_5.bricks[n]=_.color,_.coloredABrick=!0,A.colorChange(_.x,.3)),(void 0!==n||o)&&(_.vx*=.8,_.vy*=.8,_.sa*=.9,r>20&&!d&&(d=!0,A.coinBounce(_.x,.2)),3>Math.abs(_.vy)&&(_.vy=0))}}),_5.balls.forEach(function(_){return function(_,e){_.previousVX=_.vx,_.previousVY=_.vy;var t,r,o=1+_5.perks.telekinesis+_5.perks.ball_repulse_ball+_5.perks.puck_repulse_ball+_5.perks.ball_attract_ball;_S(_)&&(o+=3,_.vx+=(_5.puckPosition-_.x)/1e3*e*_5.perks.telekinesis),_.vx*_.vx+_.vy*_.vy<_5.baseSpeed*_5.baseSpeed*2?(_.vx*=1+.02/o,_.vy*=1+.02/o):(_.vx*=1-.02/o,_.vy*=1-.02/o),Math.abs(_.vy)<.2*_5.baseSpeed&&(_.vy+=(_.vy>0?1:-1)*.02/o);var n=!0,i=!1,s=void 0;if(_5.perks.ball_repulse_ball)try{for(var a,l,c,u=_5.balls[Symbol.iterator]();!(n=(c=u.next()).done);n=!0){var h=c.value;h.x>=_.x||_K(_,h,_5.perks.ball_repulse_ball,!0)}}catch(_){i=!0,s=_}finally{try{n||null==u.return||u.return()}finally{if(i)throw s}}var d=!0,b=!1,p=void 0;if(_5.perks.ball_attract_ball)try{for(var m,g=_5.balls[Symbol.iterator]();!(d=(m=g.next()).done);d=!0){var y=m.value;y.x>=_.x||function(_,e,t){var r=_Y(_,e),o=.5*_5.gameZoneWidth;if(!(r1&&!_X("basic"))for(var v=0;v<(null===(l=_.hitItem)||void 0===l?void 0:l.length)-1&&v<_5.perks.respawn;v++){var f=_.hitItem[v],k=f.index,W=f.color;if(!_5.bricks[k]&&"black"!==W){var w=Math.random()>.5,S=Math.random()>.5?1:-1,x=Math.random()>.5?1:-1;_5.flashes.push({type:"particle",duration:250,ethereal:!0,time:_5.levelTime,size:_5.coinSize/2,color:W,x:_l(k)+S*_5.brickWidth/2,y:_c(k)+x*_5.brickWidth/2,vx:w?0:-S*_5.baseSpeed,vy:w?-x*_5.baseSpeed:0})}}var M=_w(_,_5.ballSize/2,e);M&&(_5.perks.left_is_lava&&M%2&&_.x<_5.offsetX+_5.gameZoneWidth/2&&$(_5,_.x,_.y),_5.perks.right_is_lava&&M%2&&_.x>_5.offsetX+_5.gameZoneWidth/2&&$(_5,_.x,_.y),_5.perks.top_is_lava&&M>=2&&$(_5,_.x,_.y+_5.ballSize),A.wallBeep(_.x),null===(t=_.bouncesList)||void 0===t||t.push({x:_.previousX,y:_.previousY}));var z=_5.gameZoneHeight-_5.puckHeight-_5.ballSize/2,R=Math.abs(_.x-_5.puckPosition)<_5.ballSize/2+_5.puckWidth/2;if(_.y>z&&_.vy>0&&(R||_5.perks.extra_life&&_.y>z+_5.puckHeight/2)){if(R){var B=Math.sqrt(_.vx*_.vx+_.vy*_.vy),G=Math.atan2(-_5.puckWidth/2,_.x-_5.puckPosition);_.vx=B*Math.cos(G),_.vy=B*Math.sin(G),A.wallBeep(_.x)}else if(_.vy*=-1,_5.perks.extra_life=Math.max(0,_5.perks.extra_life-1),A.lifeLost(_.x),!_X("basic"))for(var L=0;L<10;L++)_5.flashes.push({type:"particle",ethereal:!1,color:"red",destroyed:!1,duration:150,size:_5.coinSize/2,time:_5.levelTime,x:_.x,y:_.y,vx:Math.random()*_5.baseSpeed*3,vy:3*_5.baseSpeed});_5.perks.streak_shots&&$(_5,_.x,_.y),_5.perks.respawn&&_.hitItem.slice(0,-1).slice(0,_5.perks.respawn).forEach(function(_){var e=_.index,t=_.color;_5.bricks[e]||"black"===t||(_5.bricks[e]=t)}),_.hitItem=[],_.hitSinceBounce||(_5.runStatistics.misses++,_5.levelMisses++,$(_5,_.x,_.y),_5.flashes.push({type:"text",text:"miss",duration:500,time:_5.levelTime,size:1.5*_5.puckHeight,color:"red",x:_5.puckPosition,y:_5.gameZoneHeight-2*_5.puckHeight})),_5.runStatistics.puck_bounces++,_.hitSinceBounce=0,_.sapperUses=0,_.piercedSinceBounce=0,_.bouncesList=[{x:_.previousX,y:_.previousY}]}_.y>_5.gameZoneHeight+_5.ballSize/2&&_5.running&&(_.destroyed=!0,_5.runStatistics.balls_lost++,_5.balls.find(function(_){return!_.destroyed})||_M("Game Over","You dropped the ball after catching "+_5.score+" coins. "));var T=_5.ballSize/2,P=_.x,C=_.y,O=_.previousX,H=_.previousY,E=_W(O,C,T),Z=_W(P,H,T),D=void 0===E&&void 0===Z&&_W(P,C,T)||void 0,q=null!==(r=null!=E?E:Z)&&void 0!==r?r:D,I=q&&"black"!==_5.bricks[q]&&_5.perks.sturdy_bricks&&_5.perks.sturdy_bricks>5*Math.random(),X=!1;if(I||void 0===q||((_5.perks.pierce_color&&(void 0===E||_5.bricks[E]===_5.ballsColor)&&(void 0===Z||_5.bricks[Z]===_5.ballsColor)&&(void 0===D||_5.bricks[D]===_5.ballsColor)?0:1)?_.piercedSinceBounce<3*_5.perks.pierce&&(X=!0,_.piercedSinceBounce++):X=!0),void 0===E&&void 0===D||X||(_.y=_.previousY,_.vy*=-1),void 0===Z&&void 0===D||X||(_.x=_.previousX,_.vx*=-1),I){A.wallBeep(P);return}if(void 0!==q){var V=_5.bricks[q];_z(q,_,!1),_.sapperUses<_5.perks.sapper&&"black"!==V&&!_5.bricks[q]&&(_5.bricks[q]="black",_.sapperUses++)}!_X("basic")&&(_.sparks+=e*(_5.combo-1)/30,_.sparks>1&&(_5.flashes.push({type:"particle",duration:100*_.sparks,time:_5.levelTime,size:_5.coinSize/2,color:_5.ballsColor,x:_.x,y:_.y,vx:(Math.random()-.5)*_5.baseSpeed,vy:(Math.random()-.5)*_5.baseSpeed,ethereal:!1}),_.sparks=0))}(_,u)}),_5.perks.wind)for(var p=(_5.puckPosition-(_5.offsetX+_5.gameZoneWidth/2))/_5.gameZoneWidth*2*_5.perks.wind,m=0;m<_5.perks.wind;m++)Math.random()*Math.abs(p)>.5&&_5.flashes.push({type:"particle",duration:150,ethereal:!0,time:_5.levelTime,size:_5.coinSize/2,color:_J(),x:_5.offsetXRoundedDown+Math.random()*_5.gameZoneWidthRoundedUp,y:Math.random()*_5.gameZoneHeight,vx:8*p,vy:0});_5.flashes.forEach(function(_){"particle"===_.type&&(_.x+=_.vx*u,_.y+=_.vy*u,!_.ethereal&&(_.vy+=.5,_k(_f(_.x,_.y))&&(_.destroyed=!0)))})}}else _5.currentLevel+1<_R()?_p(_5.currentLevel+1):_M("Run finished ","You cleared all levels for this run, catching ".concat(_5.score," coins in total."));if(_5.combo>K(_5)){var g=!_X("basic")&&(_5.combo-K(_5))*Math.random()>5&&_5.running&&{type:"particle",duration:100*(Math.random()+1),time:_5.levelTime,size:_5.coinSize/2,color:"red",ethereal:!0};if(_5.perks.top_is_lava&&g&&_5.flashes.push(v(y({},g),{x:_5.offsetXRoundedDown+Math.random()*_5.gameZoneWidthRoundedUp,y:0,vx:(Math.random()-.5)*10,vy:5})),_5.perks.left_is_lava&&g&&_5.flashes.push(v(y({},g),{x:_5.offsetXRoundedDown,y:Math.random()*_5.gameZoneHeight,vx:5,vy:(Math.random()-.5)*10})),_5.perks.right_is_lava&&g&&_5.flashes.push(v(y({},g),{x:_5.offsetXRoundedDown+_5.gameZoneWidthRoundedUp,y:Math.random()*_5.gameZoneHeight,vx:-5,vy:(Math.random()-.5)*10})),_5.perks.compound_interest){var f=_5.puckPosition,k=0;do f=_5.offsetXRoundedDown+_5.gameZoneWidthRoundedUp*Math.random(),k++;while(Math.abs(f-_5.puckPosition)<_5.puckWidth/2&&k<10)g&&_5.flashes.push(v(y({},g),{x:f,y:_5.gameZoneHeight,vx:(Math.random()-.5)*10,vy:-5}))}if(_5.perks.streak_shots){var W=.5-Math.random();g&&_5.flashes.push(v(y({},g),{duration:100,x:_5.puckPosition+_5.puckWidth*W,y:_5.gameZoneHeight-_5.puckHeight,vx:10*W,vy:-5}))}}}(function(){if(_5.running&&(_5.needsRender=!0),_5.needsRender){_5.needsRender=!1;var _=_m(),e=__.width,t=__.height;if(e&&t){if(_5.currentLevel||_5.levelTime?_A.innerText="L".concat(_5.currentLevel+1,"/").concat(_R()):_A.innerText="menu",_E.innerText="$".concat(_5.score),_E.className=_5.lastScoreIncrease>_5.levelTime-500?"active":"",_X("basic")||_.color||!_.svg)_e.globalAlpha=1,_e.globalCompositeOperation="source-over",_e.fillStyle=_.color||"#000",_e.fillRect(0,0,e,t),_5.flashes.forEach(function(_){var e=_.x,t=_.y,r=_.time,o=_.color,n=_.size,i=_.type,s=_.duration;_e.globalAlpha=Math.min(1,2-(_5.levelTime-r)/s*2),"particle"===i&&_P(_e,o,n,e,t)});else if(_e.globalCompositeOperation="source-over",_e.globalAlpha=1,_e.fillStyle="#000",_e.fillRect(0,0,e,t),_e.globalCompositeOperation="screen",_e.globalAlpha=.6,_5.coins.forEach(function(_){_.destroyed||_O(_e,_.color,2*_5.coinSize,_.x,_.y)}),_5.balls.forEach(function(_){_O(_e,_5.ballsColor,2*_5.ballSize,_.x,_.y)}),_e.globalAlpha=.5,_5.bricks.forEach(function(_,e){if(_){var t=_l(e),r=_c(e);_O(_e,"black"==_?"#666":_,_5.brickWidth,t,r)}}),_e.globalAlpha=1,_5.flashes.forEach(function(_){var e=_.x,t=_.y,r=_.time,o=_.color,n=_.size,i=_.type,s=_.duration;_e.globalAlpha=Math.min(1,2-(_5.levelTime-r)/s*2),"ball"===i&&_O(_e,o,n,e,t),"particle"===i&&_O(_e,o,3*n,e,t)}),_e.globalAlpha=.2,_e.globalCompositeOperation="multiply",_e.fillStyle="black",_e.fillRect(0,0,e,t),_e.globalAlpha=.8,_e.globalCompositeOperation="multiply",_.svg&&_n.width&&_n.complete){if(_i.title!==_.name){_i.title=_.name,_i.width=_5.canvasWidth,_i.height=_5.canvasHeight;var r=_i.getContext("2d");r.fillStyle=_.color||"#000",r.fillRect(0,0,_5.canvasWidth,_5.canvasHeight);var o=_e.createPattern(_n,"repeat");o&&(r.fillStyle=o,r.fillRect(0,0,e,t))}_e.drawImage(_i,0,0)}else _e.fillStyle="#000",_e.fillRect(0,0,e,t);_e.globalAlpha=1,_e.globalCompositeOperation="source-over";var n=Date.now()-_5.lastExplosion+5,i=n<200;if(i){var u=(_5.perks.bigger_explosions+1)*50/n;_e.translate(Math.sin(Date.now())*u,Math.sin(Date.now()+36)*u)}if(_e.globalAlpha=1,_5.coins.forEach(function(e){e.destroyed||(_e.globalCompositeOperation="gold"===e.color||_.color?"source-over":"screen",_C(_e,e.color,e.size,e.x,e.y,_.color||"black",e.a))}),_X("basic")||(_e.globalCompositeOperation="source-over",_e.globalAlpha=Math.min(.8,_5.coins.length/20),_5.balls.forEach(function(e){_P(_e,_.color||"#000",6*_5.ballSize,e.x,e.y)})),_e.globalCompositeOperation="source-over",function(){_e.globalAlpha=1;var _=_5.combo>K(_5)&&_5.perks.picky_eater,e=_5.gameZoneWidth+"_"+_5.bricks.join("_")+_t.complete+"_"+_+"_"+_5.ballsColor+"_"+_5.perks.pierce_color;if(e!==_G){_G=e,_B.width=_5.gameZoneWidth,_B.height=_5.gameZoneWidth+1;var t=_B.getContext("2d");t.clearRect(0,0,_5.gameZoneWidth,_5.gameZoneWidth),t.resetTransform(),t.translate(-_5.offsetX,0),_5.bricks.forEach(function(e,r){var o=_l(r),n=_c(r);if(e){var i=_5.ballsColor!==e&&"black"!==e&&_&&"red"||e;(function(_,e,t,r,o){var n=Math.ceil(r-_5.brickWidth/2),i=Math.ceil(o-_5.brickWidth/2),s=Math.ceil(r+_5.brickWidth/2)-1,a=Math.ceil(o+_5.brickWidth/2)-1,l=s-n,c=a-i,u="brick"+e+"_"+t+"_"+l+"_"+c;if(!_L[u]){var h,d,b,p,m,g,y=document.createElement("canvas");y.width=l,y.height=c;var v=y.getContext("2d");v.fillStyle=e,v.strokeStyle=t,v.lineJoin="round",v.lineWidth=2,h=v,d=1,b=1,p=l-2,m=c-2,g=2,h.beginPath(),h.moveTo(3,1),h.lineTo(d+p-g,b),h.quadraticCurveTo(d+p,b,d+p,b+g),h.lineTo(d+p,b+m-g),h.quadraticCurveTo(d+p,b+m,d+p-g,b+m),h.lineTo(d+g,b+m),h.quadraticCurveTo(d,b+m,d,b+m-g),h.lineTo(d,b+g),h.quadraticCurveTo(d,b,d+g,b),h.closePath(),v.fill(),v.stroke(),_L[u]=y}_.drawImage(_L[u],n,i,l,c)})(t,e,i,o,n),"black"===e&&(t.globalCompositeOperation="source-over",function(_,e,t,r,o){var n="svg"+e+"_"+t+"_"+e.complete;if(!_L[n]){var i=document.createElement("canvas");i.width=t,i.height=t;var s=i.getContext("2d"),a=t/Math.max(e.width,e.height),l=e.width*a,c=e.height*a;s.drawImage(e,(t-l)/2,(t-c)/2,l,c),_L[n]=i}_.drawImage(_L[n],Math.round(r-t/2),Math.round(o-t/2))}(t,_t,_5.brickWidth,o,n))}})}_e.drawImage(_B,_5.offsetX,0)}(),_e.globalCompositeOperation="screen",_5.flashes=_5.flashes.filter(function(_){return _5.levelTime-_.time<_.duration&&!_.destroyed}),_5.flashes.forEach(function(_){var e=_.x,t=_.y,r=_.time,o=_.color,n=_.size,i=_.type,s=_.duration,a=_5.levelTime-r;_e.globalAlpha=Math.max(0,Math.min(1,2-a/s*2)),"text"===i?(_e.globalCompositeOperation="source-over",_H(_e,_.text,o,n,e,t-a/10)):"particle"===i&&(_e.globalCompositeOperation="screen",_P(_e,o,n,e,t),_O(_e,o,n,e,t))}),_5.perks.extra_life){_e.globalAlpha=1,_e.globalCompositeOperation="source-over",_e.fillStyle=_5.puckColor;for(var h=0;h<_5.perks.extra_life;h++)_e.fillRect(_5.offsetXRoundedDown,_5.gameZoneHeight-_5.puckHeight/2+2*h,_5.gameZoneWidthRoundedUp,1)}if(_e.globalAlpha=1,_e.globalCompositeOperation="source-over",_5.balls.forEach(function(_){_P(_e,_5.ballsColor,_5.ballSize,_.x,_.y,_5.puckColor),_S(_)&&(_e.strokeStyle=_5.puckColor,_e.beginPath(),_e.bezierCurveTo(_5.puckPosition,_5.gameZoneHeight,_5.puckPosition,_.y,_.x,_.y),_e.stroke())}),_e.globalAlpha=1,_e.globalCompositeOperation="source-over",_5.perks.streak_shots&&_5.combo>K(_5)&&_T(_e,"red",_5.puckWidth,_5.puckHeight,-2),_T(_e,_5.puckColor,_5.puckWidth,_5.puckHeight),_5.combo>1){_e.globalCompositeOperation="source-over";var d="x "+_5.combo,b=d.length*_5.puckHeight/1.8+2*_5.coinSize,p=_5.puckPosition-b/2;b<_5.puckWidth?(_C(_e,"gold",_5.coinSize,p+_5.coinSize/2,_5.gameZoneHeight-_5.puckHeight/2,_5.puckColor,0),_H(_e,d,"#000",_5.puckHeight,p+1.5*_5.coinSize,_5.gameZoneHeight-_5.puckHeight/2,!0)):_H(_e,d,"#FFF",_5.puckHeight,_5.puckPosition,_5.gameZoneHeight-_5.puckHeight/2,!1)}var m=_5.combo>K(_5);_e.globalCompositeOperation="source-over",_5.offsetXRoundedDown?(_e.fillStyle=m&&_5.perks.left_is_lava?"red":_5.puckColor,_e.fillRect(_5.offsetX-1,0,1,t),_e.fillStyle=m&&_5.perks.right_is_lava?"red":_5.puckColor,_e.fillRect(e-_5.offsetX+1,0,1,t)):(_e.fillStyle="red",m&&_5.perks.left_is_lava&&_e.fillRect(0,0,1,t),m&&_5.perks.right_is_lava&&_e.fillRect(e-1,0,1,t)),_5.perks.top_is_lava&&_5.combo>K(_5)&&(_e.fillStyle="red",_e.fillRect(_5.offsetXRoundedDown,0,_5.gameZoneWidthRoundedUp,1));var g=_5.perks.compound_interest&&_5.combo>K(_5);_e.fillStyle=g?"red":_5.puckColor,_X("mobile-mode")?(_e.fillRect(_5.offsetXRoundedDown,_5.gameZoneHeight,_5.gameZoneWidthRoundedUp,1),_5.running||_H(_e,"Press and hold here to play",_5.puckColor,_5.puckHeight,_5.canvasWidth/2,_5.gameZoneHeight+(_5.canvasHeight-_5.gameZoneHeight)/2)):g&&_e.fillRect(_5.offsetXRoundedDown,_5.gameZoneHeight-1,_5.gameZoneWidthRoundedUp,1),i&&_e.resetTransform(),_X("record")&&_5.running&&s&&(c&&(c.drawImage(__,_5.offsetXRoundedDown,0,_5.gameZoneWidthRoundedUp,_5.gameZoneHeight,0,0,l.width,l.height),c.fillStyle="#FFF",c.textBaseline="top",c.font="12px monospace",c.textAlign="right",c.fillText(_5.score.toString(),l.width-12,12),c.textAlign="left",c.fillText("Level "+(_5.currentLevel+1)+"/"+_R(),12,12)),(null==a?void 0:a.requestFrame)?null==a||a.requestFrame():(null==s?void 0:s.requestFrame)&&s.requestFrame())}}})(),requestAnimationFrame(_),_5.lastTick=e}()}();