-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparking-fury-1.min.js
executable file
·1 lines (1 loc) · 71.4 KB
/
parking-fury-1.min.js
1
!function(e){function t(){for(var e=0;e<k.length;e++)k[e][0](k[e][1]);m=!(k=[])}function a(e,s){k.push([e,s]),m||(m=!0,j(t,0))}function s(e,s){function t(e){l(s,e)}try{e(function(e){o(s,e)},t)}catch(e){t(e)}}function i(s){var e=(t=s.owner).state_,t=t.data_,a=s[e];if(s=s.then,"function"==typeof a){e=w;try{t=a(t)}catch(e){l(s,e)}}n(s,t)||(e===w&&o(s,t),e===y&&l(s,t))}function n(s,t){var a;try{if(s===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&("function"==typeof t||"object"==typeof t)){var e=t.then;if("function"==typeof e)return e.call(t,function(e){a||(a=!0,(t!==e?o:r)(s,e))},function(e){a||(a=!0,l(s,e))}),1}}catch(e){return a||l(s,e),1}}function o(e,s){e!==s&&n(e,s)||r(e,s)}function r(e,s){e.state_===v&&(e.state_=b,e.data_=s,a(d,e))}function l(e,s){e.state_===v&&(e.state_=b,e.data_=s,a(u,e))}function h(e){var s=e.then_;for(e.then_=void 0,e=0;e<s.length;e++)i(s[e])}function d(e){e.state_=w,h(e)}function u(e){e.state_=y,h(e)}function c(e){if("function"!=typeof e)throw new TypeError("Promise constructor takes a function argument");if(!1==this instanceof c)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],s(e,this)}function g(){}var _,m,p=e.Promise,f=p&&"resolve"in p&&"reject"in p&&"all"in p&&"race"in p&&(new p(function(e){_=e}),"function"==typeof _),v=("undefined"!=typeof exports&&exports?(exports.Promise=f?p:c,exports.Polyfill=c):"function"==typeof define&&define.amd?define(function(){return f?p:c}):f||(e.Promise=c),"pending"),b="sealed",w="fulfilled",y="rejected",j="undefined"!=typeof setImmediate?setImmediate:setTimeout,k=[];c.prototype={constructor:c,state_:v,then_:null,data_:void 0,then:function(e,s){e={owner:this,then:new this.constructor(g),fulfilled:e,rejected:s};return this.state_===w||this.state_===y?a(i,e):this.then_.push(e),e.then},catch:function(e){return this.then(null,e)}},c.all=function(o){if("[object Array]"!==Object.prototype.toString.call(o))throw new TypeError("You must pass an array to Promise.all().");return new this(function(t,e){for(var s,a=[],i=0,n=0;n<o.length;n++)(s=o[n])&&"function"==typeof s.then?s.then(function(s){return i++,function(e){a[s]=e,--i||t(a)}}(n),e):a[n]=s;i||t(a)})},c.race=function(i){if("[object Array]"!==Object.prototype.toString.call(i))throw new TypeError("You must pass an array to Promise.race().");return new this(function(e,s){for(var t,a=0;a<i.length;a++)(t=i[a])&&"function"==typeof t.then?t.then(e,s):e(t)})},c.resolve=function(s){return s&&"object"==typeof s&&s.constructor===this?s:new this(function(e){e(s)})},c.reject=function(t){return new this(function(e,s){s(t)})}}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this),function(){function B(e,s,t){return e.call.apply(e.bind,arguments)}function F(s,t,e){var a;if(s)return 2<arguments.length?(a=Array.prototype.slice.call(arguments,2),function(){var e=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(e,a),s.apply(t,e)}):function(){return s.apply(t,arguments)};throw Error()}function _(e,s,t){return(_=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?B:F).apply(null,arguments)}var r=Date.now||function(){return+new Date};function N(e,s){this.a=e,this.o=s||e,this.c=this.o.document}var R=!!window.FontFace;function l(e,s,t,a){if(s=e.c.createElement(s),t)for(var i in t)t.hasOwnProperty(i)&&("style"==i?s.style.cssText=t[i]:s.setAttribute(i,t[i]));return a&&s.appendChild(e.c.createTextNode(a)),s}function h(e,s,t){(e=(e=e.c.getElementsByTagName(s)[0])||document.documentElement).insertBefore(t,e.lastChild)}function t(e){e.parentNode&&e.parentNode.removeChild(e)}function m(e,s,t){s=s||[],t=t||[];for(var a=e.className.split(/\s+/),i=0;i<s.length;i+=1){for(var n=!1,o=0;o<a.length;o+=1)if(s[i]===a[o]){n=!0;break}n||a.push(s[i])}for(s=[],i=0;i<a.length;i+=1){for(n=!1,o=0;o<t.length;o+=1)if(a[i]===t[o]){n=!0;break}n||s.push(a[i])}e.className=s.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function n(e,s){for(var t=e.className.split(/\s+/),a=0,i=t.length;a<i;a++)if(t[a]==s)return!0;return!1}function x(e,s,t){function a(){o&&i&&(o(n),o=null)}s=l(e,"link",{rel:"stylesheet",href:s,media:"all"});var i=!1,n=null,o=t||null;R?(s.onload=function(){i=!0,a()},s.onerror=function(){i=!0,n=Error("Stylesheet failed to load"),a()}):setTimeout(function(){i=!0,a()},0),h(e,"head",s)}function a(e,s,t,a){var i,n,o=e.c.getElementsByTagName("head")[0];return o?(i=l(e,"script",{src:s}),n=!1,i.onload=i.onreadystatechange=function(){n||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(n=!0,t&&t(null),i.onload=i.onreadystatechange=null,"HEAD"==i.parentNode.tagName&&o.removeChild(i))},o.appendChild(i),setTimeout(function(){n||(n=!0,t&&t(Error("Script load timeout")))},a||5e3),i):null}function T(){this.a=0,this.c=null}function S(e){return e.a++,function(){e.a--,i(e)}}function E(e,s){e.c=s,i(e)}function i(e){0==e.a&&e.c&&(e.c(),e.c=null)}function o(e){this.a=e||"-"}function C(e,s){this.c=e,this.f=4,this.a="n";e=(s||"n4").match(/^([nio])([1-9])$/i);e&&(this.a=e[1],this.f=parseInt(e[2],10))}function d(e){var s=[];e=e.split(/,\s*/);for(var t=0;t<e.length;t++){var a=e[t].replace(/['"]/g,"");-1!=a.indexOf(" ")||/^\d/.test(a)?s.push("'"+a+"'"):s.push(a)}return s.join(",")}function p(e){return e.a+e.f}function u(e){var s="normal";return"o"===e.a?s="oblique":"i"===e.a&&(s="italic"),s}function H(e,s){this.c=e,this.f=e.o.document.documentElement,this.h=s,this.a=new o("-"),this.j=!1!==s.events,this.g=!1!==s.classes}function f(e){var s,t,a;e.g&&(s=n(e.f,e.a.c("wf","active")),t=[],a=[e.a.c("wf","loading")],s||t.push(e.a.c("wf","inactive")),m(e.f,t,a)),v(e,"inactive")}function v(e,s,t){e.j&&e.h[s]&&(t?e.h[s](t.c,p(t)):e.h[s]())}function G(){this.c={}}function c(e,s){this.c=e,this.f=s,this.a=l(this.c,"span",{"aria-hidden":"true"},this.f)}function g(e){h(e.c,"body",e.a)}function b(e){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+d(e.c)+";font-style:"+u(e)+";font-weight:"+e.f+"00;"}function w(e,s,t,a,i,n){this.g=e,this.j=s,this.a=a,this.c=t,this.f=i||3e3,this.h=n||void 0}function y(e,s,t,a,i,n,o){this.v=e,this.B=s,this.c=t,this.a=a,this.s=o||"BESbswy",this.f={},this.w=i||3e3,this.u=n||null,this.m=this.j=this.h=this.g=null,this.g=new c(this.c,this.s),this.h=new c(this.c,this.s),this.j=new c(this.c,this.s),this.m=new c(this.c,this.s),e=b(e=new C(this.a.c+",serif",p(this.a))),this.g.a.style.cssText=e,e=b(e=new C(this.a.c+",sans-serif",p(this.a))),this.h.a.style.cssText=e,e=b(e=new C("serif",p(this.a))),this.j.a.style.cssText=e,e=b(e=new C("sans-serif",p(this.a))),this.m.a.style.cssText=e,g(this.g),g(this.h),g(this.j),g(this.m)}o.prototype.c=function(e){for(var s=[],t=0;t<arguments.length;t++)s.push(arguments[t].replace(/[\W_]+/g,"").toLowerCase());return s.join(this.a)},w.prototype.start=function(){var i=this.c.o.document,n=this,o=r(),e=new Promise(function(t,a){!function s(){var e;r()-o>=n.f?a():i.fonts.load(u(e=n.a)+" "+e.f+"00 300px "+d(e.c),n.h).then(function(e){1<=e.length?t():setTimeout(s,25)},function(){a()})}()}),t=null,s=new Promise(function(e,s){t=setTimeout(s,n.f)});Promise.race([s,e]).then(function(){t&&(clearTimeout(t),t=null),n.g(n.a)},function(){n.j(n.a)})};var j={D:"serif",C:"sans-serif"},s=null;function k(){var e;return null===s&&(e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),s=!!e&&(parseInt(e[1],10)<536||536===parseInt(e[1],10)&&parseInt(e[2],10)<=11)),s}function P(e,s,t){for(var a in j)if(j.hasOwnProperty(a)&&s===e.f[j[a]]&&t===e.f[j[a]])return!0;return!1}function I(e){var s=e.g.a.offsetWidth,t=e.h.a.offsetWidth;s===e.f.serif&&t===e.f["sans-serif"]||k()&&P(e,s,t)?r()-e.A>=e.w?k()&&P(e,s,t)&&(null===e.u||e.u.hasOwnProperty(e.a.c))?L(e,e.v):L(e,e.B):setTimeout(_(function(){I(this)},e),50):L(e,e.v)}function L(e,s){setTimeout(_(function(){t(this.g.a),t(this.h.a),t(this.j.a),t(this.m.a),s(this.a)},e),0)}function A(e,s,t){this.c=e,this.a=s,this.f=0,this.m=this.j=!1,this.s=t}y.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=r(),I(this)};var O=null;function D(e){0==--e.f&&e.j&&(e.m?((e=e.a).g&&m(e.f,[e.a.c("wf","active")],[e.a.c("wf","loading"),e.a.c("wf","inactive")]),v(e,"active")):f(e.a))}function Z(e){this.j=e,this.a=new G,this.h=0,this.f=this.g=!0}function z(e,s){this.c=e,this.a=s}function K(e,s){this.c=e,this.a=s}function W(e,s){this.c=e||"https://fonts.googleapis.com/css",this.a=[],this.f=[],this.g=s||""}A.prototype.g=function(e){var s=this.a;s.g&&m(s.f,[s.a.c("wf",e.c,p(e).toString(),"active")],[s.a.c("wf",e.c,p(e).toString(),"loading"),s.a.c("wf",e.c,p(e).toString(),"inactive")]),v(s,"fontactive",e),this.m=!0,D(this)},A.prototype.h=function(e){var s,t,a,i=this.a;i.g&&(s=n(i.f,i.a.c("wf",e.c,p(e).toString(),"active")),t=[],a=[i.a.c("wf",e.c,p(e).toString(),"loading")],s||t.push(i.a.c("wf",e.c,p(e).toString(),"inactive")),m(i.f,t,a)),v(i,"fontinactive",e),D(this)},Z.prototype.load=function(e){this.c=new N(this.j,e.context||this.j),this.g=!1!==e.events,this.f=!1!==e.classes;var a=this,s=new H(this.c,e),t=e,i=[],e=t.timeout,i=(function(e){e.g&&m(e.f,[e.a.c("wf","loading")]),v(e,"loading")}(s),function(e,s,t){var a,i,n=[];for(a in s)s.hasOwnProperty(a)&&(i=e.c[a])&&n.push(i(s[a],t));return n}(a.a,t,a.c)),n=new A(a.c,s,e);for(a.h=i.length,s=0,t=i.length;s<t;s++)i[s].load(function(e,s,t){var h,d,u,c,g;h=n,d=e,u=s,c=t,g=0==--(e=a).h,(e.f||e.g)&&setTimeout(function(){var e=c||null,s=u||{};if(0===d.length&&g)f(h.a);else{h.f+=d.length,g&&(h.j=g);for(var t=[],a=0;a<d.length;a++){var i,n=d[a],o=s[n.c],r=h.a,l=n;r.g&&m(r.f,[r.a.c("wf",l.c,p(l).toString(),"loading")]),v(r,"fontloading",l),r=(O=(r=null)===O?!!window.FontFace&&(l=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),i=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor),l?42<parseInt(l[1],10):!i):O)?new w(_(h.g,h),_(h.h,h),h.c,n,h.s,o):new y(_(h.g,h),_(h.h,h),h.c,n,h.s,e,o),t.push(r)}for(a=0;a<t.length;a++)t[a].start()}},0)})},z.prototype.load=function(o){var r,s=this,l=s.a.projectId,e=s.a.version;l?(r=s.c.o,a(this.c,(s.a.api||"https://fast.fonts.net/jsapi")+"/"+l+".js"+(e?"?v="+e:""),function(e){e?o([]):(r["__MonotypeConfiguration__"+l]=function(){return s.a},function e(){if(r["__mti_fntLst"+l]){var s,t=r["__mti_fntLst"+l](),a=[];if(t)for(var i=0;i<t.length;i++){var n=t[i].fontfamily;null!=t[i].fontStyle&&null!=t[i].fontWeight?(s=t[i].fontStyle+t[i].fontWeight,a.push(new C(n,s))):a.push(new C(n))}o(a)}else setTimeout(function(){e()},50)}())}).id="__MonotypeAPIScript__"+l):o([])},K.prototype.load=function(e){for(var s=this.a.urls||[],t=this.a.families||[],a=this.a.testStrings||{},i=new T,n=0,o=s.length;n<o;n++)x(this.c,s[n],S(i));var r=[];for(n=0,o=t.length;n<o;n++)if((s=t[n].split(":"))[1])for(var l=s[1].split(","),h=0;h<l.length;h+=1)r.push(new C(s[0],l[h]));else r.push(new C(s[0]));E(i,function(){e(r,a)})};function U(e){this.f=e,this.a=[],this.c={}}var X={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},Y={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},V={i:"i",italic:"i",n:"n",normal:"n"},J=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function $(e,s){this.c=e,this.a=s}var q={Arimo:!0,Cousine:!0,Tinos:!0};function Q(e,s){this.c=e,this.a=s}function ee(e,s){this.c=e,this.f=s,this.a=[]}$.prototype.load=function(e){for(var s=new T,t=this.c,a=new W(this.a.api,this.a.text),i=this.a.families,n=a,o=i,r=o.length,l=0;l<r;l++){var h=o[l].split(":"),d=(3==h.length&&n.f.push(h.pop()),"");2==h.length&&""!=h[1]&&(d=":"),n.a.push(h.join(d))}for(var u=new U(i),c=u,g=c.f.length,_=0;_<g;_++){var m=c.f[_].split(":"),p=m[0].replace(/\+/g," "),f=["n4"];if(2<=m.length){var v,b,w=m[1],y=[];if(w)for(var j=(w=w.split(",")).length,k=0;k<j;k++)(b=!(b=w[k]).match(/^[\w-]+$/)||null==(v=J.exec(b.toLowerCase()))?"":[b=null==(b=v[2])||""==b?"n":V[b],v=null==(v=v[1])||""==v?"4":Y[v]||(isNaN(v)?"4":v.substr(0,1))].join(""))&&y.push(b);0<y.length&&(f=y),3==m.length&&(y=[],0<(m=(m=m[2])?m.split(","):y).length)&&(m=X[m[0]])&&(c.c[p]=m)}for(c.c[p]||(m=X[p])&&(c.c[p]=m),m=0;m<f.length;m+=1)c.a.push(new C(p,f[m]))}x(t,function(e){if(0==e.a.length)throw Error("No fonts to load!");if(-1!=e.c.indexOf("kit="))return e.c;for(var s=e.a.length,t=[],a=0;a<s;a++)t.push(e.a[a].replace(/ /g,"+"));return s=e.c+"?family="+t.join("%7C"),0<e.f.length&&(s+="&subset="+e.f.join(",")),0<e.g.length&&(s+="&text="+encodeURIComponent(e.g)),s}(a),S(s)),E(s,function(){e(u.a,u.c,q)})},Q.prototype.load=function(o){var e=this.a.id,r=this.c.o;e?a(this.c,(this.a.api||"https://use.typekit.net")+"/"+e+".js",function(e){if(e)o([]);else if(r.Typekit&&r.Typekit.config&&r.Typekit.config.fn){e=r.Typekit.config.fn;for(var s=[],t=0;t<e.length;t+=2)for(var a=e[t],i=e[t+1],n=0;n<i.length;n++)s.push(new C(a,i[n]));try{r.Typekit.load({events:!1,classes:!1,async:!0})}catch(e){}o(s)}},2e3):o([])},ee.prototype.load=function(l){var e=this.f.id,s=this.c.o,h=this;e?(s.__webfontfontdeckmodule__||(s.__webfontfontdeckmodule__={}),s.__webfontfontdeckmodule__[e]=function(e,s){for(var t,a,i,n=0,o=s.fonts.length;n<o;++n){var r=s.fonts[n];h.a.push(new C(r.name,(r="font-weight:"+r.weight+";font-style:"+r.style,i=a=t=void 0,t=4,a="n",i=null,r&&((i=r.match(/(normal|oblique|italic)/i))&&i[1]&&(a=i[1].substr(0,1).toLowerCase()),i=r.match(/([1-9]00|normal|bold)/i))&&i[1]&&(/bold/i.test(i[1])?t=7:/[1-9]00/.test(i[1])&&(t=parseInt(i[1].substr(0,1),10))),a+t)))}l(h.a)},a(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+((s=this.c).o.location.hostname||s.a.location.hostname)+"/"+e+".js",function(e){e&&l([])})):l([])};var e=new Z(window),M=(e.a.c.custom=function(e,s){return new K(s,e)},e.a.c.fontdeck=function(e,s){return new ee(s,e)},e.a.c.monotype=function(e,s){return new z(s,e)},e.a.c.typekit=function(e,s){return new Q(s,e)},e.a.c.google=function(e,s){return new $(s,e)},{load:_(e.load,e)});"function"==typeof define&&define.amd?define(function(){return M}):"undefined"!=typeof module&&module.exports?module.exports=M:(window.WebFont=M,window.WebFontConfig&&e.load(window.WebFontConfig))}();var Fabrique,AzerionIntegration={LoaderHelper:{}},ParkingFury={render_textures_created:null,s_menu:null,s_ingame:null,s_splash:null,s_check:null,s_hit:null,s_engine:null,s_star:null,sound_enabled:null,score:null,levels:null,currentLevel:null,currentStars:null,levelsStars:null,save:null,load:null,sound_ON_OFF:null,mobile_browser:null,game_name_for_buttons:null},Constants=function(){function e(){}return e.GAME_SCALE=1,e.CALCULATED_WIDTH=0,e.CALCULATED_HEIGHT=0,e.GAME_WIDTH=853,e.GAME_HEIGHT=480,e.LANDSCAPE_LOCKED=!0,e.PORTRAIT_LOCKED=!1,e.GAME_KEY="cfc668a321ffa887041c43e802d91bf6",e.SECRET_KEY="a8544eb95f5dbc00a37b25d0f432deb5469e8ecd",e.GOOGLE_ID="UA-85519155-37",e.GOOGLE_APP_NAME="Parking Fury 1",e.GAMEDISTRIBUTION_ID="919e83dbc31749e1a54787e656ce513b",e.GAMEDISTRIBUTION_USER="ABD36C6C-E74B-4BA7-BE87-0AB01F98D30D-s1",e.CURRENT_LEVEL=0,e.DEFAULT_STARS="[0,-1,-1,-1,-1,-1,-1,-1,-1,-1]",e.GAME_TITLE="Parking Fury 1",e}(),Images=function(){function e(){}return e.preloadList=[],e.list=["btn_play","btn_more","btn_credits","btn_home","bkg_pattern","btn_restart","btn_back","game_logo","btn_levels","logo105"],e}(),Atlases=function(){function e(){}return e.preloadList=[e.Interface="interface"],e.list=[],e}(),Sounds=function(){function e(){}return e.preloadList=[e.Click="click"],e.list=[],e}(),LoaderHelper=function(){function e(){}return e.show=function(){var e=document.getElementById("loader");e&&(e.style.display="block")},e.hide=function(){var e=document.getElementById("loader");e&&(e.style.display="none")},e}(),AdEventTracker=function(){function e(){}return e.eventNames=["exit_gameplay_to_main_menu","restart","restart_on_level_lose","exit_level_win_to_menu","exit_level_select_to_menu","next_level","resume"],e.events=[],e.getEventNames=function(){var e=new CustomEvent("getAzerionIntEventNames",{detail:this.eventNames});document.dispatchEvent(e)},e.register=function(e){this.eventNames.map(e=>{this.events.push(new Event(e))}),this.getEventNames()},e.dispatch=function(s){var e=this.events.filter(e=>e.type===s);e&&0<e.length&&document.dispatchEvent(e[0])},e}(),PauseHandler=function(){function e(){}return e.game=null,e.focused=!0,e.init=function(e){this.game=e,this.focused=!0,this.game.stage.disableVisibilityChange=!0,this.onPauseCallback=new Phaser.Signal;var s=this;h5branding.Utils.isOnDevice()&&(document.addEventListener("pause",function(){return s.onPause()}),document.addEventListener("resume",function(){return s.onResume()})),this.game.onBlur.add(this.onBlur,this),this.game.onFocus.add(this.onFocus,this),this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},e.onBlur=function(){this.focused=!1,this.game.onPause.dispatch()},e.onFocus=function(){this.focused=!0,AdHandler.isAdPlaying()||this.game.onResume.dispatch()},e.onPause=function(){this.game.sound.setMute(),this.onPauseCallback&&this.onPauseCallback.dispatch()},e.onResume=function(){this.game.sound.unsetMute()},e.pause=function(){this.game.onPause.dispatch()},e.resume=function(){this.hasFocus&&this.game.onResume.dispatch()},e}(),AdHandler=function(){function e(){}return e.azAdWrapper=null,e.contentStatus="resumed",e.init=function(){var e=window._azerionIntegration.advType,s=window._azerionIntegration.gdId;this.azAdWrapper=new window.h5ads.AdWrapper(e,s),this.addListeners()},e.addListeners=function(){this.azAdWrapper.on(h5ads.AdEvents.CONTENT_PAUSED,()=>{LoaderHelper.hide(),this.contentStatus="paused",PauseHandler.pause()}),this.azAdWrapper.on(h5ads.AdEvents.CONTENT_RESUMED,()=>{LoaderHelper.hide(),this.contentStatus="resumed",PauseHandler.resume()})},e.showAd=function(e,s){LoaderHelper.show();let t=()=>{s&&s.call(this),this.azAdWrapper.removeAllListeners(h5ads.AdEvents.AD_REWARDED),this.azAdWrapper.removeListener(h5ads.AdEvents.CONTENT_RESUMED,t)};this.azAdWrapper.on(h5ads.AdEvents.CONTENT_RESUMED,t),this.azAdWrapper.showAd(h5ads.AdType.interstitial)},e.isAdPlaying=function(){return"paused"===this.contentStatus},e}(),AzerionIntegrationSDK=function(){function e(){}return e.createSplashLoader=function(e,s){window._azerionIntegration?.sa&&(h5branding.Utils.ASSET_LOCATION="assets/"),h5branding.SplashLoader.getInstance({gameId:Constants.GAMEDISTRIBUTION_ID,gameName:Constants.GAME_TITLE,gameTitle:Constants.GAME_TITLE,libs:libs,version:_azerionIntegration.build.version}).create().then(function(){PauseHandler.init(e),AdHandler.init(),AdEventTracker.register(),s&&s.call(this)})},e.removeSplashLoader=function(e){h5branding.SplashLoader.getInstance().setButtonCallback(function(){h5branding.SplashLoader.getInstance().destroy(),AdHandler.showAd("splash",function(){e&&e.call(this)})})},e.onLoadProgress=function(e){h5branding.SplashLoader.getInstance().setLoadProgress(e)},e.onLoadComplete=function(){h5branding.SplashLoader.getInstance().setLoadProgress(100)},e.showAd=function(e,s){AdEventTracker.dispatch(e),AdHandler.showAd(e,function(){s&&s.call(this)})},e}(),storageHelper=(ParkingFury.BlankState=function(e){},ParkingFury.BlankState.prototype={create:function(){this.game.world.scale.set(1),this.state.start("Game",!0,!1)}},ParkingFury.Boot=function(e){},ParkingFury.Boot.prototype={init:function(){storageHelper.init(this.game,"lvlStar"),game_name_for_buttons="parking-fury-1",s_menu=null,s_ingame=null,s_splash=null,s_check=null,s_hit=null,s_engine=null,s_star=null,sound_enabled=!0,wasPaused=!0,(this.game.device.desktop||(mobile_browser=!0,navigator.userAgent.match(/Windows NT/i)))&&(mobile_browser=!1),sound_ON_OFF=function(){sound_enabled=!sound_enabled,s_menu.mute=!sound_enabled,s_ingame.mute=!sound_enabled,s_splash.mute=!sound_enabled,s_check.mute=!sound_enabled,s_hit.mute=!sound_enabled,s_engine.mute=!sound_enabled,s_star.mute=!sound_enabled},isLocalStorageNameSupported=function(){var e=window.localStorage;try{return e.setItem("test","1"),e.removeItem("test"),!0}catch(e){return!1}},mobileResizeCallback=function(e){},setScaling=function(e){var s=window.innerWidth>window.innerHeight?window.innerWidth:window.innerHeight;s*=e.device.pixelRatio,Constants.GAME_SCALE=s<650?.5:1050<s?1:.75},handleCorrect=function(){wasPaused||(this.game.pause=!1),document.getElementById("orientation").style.display="none",document.getElementById("content").style.display="block"},handleIncorrect=function(){wasPaused||(this.game.pause=!0),document.getElementById("orientation").style.display="block",document.getElementById("content").style.display="none"},save=function(){storageHelper.save("lvlStar",JSON.stringify(levelsStars))},load=function(){storageHelper.load("lvlStar").then(function(e){e&&(levelsStars=JSON.parse(JSON.parse(e)))})},this.game.tweens.frameBased=!0,render_textures_created=!1,currentLevel=0,Constants.CURRENT_LEVEL=currentLevel,currentStars=0,levelsStars=[0,-1,-1,-1,-1,-1,-1,-1,-1,-1],score=66,this.input.maxPointers=2;var s=this;this.game.device.desktop?(this.scale.scaleMode=Phaser.ScaleManager.SHOW_ALL,this.scale.pageAlignHorizontally=!0,this.scale.pageAlignVertically=!0,this.game.scale.windowConstraints.bottom="visual"):(this.game.scale.scaleMode=Phaser.ScaleManager.SHOW_ALL,this.game.scale.fullScreenScaleMode=Phaser.ScaleManager.USER_SCALE,this.game.scale.pageAlignHorizontally=!0,this.game.scale.pageAlignVertically=!0,this.game.scale.windowConstraints.right="layout",this.game.scale.windowConstraints.bottom="visual",window.addEventListener("resize",function(e){return s.changeOrientation(),mobileResizeCallback.call(s,s.game.scale)}),mobileResizeCallback.call(s,s.game.scale),this.game.scale.onSizeChange.add(this.changeOrientation,this),this.changeOrientation()),load()},preload:function(){var s=this;this.game.load.cacheBuster="undefined"==typeof version?null:version,this.game.load.onFileComplete.add(function(e){AzerionIntegrationSDK.onLoadProgress(e)}),this.game.load.onLoadComplete.add(function(){AzerionIntegrationSDK.onLoadComplete()}),AzerionIntegrationSDK.removeSplashLoader(function(){this.game.state.start("MainMenu")}.bind(this)),this.load.image("preloaderBackground","assets/images/background_menu.png"),this.load.image("preloaderBar","assets/images/loader.png"),this.load.image("btn_walk","assets/images/btn_walk.png"),this.load.image("asphalt_1.jpg","assets/images/textures/asphalt_1.jpg"),this.load.image("Bruk.png","assets/images/textures/Bruk.png"),this.load.image("asphalt_2.png","assets/images/textures/asphalt_2.png"),this.load.image("Trotuar.jpg","assets/images/textures/Trotuar.jpg"),this.load.image("Trava.jpg","assets/images/textures/Trava.jpg"),this.load.image("House.jpg","assets/images/textures/House.jpg"),this.load.image("roof.jpg","assets/images/textures/roof.jpg"),this.load.image("Tree1.png","assets/images/textures/Tree1.png"),this.load.image("Tree2.png","assets/images/textures/Tree2.png"),this.load.image("Barrels.png","assets/images/textures/Barrels.png"),this.load.image("Barrels2.png","assets/images/textures/Barrels2.png"),this.load.image("beton.png","assets/images/textures/beton.png"),this.load.image("Car.png","assets/images/textures/Car.png"),this.load.image("Door.png","assets/images/textures/Door.png"),this.load.image("Klumba.jpg","assets/images/textures/Klumba.jpg"),this.load.image("Musor1.png","assets/images/textures/Musor1.png"),this.load.image("Musor2.png","assets/images/textures/Musor2.png"),this.load.image("Zabor_X1.jpg","assets/images/textures/Zabor_X1.jpg"),this.load.image("Zabor_X1_2.jpg","assets/images/textures/Zabor_X1_2.jpg"),this.load.image("Zabor_X3.jpg","assets/images/textures/Zabor_X3.jpg"),this.load.image("wood_box.png","assets/images/textures/wood_box.png"),this.load.image("Bordur_Long.jpg","assets/images/textures/Bordur_Long.jpg"),this.load.image("Bordur_rot.png","assets/images/textures/Bordur_rot.png"),this.load.image("Bordur_Short.jpg","assets/images/textures/Bordur_Short.jpg"),this.load.image("Zebra.png","assets/images/textures/Zebra.png"),this.load.image("razmetka.png","assets/images/textures/razmetka.png"),this.load.image("car_shadow","assets/images/cars/car_shadow.png"),this.load.image("car_wheel","assets/images/cars/car_wheel.png"),this.load.image("c2_1.png","assets/images/cars/c2_1.png"),this.load.image("c2_2.png","assets/images/cars/c2_2.png"),this.load.image("c3_1.png","assets/images/cars/c3_1.png"),this.load.image("c3_2.png","assets/images/cars/c3_2.png"),this.load.image("c3_3.png","assets/images/cars/c3_3.png"),this.load.image("c3_4.png","assets/images/cars/c3_4.png"),this.load.image("c4_1.png","assets/images/cars/c4_1.png"),this.load.image("c4_2.png","assets/images/cars/c4_2.png"),this.load.image("c4_3.png","assets/images/cars/c4_3.png"),this.load.image("c5_1.png","assets/images/cars/c5_1.png"),this.load.image("c5_2.png","assets/images/cars/c5_2.png"),this.load.image("c5_3.png","assets/images/cars/c5_3.png"),this.load.image("c6_1.png","assets/images/cars/c6_1.png"),this.load.image("c6_2.png","assets/images/cars/c6_2.png"),this.load.image("c6_3.png","assets/images/cars/c6_3.png"),this.load.image("hero_car_1.png","assets/images/cars/hero_car_1.png"),this.load.image("hero_car_2.png","assets/images/cars/hero_car_2.png"),this.load.image("arrow_direct.png","assets/images/textures/arrow_direct.png"),this.load.image("arrow_fin.png","assets/images/textures/arrow_fin.png"),this.load.image("arrow_turn.png","assets/images/textures/arrow_turn.png"),this.load.image("flare","assets/images/flare.png"),this.game.load.json("car_1","assets/json/cars/car_1.json"),this.game.load.json("car_2","assets/json/cars/car_2.json"),this.game.load.json("car_3","assets/json/cars/car_3.json"),this.game.load.json("car_4","assets/json/cars/car_4.json"),this.game.load.json("car_5","assets/json/cars/car_5.json"),this.game.load.json("car_6","assets/json/cars/car_6.json"),this.game.load.json("car_7","assets/json/cars/car_7.json"),this.game.load.json("car_8","assets/json/cars/car_8.json"),this.game.load.json("car_9","assets/json/cars/car_9.json"),this.game.load.json("car_10","assets/json/cars/car_10.json"),this.game.load.json("car_11","assets/json/cars/car_11.json"),this.game.load.json("car_12","assets/json/cars/car_12.json"),this.game.load.json("car_13","assets/json/cars/car_13.json"),this.game.load.json("car_14","assets/json/cars/car_14.json"),this.game.load.json("car_15","assets/json/cars/car_15.json"),this.game.load.json("car_16","assets/json/cars/car_16.json"),this.game.load.json("car_17","assets/json/cars/car_17.json"),this.game.load.json("level_0","assets/json/levels/level_0.json"),this.game.load.json("level_0_ground","assets/json/levels/level_0_ground.json"),this.game.load.json("level_0_decals","assets/json/levels/level_0_decals.json"),this.game.load.json("level_0_missions","assets/json/levels/level_0_missions.json"),this.game.load.json("level_0_phys","assets/json/levels/level_0_phys.json"),this.game.load.json("level_1","assets/json/levels/level_1.json"),this.game.load.json("level_1_ground","assets/json/levels/level_1_ground.json"),this.game.load.json("level_1_decals","assets/json/levels/level_1_decals.json"),this.game.load.json("level_1_missions","assets/json/levels/level_1_missions.json"),this.game.load.json("level_1_phys","assets/json/levels/level_1_phys.json"),this.game.load.json("level_2","assets/json/levels/level_2.json"),this.game.load.json("level_2_ground","assets/json/levels/level_2_ground.json"),this.game.load.json("level_2_decals","assets/json/levels/level_2_decals.json"),this.game.load.json("level_2_missions","assets/json/levels/level_2_missions.json"),this.game.load.json("level_2_phys","assets/json/levels/level_2_phys.json"),this.game.load.json("level_3","assets/json/levels/level_3.json"),this.game.load.json("level_3_ground","assets/json/levels/level_3_ground.json"),this.game.load.json("level_3_decals","assets/json/levels/level_3_decals.json"),this.game.load.json("level_3_missions","assets/json/levels/level_3_missions.json"),this.game.load.json("level_3_phys","assets/json/levels/level_3_phys.json"),this.game.load.json("level_4","assets/json/levels/level_4.json"),this.game.load.json("level_4_ground","assets/json/levels/level_4_ground.json"),this.game.load.json("level_4_decals","assets/json/levels/level_4_decals.json"),this.game.load.json("level_4_missions","assets/json/levels/level_4_missions.json"),this.game.load.json("level_4_phys","assets/json/levels/level_4_phys.json"),this.game.load.json("level_5","assets/json/levels/level_5.json"),this.game.load.json("level_5_ground","assets/json/levels/level_5_ground.json"),this.game.load.json("level_5_decals","assets/json/levels/level_5_decals.json"),this.game.load.json("level_5_missions","assets/json/levels/level_5_missions.json"),this.game.load.json("level_5_phys","assets/json/levels/level_5_phys.json"),this.game.load.json("level_6","assets/json/levels/level_6.json"),this.game.load.json("level_6_ground","assets/json/levels/level_6_ground.json"),this.game.load.json("level_6_decals","assets/json/levels/level_6_decals.json"),this.game.load.json("level_6_missions","assets/json/levels/level_6_missions.json"),this.game.load.json("level_6_phys","assets/json/levels/level_6_phys.json"),this.game.load.json("level_7","assets/json/levels/level_7.json"),this.game.load.json("level_7_ground","assets/json/levels/level_7_ground.json"),this.game.load.json("level_7_decals","assets/json/levels/level_7_decals.json"),this.game.load.json("level_7_missions","assets/json/levels/level_7_missions.json"),this.game.load.json("level_7_phys","assets/json/levels/level_7_phys.json"),this.game.load.json("level_8","assets/json/levels/level_8.json"),this.game.load.json("level_8_ground","assets/json/levels/level_8_ground.json"),this.game.load.json("level_8_decals","assets/json/levels/level_8_decals.json"),this.game.load.json("level_8_missions","assets/json/levels/level_8_missions.json"),this.game.load.json("level_8_phys","assets/json/levels/level_8_phys.json"),this.game.load.json("level_9","assets/json/levels/level_9.json"),this.game.load.json("level_9_ground","assets/json/levels/level_9_ground.json"),this.game.load.json("level_9_decals","assets/json/levels/level_9_decals.json"),this.game.load.json("level_9_missions","assets/json/levels/level_9_missions.json"),this.game.load.json("level_9_phys","assets/json/levels/level_9_phys.json"),this.game.load.json("map_part_plitka_1.json","assets/json/clips/map_part_plitka_1.json"),this.game.load.json("map_part_plitka_2.json","assets/json/clips/map_part_plitka_2.json"),this.game.load.json("map_part_plitka_3.json","assets/json/clips/map_part_plitka_3.json"),this.game.load.json("map_part_trava_1.json","assets/json/clips/map_part_trava_1.json"),this.game.load.json("map_part_trava_2.json","assets/json/clips/map_part_trava_2.json"),this.game.load.json("map_part_trava_3.json","assets/json/clips/map_part_trava_3.json"),this.load.spritesheet("btn_sound","assets/images/btn_sound_frames.png",92,91),this.load.spritesheet("star","assets/images/star_frames.png",96,92),this.load.image("gui_stars_bkg","assets/images/gui_stars_bkg.png"),this.load.image("gui_mission_complete","assets/images/gui_mission_complete.png"),this.load.image("check","assets/images/check.png"),this.load.image("fail","assets/images/fail.png"),this.load.image("gui_wheel","assets/images/gui_wheel.png"),this.load.image("gui_pedal_gas","assets/images/gui_pedal_gas.png"),this.load.image("gui_pedal_brake","assets/images/gui_pedal_brake.png"),this.load.image("loading","assets/images/loading.png"),this.load.bitmapFont("myfont","assets/images/font.png","assets/images/font.fnt"),this.load.atlas("spark","assets/images/spark_frames.png","assets/images/spark_frames.json"),Images.list.forEach(function(e){s.game.load.image(e,"assets/images/"+e+".png")}),Atlases.list.forEach(function(e){s.game.load.atlas(e,"assets/atlases/"+scale+e+".png","assets/atlases/"+scale+e+".json")}),Sounds.list.forEach(function(e){s.game.device.iOS?s.game.load.audio(e,["assets/sound/"+e+".m4a"]):s.game.load.audio(e,["assets/sound/"+e+".ogg","assets/sound/"+e+".mp3"])}),this.load.audio("music_menu",["assets/sounds/menu_music.ogg","assets/sounds/menu_music.mp3"]),this.load.audio("music_game",["assets/sounds/ingame_FunkGameLoop.ogg","assets/sounds/ingame_FunkGameLoop.mp3"]),this.load.audio("music_splash",["assets/sounds/splash.ogg","assets/sounds/splash.mp3"]),this.load.audio("music_check",["assets/sounds/check.ogg","assets/sounds/check.mp3"]),this.load.audio("music_hit",["assets/sounds/HitSound.ogg","assets/sounds/HitSound.mp3"]),this.load.audio("music_engine",["assets/sounds/engine_rev.ogg","assets/sounds/engine_rev.mp3"]),this.load.audio("music_star",["assets/sounds/star.ogg","assets/sounds/star.mp3"]),this.game.load.crossOrigin=!0,this.game.storage.forcePromises=!0,this.game.canvas.oncontextmenu=function(e){e.preventDefault()}},changeOrientation:function(){Constants.LANDSCAPE_LOCKED&&(window.innerWidth>window.innerHeight?handleCorrect:handleIncorrect)(this.game)}},ParkingFury.Game=function(e){this.gamePaused=!1,this.pressTimer=0,this.asphalt,this.spark,this.car,this.carSpeed,this.cursors,this.wasd,this.worldScale=.8,this.globalGroup,this.globalBmp,this.globalBmpImage,this.carIndex=0,this.cars=[],this.parkZone=null,this.parkZones=[],this.parkZonesPositions=[],this.parkPolys=[],this.missions=[],this.contactsCount=0,this.missionMessage=!1,this.stars=6,this.hitTimer=0,this.gui,this.gui_stars,this.gui_star_1,this.gui_star_2,this.gui_star_3,this.gui_complete,this.gui_complete_check,this.gui_complete_fail,this.text_complete,this.check_fail_rect,this.check_fail_inProgress=!1,this.gui_pause,this.gui_pause_btn,this.pause_label,this.up_bmp,this.up_bmp_image,this.levelFinished,this.gui_wheel,this.gui_gas,this.gui_brake,this.gui_gas_pressed=!1,this.gui_brake_pressed=!1,this.gui_wheel_pressed=!1,this.wheel_left=!1,this.wheel_right=!1,this.wheelPointer=null,this.wheelTouchPosition=null,this.music_engine_played=!1,this.temp_textures=[]},ParkingFury.Game.prototype={create:function(){this.game.world.scale.set(1),this.game.time.desiredFps=60;var e=currentLevel,e=(s_ingame.play(),this.gamePaused=!1,this.pressTimer=0,this.carSpeed=0,this.worldScale=.8,this.carIndex=0,this.cars=[],this.parkZone=null,this.parkZones=[],this.parkZonesPositions=[],this.parkPolys=[],this.missions=[],this.contactsCount=0,this.missionMessage=!1,this.stars=6,this.hitTimer=0,this.missionMessage=!1,this.check_fail_inProgress=!1,this.levelFinished=!1,this.music_engine_played=!1,this.game.time.advancedTiming=!0,this.game.world.setBounds(0,0,3e3,3e3),this.game.physics.startSystem(Phaser.Physics.P2JS),this.asphalt=1==e||2==e||3==e||5==e||6==e||7==e?this.game.add.tileSprite(0,0,3e3,3e3,"Bruk.png"):this.game.add.tileSprite(0,0,3e3,3e3,"asphalt_1.jpg"),this.globalBmp=this.game.add.bitmapData(3e3,3e3),this.globalBmpImage=this.globalBmp.addToWorld(),this.globalBmp.smoothed=!1,this.globalGroup=this.game.make.group(),this.cursors=this.game.input.keyboard.createCursorKeys(),this.wasd={up:this.game.input.keyboard.addKey(Phaser.Keyboard.W),down:this.game.input.keyboard.addKey(Phaser.Keyboard.S),left:this.game.input.keyboard.addKey(Phaser.Keyboard.A),right:this.game.input.keyboard.addKey(Phaser.Keyboard.D)},this.prepare_render_textures(),this.load_json_level_decals(e),this.load_json_ground_layer(e),this.load_json_missions(e),this.load_json_level_physics(e),this.load_json_level_objects(e),this.game.camera.follow(this.car.camPoint,Phaser.Camera.FOLLOW_LOCKON,.1,.1),this.load_json_level_up(e),this.globalBmp.shadow(),this.spark=this.game.add.sprite(-300,-200,"spark"),this.spark.animations.add("blam"),this.spark.anchor.setTo(.5,.5),this.spark.animations.play("blam",30,!1),this.gui=this.game.add.group(),this.game.stage.addChild(this.gui),this.gui_stars=this.game.make.group(),this.gui_stars.create(0,5,"gui_stars_bkg"),this.gui_star_1=this.gui_stars.create(32.9,23.95,"star"),this.gui_star_1.anchor.setTo(.5,.5),this.gui_star_1.scale.setTo(.324,.324),this.gui_star_1.frame=2,this.gui_star_2=this.gui_stars.create(70.7,23.95,"star"),this.gui_star_2.anchor.setTo(.5,.5),this.gui_star_2.scale.setTo(.324,.324),this.gui_star_2.frame=2,this.gui_star_3=this.gui_stars.create(107.75,23.95,"star"),this.gui_star_3.anchor.setTo(.5,.5),this.gui_star_3.scale.setTo(.324,.324),this.gui_star_3.frame=2,this.gui.addChild(this.gui_stars),this.gui_pause_btn=this.gui.create(this.game.width,5),this.game.add.sprite(0,0,"gui_stars_bkg")),e=(this.gui_pause_btn.addChild(e),e.scale.setTo(-1,1),this.pause_label=this.game.add.bitmapText(-110,7,"myfont","PAUSE",18),this.gui_pause_btn.addChild(this.pause_label),this.gui_pause_btn.inputEnabled=!0,this.gui_pause_btn.input.useHandCursor=!0,this.gui_pause_btn.events.onInputOver.add(this.over,this),this.gui_pause_btn.events.onInputOut.add(this.out,this),this.gui_pause_btn.events.onInputDown.add(this.pause_pressed,this),this.gui_complete=this.game.make.group(),this.gui_complete.position.setTo(276,-240),this.gui_complete.create(-45,-45,"gui_mission_complete"),this.gui_complete_check=this.gui_complete.create(-22,-38,"check"),this.gui_complete_fail=this.gui_complete.create(-33,-38,"fail"),this.text_complete=this.game.add.bitmapText(190,5,"myfont","MISSION COMPLETE!",22),this.text_complete.anchor.setTo(.5,.5),this.gui_complete.addChild(this.text_complete),this.check_fail_rect=new Phaser.Rectangle(0,0,0,74),this.gui_complete_check.crop(this.check_fail_rect),this.gui_complete_fail.crop(this.check_fail_rect),this.gui.addChild(this.gui_complete),this.gui_pause=this.game.make.group(),this.gui_pause.position.setTo(this.game.width/2,-260),this.gui_pause.create(-195,-45,"gui_mission_complete"),this.gui_pause.create(40,50,"btn_home")),e=(e.inputEnabled=!0,e.input.useHandCursor=!0,e.events.onInputOver.add(this.over,this),e.events.onInputOut.add(this.out,this),e.events.onInputDown.add(this.home_pressed,this),this.gui_pause.create(-80,50,"btn_restart")),e=(e.inputEnabled=!0,e.input.useHandCursor=!0,e.events.onInputOver.add(this.over,this),e.events.onInputOut.add(this.out,this),e.events.onInputDown.add(this.restart_pressed,this),this.game.add.bitmapText(40,5,"myfont","GAME PAUSED",22));e.anchor.setTo(.5,.5),this.gui_pause.addChild(e),this.gui.addChild(this.gui_pause),mobile_browser&&(this.gui_wheel=this.gui.create(95,this.game.height-90),this.gui_wheel.anchor.setTo(.5,.5),this.gui_wheel.alpha=.9,this.gui_wheel.inputEnabled=!0,this.gui_wheel.input.useHandCursor=!0,this.gui_wheel.events.onInputDown.add(this.wheel_down,this),this.gui_wheel.events.onInputOut.add(this.wheel_up,this),this.gui_wheel.events.onInputUp.add(this.wheel_up,this),this.gui_wheel.hitArea=new Phaser.Rectangle(-110,-110,220,220),(e=this.game.add.sprite(0,0,"gui_wheel")).anchor.setTo(.5,.5),this.gui_wheel.addChild(e),this.gui_wheel.label=e,this.gui_gas=this.gui.create(this.game.width-60,this.game.height-80),this.gui_gas.anchor.setTo(.5,.5),this.gui_gas.alpha=.9,this.gui_gas.inputEnabled=!0,this.gui_gas.input.useHandCursor=!0,this.gui_gas.events.onInputDown.add(this.gas_down,this),this.gui_gas.events.onInputOut.add(this.gas_up,this),this.gui_gas.events.onInputUp.add(this.gas_up,this),this.gui_gas.hitArea=new Phaser.Rectangle(-45,-80,90,160),(e=this.game.add.sprite(0,0,"gui_pedal_gas")).anchor.setTo(.5,.5),this.gui_gas.addChild(e),this.gui_gas.label=e,this.gui_brake=this.gui.create(this.game.width-155,this.game.height-52),this.gui_brake.anchor.setTo(.5,.5),this.gui_brake.alpha=.9,this.gui_brake.inputEnabled=!0,this.gui_brake.input.useHandCursor=!0,this.gui_brake.events.onInputDown.add(this.brake_down,this),this.gui_brake.events.onInputOut.add(this.brake_up,this),this.gui_brake.events.onInputUp.add(this.brake_up,this),this.gui_brake.hitArea=new Phaser.Rectangle(-45,-55,90,110),(e=this.game.add.sprite(0,0,"gui_pedal_brake")).anchor.setTo(.5,.5),this.gui_brake.addChild(e),this.gui_brake.label=e),this.game.world.scale.set(this.worldScale),this.blinkFlares()},walk_pressed:function(e,s){window.op3n("http://kizi.com/videos/parking-fury/?ch=2793&utm_source=GameDistribution","_blank")},gas_down:function(e,s){this.gui_gas_pressed=!0,e.label.scale.setTo(.94,.94)},gas_up:function(e,s){this.gui_gas_pressed=!1,e.label.scale.setTo(1,1)},brake_down:function(e,s){this.gui_brake_pressed=!0,e.label.scale.setTo(.94,.94)},brake_up:function(e,s){this.gui_brake_pressed=!1,e.label.scale.setTo(1,1)},wheel_down:function(e,s){this.gui_wheel_pressed=!0,this.wheelPointer=s,this.wheelTouchPosition=new Phaser.Point(s.x,s.y)},wheel_up:function(e,s){this.gui_wheel_pressed=!1,this.wheelPointer=null,this.wheelTouchPosition=null},over:function(e,s){e.scale.x=1.05,e.scale.y=1.05},out:function(e,s){e.scale.x=1,e.scale.y=1},home_pressed:function(e,s){AzerionIntegrationSDK.showAd("exit_gameplay_to_main_menu",function(){this.missionMessage=!0,this.game.state.start("MainMenu",!0,!1)}.bind(this))},restart_pressed:function(e,s){AzerionIntegrationSDK.showAd("restart",function(){this.missionMessage=!0,this.game.state.start("BlankState",!0,!1)}.bind(this))},pause_pressed:function(e,s){this.missionMessage||this.levelFinished||(this.gamePaused?AzerionIntegrationSDK.showAd("resume",function(){this.pause_ON_OFF()}.bind(this)):this.pause_ON_OFF())},shutdown:function(){s_ingame.stop(),this.up_bmp.destroy(),this.up_bmp_image.destroy(),this.up_bmp=null,this.up_bmp_image=null,this.gui.removeChild(this.gui_stars),this.gui.removeChild(this.gui_complete),this.gui.removeChild(this.gui_pause),this.game.stage.removeChild(this.gui),this.gui_stars.destroy(),this.gui_stars=null,this.gui_complete.destroy(),this.gui_complete=null,this.gui_pause.destroy(),this.gui_pause=null,mobile_browser&&(this.gui.removeChild(this.gui_wheel),this.gui.removeChild(this.gui_gas),this.gui.removeChild(this.gui_brake),this.gui_wheel.destroy(),this.gui_wheel=null,this.gui_gas.destroy(),this.gui_gas=null,this.gui_brake.destroy(),this.gui_brake=null),this.gui.destroy(),this.gui=null,this.asphalt.destroy(),this.asphalt=null,this.spark.destroy(),this.spark=null,this.globalGroup.destroy(),this.globalBmp.destroy(),this.globalBmpImage.destroy(),this.globalGroup=null,this.globalBmp=null,this.globalBmpImage=null,this.cars[0].destroy(),this.cars=null,this.parkZone=null,this.parkZones=null,this.parkZonesPositions=null,this.parkPolys=null,this.missions=null,this.car.destroy(),this.car=null},gui_show_mission_complete:function(){Constants.CURRENT_LEVEL+=1,this.gui_complete_check.visible=!0,this.gui_complete_fail.visible=!1,this.levelFinished?this.text_complete.text="LEVEL CLEARED!":this.text_complete.text="MISSION COMPLETE!",this.gui_complete.y=-240;var e=this.game.add.tween(this.gui_complete).to({y:240},200,"Linear",!1),e=(e.to({y:720},300,"Linear",!1,1200),e.onComplete.add(this.mission_message_disabled,this),e.start(),this.check_fail_rect.width=0,this.check_fail_rect.height=74,this.game.add.tween(this.check_fail_rect).to({width:86},150,"Linear",!1));e.delay(400),e.onComplete.add(this.gui_check_fail_tween_complete,this),e.onStart.add(this.gui_check_fail_tween_start,this),e.start(),this.check_fail_inProgress=!0,this.missionMessage=!0},gui_show_failed:function(){this.gui_complete_check.visible=!1,this.gui_complete_fail.visible=!0,this.text_complete.text="LEVEL FAILED :(",this.gui_complete.y=-240;var e=this.game.add.tween(this.gui_complete).to({y:240},200,"Linear",!1),e=(e.to({y:720},300,"Linear",!1,1200),e.onComplete.add(this.mission_message_disabled,this),e.start(),this.check_fail_rect.width=0,this.check_fail_rect.height=77,this.game.add.tween(this.check_fail_rect).to({width:67},150,"Linear",!1));e.delay(400),e.onComplete.add(this.gui_check_fail_tween_complete,this),e.onStart.add(this.gui_check_fail_tween_start,this),e.start(),this.check_fail_inProgress=!0,this.missionMessage=!0},gui_check_fail_tween_start:function(){s_check.play()},gui_check_fail_tween_complete:function(){this.check_fail_inProgress=!1},mission_message_disabled:function(){0==this.stars?AzerionIntegrationSDK.showAd("restart_on_level_lose",function(){this.game.state.start("BlankState",!0,!1)}.bind(this)):this.levelFinished?(currentStars=this.stars,this.game.state.start("MainMenu",!0,!1,"result")):(this.missionMessage=!1,this.missions[this.carIndex-1].visible=!1,this.missions[this.carIndex].visible=!0,this.game.camera.follow(this.car.camPoint,Phaser.Camera.FOLLOW_LOCKON,.1,.1),this.blinkFlares())},prepare_render_textures:function(){render_textures_created||(this.make_texture("map_part_plitka_1.json","map_part_plitka_1"),this.make_texture("map_part_plitka_2.json","map_part_plitka_2"),this.make_texture("map_part_plitka_3.json","map_part_plitka_3"),this.make_texture("map_part_trava_1.json","map_part_trava_1"),this.make_texture("map_part_trava_2.json","map_part_trava_2"),this.make_texture("map_part_trava_3.json","map_part_trava_3"),render_textures_created=!0)},make_texture:function(e,s){var t=this.game.cache.getJSON(e),a=this.game.make.group(),e=this.game.make.tileSprite(t.base_sprite.x,t.base_sprite.y,t.base_sprite.w,t.base_sprite.h,t.base_sprite.texture),n=(a.addChild(e),this.game.add.graphics(1500,1500));for(i in n.beginFill(16777215),t.shape_points)0==i?n.moveTo(t.shape_points[i][0]+t.base_sprite.fixX,t.shape_points[i][1]+t.base_sprite.fixY):n.lineTo(t.shape_points[i][0]+t.base_sprite.fixX,t.shape_points[i][1]+t.base_sprite.fixY);for(i in n.endFill(),e.mask=n,t.bordurs){var o=a.create(t.bordurs[i].x,t.bordurs[i].y,t.bordurs[i].name);o.angle=t.bordurs[i].rotation,o.scale.setTo(t.bordurs[i].scaleX,t.bordurs[i].scaleY)}e=a.generateTexture();this.game.world.remove(a,!0),this.game.world.remove(n,!(a=null)),this.game.cache.addImage(s,n=null,e.getCanvas()),e=null},load_json_missions:function(e){var s=this.game.cache.getJSON("level_"+e+"_missions");for(i in s.frames){var t=this.game.add.group();for(ii in s.frames[i].objects){var a=t.create(s.frames[i].objects[ii].x,s.frames[i].objects[ii].y,s.frames[i].objects[ii].name);a.angle=s.frames[i].objects[ii].rotation,a.scale.setTo(s.frames[i].objects[ii].scaleX,s.frames[i].objects[ii].scaleY)}(this.missions[i]=t).visible=!1}this.missions[0].visible=!0},load_json_level_objects:function(e){var s=this.game.cache.getJSON("level_"+e),t=this.game.make.group();for(i in s.objects){var a=t.create(s.objects[i].x,s.objects[i].y,s.objects[i].name);a.angle=s.objects[i].rotation,a.scale.setTo(s.objects[i].scaleX,s.objects[i].scaleY)}this.globalBmp.shadow("rgba(0,0,0,0.9)",30,1,1),this.game.stage.updateTransform(),this.globalBmp.drawGroup(t),this.globalBmp.shadow(),this.game.world.remove(t,!(a=null)),t.destroy(),t=null},load_json_ground_layer:function(e){for(var s,t=this.game.cache.getJSON("level_"+e+"_ground"),a=this.game.make.group(),i=0;i<t.ground_objects.length;i++)if("bitmap"==t.ground_objects[i].type){var n=a.create(t.ground_objects[i].x,t.ground_objects[i].y,t.ground_objects[i].name);n.angle=t.ground_objects[i].rotation,n.scale.setTo(t.ground_objects[i].scaleX,t.ground_objects[i].scaleY),n.anchor.setTo(.5,.5),n=null}else{var n=this.game.make.group(),o=this.game.add.tileSprite(t.ground_objects[i].x,t.ground_objects[i].y,t.ground_objects[i].w,t.ground_objects[i].h,t.ground_objects[i].texture),r=(n.addChild(o),this.game.add.graphics(0,0));for(ii in r.beginFill(16777215),t.ground_objects[i].points)0==ii?r.moveTo(t.ground_objects[i].points[ii][0]-t.ground_objects[i].x,t.ground_objects[i].points[ii][1]-t.ground_objects[i].y):r.lineTo(t.ground_objects[i].points[ii][0]-t.ground_objects[i].x,t.ground_objects[i].points[ii][1]-t.ground_objects[i].y);r.endFill(),o.mask=r;var l=n.generateTexture();this.game.world.remove(r,!0),r.destroy(),this.game.world.remove(o,!(r=null)),o.destroy(),this.game.world.remove(n,!(o=null)),n.destroy(),n=null,a.create(t.ground_objects[i].x,t.ground_objects[i].y,l),this.temp_textures.push(l)}for(mobile_browser?(this.globalBmp.shadow(),this.game.stage.updateTransform(),this.globalBmp.drawGroup(a),this.globalBmp.shadow(),this.game.world.remove(a,!0),a.destroy(),a=null):(s=(e=this.game.add.bitmapData(3e3,3e3)).addToWorld(),this.game.stage.updateTransform(),e.smoothed=!1,e.drawGroup(a),this.game.world.remove(a,!0),a.destroy(),a=null,this.globalBmp.shadow("rgba(0,0,0,0.9)",30,1,1),this.game.stage.updateTransform(),this.globalBmp.draw(s),this.globalBmp.shadow(),this.game.world.remove(s,!0),s.destroy(),e.destroy(),e=s=null);0<this.temp_textures.length;)this.temp_textures.pop().destroy(!0),0;this.temp_textures=[]},load_json_level_decals:function(e){var s=this.game.cache.getJSON("level_"+e+"_decals"),t=this.game.make.group();for(i in s.shapes){var a=this.game.make.group(),n=this.game.add.tileSprite(s.shapes[i].x,s.shapes[i].y,s.shapes[i].w,s.shapes[i].h,s.shapes[i].texture),o=(a.addChild(n),this.game.add.graphics(0,0));for(ii in o.beginFill(16777215),s.shapes[i].points)0==ii?o.moveTo(s.shapes[i].points[ii][0]-s.shapes[i].x,s.shapes[i].points[ii][1]-s.shapes[i].y):o.lineTo(s.shapes[i].points[ii][0]-s.shapes[i].x,s.shapes[i].points[ii][1]-s.shapes[i].y);o.endFill(),n.mask=o;var r=a.generateTexture(),l=(this.game.world.remove(o,!0),o.destroy(),this.game.world.remove(n,!(o=null)),n.destroy(),this.game.world.remove(a,!(n=null)),a.destroy(),a=null,t.create(s.shapes[i].x,s.shapes[i].y,r))}for(i in s.decals)(l=t.create(s.decals[i].x,s.decals[i].y,s.decals[i].name)).scale.setTo(s.decals[i].scaleX,s.decals[i].scaleY),l.angle=s.decals[i].rotation;this.globalBmp.shadow(),this.game.stage.updateTransform(),this.globalBmp.drawGroup(t),this.game.world.remove(t),t.destroy(),t=null},load_json_level_up:function(e){var s=this.game.cache.getJSON("level_"+e),t=this.game.make.group();for(i in s.up)t.create(s.up[i].x,s.up[i].y,s.up[i].name).angle=s.up[i].rotation;mobile_browser||(this.globalBmp.shadow("rgba(0,0,0,0.9)",30,1,1),this.game.stage.updateTransform(),this.globalBmp.drawGroup(t),this.globalBmp.shadow()),this.up_bmp=this.game.add.bitmapData(3e3,3e3),this.up_bmp_image=this.up_bmp.addToWorld(),this.up_bmp.shadow("rgba(0,0,0,0.9)",30,1,1),this.game.stage.updateTransform(),this.up_bmp.smoothed=!1,this.up_bmp.drawGroup(t),this.up_bmp.shadow(),this.game.world.remove(t),t.destroy(!0),t=null},load_json_level_physics:function(e){var s=this.game.cache.getJSON("level_"+e+"_phys");for(i in s.boxes){var t=this.game.add.sprite(s.boxes[i].x,s.boxes[i].y);this.game.physics.p2.enable(t,!1),t.body.clearShapes(),t.body.addRectangle(s.boxes[i].scaleX,s.boxes[i].scaleY,0,0,0),t.body.static=!0,t.body.angle=s.boxes[i].rotation}for(i in s.circles){var a=this.game.add.sprite(s.circles[i].x,s.circles[i].y);this.game.physics.p2.enable(a,!1),a.body.clearShapes(),a.body.addCircle(s.circles[i].radius,0,0,0),a.body.static=!0}for(i in this.parkZone=this.game.add.sprite(100,0),this.game.physics.p2.enable(this.parkZone,!1),this.parkZone.body.clearShapes(),this.parkZone.body.addRectangle(110,230,0,0,0).sensor=!0,this.parkZone.body.static=!0,this.parkZone.body.angle=0,s.park){var n=new Object,n=(n.x=s.park[i].x,n.y=s.park[i].y,n.angle=s.park[i].rotation,this.parkZonesPositions[s.park[i].order-1]=n,new Phaser.Polygon([s.park[i].points[0],s.park[i].points[1],s.park[i].points[2],s.park[i].points[3]]));this.parkPolys[s.park[i].order-1]=n}for(i in this.parkZone.body.x=this.parkZonesPositions[0].x,this.parkZone.body.y=this.parkZonesPositions[0].y,this.parkZone.body.angle=this.parkZonesPositions[0].angle,s.cars)this.load_json_car(s.cars[i].x,s.cars[i].y,s.cars[i].rotation,s.cars[i].order,s.cars[i].type);this.car=this.cars[0],this.car.body.mass=1,this.car.body.onBeginContact.add(this.carOnContact,this),this.car.body.onEndContact.add(this.carOnEndContact,this)},load_json_car:function(e,s,t,a,n){var o=this.game.cache.getJSON("car_"+n),r=this.game.add.sprite(e,s),e=(this.game.physics.p2.enable(r,!1),this.game.make.sprite(o.wheels.wheel_l_x,o.wheels.wheel_l_y,"car_wheel")),s=this.game.make.sprite(o.wheels.wheel_r_x,o.wheels.wheel_r_y,"car_wheel"),e=(e.anchor.setTo(.5,.5),s.anchor.setTo(.5,.5),r.addChild(e),r.addChild(s),r.wheel_l=e,r.wheel_r=s,this.game.make.sprite(o.shadow.x,o.shadow.y,"car_shadow")),s=(e.scale.setTo(o.shadow.scaleX,o.shadow.scaleY),r.addChild(e),this.game.make.sprite(o.car_image.x,o.car_image.y,o.car_image.image));for(i in s.anchor.setTo(1,0),s.angle=-90,1!=n&&2!=n||s.scale.setTo(.92,.92),r.addChild(s),r.body.clearShapes(),o.boxes)r.body.addRectangle(o.boxes[i].scaleX,o.boxes[i].scaleY,o.boxes[i].x,o.boxes[i].y,0);for(i in o.circles)r.body.addCircle(o.circles[i].radius,o.circles[i].x,o.circles[i].y,0);r.body.angularDamping=.999,r.body.damping=.999,r.body.rotation=.017453292519*t,r.body.mass=30,this.cars[a-1]=r;e=this.game.make.sprite(o.cam_point.x,o.cam_point.y),r.addChild(e),r.camPoint=e,n=this.game.make.sprite(o.hitpoints[0][0],o.hitpoints[0][1]),r.addChild(n),s=this.game.make.sprite(o.hitpoints[1][0],o.hitpoints[1][1]),r.addChild(s),t=this.game.make.sprite(o.hitpoints[2][0],o.hitpoints[2][1]),r.addChild(t),a=this.game.make.sprite(o.hitpoints[3][0],o.hitpoints[3][1]);for(i in r.addChild(a),r.pPoints=[n,s,t,a],r.flares=[],o.flares){var l=this.game.make.sprite(o.flares[i][0],o.flares[i][1],"flare");l.anchor.setTo(.5,.5),l.scale.setTo(.5,.5),l.blendMode=PIXI.blendModes.ADD,l.tint=16737792,r.addChild(l),(r.flares[i]=l).visible=!1,0!=i&&1!=i||((l=this.game.make.sprite(o.flares[i][0],o.flares[i][1],"flare")).anchor.setTo(.5,.5),l.scale.setTo(.5,.5),l.blendMode=PIXI.blendModes.ADD,l.tint=16711680,r.addChild(l),0==i?r.flares[4]=l:r.flares[5]=l,l.visible=!1)}return o=null,r},blinkFlares:function(){LoaderHelper.hide();for(var e=0;e<4;e++){this.car.flares[e].tint=16737792,this.car.flares[e].visible=!0,this.car.flares[e].alpha=0;var s=this.game.add.tween(this.car.flares[e]).to({alpha:1},300,"Linear",!1);s.to({alpha:0},300,"Linear",!1,0),s.to({alpha:1},300,"Linear",!1,0),s.to({alpha:0},300,"Linear",!1,0),s.start()}},changeCar:function(){this.carIndex+=1,this.carIndex==this.cars.length?(--this.carIndex,this.levelFinished=!0,this.gui_show_mission_complete()):(this.gui_show_mission_complete(),this.car.body.mass=30,this.car.body.onBeginContact.remove(this.carOnContact,this),this.car.body.onEndContact.remove(this.carOnEndContact,this),this.contactsCount=0,this.car.flares[4].visible=!1,this.car.flares[5].visible=!1,this.car=this.cars[this.carIndex],this.car.body.onBeginContact.add(this.carOnContact,this),this.car.body.onEndContact.add(this.carOnEndContact,this),this.car.body.mass=1,this.car.body.setZeroVelocity(),this.carSpeed=0,this.parkZone.body.x=this.parkZonesPositions[this.carIndex].x,this.parkZone.body.y=this.parkZonesPositions[this.carIndex].y,this.parkZone.body.angle=this.parkZonesPositions[this.carIndex].angle)},carOnContact:function(e,s,t,a,i){var n;e&&(e.data.shapes[0].sensor?this.contactsCount+=1:this.hitTimer<0&&(this.hitTimer=30,--this.stars,s_hit.play(),i[0]&&(e=i[0].bodyA.position,i=i[0].contactPointA,n=this.game.physics.p2.mpxi(e[0]+i[0]),e=this.game.physics.p2.mpxi(e[1]+i[1]),this.spark.x=n,this.spark.y=e,this.spark.animations.play("blam",30,!1)),5==this.stars&&(this.gui_star_3.frame=1,this.gui_star_3.scale.setTo(0,0),this.game.add.tween(this.gui_star_3.scale).to({x:.324,y:.324},500,Phaser.Easing.Elastic.Out,!0)),4==this.stars&&(this.gui_star_3.frame=0,this.gui_star_3.scale.setTo(0,0),this.game.add.tween(this.gui_star_3.scale).to({x:.324,y:.324},500,Phaser.Easing.Elastic.Out,!0)),3==this.stars&&(this.gui_star_2.frame=1,this.gui_star_2.scale.setTo(0,0),this.game.add.tween(this.gui_star_2.scale).to({x:.324,y:.324},500,Phaser.Easing.Elastic.Out,!0)),2==this.stars&&(this.gui_star_2.frame=0,this.gui_star_2.scale.setTo(0,0),this.game.add.tween(this.gui_star_2.scale).to({x:.324,y:.324},500,Phaser.Easing.Elastic.Out,!0)),1==this.stars&&(this.gui_star_1.frame=1,this.gui_star_1.scale.setTo(0,0),this.game.add.tween(this.gui_star_1.scale).to({x:.324,y:.324},500,Phaser.Easing.Elastic.Out,!0)),0==this.stars)&&(this.game.device.desktop||(this.gui_pause_btn.inputEnabled=!1),this.gui_star_1.frame=0,this.gui_star_1.scale.setTo(0,0),this.game.add.tween(this.gui_star_1.scale).to({x:.324,y:.324},500,Phaser.Easing.Elastic.Out,!0),this.gui_show_failed()))},carOnEndContact:function(e,s,t,a,i){this.missionMessage||e&&e.data.shapes[0].sensor&&(--this.contactsCount,this.contactsCount<0)&&(this.contactsCount=0)},pause_ON_OFF:function(){this.missionMessage||this.levelFinished||(this.gamePaused=!this.gamePaused,this.gamePaused&&(this.pause_label.setText("RESUME"),this.gui_pause.y=-240,this.game.add.tween(this.gui_pause).to({y:140},150,"Linear",!1).start(),this.game.sound.setMute()),this.gamePaused)||(this.pause_label.setText("PAUSE"),this.game.add.tween(this.gui_pause).to({y:740},200,"Linear",!1).start(),this.game.sound.unsetMute())},update:function(){if(--this.pressTimer,(this.game.input.keyboard.isDown(Phaser.Keyboard.P)||this.game.input.keyboard.isDown(Phaser.Keyboard.ESC))&&this.pressTimer<0&&(this.pressTimer=20,this.pause_ON_OFF()),!this.gamePaused){this.check_fail_inProgress&&(this.gui_complete_check.updateCrop(),this.gui_complete_fail.updateCrop()),--this.hitTimer;for(var e=0;e<6;e++)this.car.flares[e].rotation=0-this.car.body.rotation;if(0<this.contactsCount&&!this.missionMessage&&-.4<this.carSpeed&&this.carSpeed<.4){for(var s=0,e=0;e<4;e++)this.parkPolys[this.carIndex].contains(this.car.pPoints[e].world.x*(1/this.worldScale),this.car.pPoints[e].world.y*(1/this.worldScale))&&(s+=1);4==s&&this.changeCar()}this.car.body.setZeroVelocity(),this.gui_wheel_pressed?this.wheelPointer?(i=this.gui_wheel.label.angle,a=this.wheelPointer.x-this.wheelTouchPosition.x,t=this.wheelPointer.y-this.wheelTouchPosition.y,this.wheelTouchPosition.x<this.gui_wheel.x&&(t=-t),a=((a=this.wheelTouchPosition.y>this.gui_wheel.y?-a:a)+t)/2,this.gui_wheel.label.angle=a+i,90<this.gui_wheel.label.angle&&(this.gui_wheel.label.angle=90),this.gui_wheel.label.angle<-90&&(this.gui_wheel.label.angle=-90),this.wheelTouchPosition.x=this.wheelPointer.x,this.wheelTouchPosition.y=this.wheelPointer.y):(this.wheel_right=!1,this.wheel_left=!1):mobile_browser&&(this.gui_wheel.label.angle*=.92,this.gui_wheel.label.angle<=2)&&-2<=this.gui_wheel.label.angle&&(this.gui_wheel.label.angle=0),mobile_browser?(this.car.wheel_l.angle=.44*this.gui_wheel.label.angle,this.car.wheel_r.angle=this.car.wheel_l.angle):this.cursors.left.isDown&&!this.missionMessage||this.wasd.left.isDown&&!this.missionMessage||this.wheel_left&&!this.missionMessage?-40<this.car.wheel_l.angle&&(this.car.wheel_l.angle=this.car.wheel_r.angle-=2):this.cursors.right.isDown&&!this.missionMessage||this.wasd.right.isDown&&!this.missionMessage||this.wheel_right&&!this.missionMessage?this.car.wheel_l.angle<40&&(this.car.wheel_l.angle=this.car.wheel_r.angle+=2):(this.car.wheel_l.angle*=.92,this.car.wheel_l.angle<=3&&-3<=this.car.wheel_l.angle&&(this.car.wheel_l.angle=0),this.car.wheel_r.angle=this.car.wheel_l.angle),this.cursors.up.isDown&&!this.missionMessage||this.gui_gas_pressed&&!this.missionMessage||this.wasd.up.isDown&&!this.missionMessage?(this.music_engine_played||(this.music_engine_played=!0,s_engine.play()),this.carSpeed+=this.carSpeed<4?.08:0):this.cursors.down.isDown&&!this.missionMessage||this.gui_brake_pressed&&!this.missionMessage||this.wasd.down.isDown&&!this.missionMessage?(this.music_engine_played||(this.music_engine_played=!0,s_engine.play()),this.carSpeed+=-2.8<this.carSpeed?.3<this.carSpeed?-.3:-.1:0,this.car.flares[4].visible=!0,this.car.flares[5].visible=!0):(this.music_engine_played=!1,this.carSpeed<=-.1&&(this.carSpeed+=.1),.1<=this.carSpeed&&(this.carSpeed-=.1),-.1<this.carSpeed&&this.carSpeed<.1&&(this.carSpeed=0),this.missionMessage||(this.car.flares[4].visible=!1,this.car.flares[5].visible=!1)),this.car.body.rotation+=this.car.wheel_l.angle*this.carSpeed/this.car.wheel_l.x*.017453292519;var t=this.car.body.rotation+this.car.wheel_l.rotation,a=this.carSpeed*Math.cos(t),i=this.carSpeed*Math.sin(t),t=new Phaser.Point(a,i),a=new Phaser.Point,i=(a.x=1,a.y=0,Math.cos(this.car.body.rotation)),n=Math.sin(this.car.body.rotation),n=(a=new Phaser.Point(i*a.x-n*a.y,n*a.x+i*a.y)).dot(t);t.x=a.x*n,t.y=a.y*n,this.car.body.applyImpulse([-3*t.x,-3*t.y],0,0),this.game.input.keyboard.isDown(Phaser.Keyboard.Q)?this.worldScale+=.005:this.game.input.keyboard.isDown(Phaser.Keyboard.E)&&(this.worldScale-=.005),this.game.world.scale.set(this.worldScale)}}},ParkingFury.MainMenu=function(e){this.background,this.menu_main,this.menu_result,this.menu_levels,this.menu_credits,this.star_r_1,this.star_r_2,this.star_r_3,this.result_score_text,this.result_flare,this.menu_to_show,this.levels_buttons},ParkingFury.MainMenu.prototype={init:function(e){this.menu_to_show=0,e&&(this.menu_to_show="result"==e?1:0),this.levels_buttons=[]},create:function(){s_menu||((s_menu=this.game.add.audio("music_menu")).volume=1,s_menu.loop=!0,(s_ingame=this.game.add.audio("music_game")).volume=1,s_ingame.loop=!0,s_check=this.game.add.audio("music_check"),(s_hit=this.game.add.audio("music_hit")).volume=.8,(s_engine=this.game.add.audio("music_engine")).volume=.7,s_splash=this.game.add.audio("music_splash"),s_star=this.game.add.audio("music_star")),s_menu.play(),this.game.world.scale.set(1),this.background=this.add.sprite(426,240,"preloaderBackground"),this.background.anchor.setTo(.5,.5);var e=this.game.width,s=this.game.height,e=(this.game.width<this.game.height&&(e=this.game.height,s=this.game.width),e/s),s=(this.background.scale.set(e,e/1.07),this.menu_main=this.game.add.group(),this.menu_main.create(107,4,"game_logo"),this.menu_main.create(602,278,"btn_play")),e=(s.anchor.setTo(.5,.5),s.inputEnabled=!0,s.input.useHandCursor=!0,s.events.onInputOver.add(this.over,this),s.events.onInputOut.add(this.out,this),s.events.onInputDown.add(this.play_pressed,this),this.menu_main.create(655,400,"btn_credits")),s=(e.anchor.setTo(.5,.5),e.inputEnabled=!0,e.input.useHandCursor=!0,e.events.onInputOver.add(this.over,this),e.events.onInputOut.add(this.out,this),e.events.onInputDown.add(this.credits_pressed,this),this.menu_main.create(728,316,"btn_sound")),e=(s.anchor.setTo(.5,.5),s.inputEnabled=!0,s.input.useHandCursor=!0,s.events.onInputOver.add(this.over,this),s.events.onInputOut.add(this.out,this),s.events.onInputDown.add(this.sound_pressed,this),sound_enabled?s.frame=0:s.frame=1,this.menu_result=this.game.add.group(),this.game.add.tileSprite(0,24,853,66,"bkg_pattern")),s=(this.menu_result.addChild(e),this.game.add.graphics(0,76.1));this.menu_result.addChild(s),s.beginFill(16569617),s.drawRect(0,0,853,6.7),s.endFill();(d=this.game.add.bitmapText(426,37,"myfont","LEVEL RESULT",28)).anchor.setTo(.5,0),this.menu_result.addChild(d);var t=this.game.add.tileSprite(246.5,104,360,239,"bkg_pattern"),a=(this.menu_result.addChild(t),this.star_r_1=this.menu_result.create(426,186.25,"star"),this.star_r_1.anchor.setTo(.5,.5),this.star_r_1.frame=0,this.star_r_2=this.menu_result.create(347.3,211.8,"star"),this.star_r_2.anchor.setTo(.5,.5),this.star_r_2.scale.setTo(.9,.9),this.star_r_2.frame=1,this.star_r_3=this.menu_result.create(504.25,211.8,"star"),this.star_r_3.anchor.setTo(.5,.5),this.star_r_3.scale.setTo(.9,.9),this.star_r_3.frame=2,this.game.add.graphics(257,116)),a=(this.menu_result.addChild(a),a.beginFill(16569617),a.drawRect(0,0,340,6.7),a.drawRect(0,0,6.7,209),a.drawRect(0,209,340,6.7),a.drawRect(333.3,0,6.7,209),a.endFill(),this.menu_result.create(75.3,420.3,"btn_home")),a=(a.anchor.setTo(.5,.5),a.inputEnabled=!0,a.input.useHandCursor=!0,a.events.onInputOver.add(this.over,this),a.events.onInputOut.add(this.out,this),a.events.onInputDown.add(this.result_home_pressed,this),this.menu_result.create(733.35,420.3,"btn_back")),e=(a.scale.setTo(-1,1),a.anchor.setTo(.5,.5),a.inputEnabled=!0,a.input.useHandCursor=!0,a.events.onInputOver.add(this.over,this),a.events.onInputOut.add(this.out,this),a.events.onInputDown.add(this.result_next_pressed,this),this.result_flare=this.menu_result.create(326,220,"flare"),this.result_flare.anchor.setTo(.5,.5),this.result_flare.tint=16776960,this.result_flare.blendMode=PIXI.blendModes.ADD,this.menu_levels=this.game.add.group(),this.game.add.tileSprite(0,24,853,66,"bkg_pattern")),s=(this.menu_levels.addChild(e),this.game.add.graphics(0,76.1)),a=(this.menu_levels.addChild(s),s.beginFill(16569617),s.drawRect(0,0,853,6.7),s.endFill(),this.game.add.bitmapText(426,37,"myfont","SELECT LEVEL",28));a.anchor.setTo(.5,0),this.menu_levels.addChild(a);for(var i=0;i<10;i++){var n=301,o=222,o=(o+=i<5?105*i:105*(i-5),this.menu_levels.create(o,n=i<5?174:n,"btn_levels")),n=(o.anchor.setTo(.5,.5),o.inputEnabled=!0,o.input.useHandCursor=!0,o.events.onInputOver.add(this.over,this),o.events.onInputOut.add(this.out,this),o.events.onInputDown.add(this.levelPressed,this),this.game.add.bitmapText(0,0,"myfont",i+1,34)),r=(n.anchor.setTo(.56,.4),o.addChild(n),this.game.add.group()),l=(r.y=-39,o.addChild(r),r.create(0,-4.25,"star")),h=(l.anchor.setTo(.5,.5),l.scale.setTo(.4,.4),l.frame=0,r.create(-27.85,5.95,"star")),r=(h.anchor.setTo(.5,.5),h.scale.setTo(.35,.35),h.frame=0,r.create(27.85,5.95,"star"));r.anchor.setTo(.5,.5),r.scale.setTo(.35,.35),r.frame=0,o.label=n,o.level=i,o.s_1=l,o.s_2=h,o.s_3=r,o.open=!0,this.levels_buttons[i]=o}a=this.menu_levels.create(75.3,420.3,"btn_home"),a.anchor.setTo(.5,.5),a.inputEnabled=!0,a.input.useHandCursor=!0,a.events.onInputOver.add(this.over,this),a.events.onInputOut.add(this.out,this),a.events.onInputDown.add(this.levels_home_pressed,this),this.initLevels(),this.menu_credits=this.game.add.group(),e=this.game.add.tileSprite(0,24,853,66,"bkg_pattern"),this.menu_credits.addChild(e),s=this.game.add.graphics(0,76.1);this.menu_credits.addChild(s),s.beginFill(16569617),s.drawRect(0,0,853,6.7),s.endFill();(d=this.game.add.bitmapText(426,37,"myfont","CREDITS",28)).anchor.setTo(.5,0),this.menu_credits.addChild(d);var d,t=this.game.add.tileSprite(246.5,104,360,229,"bkg_pattern"),a=(this.menu_credits.addChild(t),this.menu_credits.create(75.3,420.3,"btn_home"));a.anchor.setTo(.5,.5),a.inputEnabled=!0,a.input.useHandCursor=!0,a.events.onInputOver.add(this.over,this),a.events.onInputOut.add(this.out,this),a.events.onInputDown.add(this.credits_home_pressed,this),(d=this.game.add.bitmapText(426,137,"myfont","GAME DESIGN AND DEVELOPMENT\nANDRIY PIDVIRNYY\nAKA\nFREES\n\nMUSIC BY\nKEVIN MACLEOD",16)).align="center",d.anchor.setTo(.5,0),this.menu_credits.addChild(d),this.menu_levels.y=-800,this.menu_credits.y=-800,this.menu_main.alignIn(this.background,Phaser.CENTER),0==this.menu_to_show?this.menu_result.y=-800:1==this.menu_to_show&&(this.menu_main.y=-800,this.setResult())},shutdown:function(){this.background.destroy(),this.background=null,this.menu_main.destroy(),this.menu_main=null,this.menu_result.destroy(),this.menu_result=null,this.menu_credits.destroy(),this.menu_credits=null,this.menu_levels.destroy(),this.menu_levels=null},sound_pressed:function(e,s){sound_ON_OFF(),sound_enabled?e.frame=0:e.frame=1},initLevels:function(){for(var e=0;e<10;e++)0<=levelsStars[e]?(this.levels_buttons[e].label.alpha=1,this.levels_buttons[e].open=!0,1!=levelsStars[e]&&2!=levelsStars[e]||(this.levels_buttons[e].s_1.frame=levelsStars[e],this.levels_buttons[e].s_2.frame=0,this.levels_buttons[e].s_3.frame=0),3!=levelsStars[e]&&4!=levelsStars[e]||(this.levels_buttons[e].s_1.frame=2,this.levels_buttons[e].s_2.frame=levelsStars[e]-2,this.levels_buttons[e].s_3.frame=0),5!=levelsStars[e]&&6!=levelsStars[e]||(this.levels_buttons[e].s_1.frame=2,this.levels_buttons[e].s_2.frame=2,this.levels_buttons[e].s_3.frame=levelsStars[e]-4)):(this.levels_buttons[e].label.alpha=.4,this.levels_buttons[e].open=!1,this.levels_buttons[e].s_1.frame=0,this.levels_buttons[e].s_2.frame=0,this.levels_buttons[e].s_3.frame=0)},levelPressed:function(e,s){LoaderHelper.show(),s_menu.stop(),currentLevel=e.level,this.state.start("Game",!0,!1)},setResult:function(){this.star_r_1.frame=0,this.star_r_2.frame=0;var e=this.star_r_3.frame=0,s=(1!=currentStars&&2!=currentStars||((t=this.game.add.tween(this.star_r_1.scale).to({x:0,y:0},100,"Linear",!1)).to({x:1,y:1},400,Phaser.Easing.Elastic.Out,!1),t.delay(200),t.onStart.add(this.star_appear,this),t.start(),this.game.add.tween(this.star_r_1).to({frame:currentStars},1,"Linear",!0,300),e=450),3!=currentStars&&4!=currentStars||((t=this.game.add.tween(this.star_r_1.scale).to({x:0,y:0},100,"Linear",!1)).to({x:1,y:1},400,Phaser.Easing.Elastic.Out,!1),t.delay(200),t.onStart.add(this.star_appear,this),t.start(),this.game.add.tween(this.star_r_1).to({frame:2},1,"Linear",!0,300),(s=this.game.add.tween(this.star_r_2.scale).to({x:0,y:0},100,"Linear",!1)).to({x:1,y:1},400,Phaser.Easing.Elastic.Out,!1),s.delay(650),s.onStart.add(this.star_appear,this),s.start(),this.game.add.tween(this.star_r_2).to({frame:currentStars-2},1,"Linear",!0,750),e=900),5!=currentStars&&6!=currentStars||((t=this.game.add.tween(this.star_r_1.scale).to({x:0,y:0},100,"Linear",!1)).to({x:1,y:1},400,Phaser.Easing.Elastic.Out,!1),t.delay(200),t.onStart.add(this.star_appear,this),t.start(),this.game.add.tween(this.star_r_1).to({frame:2},1,"Linear",!0,300),(s=this.game.add.tween(this.star_r_2.scale).to({x:0,y:0},100,"Linear",!1)).to({x:1,y:1},400,Phaser.Easing.Elastic.Out,!1),s.delay(650),s.onStart.add(this.star_appear,this),s.start(),this.game.add.tween(this.star_r_2).to({frame:2},1,"Linear",!0,750),(t=this.game.add.tween(this.star_r_3.scale).to({x:0,y:0},100,"Linear",!1)).to({x:1,y:1},400,Phaser.Easing.Elastic.Out,!1),t.delay(1100),t.onStart.add(this.star_appear,this),t.start(),this.game.add.tween(this.star_r_3).to({frame:currentStars-4},1,"Linear",!0,1200),e=1400),this.result_flare.scale.setTo(0,0),this.result_flare.x=306,this.game.add.tween(this.result_flare.scale).to({x:1,y:1},100,"Linear",!1)),t=(s.to({x:0,y:0},100,"Linear",!1),s.delay(e),s.start(),this.game.add.tween(this.result_flare).to({x:546},100,"Linear",!1));t.delay(e),t.start(),levelsStars[currentLevel]=currentStars,currentLevel<9&&(currentLevel+=1,levelsStars[currentLevel]<0)&&(levelsStars[currentLevel]=0),save()},star_appear:function(){s_star.play()},result_home_pressed:function(e,s){AzerionIntegrationSDK.showAd("exit_level_win_to_menu",function(){this.swap_menus(this.menu_result,this.menu_main)}.bind(this))},credits_home_pressed:function(e,s){this.swap_menus(this.menu_credits,this.menu_main)},levels_home_pressed:function(e,s){AzerionIntegrationSDK.showAd("exit_level_select_to_menu",function(){this.swap_menus(this.menu_levels,this.menu_main)}.bind(this))},result_next_pressed:function(e,s){AzerionIntegrationSDK.showAd("next_level",function(){this.swap_menus(this.menu_result,this.menu_levels),this.initLevels()}.bind(this))},credits_pressed:function(e,s){this.swap_menus(this.menu_main,this.menu_credits)},play_pressed:function(e,s){this.swap_menus(this.menu_main,this.menu_levels),this.initLevels()},over:function(e,s){e.label&&!e.open||(e.scaleOrig||(e.scaleOrig=new Phaser.Point(e.scale.x,e.scale.y)),e.scale.setTo(1.05*e.scaleOrig.x,1.05*e.scaleOrig.y))},out:function(e,s){e.label&&!e.open||e.scale.setTo(e.scaleOrig.x,e.scaleOrig.y)},swap_menus:function(e,s){s_splash.play();this.game.add.tween(e).to({y:-800},200,"Linear",!0),s.x=0,s.y=-800,this.game.add.tween(s).to({y:0},200,"Linear",!0,200)},update:function(){this.game.input.x,this.game.input.y},startGame:function(e){}},{game:null,init:function(e,s){this.game=e;this.load(s).then(function(e){e&&null!=e||this.save(s,Constants.DEFAULT_STARS)}.bind(this))},load:function(e){return this.game.storage.getItem(e)},save:function(e,s){this.game.storage.setItem(e,JSON.stringify(s))}});function Game(){var s=Phaser.Game.call(this,{enableDebug:!1,width:Constants.CALCULATED_WIDTH,height:Constants.CALCULATED_HEIGHT,renderer:Phaser.AUTO,parent:"content",transparent:!0,antialias:!0,preserveDrawingBuffer:!1,physicsConfig:null,seed:"",state:null,forceSetTimeOut:!1})||this;return s.clearBeforeRender=!1,Phaser.Device.whenReady(function(){s.stage.disableVisibilityChange=!0;var e=s.device.desktop?"click":"touchstart";document.getElementById("content").addEventListener(e,function(e){s.gameResumed(e)})}),AzerionIntegrationSDK.createSplashLoader(this,function(){s.state.add("game",{create:s.stateCreator.bind(s),preload:s.statePreloader.bind(s)},!0)}.bind(this)),s}Game.prototype=Object.create(Phaser.Game.prototype),Game.prototype.statePreloader=function(){var s=this;libs.forEach(function(e){s.load.script(e,e)})},Game.prototype.stateCreator=function(){this.plugins.add(PhaserSuperStorage.StoragePlugin),this.plugins.add(PhaserCachebuster.CacheBuster),this.plugins.add(PhaserSpine.SpinePlugin),this.storage.forcePromises=!0,this.storage.setNamespace("pf1"),this.state.add("Boot",ParkingFury.Boot),this.state.add("MainMenu",ParkingFury.MainMenu),this.state.add("Game",ParkingFury.Game),this.state.add("BlankState",ParkingFury.BlankState),this.state.start("Boot"),this.state.remove("game")};