Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/space_adventure_pinball/js/main.js
�азад
/* Platform.js <https://mths.be/platform> Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/> Copyright 2011-2013 John-David Dalton Available under MIT license <https://mths.be/mit> */ (function() { var a = "undefined" !== typeof window && "undefined" !== typeof window.document ? window.document : {}, m = "undefined" !== typeof module && module.exports, d = function() { for (var g, c = ["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror".split(" "), "webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror".split(" "), "webkitRequestFullScreen webkitCancelFullScreen webkitCurrentFullScreenElement webkitCancelFullScreen webkitfullscreenchange webkitfullscreenerror".split(" "), "mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror".split(" "), "msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError".split(" ") ], h = 0, n = c.length, b = {}; h < n; h++) if ((g = c[h]) && g[1] in a) { for (h = 0; h < g.length; h++) b[c[0][h]] = g[h]; return b } return !1 }(), f = { change: d.fullscreenchange, error: d.fullscreenerror }, l = { request: function(g) { return new Promise(function(c, h) { var n = function() { this.off("change", n); c() }.bind(this); this.on("change", n); g = g || a.documentElement; Promise.resolve(g[d.requestFullscreen]())["catch"](h) }.bind(this)) }, exit: function() { return new Promise(function(g, c) { if (this.isFullscreen) { var h = function() { this.off("change", h); g() }.bind(this); this.on("change", h); Promise.resolve(a[d.exitFullscreen]())["catch"](c) } else g() }.bind(this)) }, toggle: function(g) { return this.isFullscreen ? this.exit() : this.request(g) }, onchange: function(g) { this.on("change", g) }, onerror: function(g) { this.on("error", g) }, on: function(g, c) { var h = f[g]; h && a.addEventListener(h, c, !1) }, off: function(g, c) { var h = f[g]; h && a.removeEventListener(h, c, !1) }, raw: d }; d ? (Object.defineProperties(l, { isFullscreen: { get: function() { return !!a[d.fullscreenElement] } }, element: { enumerable: !0, get: function() { return a[d.fullscreenElement] } }, isEnabled: { enumerable: !0, get: function() { return !!a[d.fullscreenEnabled] } } }), m ? module.exports = l : window.screenfull = l) : m ? module.exports = { isEnabled: !1 } : window.screenfull = { isEnabled: !1 } })(); (function() { function a(r) { r = String(r); return r.charAt(0).toUpperCase() + r.slice(1) } function m(r, C) { var I = -1, z = r ? r.length : 0; if ("number" == typeof z && -1 < z && z <= u) for (; ++I < z;) C(r[I], I, r); else f(r, C) } function d(r) { r = String(r).replace(/^ +| +$/g, ""); return /^(?:webOS|i(?:OS|P))/.test(r) ? r : a(r) } function f(r, C) { for (var I in r) w.call(r, I) && C(r[I], I, r) } function l(r) { return null == r ? a(r) : q.call(r).slice(8, -1) } function g(r, C) { var I = null != r ? typeof r[C] : "number"; return !/^(?:boolean|number|string|undefined)$/.test(I) && ("object" == I ? !!r[C] : !0) } function c(r) { return String(r).replace(/([ -])(?!$)/g, "$1?") } function h(r, C) { var I = null; m(r, function(z, y) { I = C(I, z, y, r) }); return I } function n(r) { function C(M) { return h(M, function(J, H) { var O = H.pattern || c(H); !J && (J = RegExp("\\b" + O + " *\\d+[.\\w_]*", "i").exec(r) || RegExp("\\b" + O + " *\\w+-[\\w]*", "i").exec(r) || RegExp("\\b" + O + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(r)) && ((J = String(H.label && !RegExp(O, "i").test(H.label) ? H.label : J).split("/"))[1] && !/[\d.]+/.test(J[0]) && (J[0] += " " + J[1]), H = H.label || H, J = d(J[0].replace(RegExp(O, "i"), H).replace(RegExp("; *(?:" + H + "[_-])?", "i"), " ").replace(RegExp("(" + H + ")[-_.]?(\\w)", "i"), "$1 $2"))); return J }) } function I(M) { return h(M, function(J, H) { return J || (RegExp(H + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(r) || 0)[1] || null }) } var z = k, y = r && "object" == typeof r && "String" != l(r); y && (z = r, r = null); var K = z.navigator || {}, D = K.userAgent || ""; r || (r = D); var L = y ? !!K.likeChrome : /\bChrome\b/.test(r) && !/internal|\n/i.test(q.toString()), T = y ? "Object" : "ScriptBridgingProxyObject", E = y ? "Object" : "Environment", N = y && z.java ? "JavaPackage" : l(z.java), U = y ? "Object" : "RuntimeObject"; E = (N = /\bJava/.test(N) && z.java) && l(z.environment) == E; var ca = N ? "a" : "\u03b1", da = N ? "b" : "\u03b2", Y = z.document || {}, R = z.operamini || z.opera, V = t.test(V = y && R ? R["[[Class]]"] : l(R)) ? V : R = null, v, W = r; y = []; var X = null, S = r == D; D = S && R && "function" == typeof R.version && R.version(); var F = function(M) { return h(M, function(J, H) { return J || RegExp("\\b" + (H.pattern || c(H)) + "\\b", "i").exec(r) && (H.label || H) }) }([{ label: "EdgeHTML", pattern: "Edge" }, "Trident", { label: "WebKit", pattern: "AppleWebKit" }, "iCab", "Presto", "NetFront", "Tasman", "KHTML", "Gecko"]), A = function(M) { return h(M, function(J, H) { return J || RegExp("\\b" + (H.pattern || c(H)) + "\\b", "i").exec(r) && (H.label || H) }) }(["Adobe AIR", "Arora", "Avant Browser", "Breach", "Camino", "Electron", "Epiphany", "Fennec", "Flock", "Galeon", "GreenBrowser", "iCab", "Iceweasel", "K-Meleon", "Konqueror", "Lunascape", "Maxthon", { label: "Microsoft Edge", pattern: "Edge" }, "Midori", "Nook Browser", "PaleMoon", "PhantomJS", "Raven", "Rekonq", "RockMelt", { label: "Samsung Internet", pattern: "SamsungBrowser" }, "SeaMonkey", { label: "Silk", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Sleipnir", "SlimBrowser", { label: "SRWare Iron", pattern: "Iron" }, "Sunrise", "Swiftfox", "Waterfox", "WebPositive", "Opera Mini", { label: "Opera Mini", pattern: "OPiOS" }, "Opera", { label: "Opera", pattern: "OPR" }, "Chrome", { label: "Chrome Mobile", pattern: "(?:CriOS|CrMo)" }, { label: "Firefox", pattern: "(?:Firefox|Minefield)" }, { label: "Firefox for iOS", pattern: "FxiOS" }, { label: "IE", pattern: "IEMobile" }, { label: "IE", pattern: "MSIE" }, "Safari" ]), G = C([{ label: "BlackBerry", pattern: "BB10" }, "BlackBerry", { label: "Galaxy S", pattern: "GT-I9000" }, { label: "Galaxy S2", pattern: "GT-I9100" }, { label: "Galaxy S3", pattern: "GT-I9300" }, { label: "Galaxy S4", pattern: "GT-I9500" }, { label: "Galaxy S5", pattern: "SM-G900" }, { label: "Galaxy S6", pattern: "SM-G920" }, { label: "Galaxy S6 Edge", pattern: "SM-G925" }, { label: "Galaxy S7", pattern: "SM-G930" }, { label: "Galaxy S7 Edge", pattern: "SM-G935" }, "Google TV", "Lumia", "iPad", "iPod", "iPhone", "Kindle", { label: "Kindle Fire", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Nexus", "Nook", "PlayBook", "PlayStation Vita", "PlayStation", "TouchPad", "Transformer", { label: "Wii U", pattern: "WiiU" }, "Wii", "Xbox One", { label: "Xbox 360", pattern: "Xbox" }, "Xoom" ]), P = function(M) { return h(M, function(J, H, O) { return J || (H[G] || H[/^[a-z]+(?: +[a-z]+\b)*/i.exec(G)] || RegExp("\\b" + c(O) + "(?:\\b|\\w*\\d)", "i").exec(r)) && O }) }({ Apple: { iPad: 1, iPhone: 1, iPod: 1 }, Archos: {}, Amazon: { Kindle: 1, "Kindle Fire": 1 }, Asus: { Transformer: 1 }, "Barnes & Noble": { Nook: 1 }, BlackBerry: { PlayBook: 1 }, Google: { "Google TV": 1, Nexus: 1 }, HP: { TouchPad: 1 }, HTC: {}, LG: {}, Microsoft: { Xbox: 1, "Xbox One": 1 }, Motorola: { Xoom: 1 }, Nintendo: { "Wii U": 1, Wii: 1 }, Nokia: { Lumia: 1 }, Samsung: { "Galaxy S": 1, "Galaxy S2": 1, "Galaxy S3": 1, "Galaxy S4": 1 }, Sony: { PlayStation: 1, "PlayStation Vita": 1 } }), B = function(M) { return h(M, function(J, H) { var O = H.pattern || c(H); if (!J && (J = RegExp("\\b" + O + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(r))) { var Q = J, Z = H.label || H, aa = { "10.0": "10", "6.4": "10 Technical Preview", "6.3": "8.1", "6.2": "8", "6.1": "Server 2008 R2 / 7", "6.0": "Server 2008 / Vista", "5.2": "Server 2003 / XP 64-bit", "5.1": "XP", "5.01": "2000 SP1", "5.0": "2000", "4.0": "NT", "4.90": "ME" }; O && Z && /^Win/i.test(Q) && !/^Windows Phone /i.test(Q) && (aa = aa[/[\d.]+$/.exec(Q)]) && (Q = "Windows " + aa); Q = String(Q); O && Z && (Q = Q.replace(RegExp(O, "i"), Z)); J = Q = d(Q.replace(/ ce$/i, " CE").replace(/\bhpw/i, "web").replace(/\bMacintosh\b/, "Mac OS").replace(/_PowerPC\b/i, " OS").replace(/\b(OS X) [^ \d]+/i, "$1").replace(/\bMac (OS X)\b/, "$1").replace(/\/(\d)/, " $1").replace(/_/g, ".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, "").replace(/\bx86\.64\b/gi, "x86_64").replace(/\b(Windows Phone) OS\b/, "$1").replace(/\b(Chrome OS \w+) [\d.]+\b/, "$1").split(" on ")[0]) } return J }) }(["Windows Phone", "Android", "CentOS", { label: "Chrome OS", pattern: "CrOS" }, "Debian", "Fedora", "FreeBSD", "Gentoo", "Haiku", "Kubuntu", "Linux Mint", "OpenBSD", "Red Hat", "SuSE", "Ubuntu", "Xubuntu", "Cygwin", "Symbian OS", "hpwOS", "webOS ", "webOS", "Tablet OS", "Tizen", "Linux", "Mac OS X", "Macintosh", "Mac", "Windows 98;", "Windows " ]); F && (F = [F]); P && !G && (G = C([P])); if (v = /\bGoogle TV\b/.exec(G)) G = v[0]; /\bSimulator\b/i.test(r) && (G = (G ? G + " " : "") + "Simulator"); "Opera Mini" == A && /\bOPiOS\b/.test(r) && y.push("running in Turbo/Uncompressed mode"); "IE" == A && /\blike iPhone OS\b/.test(r) ? (v = n(r.replace(/like iPhone OS/, "")), P = v.manufacturer, G = v.product) : /^iP/.test(G) ? (A || (A = "Safari"), B = "iOS" + ((v = / OS ([\d_]+)/i.exec(r)) ? " " + v[1].replace(/_/g, ".") : "")) : "Konqueror" != A || /buntu/i.test(B) ? P && "Google" != P && (/Chrome/.test(A) && !/\bMobile Safari\b/i.test(r) || /\bVita\b/.test(G)) || /\bAndroid\b/.test(B) && /^Chrome/.test(A) && /\bVersion\//i.test(r) ? (A = "Android Browser", B = /\bAndroid\b/.test(B) ? B : "Android") : "Silk" == A ? (/\bMobi/i.test(r) || (B = "Android", y.unshift("desktop mode")), /Accelerated *= *true/i.test(r) && y.unshift("accelerated")) : "PaleMoon" == A && (v = /\bFirefox\/([\d.]+)\b/.exec(r)) ? y.push("identifying as Firefox " + v[1]) : "Firefox" == A && (v = /\b(Mobile|Tablet|TV)\b/i.exec(r)) ? (B || (B = "Firefox OS"), G || (G = v[1])) : !A || (v = !/\bMinefield\b/i.test(r) && /\b(?:Firefox|Safari)\b/.exec(A)) ? (A && !G && /[\/,]|^[^(]+?\)/.test(r.slice(r.indexOf(v + "/") + 8)) && (A = null), (v = G || P || B) && (G || P || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(B)) && (A = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(B) ? B : v) + " Browser")) : "Electron" == A && (v = (/\bChrome\/([\d.]+)\b/.exec(r) || 0)[1]) && y.push("Chromium " + v) : B = "Kubuntu"; D || (D = I(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))", "Version", c(A), "(?:Firefox|Minefield|NetFront)"])); if (v = "iCab" == F && 3 < parseFloat(D) && "WebKit" || /\bOpera\b/.test(A) && (/\bOPR\b/.test(r) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(r) && !/^(?:Trident|EdgeHTML)$/.test(F) && "WebKit" || !F && /\bMSIE\b/i.test(r) && ("Mac OS" == B ? "Tasman" : "Trident") || "WebKit" == F && /\bPlayStation\b(?! Vita\b)/i.test(A) && "NetFront") F = [v]; "IE" == A && (v = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(r) || 0)[1]) ? (A += " Mobile", B = "Windows Phone " + (/\+$/.test(v) ? v : v + ".x"), y.unshift("desktop mode")) : /\bWPDesktop\b/i.test(r) ? (A = "IE Mobile", B = "Windows Phone 8.x", y.unshift("desktop mode"), D || (D = (/\brv:([\d.]+)/.exec(r) || 0)[1])) : "IE" != A && "Trident" == F && (v = /\brv:([\d.]+)/.exec(r)) && (A && y.push("identifying as " + A + (D ? " " + D : "")), A = "IE", D = v[1]); if (S) { if (g(z, "global")) if (N && (v = N.lang.System, W = v.getProperty("os.arch"), B = B || v.getProperty("os.name") + " " + v.getProperty("os.version")), E) { try { D = z.require("ringo/engine").version.join("."), A = "RingoJS" } catch (M) { (v = z.system) && v.global.system == z.system && (A = "Narwhal", B || (B = v[0].os || null)) } A || (A = "Rhino") } else "object" == typeof z.process && !z.process.browser && (v = z.process) && ("object" == typeof v.versions && ("string" == typeof v.versions.electron ? (y.push("Node " + v.versions.node), A = "Electron", D = v.versions.electron) : "string" == typeof v.versions.nw && (y.push("Chromium " + D, "Node " + v.versions.node), A = "NW.js", D = v.versions.nw)), A || (A = "Node.js", W = v.arch, B = v.platform, D = (D = /[\d.]+/.exec(v.version)) ? D[0] : null)); else l(v = z.runtime) == T ? (A = "Adobe AIR", B = v.flash.system.Capabilities.os) : l(v = z.phantom) == U ? (A = "PhantomJS", D = (v = v.version || null) && v.major + "." + v.minor + "." + v.patch) : "number" == typeof Y.documentMode && (v = /\bTrident\/(\d+)/i.exec(r)) ? (D = [D, Y.documentMode], (v = +v[1] + 4) != D[1] && (y.push("IE " + D[1] + " mode"), F && (F[1] = ""), D[1] = v), D = "IE" == A ? String(D[1].toFixed(1)) : D[0]) : "number" == typeof Y.documentMode && /^(?:Chrome|Firefox)\b/.test(A) && (y.push("masking as " + A + " " + D), A = "IE", D = "11.0", F = ["Trident"], B = "Windows"); B = B && d(B) } D && (v = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(D) || /(?:alpha|beta)(?: ?\d)?/i.exec(r + ";" + (S && K.appMinorVersion)) || /\bMinefield\b/i.test(r) && "a") && (X = /b/i.test(v) ? "beta" : "alpha", D = D.replace(RegExp(v + "\\+?$"), "") + ("beta" == X ? da : ca) + (/\d+\+?/.exec(v) || "")); if ("Fennec" == A || "Firefox" == A && /\b(?:Android|Firefox OS)\b/.test(B)) A = "Firefox Mobile"; else if ("Maxthon" == A && D) D = D.replace(/\.[\d.]+/, ".x"); else if (/\bXbox\b/i.test(G)) "Xbox 360" == G && (B = null), "Xbox 360" == G && /\bIEMobile\b/.test(r) && y.unshift("mobile mode"); else if (!/^(?:Chrome|IE|Opera)$/.test(A) && (!A || G || /Browser|Mobi/.test(A)) || "Windows CE" != B && !/Mobi/i.test(r)) if ("IE" == A && S) try { null === z.external && y.unshift("platform preview") } catch (M) { y.unshift("embedded") } else(/\bBlackBerry\b/.test(G) || /\bBB10\b/.test(r)) && (v = (RegExp(G.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(r) || 0)[1] || D) ? (v = [v, /BB10/.test(r)], B = (v[1] ? (G = null, P = "BlackBerry") : "Device Software") + " " + v[0], D = null) : this != f && "Wii" != G && (S && R || /Opera/.test(A) && /\b(?:MSIE|Firefox)\b/i.test(r) || "Firefox" == A && /\bOS X (?:\d+\.){2,}/.test(B) || "IE" == A && (B && !/^Win/.test(B) && 5.5 < D || /\bWindows XP\b/.test(B) && 8 < D || 8 == D && !/\bTrident\b/.test(r))) && !t.test(v = n.call(f, r.replace(t, "") + ";")) && v.name && (v = "ing as " + v.name + ((v = v.version) ? " " + v : ""), t.test(A) ? (/\bIE\b/.test(v) && "Mac OS" == B && (B = null), v = "identify" + v) : (v = "mask" + v, A = V ? d(V.replace(/([a-z])([A-Z])/g, "$1 $2")) : "Opera", /\bIE\b/.test(v) && (B = null), S || (D = null)), F = ["Presto"], y.push(v)); else A += " Mobile"; if (v = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(r) || 0)[1]) { v = [parseFloat(v.replace(/\.(\d)$/, ".0$1")), v]; if ("Safari" == A && "+" == v[1].slice(-1)) A = "WebKit Nightly", X = "alpha", D = v[1].slice(0, -1); else if (D == v[1] || D == (v[2] = (/\bSafari\/([\d.]+\+?)/i.exec(r) || 0)[1])) D = null; v[1] = (/\bChrome\/([\d.]+)/i.exec(r) || 0)[1]; 537.36 == v[0] && 537.36 == v[2] && 28 <= parseFloat(v[1]) && "WebKit" == F && (F = ["Blink"]); S && (L || v[1]) ? (F && (F[1] = "like Chrome"), v = v[1] || (v = v[0], 530 > v ? 1 : 532 > v ? 2 : 532.05 > v ? 3 : 533 > v ? 4 : 534.03 > v ? 5 : 534.07 > v ? 6 : 534.1 > v ? 7 : 534.13 > v ? 8 : 534.16 > v ? 9 : 534.24 > v ? 10 : 534.3 > v ? 11 : 535.01 > v ? 12 : 535.02 > v ? "13+" : 535.07 > v ? 15 : 535.11 > v ? 16 : 535.19 > v ? 17 : 536.05 > v ? 18 : 536.1 > v ? 19 : 537.01 > v ? 20 : 537.11 > v ? "21+" : 537.13 > v ? 23 : 537.18 > v ? 24 : 537.24 > v ? 25 : 537.36 > v ? 26 : "Blink" != F ? "27" : "28")) : (F && (F[1] = "like Safari"), v = (v = v[0], 400 > v ? 1 : 500 > v ? 2 : 526 > v ? 3 : 533 > v ? 4 : 534 > v ? "4+" : 535 > v ? 5 : 537 > v ? 6 : 538 > v ? 7 : 601 > v ? 8 : "8")); F && (F[1] += " " + (v += "number" == typeof v ? ".x" : /[.+]/.test(v) ? "" : "+")); "Safari" == A && (!D || 45 < parseInt(D)) && (D = v) } "Opera" == A && (v = /\bzbov|zvav$/.exec(B)) ? (A += " ", y.unshift("desktop mode"), "zvav" == v ? (A += "Mini", D = null) : A += "Mobile", B = B.replace(RegExp(" *" + v + "$"), "")) : "Safari" == A && /\bChrome\b/.exec(F && F[1]) && (y.unshift("desktop mode"), A = "Chrome Mobile", D = null, /\bOS X\b/.test(B) ? (P = "Apple", B = "iOS 4.3+") : B = null); D && 0 == D.indexOf(v = /[\d.]+$/.exec(B)) && -1 < r.indexOf("/" + v + "-") && (B = String(B.replace(v, "")).replace(/^ +| +$/g, "")); F && !/\b(?:Avant|Nook)\b/.test(A) && (/Browser|Lunascape|Maxthon/.test(A) || "Safari" != A && /^iOS/.test(B) && /\bSafari\b/.test(F[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(A) && F[1]) && (v = F[F.length - 1]) && y.push(v); y.length && (y = ["(" + y.join("; ") + ")"]); P && G && 0 > G.indexOf(P) && y.push("on " + P); G && y.push((/^on /.test(y[y.length - 1]) ? "" : "on ") + G); if (B) { var ba = (v = / ([\d.+]+)$/.exec(B)) && "/" == B.charAt(B.length - v[0].length - 1); B = { architecture: 32, family: v && !ba ? B.replace(v[0], "") : B, version: v ? v[1] : null, toString: function() { var M = this.version; return this.family + (M && !ba ? " " + M : "") + (64 == this.architecture ? " 64-bit" : "") } } }(v = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(W)) && !/\bi686\b/i.test(W) ? (B && (B.architecture = 64, B.family = B.family.replace(RegExp(" *" + v), "")), A && (/\bWOW64\b/i.test(r) || S && /\w(?:86|32)$/.test(K.cpuClass || K.platform) && !/\bWin64; x64\b/i.test(r)) && y.unshift("32-bit")) : B && /^OS X/.test(B.family) && "Chrome" == A && 39 <= parseFloat(D) && (B.architecture = 64); r || (r = null); z = {}; z.description = r; z.layout = F && F[0]; z.manufacturer = P; z.name = A; z.prerelease = X; z.product = G; z.ua = r; z.version = A && D; z.os = B || { architecture: null, family: null, version: null, toString: function() { return "null" } }; z.parse = n; z.toString = function() { return this.description || "" }; z.version && y.unshift(D); z.name && y.unshift(A); B && A && (B != String(B).split(" ")[0] || B != A.split(" ")[0] && !G) && y.push(G ? "(" + B + ")" : "on " + B); y.length && (z.description = y.join(" ")); return z } var b = { "function": !0, object: !0 }, k = b[typeof window] && window || this, e = b[typeof exports] && exports; b = b[typeof module] && module && !module.nodeType && module; var p = e && b && "object" == typeof global && global; !p || p.global !== p && p.window !== p && p.self !== p || (k = p); var u = Math.pow(2, 53) - 1, t = /\bOpera/; p = Object.prototype; var w = p.hasOwnProperty, q = p.toString, x = n(); "function" == typeof define && "object" == typeof define.amd && define.amd ? (k.platform = x, define(function() { return x })) : e && b ? f(x, function(r, C) { e[C] = r }) : k.platform = x }).call(this); function buildIOSMeta() { for (var a = [{ name: "viewport", content: "width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" }, { name: "apple-mobile-web-app-capable", content: "yes" }, { name: "apple-mobile-web-app-status-bar-style", content: "black" }], m = 0; m < a.length; m++) { var d = document.createElement("meta"); d.name = a[m].name; d.content = a[m].content; var f = window.document.head.querySelector('meta[name="' + d.name + '"]'); f && f.parentNode.removeChild(f); window.document.head.appendChild(d) } } function hideIOSFullscreenPanel() { document.querySelector(".xxx-ios-fullscreen-message").style.display = "none"; document.querySelector(".xxx-ios-fullscreen-scroll").style.display = "none"; document.querySelector(".xxx-game-iframe-full").classList.remove("xxx-game-iframe-iphone-se") } function buildIOSFullscreenPanel() { document.body.insertAdjacentHTML("beforeend", '<div class="xxx-ios-fullscreen-message"><div class="xxx-ios-fullscreen-swipe"></div></div><div class="xxx-ios-fullscreen-scroll"></div>') } function showIOSFullscreenPanel() { document.querySelector(".xxx-ios-fullscreen-message").style.display = "none"; document.querySelector(".xxx-ios-fullscreen-scroll").style.display = "none" } function __iosResize() { window.scrollTo(0, 0); console.log(window.devicePixelRatio); console.log(window.innerWidth); console.log(window.innerHeight); if ("iPhone" === platform.product) switch (window.devicePixelRatio) { case 2: switch (window.innerWidth) { case 568: 320 !== window.innerHeight && document.querySelector(".xxx-game-iframe-full").classList.add("xxx-game-iframe-iphone-se"); break; case 667: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; case 3: switch (window.innerWidth) { case 736: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 724: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; default: hideIOSFullscreenPanel() } } function iosResize() { __iosResize(); setTimeout(function() { __iosResize() }, 500) } function iosInIframe() { try { return window.self !== window.top } catch (a) { return !0 } } function isIOSLessThen13() { var a = platform.os, m = a.family.toLowerCase(); a = parseFloat(a.version); return "ios" === m && 13 > a ? !0 : !1 } document.addEventListener("DOMContentLoaded", function() { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && (buildIOSFullscreenPanel(), buildIOSMeta()) }); window.addEventListener("resize", function(a) { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && iosResize() }); var s_iScaleFactor = 1, s_iOffsetX, s_iOffsetY, s_bIsIphone = !1, s_bFocus = !0; (function(a) { (jQuery.browser = jQuery.browser || {}).mobile = /android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(ad|hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|tablet|treo|up\.(browser|link)|vodafone|wap|webos|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)) })(navigator.userAgent || navigator.vendor || window.opera); $(window).resize(function() { sizeHandler() }); function trace(a) { console.log(a) } function getSize(a) { var m = a.toLowerCase(), d = window.document, f = d.documentElement; if (void 0 === window["inner" + a]) a = f["client" + a]; else if (window["inner" + a] != f["client" + a]) { var l = d.createElement("body"); l.id = "vpw-test-b"; l.style.cssText = "overflow:scroll"; var g = d.createElement("div"); g.id = "vpw-test-d"; g.style.cssText = "position:absolute;top:-1000px"; g.innerHTML = "<style>@media(" + m + ":" + f["client" + a] + "px){body#vpw-test-b div#vpw-test-d{" + m + ":7px!important}}</style>"; l.appendChild(g); f.insertBefore(l, d.head); a = 7 == g["offset" + a] ? f["client" + a] : window["inner" + a]; f.removeChild(l) } else a = window["inner" + a]; return a } window.addEventListener("orientationchange", onOrientationChange); function onOrientationChange() { window.matchMedia("(orientation: portrait)").matches && sizeHandler(); window.matchMedia("(orientation: landscape)").matches && sizeHandler() } function isChrome() { return /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) } function isIpad() { var a = -1 !== navigator.userAgent.toLowerCase().indexOf("ipad"); return !a && navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && 2 < navigator.maxTouchPoints ? !0 : a } function isIpad() { var a = -1 !== navigator.userAgent.toLowerCase().indexOf("ipad"); return !a && navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && 2 < navigator.maxTouchPoints ? !0 : a } function isMobile() { return isIpad() ? !0 : navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i) ? !0 : !1 } function isIOS() { if (isIpad()) return !0; for (var a = "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";"); a.length;) if (navigator.platform === a.pop()) return s_bIsIphone = !0; return s_bIsIphone = !1 } function getIOSWindowHeight() { return document.documentElement.clientWidth / window.innerWidth * window.innerHeight } function getHeightOfIOSToolbars() { var a = (0 === window.orientation ? screen.height : screen.width) - getIOSWindowHeight(); return 1 < a ? a : 0 } function sizeHandler() { window.scrollTo(0, 1); if ($("#canvas")) { var a = null !== platform.name && "safari" === platform.name.toLowerCase() ? getIOSWindowHeight() : getSize("Height"); var m = getSize("Width"); s_bFocus && _checkOrientation(m, a); var d = Math.min(a / CANVAS_HEIGHT, m / CANVAS_WIDTH), f = Math.round(CANVAS_WIDTH * d); d = Math.round(CANVAS_HEIGHT * d); if (d < a) { var l = a - d; d += l; f += CANVAS_WIDTH / CANVAS_HEIGHT * l } else f < m && (l = m - f, f += l, d += CANVAS_HEIGHT / CANVAS_WIDTH * l); l = a / 2 - d / 2; var g = m / 2 - f / 2, c = CANVAS_WIDTH / f; if (g * c < -EDGEBOARD_X || l * c < -EDGEBOARD_Y) d = Math.min(a / (CANVAS_HEIGHT - 2 * EDGEBOARD_Y), m / (CANVAS_WIDTH - 2 * EDGEBOARD_X)), f = Math.round(CANVAS_WIDTH * d), d = Math.round(CANVAS_HEIGHT * d), l = (a - d) / 2, g = (m - f) / 2, c = CANVAS_WIDTH / f; s_iOffsetX = -1 * g * c; s_iOffsetY = -1 * l * c; 0 <= l && (s_iOffsetY = 0); 0 <= g && (s_iOffsetX = 0); null !== s_oInterface && s_oInterface.refreshButtonPos(s_iOffsetX, s_iOffsetY); null !== s_oMenu && s_oMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); s_bIsIphone && s_oStage ? (canvas = document.getElementById("canvas"), s_oStage.canvas.width = 2 * f, s_oStage.canvas.height = 2 * d, canvas.style.width = f + "px", canvas.style.height = d + "px", s_iScaleFactor = 2 * Math.min(f / CANVAS_WIDTH, d / CANVAS_HEIGHT), s_oStage.scaleX = s_oStage.scaleY = s_iScaleFactor) : s_bMobile || isChrome() ? ($("#canvas").css("width", f + "px"), $("#canvas").css("height", d + "px")) : s_oStage && (s_oStage.canvas.width = f, s_oStage.canvas.height = d, s_iScaleFactor = Math.min(f / CANVAS_WIDTH, d / CANVAS_HEIGHT), s_oStage.scaleX = s_oStage.scaleY = s_iScaleFactor); 0 > l || (l = (a - d) / 2); $("#canvas").css("top", l + "px"); $("#canvas").css("left", g + "px"); if (DEBUG_BOX2D) { if (s_bMobile || isChrome()) $("#debug").css("width", f + "px"), $("#debug").css("height", d + "px"); 0 > l ? $("#debug").css("top", l + "px") : (l = (a - d) / 2, $("#canvas").css("top", l + "px")); $("#debug").css("left", g + "px") } fullscreenHandler() } } function _checkOrientation(a, m) { s_bMobile && ENABLE_CHECK_ORIENTATION && (a > m ? "landscape" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate()) : "portrait" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate())) } function playSound(a, m, d) { return !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (s_aSounds[a].play(), s_aSounds[a].volume(m), s_aSounds[a].loop(d), s_aSounds[a]) : null } function stopSound(a) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].stop() } function setVolume(a, m) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].volume(m) } function setMute(a, m) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].mute(m) } function fadeSound(a, m, d, f) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].fade(m, d, f) } function soundPlaying(a) { if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) return s_aSounds[a].playing() } function createBitmap(a, m, d) { var f = new createjs.Bitmap(a), l = new createjs.Shape; m && d ? l.graphics.beginFill("#fff").drawRect(0, 0, m, d) : l.graphics.beginFill("#ff0").drawRect(0, 0, a.width, a.height); f.hitArea = l; return f } function createSprite(a, m, d, f, l, g) { a = null !== m ? new createjs.Sprite(a, m) : new createjs.Sprite(a); m = new createjs.Shape; m.graphics.beginFill("#000000").drawRect(-d, -f, l, g); a.hitArea = m; return a } function pad(a, m, d) { a += ""; return a.length >= m ? a : Array(m - a.length + 1).join(d || "0") + a } function linearFunction(a, m, d, f, l) { return (a - m) * (l - f) / (d - m) + f } function randomFloatBetween(a, m, d) { "undefined" === typeof d && (d = 2); return parseFloat(Math.min(a + Math.random() * (m - a), m).toFixed(d)) } function rotateVector2D(a, m) { var d = m.getX() * Math.cos(a) + m.getY() * Math.sin(a), f = m.getX() * -Math.sin(a) + m.getY() * Math.cos(a); m.set(d, f) } function tweenVectorsOnX(a, m, d) { return a + d * (m - a) } function shuffle(a) { for (var m = a.length, d, f; 0 !== m;) f = Math.floor(Math.random() * m), --m, d = a[m], a[m] = a[f], a[f] = d; return a } function bubbleSort(a) { do { var m = !1; for (var d = 0; d < a.length - 1; d++) a[d] > a[d + 1] && (m = a[d], a[d] = a[d + 1], a[d + 1] = m, m = !0) } while (m) } function compare(a, m) { return a.index > m.index ? -1 : a.index < m.index ? 1 : 0 } function easeLinear(a, m, d, f) { return d * a / f + m } function easeInQuad(a, m, d, f) { return d * (a /= f) * a + m } function easeInSine(a, m, d, f) { return -d * Math.cos(a / f * (Math.PI / 2)) + d + m } function easeInCubic(a, m, d, f) { return d * (a /= f) * a * a + m } function getTrajectoryPoint(a, m) { var d = new createjs.Point, f = (1 - a) * (1 - a), l = a * a; d.x = f * m.start.x + 2 * (1 - a) * a * m.traj.x + l * m.end.x; d.y = f * m.start.y + 2 * (1 - a) * a * m.traj.y + l * m.end.y; return d } function formatTime(a) { a /= 1E3; var m = Math.floor(a / 60); a = parseFloat(a - 60 * m).toFixed(1); var d = ""; d = 10 > m ? d + ("0" + m + ":") : d + (m + ":"); return 10 > a ? d + ("0" + a) : d + a } function degreesToRadians(a) { return a * Math.PI / 180 } function checkRectCollision(a, m) { var d = getBounds(a, .9); var f = getBounds(m, .98); return calculateIntersection(d, f) } function calculateIntersection(a, m) { var d, f, l, g; var c = a.x + (d = a.width / 2); var h = a.y + (f = a.height / 2); var n = m.x + (l = m.width / 2); var b = m.y + (g = m.height / 2); c = Math.abs(c - n) - (d + l); h = Math.abs(h - b) - (f + g); return 0 > c && 0 > h ? (c = Math.min(Math.min(a.width, m.width), -c), h = Math.min(Math.min(a.height, m.height), -h), { x: Math.max(a.x, m.x), y: Math.max(a.y, m.y), width: c, height: h, rect1: a, rect2: m }) : null } function getBounds(a, m) { var d = { x: Infinity, y: Infinity, width: 0, height: 0 }; if (a instanceof createjs.Container) { d.x2 = -Infinity; d.y2 = -Infinity; var f = a.children, l = f.length, g; for (g = 0; g < l; g++) { var c = getBounds(f[g], 1); c.x < d.x && (d.x = c.x); c.y < d.y && (d.y = c.y); c.x + c.width > d.x2 && (d.x2 = c.x + c.width); c.y + c.height > d.y2 && (d.y2 = c.y + c.height) } Infinity == d.x && (d.x = 0); Infinity == d.y && (d.y = 0); Infinity == d.x2 && (d.x2 = 0); Infinity == d.y2 && (d.y2 = 0); d.width = d.x2 - d.x; d.height = d.y2 - d.y; delete d.x2; delete d.y2 } else { if (a instanceof createjs.Bitmap) { l = a.sourceRect || a.image; g = l.width * m; var h = l.height * m } else if (a instanceof createjs.Sprite) if (a.spriteSheet._frames && a.spriteSheet._frames[a.currentFrame] && a.spriteSheet._frames[a.currentFrame].image) { l = a.spriteSheet.getFrame(a.currentFrame); g = l.rect.width; h = l.rect.height; f = l.regX; var n = l.regY } else d.x = a.x || 0, d.y = a.y || 0; else d.x = a.x || 0, d.y = a.y || 0; f = f || 0; g = g || 0; n = n || 0; h = h || 0; d.regX = f; d.regY = n; l = a.localToGlobal(0 - f, 0 - n); c = a.localToGlobal(g - f, h - n); g = a.localToGlobal(g - f, 0 - n); f = a.localToGlobal(0 - f, h - n); d.x = Math.min(Math.min(Math.min(l.x, c.x), g.x), f.x); d.y = Math.min(Math.min(Math.min(l.y, c.y), g.y), f.y); d.width = Math.max(Math.max(Math.max(l.x, c.x), g.x), f.x) - d.x; d.height = Math.max(Math.max(Math.max(l.y, c.y), g.y), f.y) - d.y } return d } function NoClickDelay(a) { this.element = a; window.Touch && this.element.addEventListener("touchstart", this, !1) } function shuffle(a) { for (var m = a.length, d, f; 0 < m;) f = Math.floor(Math.random() * m), m--, d = a[m], a[m] = a[f], a[f] = d; return a } NoClickDelay.prototype = { handleEvent: function(a) { switch (a.type) { case "touchstart": this.onTouchStart(a); break; case "touchmove": this.onTouchMove(a); break; case "touchend": this.onTouchEnd(a) } }, onTouchStart: function(a) { a.preventDefault(); this.moved = !1; this.element.addEventListener("touchmove", this, !1); this.element.addEventListener("touchend", this, !1) }, onTouchMove: function(a) { this.moved = !0 }, onTouchEnd: function(a) { this.element.removeEventListener("touchmove", this, !1); this.element.removeEventListener("touchend", this, !1); if (!this.moved) { a = document.elementFromPoint(a.changedTouches[0].clientX, a.changedTouches[0].clientY); 3 == a.nodeType && (a = a.parentNode); var m = document.createEvent("MouseEvents"); m.initEvent("click", !0, !0); a.dispatchEvent(m) } } }; (function() { function a(d) { var f = { focus: "visible", focusin: "visible", pageshow: "visible", blur: "hidden", focusout: "hidden", pagehide: "hidden" }; d = d || window.event; d.type in f ? document.body.className = f[d.type] : (document.body.className = this[m] ? "hidden" : "visible", "hidden" === document.body.className ? (s_oMain.stopUpdate(), s_bFocus = !1) : (s_oMain.startUpdate(), s_bFocus = !0)) } var m = "hidden"; m in document ? document.addEventListener("visibilitychange", a) : (m = "mozHidden") in document ? document.addEventListener("mozvisibilitychange", a) : (m = "webkitHidden") in document ? document.addEventListener("webkitvisibilitychange", a) : (m = "msHidden") in document ? document.addEventListener("msvisibilitychange", a) : "onfocusin" in document ? document.onfocusin = document.onfocusout = a : window.onpageshow = window.onpagehide = window.onfocus = window.onblur = a })(); function ctlArcadeResume() { null !== s_oMain && s_oMain.startUpdate() } function ctlArcadePause() { null !== s_oMain && s_oMain.stopUpdate() } function getParamValue(a) { for (var m = window.location.search.substring(1).split("&"), d = 0; d < m.length; d++) { var f = m[d].split("="); if (f[0] == a) return f[1] } } String.prototype.format = function() { for (var a = this, m = arguments.length; m--;) a = a.replace(new RegExp("\\{" + m + "\\}", "gm"), arguments[m]); return a }; function fullscreenHandler() { ENABLE_FULLSCREEN && screenfull.isEnabled && (s_bFullscreen = screenfull.isFullscreen, null !== s_oInterface && s_oInterface.resetFullscreenBut(), null !== s_oMenu && s_oMenu.resetFullscreenBut()) } if (screenfull.isEnabled) screenfull.on("change", function() { s_bFullscreen = screenfull.isFullscreen; null !== s_oInterface && s_oInterface.resetFullscreenBut(); null !== s_oMenu && s_oMenu.resetFullscreenBut() }); function CSpriteLibrary() { var a = {}, m, d, f, l, g, c; this.init = function(h, n, b) { m = {}; f = d = 0; l = h; g = n; c = b }; this.addSprite = function(h, n) { if (!a.hasOwnProperty(h)) { var b = new Image; a[h] = m[h] = { szPath: n, oSprite: b, bLoaded: !1 }; d++ } }; this.getSprite = function(h) { return a.hasOwnProperty(h) ? a[h].oSprite : null }; this._onSpritesLoaded = function() { d = 0; g.call(c) }; this._onSpriteLoaded = function() { l.call(c); ++f === d && this._onSpritesLoaded() }; this.loadSprites = function() { for (var h in m) m[h].oSprite.oSpriteLibrary = this, m[h].oSprite.szKey = h, m[h].oSprite.onload = function() { this.oSpriteLibrary.setLoaded(this.szKey); this.oSpriteLibrary._onSpriteLoaded(this.szKey) }, m[h].oSprite.onerror = function(n) { var b = n.currentTarget; setTimeout(function() { m[b.szKey].oSprite.src = m[b.szKey].szPath }, 500) }, m[h].oSprite.src = m[h].szPath }; this.setLoaded = function(h) { a[h].bLoaded = !0 }; this.isLoaded = function(h) { return a[h].bLoaded }; this.getNumSprites = function() { return d } } var CANVAS_WIDTH = 768, CANVAS_HEIGHT = 1280, CANVAS_WIDTH_HALF = CANVAS_WIDTH / 2, CANVAS_HEIGHT_HALF = CANVAS_HEIGHT / 2, EDGEBOARD_X = 100, EDGEBOARD_Y = 140, GAME_NAME = "pinball", PRIMARY_FONT = "walibi0615bold", SECONDARY_FONT = "Digital", PRIMARY_FONT_COLOUR = "#fff600", SOUNDTRACK_VOLUME_IN_GAME = 1, FPS = 60, FPS_TIME = 1E3 / FPS, DISABLE_SOUND_MOBILE = !1, STATE_LOADING = 0, STATE_MENU = 1, STATE_HELP = 1, STATE_GAME = 3, ON_MOUSE_DOWN = 0, ON_MOUSE_UP = 1, ON_MOUSE_OVER = 2, ON_MOUSE_OUT = 3, ON_DRAG_START = 4, ON_DRAG_END = 5, ON_INCREASE_JACKPOT = 6, ON_INCREASE_SCORE = 7, CONTACT_BEGIN = 0, CONTACT_END = 1, CONTACT_PRESOLVE = 2, CONTACT_POSTSOLVE = 3, SETTINGS_HEIGHT = 240, TODEGREE_PROPORTION = 180 / Math.PI, ZOOM_TABLE_SIZE = { w: 1, h: 1 }, BALL_OUT_SAFE_LIMIT = 40, DEBUG_BOX2D = !1, DEBUG_BOX2D_ALPHA = .2, WORLD_SCALE = 100, GRAVITY = 13.6, GENERAL_RESTITUTION = .33, GENERAL_FRICTION = .7, ZOOM = 1, ZOOM_PER_WORLDSCALE = ZOOM * WORLD_SCALE, BALL_STARTPOS = { x: 1092, y: 1770 }, BALL_RADIUS = 28, LERP_SLOW = { x: .01, y: .01 }, LERP_FOLLOW_BALL = { x: .05, y: .15 }, NUM_BALL = 3, SHIELD_ACTIVATION_THRESHOLD = 3, EXTRABALL_JACKPOT_SCORE_ACTIVATION = 5E5, FLIPPER_STRENGTH = 18, SPRING_MAX_STRENGTH = 1, iY = 1300, LETTERS_POSITION = [{ x: 300, y: iY }, { x: 360, y: iY }, { x: 440, y: iY }, { x: 530, y: iY }, { x: 630, y: iY }, { x: 720, y: iY }, { x: 810, y: iY }], MAX_MULTIPLIER = 7, TIME_ROUTER_SCORE_DECREASE = 2E4, SCORE_RATIO_TO_ADD_AT_JACKPOT = 2, TIME_LAST_ACTIVE_JACKPOT = 9E4, ENABLE_FULLSCREEN, ENABLE_CHECK_ORIENTATION; function CPreloader() { var a, m, d, f, l, g, c, h, n; this._init = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("progress_bar", "./sprites/progress_bar.png"); s_oSpriteLibrary.addSprite("200x200", "./sprites/200x200.jpg"); s_oSpriteLibrary.loadSprites(); n = new createjs.Container; s_oStage.addChild(n) }; this.unload = function() { n.removeAllChildren() }; this._onImagesLoaded = function() {}; this._onAllImagesLoaded = function() { this.attachSprites(); s_oMain.preloaderReady() }; this.attachSprites = function() { var b = new createjs.Shape; b.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); n.addChild(b); b = s_oSpriteLibrary.getSprite("200x200"); c = createBitmap(b); c.regX = .5 * b.width; c.regY = .5 * b.height; c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT / 2 - 180; n.addChild(c); h = new createjs.Shape; h.graphics.beginFill("rgba(0,0,0,0.01)").drawRoundRect(c.x - 100, c.y - 100, 200, 200, 10); n.addChild(h); c.mask = h; b = s_oSpriteLibrary.getSprite("progress_bar"); f = createBitmap(b); f.x = CANVAS_WIDTH / 2 - b.width / 2; f.y = CANVAS_HEIGHT / 2 + 50; n.addChild(f); a = b.width; m = b.height; l = new createjs.Shape; l.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(f.x, f.y, 1, m); n.addChild(l); f.mask = l; d = new createjs.Text("", "30px " + PRIMARY_FONT, PRIMARY_FONT_COLOUR); d.x = CANVAS_WIDTH / 2; d.y = CANVAS_HEIGHT / 2 + 100; d.textBaseline = "alphabetic"; d.textAlign = "center"; n.addChild(d); g = new createjs.Shape; g.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); n.addChild(g); createjs.Tween.get(g).to({ alpha: 0 }, 500).call(function() { createjs.Tween.removeTweens(g); n.removeChild(g) }) }; this.refreshLoader = function(b) { d.text = b + "%"; 100 === b && (s_oMain._onRemovePreloader(), d.visible = !1, f.visible = !1); l.graphics.clear(); b = Math.floor(b * a / 100); l.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(f.x, f.y, b, m) }; this._init() } function CMain(a) { var m, d = 0, f = 0, l = STATE_LOADING, g, c; this.initContainer = function() { s_oCanvas = document.getElementById("canvas"); s_oStage = new createjs.Stage(s_oCanvas); s_oStage.preventSelection = !1; createjs.Touch.enable(s_oStage); s_bMobile = isMobile(); !1 === s_bMobile && s_oStage.enableMouseOver(FPS); s_iPrevTime = (new Date).getTime(); createjs.Ticker.addEventListener("tick", this._update); createjs.Ticker.framerate = FPS; navigator.userAgent.match(/Windows Phone/i) && (DISABLE_SOUND_MOBILE = !0); s_oSpriteLibrary = new CSpriteLibrary; g = new CPreloader; s_oLocalStorage = new CLocalStorage(GAME_NAME) }; this.preloaderReady = function() { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || this._initSounds(); this._loadImages(); m = !0 }; this.soundLoaded = function() { d++; g.refreshLoader(Math.floor(d / f * 100)) }; this._initSounds = function() { Howler.mute(!s_bAudioActive); s_aSoundsInfo = []; s_aSoundsInfo.push({ path: "./sounds/", filename: "soundtrack", loop: !0, volume: 1, ingamename: "soundtrack" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "press_button", loop: !1, volume: 1, ingamename: "click" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "game_over", loop: !1, volume: 1, ingamename: "game_over" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "start_game", loop: !1, volume: 1, ingamename: "start_game" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "launch", loop: !1, volume: 1, ingamename: "launch" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "toggle", loop: !1, volume: 1, ingamename: "toggle" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "gate", loop: !1, volume: 1, ingamename: "gate" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "bumper", loop: !1, volume: 1, ingamename: "bumper" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "jumper", loop: !1, volume: 1, ingamename: "jumper" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "pinball_button_on", loop: !1, volume: 1, ingamename: "pinball_button_on" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "pinball_button_off", loop: !1, volume: 1, ingamename: "pinball_button_off" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "in_hole", loop: !1, volume: 1, ingamename: "in_hole" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "out_hole", loop: !1, volume: 1, ingamename: "out_hole" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "flipper", loop: !1, volume: 1, ingamename: "flipper" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "all_letters_complete", loop: !1, volume: 1, ingamename: "all_letters_complete" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "all_lights_on_1", loop: !1, volume: 1, ingamename: "all_lights_on_1" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "all_lights_on_2", loop: !1, volume: 1, ingamename: "all_lights_on_2" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "letter", loop: !1, volume: 1, ingamename: "letter" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "bonus_win_1", loop: !1, volume: 1, ingamename: "bonus_win_1" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "bonus_win_2", loop: !1, volume: 1, ingamename: "bonus_win_2" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "ball_out", loop: !1, volume: 1, ingamename: "ball_out" }); f += s_aSoundsInfo.length; s_aSounds = []; for (var n = 0; n < s_aSoundsInfo.length; n++) this.tryToLoadSound(s_aSoundsInfo[n], !1) }; this.tryToLoadSound = function(n, b) { setTimeout(function() { s_aSounds[n.ingamename] = new Howl({ src: [n.path + n.filename + ".mp3"], autoplay: !1, preload: !0, loop: n.loop, volume: n.volume, onload: s_oMain.soundLoaded, onloaderror: function(k, e) { for (var p = 0; p < s_aSoundsInfo.length; p++) if (0 < s_aSounds[s_aSoundsInfo[p].ingamename]._sounds.length && k === s_aSounds[s_aSoundsInfo[p].ingamename]._sounds[0]._id) { s_oMain.tryToLoadSound(s_aSoundsInfo[p], !0); break } else document.querySelector("#block_game").style.display = "none" }, onplayerror: function(k) { for (var e = 0; e < s_aSoundsInfo.length; e++) if (k === s_aSounds[s_aSoundsInfo[e].ingamename]._sounds[0]._id) { s_aSounds[s_aSoundsInfo[e].ingamename].once("unlock", function() { s_aSounds[s_aSoundsInfo[e].ingamename].play(); "soundtrack" === s_aSoundsInfo[e].ingamename && null !== s_oGame && setVolume("soundtrack", SOUNDTRACK_VOLUME_IN_GAME) }); break } } }) }, b ? 200 : 0) }; this._loadImages = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("but_play", "./sprites/but_play.png"); s_oSpriteLibrary.addSprite("msg_box", "./sprites/msg_box.png"); s_oSpriteLibrary.addSprite("credits_panel", "./sprites/credits_panel.png"); s_oSpriteLibrary.addSprite("ctl_logo", "./sprites/ctl_logo.png"); s_oSpriteLibrary.addSprite("but_credits", "./sprites/but_credits.png"); s_oSpriteLibrary.addSprite("but_yes", "./sprites/but_yes.png"); s_oSpriteLibrary.addSprite("but_no", "./sprites/but_no.png"); s_oSpriteLibrary.addSprite("score_panel", "./sprites/score_panel.png"); s_oSpriteLibrary.addSprite("keys", "./sprites/keys.png"); s_oSpriteLibrary.addSprite("but_restart", "./sprites/but_restart.png"); s_oSpriteLibrary.addSprite("but_home", "./sprites/but_home.png"); s_oSpriteLibrary.addSprite("hand_anim", "./sprites/hand_anim.png"); s_oSpriteLibrary.addSprite("bg_menu", "./sprites/bg_menu.jpg"); s_oSpriteLibrary.addSprite("but_settings", "./sprites/but_settings.png"); s_oSpriteLibrary.addSprite("but_exit", "./sprites/but_exit.png"); s_oSpriteLibrary.addSprite("audio_icon", "./sprites/audio_icon.png"); s_oSpriteLibrary.addSprite("but_fullscreen", "./sprites/but_fullscreen.png"); s_oSpriteLibrary.addSprite("bestscore", "./sprites/bestscore.png"); s_oSpriteLibrary.addSprite("extra_ball", "./sprites/extra_ball.png"); s_oSpriteLibrary.addSprite("star", "./sprites/star.png"); s_oSpriteLibrary.addSprite("pinball_bg", "./sprites/pinball_elements/pinball_bg.jpg"); s_oSpriteLibrary.addSprite("multiplier_light", "./sprites/pinball_elements/multiplier_light.png"); s_oSpriteLibrary.addSprite("multiplier_toggle_light", "./sprites/pinball_elements/multiplier_toggle_light.png"); s_oSpriteLibrary.addSprite("bumper", "./sprites/pinball_elements/bumper.png"); s_oSpriteLibrary.addSprite("bumper_button", "./sprites/pinball_elements/bumper_button.png"); s_oSpriteLibrary.addSprite("capsule_0", "./sprites/pinball_elements/capsule_0.png"); s_oSpriteLibrary.addSprite("capsule_1", "./sprites/pinball_elements/capsule_1.png"); s_oSpriteLibrary.addSprite("capsule_2", "./sprites/pinball_elements/capsule_2.png"); s_oSpriteLibrary.addSprite("capsule_3", "./sprites/pinball_elements/capsule_3.png"); for (var n = 0; 6 > n; n++) s_oSpriteLibrary.addSprite("button_light_" + n, "./sprites/pinball_elements/button_light_" + n + ".png"); s_oSpriteLibrary.addSprite("curve_light_button", "./sprites/pinball_elements/curve_light_button.png"); s_oSpriteLibrary.addSprite("light_indicator_0", "./sprites/pinball_elements/light_indicator_0.png"); s_oSpriteLibrary.addSprite("light_indicator_1", "./sprites/pinball_elements/light_indicator_1.png"); s_oSpriteLibrary.addSprite("light_indicator_2", "./sprites/pinball_elements/light_indicator_2.png"); for (n = 0; 7 > n; n++) s_oSpriteLibrary.addSprite("router_light_" + n, "./sprites/pinball_elements/router_light_" + n + ".png"); s_oSpriteLibrary.addSprite("curve_tunnel", "./sprites/pinball_elements/curve_tunnel.png"); s_oSpriteLibrary.addSprite("eye", "./sprites/pinball_elements/eye.png"); s_oSpriteLibrary.addSprite("arrow_light_0", "./sprites/pinball_elements/arrow_light_0.png"); s_oSpriteLibrary.addSprite("arrow_light_1", "./sprites/pinball_elements/arrow_light_1.png"); for (n = 0; 7 > n; n++) s_oSpriteLibrary.addSprite("letter_" + n, "./sprites/pinball_elements/letter_" + n + ".png"); s_oSpriteLibrary.addSprite("logo", "./sprites/pinball_elements/logo.png"); s_oSpriteLibrary.addSprite("jackpot", "./sprites/pinball_elements/jackpot.png"); s_oSpriteLibrary.addSprite("tunnel_start", "./sprites/pinball_elements/tunnel_start.png"); s_oSpriteLibrary.addSprite("arrow_start", "./sprites/pinball_elements/arrow_start.png"); s_oSpriteLibrary.addSprite("start_platform", "./sprites/pinball_elements/start_platform.png"); s_oSpriteLibrary.addSprite("spring", "./sprites/pinball_elements/spring.png"); s_oSpriteLibrary.addSprite("flipper_bumper", "./sprites/pinball_elements/flipper_bumper.png"); s_oSpriteLibrary.addSprite("hole", "./sprites/pinball_elements/hole.png"); s_oSpriteLibrary.addSprite("shield", "./sprites/pinball_elements/shield.png"); s_oSpriteLibrary.addSprite("jumper", "./sprites/pinball_elements/jumper.png"); s_oSpriteLibrary.addSprite("safe_pin", "./sprites/pinball_elements/safe_pin.png"); s_oSpriteLibrary.addSprite("gate", "./sprites/pinball_elements/gate.png"); s_oSpriteLibrary.addSprite("ball", "./sprites/pinball_elements/ball.png"); s_oSpriteLibrary.addSprite("flipper", "./sprites/pinball_elements/flipper.png"); f += s_oSpriteLibrary.getNumSprites(); s_oSpriteLibrary.loadSprites() }; this._onImagesLoaded = function() { d++; g.refreshLoader(Math.floor(d / f * 100)) }; this._onAllImagesLoaded = function() {}; this._onRemovePreloader = function() { g.unload(); s_oSoundtrack = playSound("soundtrack", 1, !0); this.gotoMenu() }; this.gotoMenu = function() { new CMenu; l = STATE_MENU }; this.gotoGame = function() { c = new CGame(h); l = STATE_GAME }; this.gotoHelp = function() { new CHelp; l = STATE_HELP }; this.stopUpdate = function() { m = !1; createjs.Ticker.paused = !0; $("#block_game").css("display", "block"); Howler.mute(!0) }; this.startUpdate = function() { s_iPrevTime = (new Date).getTime(); m = !0; createjs.Ticker.paused = !1; $("#block_game").css("display", "none"); s_bAudioActive && Howler.mute(!1) }; this._update = function(n) { if (!1 !== m) { var b = (new Date).getTime(); s_iTimeElaps = b - s_iPrevTime; s_iCntTime += s_iTimeElaps; s_iCntFps++; s_iPrevTime = b; 1E3 <= s_iCntTime && (s_iCurFps = s_iCntFps, s_iCntTime -= 1E3, s_iCntFps = 0); l === STATE_GAME && c.update(); s_oStage.update(n) } }; s_oMain = this; var h = a; ENABLE_FULLSCREEN = a.fullscreen; ENABLE_CHECK_ORIENTATION = a.check_orientation; s_bAudioActive = a.audio_enable_on_startup; this.initContainer() } var s_bMobile, s_bAudioActive = !1, s_iCntTime = 0, s_iTimeElaps = 0, s_iPrevTime = 0, s_iCntFps = 0, s_iCurFps = 0, s_bFullscreen = !1, s_aSounds = [], s_aSoundsInfo = [], s_oDrawLayer, s_oStage, s_oMain, s_oSpriteLibrary, s_oSoundtrack, s_oCanvas, s_oLocalStorage; function CTextButton(a, m, d, f, l, g, c, h) { var n, b, k, e, p, u, t; this._init = function(q, x, r, C, I, z, y) { n = []; b = []; k = []; var K = createBitmap(r); p = new createjs.Text(C, y + "px " + I, z); p.textAlign = "center"; p.textBaseline = "middle"; p.getBounds(); p.x = r.width / 2; p.y = Math.floor(r.height / 2); e = new createjs.Container; e.x = q; e.y = x; e.regX = r.width / 2; e.regY = r.height / 2; e.addChild(K, p); w.addChild(e); s_bMobile || (e.cursor = "pointer"); this._initListener() }; this.unload = function() { e.off("mousedown", u); e.off("pressup", t); w.removeChild(e) }; this.setVisible = function(q) { e.visible = q }; this._initListener = function() { oParent = this; u = e.on("mousedown", this.buttonDown); t = e.on("pressup", this.buttonRelease) }; this.addEventListener = function(q, x, r) { b[q] = x; k[q] = r }; this.buttonRelease = function() { e.scaleX = 1; e.scaleY = 1; playSound("click", 1, !1); b[ON_MOUSE_UP] && b[ON_MOUSE_UP].call(k[ON_MOUSE_UP], n[ON_MOUSE_UP]) }; this.buttonDown = function() { e.scaleX = .9; e.scaleY = .9; b[ON_MOUSE_DOWN] && b[ON_MOUSE_DOWN].call(k[ON_MOUSE_DOWN], n[ON_MOUSE_DOWN]) }; this.addEventListenerWithParams = function(q, x, r, C) { b[q] = x; k[q] = r; n[q] = C }; this.setTextPosition = function(q) { p.y = q }; this.setPosition = function(q, x) { e.x = q; e.y = x }; this.setX = function(q) { e.x = q }; this.setY = function(q) { e.y = q }; this.getButtonImage = function() { return e }; this.getX = function() { return e.x }; this.getY = function() { return e.y }; var w = h; this._init(a, m, d, f, l, g, c); return this } function CToggle(a, m, d, f, l) { var g, c, h, n, b, k, e; this._init = function(p, u, t, w, q) { b = []; k = []; var x = new createjs.SpriteSheet({ images: [t], frames: { width: t.width / 2, height: t.height, regX: t.width / 2 / 2, regY: t.height / 2 }, animations: { state_true: [0], state_false: [1] } }); g = w; e = createSprite(x, "state_" + g, t.width / 2 / 2, t.height / 2, t.width / 2, t.height); e.x = p; e.y = u; e.stop(); q.addChild(e); this._initListener() }; this.unload = function() { s_bMobile ? e.off("mousedown", c) : (e.off("mousedown", c), e.off("mouseover", n)); e.off("pressup", h); l.removeChild(e) }; this._initListener = function() { s_bMobile ? c = e.on("mousedown", this.buttonDown) : (c = e.on("mousedown", this.buttonDown), n = e.on("mouseover", this.buttonOver)); h = e.on("pressup", this.buttonRelease) }; this.addEventListener = function(p, u, t) { b[p] = u; k[p] = t }; this.addText = function() {}; this.setActive = function(p) { g = p; e.gotoAndStop("state_" + g) }; this.buttonRelease = function() { e.scaleX = 1; e.scaleY = 1; playSound("click", 1, !1); g = !g; e.gotoAndStop("state_" + g); b[ON_MOUSE_UP] && b[ON_MOUSE_UP].call(k[ON_MOUSE_UP], g) }; this.buttonDown = function() { e.scaleX = .9; e.scaleY = .9; b[ON_MOUSE_DOWN] && b[ON_MOUSE_DOWN].call(k[ON_MOUSE_DOWN]) }; this.buttonOver = function(p) { s_bMobile || (p.target.cursor = "pointer") }; this.setPosition = function(p, u) { e.x = p; e.y = u }; this.getButtonImage = function() { return e }; this._init(a, m, d, f, l) } function CGfxButton(a, m, d, f) { var l, g, c, h, n, b, k, e = [], p; this._init = function(t, w, q, x) { l = !1; g = 1; b = []; k = []; p = createBitmap(q); p.x = t; p.y = w; p.scaleX = p.scaleY = g; p.regX = q.width / 2; p.regY = q.height / 2; x.addChild(p); this._initListener() }; this.unload = function() { createjs.Tween.removeTweens(p); s_bMobile ? p.off("mousedown", c) : (p.off("mousedown", c), p.off("mouseover", n)); p.off("pressup", h); f.removeChild(p) }; this.setVisible = function(t) { p.visible = t }; this.setClickable = function(t) { l = !t }; this._initListener = function() { s_bMobile ? c = p.on("mousedown", this.buttonDown) : (c = p.on("mousedown", this.buttonDown), n = p.on("mouseover", this.buttonOver)); h = p.on("pressup", this.buttonRelease) }; this.addEventListener = function(t, w, q) { b[t] = w; k[t] = q }; this.addEventListenerWithParams = function(t, w, q, x) { b[t] = w; k[t] = q; e = x }; this.buttonRelease = function() { l || (p.scaleX = g, p.scaleY = g, b[ON_MOUSE_UP] && b[ON_MOUSE_UP].call(k[ON_MOUSE_UP], e)) }; this.buttonDown = function() { l || (p.scaleX = .9 * g, p.scaleY = .9 * g, playSound("click", 1, !1), b[ON_MOUSE_DOWN] && b[ON_MOUSE_DOWN].call(k[ON_MOUSE_DOWN], e)) }; this.buttonOver = function(t) { s_bMobile || l || (t.target.cursor = "pointer") }; this.pulseAnimation = function() { createjs.Tween.get(p, { loop: -1 }).to({ scaleX: 1.1 * g, scaleY: 1.1 * g }, 850, createjs.Ease.quadOut).to({ scaleX: g, scaleY: g }, 650, createjs.Ease.quadIn) }; this.trembleAnimation = function() { createjs.Tween.get(p).to({ rotation: 5 }, 75, createjs.Ease.quadOut).to({ rotation: -5 }, 140, createjs.Ease.quadIn).to({ rotation: 0 }, 75, createjs.Ease.quadIn).wait(750).call(function() { u.trebleAnimation() }) }; this.setPosition = function(t, w) { p.x = t; p.y = w }; this.setX = function(t) { p.x = t }; this.setY = function(t) { p.y = t }; this.getButtonImage = function() { return p }; this.getX = function() { return p.x }; this.getY = function() { return p.y }; var u = this; this._init(a, m, d, f); return this } function CMenu() { var a, m, d, f, l, g, c, h, n, b, k, e, p, u, t = null, w = null; this._init = function() { c = createBitmap(s_oSpriteLibrary.getSprite("bg_menu")); s_oStage.addChild(c); var q = s_oSpriteLibrary.getSprite("but_play"); h = new CGfxButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT - 300, q, s_oStage); h.addEventListener(ON_MOUSE_UP, this._onButPlayRelease, this); q = s_oSpriteLibrary.getSprite("but_credits"); l = q.width / 2 + 10; g = q.height / 2 + 10; k = new CGfxButton(l, g, q, s_oStage); k.addEventListener(ON_MOUSE_UP, this._onCreditsBut, this); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) q = s_oSpriteLibrary.getSprite("audio_icon"), d = CANVAS_WIDTH - q.width / 4 - 10, f = q.height / 2 + 10, b = new CToggle(d, f, q, s_bAudioActive, s_oStage), b.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); var x = window.document; q = x.documentElement; t = q.requestFullscreen || q.mozRequestFullScreen || q.webkitRequestFullScreen || q.msRequestFullscreen; w = x.exitFullscreen || x.mozCancelFullScreen || x.webkitExitFullscreen || x.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (t = !1); t && screenfull.isEnabled && (q = s_oSpriteLibrary.getSprite("but_fullscreen"), a = l + q.width / 2 + 10, m = q.height / 2 + 10, e = new CToggle(a, m, q, s_bFullscreen, s_oStage), e.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); q = s_oSpriteLibrary.getSprite("logo"); p = new CLightIndicator(q, CANVAS_WIDTH_HALF, CANVAS_HEIGHT_HALF - 100, s_oStage); u = []; for (x = 0; 7 > x; x++) q = s_oSpriteLibrary.getSprite("letter_" + x), q = new CLightIndicator(q, LETTERS_POSITION[x].x + -170, LETTERS_POSITION[x].y + -600, s_oStage), u.push(q); this.animLogo(); n = new createjs.Shape; n.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(n); createjs.Tween.get(n).to({ alpha: 0 }, 1E3).call(function() { n.visible = !1 }); this.refreshButtonPos(s_iOffsetX, s_iOffsetY); s_oLocalStorage.isUsed() || new CMsgBox(TEXT_IOS_PRIVATE) }; this.unload = function() { h.unload(); h = null; n.visible = !1; k.unload(); p.unload(); for (var q = 0; q < u.length; q++) u[q].unload(); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) b.unload(), b = null; t && screenfull.isEnabled && e.unload(); s_oStage.removeAllChildren(); s_oMenu = c = null }; this.refreshButtonPos = function(q, x) { k.setPosition(l + q, x + g); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || b.setPosition(d - q, x + f); t && screenfull.isEnabled && e.setPosition(a + q, m + x) }; this.animLogo = function() { p.slowHighlight(2E3, 0, function() {}); for (var q = 0; q < u.length; q++) u[q].slowHighlight(2E3, 1500, s_oMenu.animLogo) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onCreditsBut = function() { new CCreditsPanel }; this.resetFullscreenBut = function() { t && screenfull.isEnabled && e.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? w.call(window.document) : t.call(window.document.documentElement); sizeHandler() }; this._onButPlayRelease = function() { this.unload(); $(s_oMain).trigger("start_session"); s_oMain.gotoGame() }; s_oMenu = this; this._init() } var s_oMenu = null; function CGame(a) { function m(E) { E || (E = window.event); E.preventDefault(); switch (E.keyCode) { case 37: l = !0; c || (c = !0, p.shiftElementsToLeft(), playSound("flipper", 1, !1)); break; case 39: g = !0; c || (c = !0, p.shiftElementsToRight(), playSound("flipper", 1, !1)); break; case 40: c || (c = !0, s_oTable.loadSpring()) } } function d(E) { E || (E = window.event); E.preventDefault(); c = !1; switch (E.keyCode) { case 37: l = !1; break; case 39: g = !1; break; case 40: s_oTable.releaseSpring() } } var f, l, g, c, h, n, b, k, e = null, p, u, t, w, q, x, r, C, I, z, y, K, D, L, T; this._init = function() { n = h = c = g = l = f = !1; b = NUM_BALL; T = { x: LERP_SLOW.x, y: LERP_SLOW.y }; new CPhysicsController; new CObjectBuilder; new CSCoreController; u = s_oObjectBuilder.addBall(BALL_RADIUS, BALL_STARTPOS.x, BALL_STARTPOS.y, .1, .7, 0); z = new createjs.Container; z.scaleX = z.scaleY = ZOOM; s_oStage.addChild(z); y = new createjs.Container; z.addChild(y); K = new createjs.Container; z.addChild(K); q = new createjs.Shape; q.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(q); p = new CTable(y, K); L = { x: BALL_STARTPOS.x * ZOOM + CANVAS_WIDTH / 2, y: BALL_STARTPOS.y * ZOOM + CANVAS_HEIGHT / 2 }; var E = s_oSpriteLibrary.getSprite("ball"); t = createBitmap(E); t.regX = E.width / 2; t.regY = E.height / 2; y.addChild(t); D = new CPausePanel(s_oStage); k = new CInterface; k.refreshScore(0); s_oScoreController.addEventListener(ON_INCREASE_JACKPOT, s_oTable.onJackpotIncreased); s_oScoreController.addEventListener(ON_INCREASE_SCORE, k.refreshScore); E = s_oSpriteLibrary.getSprite("flipper"); C = createBitmap(E); C.x = 726; C.y = 1706; C.regX = E.width - 14; C.regY = 28; y.addChild(C); E = s_oSpriteLibrary.getSprite("flipper"); I = createBitmap(E); I.x = 326; I.y = 1706; I.regX = E.width - 14; I.regY = 28; I.scaleX = -1; y.addChild(I); p.activeShield(); if (s_bMobile) { E = s_oSpriteLibrary.getSprite("hand_anim"); var N = E.width / 5, U = E.height / 2; E = new createjs.SpriteSheet({ images: [E], frames: { width: N, height: U, regX: N / 2, regY: U / 2 }, animations: { start: [5, 9, "stop"], stop: [9, 9, "back", .02], back: [0, 4, "start"] } }); w = createSprite(E, "start", N / 2, U / 2, N, U); w.x = CANVAS_WIDTH_HALF; w.y = CANVAS_HEIGHT_HALF - 200; w.visible = !1; s_oStage.addChild(w) } new CHelpPanel; this.updateCamera() }; this.moveBall = function(E) { E = { x: E.localX / WORLD_SCALE, y: E.localY / WORLD_SCALE }; u.SetLinearVelocity({ x: 0, y: 0 }); u.SetAngularVelocity(0); u.SetPosition(E); u.SetActive(!1) }; this.releaseBall = function() { u.SetActive(!0) }; this._onPressDown = function(E) { f && (E.localX > CANVAS_WIDTH_HALF ? n && (g = !0, p.shiftElementsToRight()) : n && (l = !0, p.shiftElementsToLeft()), playSound("flipper", 1, !1), E.localY > SETTINGS_HEIGHT && s_oTable.loadSpring()) }; this._onPressUp = function(E) { if (f) { w.visible = !1; if (!1 === g && !0 === l || !0 === g && !1 === l) l = g = !1; E.localX > CANVAS_WIDTH_HALF ? g = !1 : l = !1; s_oTable.releaseSpring() } }; this.resetBallPos = function() { var E = { x: BALL_STARTPOS.x / WORLD_SCALE, y: BALL_STARTPOS.y / WORLD_SCALE }; setTimeout(function() { u.SetLinearVelocity({ x: 0, y: 0 }); u.SetAngularVelocity(0); u.SetPosition(E) }, 500) }; this.ballInGame = function(E) { n = E }; this.restartGame = function() { $(s_oMain).trigger("show_interlevel_ad"); s_oScoreController.resetScore(); s_oTable.reset(); s_oTable.unblockLaunch(); s_oTable.activeShield(); f = !0; b = NUM_BALL; k.resetBallRemaining() }; this.unload = function() { f = !1; k.unload(); null !== e && e.unload(); s_bMobile ? q.removeAllEventListeners() : (document.onkeydown = null, document.onkeyup = null); createjs.Tween.removeAllTweens(); s_oStage.removeAllChildren(); s_oPhysicsController.unload() }; this.setFlippers = function(E, N) { r = E; x = N }; this.setNewLaunch = function() { s_oGame.resetBallPos(); p.activeShield(); 0 === b && (f = !1, s_oTable.blockLaunch(), s_oGame.gameOver()) }; this.setExtraBall = function() { h = !0; k.activeExtraBallAnim(b - 1) }; this.isExtraBall = function() { return h }; this.launchBall = function(E) { u.SetActive(!0); u.ApplyImpulse({ x: -.001 + .002 * Math.random(), y: -E }, u.GetPosition()); T = LERP_FOLLOW_BALL }; this.onBallLaunched = function() { h ? (k.disableExtraBallAnim(), h = !1) : b-- }; this.onBallOut = function() { h ? (k.disableExtraBallAnim(), h = !1, s_oTable.resetOnExtraBall()) : (b--, 0 < b && k.refreshBallRemaining(b - 1), s_oTable.reset()); s_oGame.ballInGame(!1); T = LERP_SLOW; s_oTable.unblockLaunch(); s_oGame.setNewLaunch(); playSound("ball_out", 1, !1) }; this.getBall = function() { return u }; this.getBallSprite = function() { return t }; this.onExit = function() { $(s_oMain).trigger("end_session"); s_oGame.unload(); s_oMain.gotoMenu() }; this._onExitHelp = function() { f = !0; s_bMobile && (w.visible = !0); playSound("start_game", 1, !1); $(s_oMain).trigger("start_level", 1); s_bMobile ? (q.on("mousedown", this._onPressDown), q.on("pressup", this._onPressUp)) : (document.onkeydown = m, document.onkeyup = d) }; this.gameOver = function() { e = CEndPanel(s_oSpriteLibrary.getSprite("msg_box")); e.show(s_oScoreController.getScore()) }; this.onPause = function() { f = !1; D.show() }; this.onResume = function() { f = !0; D.hide() }; this.updateCamera = function() { var E = -u.GetPosition().x * ZOOM_PER_WORLDSCALE + CANVAS_WIDTH_HALF; var N = (-u.GetPosition().y * ZOOM_PER_WORLDSCALE + CANVAS_HEIGHT_HALF - L.y) * T.y; L.x += (E - L.x) * T.x; L.y += N; E = -(ZOOM_TABLE_SIZE.w - CANVAS_WIDTH + s_iOffsetX); L.x < E && (L.x = E); L.x > s_iOffsetX && (L.x = s_iOffsetX); E = -(ZOOM_TABLE_SIZE.h - CANVAS_HEIGHT + s_iOffsetY); L.y < E && (L.y = E); L.y > s_iOffsetY && (L.y = s_iOffsetY); z.x = L.x; z.y = L.y }; this.update = function() { f && (l ? x.SetMotorSpeed(FLIPPER_STRENGTH) : x.SetMotorSpeed(-FLIPPER_STRENGTH), g ? r.SetMotorSpeed(-FLIPPER_STRENGTH) : r.SetMotorSpeed(FLIPPER_STRENGTH), this.updateCamera(), s_oPhysicsController.update(L), s_oTable.update(), t.x = u.GetPosition().x * WORLD_SCALE, t.y = u.GetPosition().y * WORLD_SCALE, C.rotation = r.GetBodyA().GetAngle() * TODEGREE_PROPORTION, I.rotation = x.GetBodyA().GetAngle() * TODEGREE_PROPORTION, u.GetPosition().y > BALL_OUT_SAFE_LIMIT && (u.SetPosition({ x: u.GetPosition().x, y: u.GetPosition().y - BALL_OUT_SAFE_LIMIT / 2 }), s_oGame.onBallOut())) }; s_oGame = this; this._init() } var s_oGame; function CInterface() { var a, m, d, f, l, g, c, h, n, b, k, e, p, u, t, w, q, x, r, C = null, I = null; this._init = function() { var z, y = s_oSpriteLibrary.getSprite("but_exit"); c = CANVAS_WIDTH - y.width / 2 - 10; h = y.height / 2 + 10; p = new CGfxButton(c, h, y, s_oStage); p.addEventListener(ON_MOUSE_UP, this._onExit, this); l = z = c - y.width - 10; g = y.height / 2 + 10; if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) y = s_oSpriteLibrary.getSprite("audio_icon"), e = new CToggle(l, g, y, s_bAudioActive, s_oStage), e.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this), z = l - y.width / 2 - 10; y = window.document; var K = y.documentElement; C = K.requestFullscreen || K.mozRequestFullScreen || K.webkitRequestFullScreen || K.msRequestFullscreen; I = y.exitFullscreen || y.mozCancelFullScreen || y.webkitExitFullscreen || y.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (C = !1); C && screenfull.isEnabled && (y = s_oSpriteLibrary.getSprite("but_fullscreen"), d = z - 10, f = y.height / 2 + 10, u = new CToggle(d, f, y, s_bFullscreen, s_oStage), u.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); y = s_oSpriteLibrary.getSprite("but_settings"); r = new CGUIExpandible(c, h, y, s_oStage); r.addButton(p); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || r.addButton(e); C && screenfull.isEnabled && r.addButton(u); y = s_oSpriteLibrary.getSprite("score_panel"); a = y.width / 2 + 10; m = y.height / 2 + 10; w = new createjs.Container; w.x = a; w.y = m; s_oStage.addChild(w); z = createBitmap(y); z.regX = y.width / 2; z.regY = y.height / 2; w.addChild(z); y = s_oSpriteLibrary.getSprite("star"); z = createBitmap(y); z.x = -90; z.y = -16; z.regX = y.width / 2; z.regY = y.height / 2; z.scaleX = z.scaleY = .7; w.addChild(z); q = new createjs.Text(0, " 28px " + PRIMARY_FONT, PRIMARY_FONT_COLOUR); q.x = z.x + 28; q.y = z.y; q.textAlign = "left"; q.textBaseline = "middle"; q.lineWidth = 200; w.addChild(q); y = s_oSpriteLibrary.getSprite("ball"); n = z.x; b = z.y + 38; k = y.width / 2 + 4; t = []; for (z = 0; z < NUM_BALL - 1; z++) K = createBitmap(y), K.x = n + k * z, K.y = b, K.regX = y.width / 2, K.regY = y.height / 2, K.scaleX = K.scaleY = .5, w.addChild(K), t.push(K); y = s_oSpriteLibrary.getSprite("extra_ball"); x = createBitmap(y); x.regX = y.width / 2; x.regY = y.height / 2; x.alpha = 0; w.addChild(x); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.unload = function() { if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) e.unload(), e = null; C && screenfull.isEnabled && u.unload(); r.unload(); s_oInterface = null }; this.refreshButtonPos = function(z, y) { r.refreshPos(z, y); w.x = a + z; w.y = m + y }; this.refreshScore = function(z) { q.text = z.toLocaleString() }; this.refreshBallRemaining = function(z) { t[z].visible = !1 }; this.resetBallRemaining = function() { for (var z = 0; z < t.length; z++) t[z].visible = !0 }; this.activeExtraBallAnim = function(z) { x.x = n + z * k; x.y = b; x.alpha = 1; createjs.Tween.get(x, { loop: !0 }).to({ alpha: 0 }, 500).to({ alpha: 1 }, 500).wait(1E3) }; this.disableExtraBallAnim = function() { createjs.Tween.removeTweens(x); x.alpha = 0 }; this._onButHelpRelease = function() { _oHelpPanel = new CHelpPanel }; this._onButRestartRelease = function() { s_oGame.restartGame(); $(s_oMain).trigger("restart_level", 1) }; this.onExitFromHelp = function() { _oHelpPanel.unload() }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onExit = function() { new CAreYouSurePanel(s_oGame.onExit) }; this.resetFullscreenBut = function() { C && screenfull.isEnabled && u.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? I.call(window.document) : C.call(window.document.documentElement); sizeHandler() }; s_oInterface = this; this._init(); return this } var s_oInterface = null; function CHelpPanel() { var a, m, d, f; this._init = function() { d = new createjs.Shape; d.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); d.alpha = 1; d.on("mousedown", function() { l._onExitHelp() }); s_oStage.addChild(d); (new createjs.Tween.get(d)).to({ alpha: .7 }, 500); f = new createjs.Container; f.on("mousedown", function() { l._onExitHelp() }); s_oStage.addChild(f); var g = s_oSpriteLibrary.getSprite("msg_box"), c = createBitmap(g); c.regX = g.width / 2; c.regY = g.height / 2; f.addChild(c); f.x = CANVAS_WIDTH / 2; f.y = CANVAS_HEIGHT + g.height / 2; a = f.y; (new createjs.Tween.get(f)).to({ y: CANVAS_HEIGHT / 2 - 40 }, 500, createjs.Ease.cubicOut); if (s_bMobile) { g = s_oSpriteLibrary.getSprite("flipper"); c = createBitmap(g); c.x = 250; c.y = -80; c.regX = g.width - 7; c.regY = 14; c.scaleX = .5; c.scaleY = .5; f.addChild(c); g = s_oSpriteLibrary.getSprite("flipper"); var h = createBitmap(g); h.x = -250; h.y = -80; h.regX = g.width - 7; h.regY = 14; h.scaleX = -.5; h.scaleY = .5; f.addChild(h); createjs.Tween.get(h, { loop: !0 }).to({ rotation: -50 }, 100, createjs.Ease.cubicIn).wait(500 * Math.random()).to({ rotation: 0 }, 500, createjs.Ease.cubicIn); createjs.Tween.get(c, { loop: !0 }).to({ rotation: 50 }, 100, createjs.Ease.cubicIn).wait(500 * Math.random()).to({ rotation: 0 }, 500, createjs.Ease.cubicIn); g = 300; c = 70; new CTLText(f, -(g / 2), -110 - c / 2, g, c, 20, "center", PRIMARY_FONT_COLOUR, PRIMARY_FONT, 1.3, 2, 2, TEXT_HELP1_MOBILE, !0, !0, !0, !1) } else c = 80, new CTLText(f, -250, -110 - c / 2, 300, c, 20, "left", PRIMARY_FONT_COLOUR, PRIMARY_FONT, 1.3, 2, 2, TEXT_HELP1, !0, !0, !0, !1), g = s_oSpriteLibrary.getSprite("keys"), c = createBitmap(g), c.x = 130, c.y = -100, c.regX = g.width / 2, c.regY = g.height / 2, f.addChild(c); g = 400; c = 80; new CTLText(f, -(g / 2), 50 - c / 2, g, c, 20, "center", PRIMARY_FONT_COLOUR, PRIMARY_FONT, 1.3, 2, 2, TEXT_HELP2, !0, !0, !0, !1); g = s_oSpriteLibrary.getSprite("star"); c = createBitmap(g); c.regX = g.width / 2; c.regY = g.height / 2; c.y = 120; f.addChild(c) }; this.unload = function() { s_oStage.removeChild(d); s_oStage.removeChild(f); f.off("mousedown", function() { l._onExitHelp() }); d.off("mousedown", function() { l._onExitHelp() }) }; this._onExitHelp = function() { m || (m = !0, (new createjs.Tween.get(d)).to({ alpha: 0 }, 500), (new createjs.Tween.get(f)).to({ y: a }, 400, createjs.Ease.backIn).call(function() { l.unload(); s_oGame._onExitHelp() })) }; var l = this; this._init() } function CCreditsPanel() { var a, m, d, f, l, g, c; this._init = function() { m = new createjs.Shape; m.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); m.alpha = 0; s_oStage.addChild(m); createjs.Tween.get(m).to({ alpha: .7 }, 500); g = new createjs.Shape; g.graphics.beginFill("#0f0f0f").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); g.alpha = .01; c = g.on("click", this._onLogoButRelease); s_oStage.addChild(g); d = new createjs.Container; s_oStage.addChild(d); var h = s_oSpriteLibrary.getSprite("msg_box"), n = createBitmap(h); n.regX = h.width / 2; n.regY = h.height / 2; d.addChild(n); d.x = CANVAS_WIDTH / 2; d.y = CANVAS_HEIGHT + h.height / 2; a = d.y; createjs.Tween.get(d).to({ y: CANVAS_HEIGHT / 2 }, 500, createjs.Ease.quartIn); new CTLText(d, -200, 140, 400, 60, 40, "center", PRIMARY_FONT_COLOUR, PRIMARY_FONT, 1.3, 2, 2, "www.codethislab.com", !0, !0, !0, !1); h = s_oSpriteLibrary.getSprite("ctl_logo"); l = createBitmap(h); l.regX = h.width / 2; l.regY = h.height / 2; d.addChild(l); h = s_oSpriteLibrary.getSprite("but_exit"); f = new CGfxButton(270, -138, h, d); f.addEventListener(ON_MOUSE_UP, this.unload, this) }; this.unload = function() { g.off("click", c); f.setClickable(!1); createjs.Tween.get(m).to({ alpha: 0 }, 500); createjs.Tween.get(d).to({ y: a }, 400, createjs.Ease.backIn).call(function() { s_oStage.removeChild(m); s_oStage.removeChild(d); f.unload() }) }; this._onLogoButRelease = function() { window.open("https://www.codethislab.com/", "_blank") }; this._init() } function CAreYouSurePanel(a, m) { var d, f, l, g, c, h; this._init = function(b, k) { g = new createjs.Shape; g.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); g.alpha = 0; h = g.on("mousedown", function() {}); s_oStage.addChild(g); createjs.Tween.get(g).to({ alpha: .7 }, 500); c = new createjs.Container; s_oStage.addChild(c); var e = s_oSpriteLibrary.getSprite("credits_panel"), p = createBitmap(e); p.regX = e.width / 2; p.regY = e.height / 2; c.addChild(p); c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT + e.height / 2; d = c.y; createjs.Tween.get(c).to({ y: CANVAS_HEIGHT / 2 }, 500, createjs.Ease.quartIn); p = new createjs.Text(TEXT_ARE_SURE, " 34px " + PRIMARY_FONT, "#000000"); p.y = -e.height / 2 + 120; p.textAlign = "center"; p.textBaseline = "middle"; p.lineWidth = 400; p.outline = 5; c.addChild(p); e = new createjs.Text(TEXT_ARE_SURE, " 34px " + PRIMARY_FONT, PRIMARY_FONT_COLOUR); e.y = p.y; e.textAlign = "center"; e.textBaseline = "middle"; e.lineWidth = 400; c.addChild(e); f = new CGfxButton(110, 80, s_oSpriteLibrary.getSprite("but_yes"), c); f.addEventListener(ON_MOUSE_UP, this._onButYes, this); l = new CGfxButton(-110, 80, s_oSpriteLibrary.getSprite("but_no"), c); l.addEventListener(ON_MOUSE_UP, this._onButNo, this); l.pulseAnimation() }; this._onButYes = function() { l.setClickable(!1); f.setClickable(!1); createjs.Tween.get(g).to({ alpha: 0 }, 500); createjs.Tween.get(c).to({ y: d }, 400, createjs.Ease.backIn).call(function() { n.unload(); a && a() }) }; this._onButNo = function() { l.setClickable(!1); f.setClickable(!1); createjs.Tween.get(g).to({ alpha: 0 }, 500); createjs.Tween.get(c).to({ y: d }, 400, createjs.Ease.backIn).call(function() { n.unload(); m && m() }) }; this.unload = function() { l.unload(); f.unload(); s_oStage.removeChild(g); s_oStage.removeChild(c); g.off("mousedown", h) }; var n = this; this._init(a, m) } function CEndPanel(a) { var m, d, f, l, g, c, h, n, b, k; this._init = function(e) { h = new createjs.Shape; h.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); h.alpha = 0; k = h.on("mousedown", function() {}); s_oStage.addChild(h); createjs.Tween.get(h).to({ alpha: .7 }, 500); c = new createjs.Container; s_oStage.addChild(c); e = s_oSpriteLibrary.getSprite("msg_box"); var p = createBitmap(e); p.regX = e.width / 2; p.regY = e.height / 2; c.addChild(p); c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT + e.height / 2; m = c.y; d = new createjs.Container; d.y = -120; c.addChild(d); e = s_oSpriteLibrary.getSprite("bestscore"); p = createBitmap(e); p.regY = e.height / 2; d.addChild(p); f = new createjs.Text("0", " 38px " + PRIMARY_FONT, PRIMARY_FONT_COLOUR); f.x = p.x + e.width + 4; f.y = p.y; f.textAlign = "left"; f.textBaseline = "middle"; f.lineWidth = 200; d.addChild(f); l = new createjs.Container; l.y = -50; c.addChild(l); e = s_oSpriteLibrary.getSprite("star"); p = createBitmap(e); p.regY = e.height / 2; l.addChild(p); g = new createjs.Text("0", " 28px " + PRIMARY_FONT, PRIMARY_FONT_COLOUR); g.x = p.x + e.width + 4; g.y = p.y; g.textAlign = "left"; g.textBaseline = "middle"; g.lineWidth = 200; l.addChild(g); b = new CGfxButton(110, 80, s_oSpriteLibrary.getSprite("but_restart"), c); b.addEventListener(ON_MOUSE_UP, this._onRestart, this); b.pulseAnimation(); n = new CGfxButton(-110, 80, s_oSpriteLibrary.getSprite("but_home"), c); n.addEventListener(ON_MOUSE_UP, this._onExit, this) }; this.unload = function() { h.off("mousedown", k); s_oStage.removeChild(c); s_oStage.removeChild(h) }; this.show = function(e) { playSound("game_over", 1, !1); e > s_iTotalScore && (s_iTotalScore = e, s_oLocalStorage.saveData()); f.text = s_iTotalScore.toLocaleString(); d.regX = d.getBounds().width / 2; g.text = e.toLocaleString(); l.regX = l.getBounds().width / 2; createjs.Tween.get(c).to({ y: CANVAS_HEIGHT / 2 }, 500, createjs.Ease.quartIn); $(s_oMain).trigger("save_score", e, "DON'T FORGET TO SET THE MODE"); $(s_oMain).trigger("end_level", 1); var p = "You collected <strong>" + e + " points</strong>!<br><br>Share your score with your friends!", u = "My score is " + e + " points! Can you do better?"; $(s_oMain).trigger("share_event", e, "200x200.jpg", "Congratulations!", p, u) }; this._onRestart = function() { b.setClickable(!1); n.setClickable(!1); s_oGame.restartGame(); createjs.Tween.get(h).to({ alpha: 0 }, 500); createjs.Tween.get(c).to({ y: m }, 400, createjs.Ease.backIn).call(function() { s_oStage.removeChild(h); s_oStage.removeChild(c) }) }; this._onExit = function() { $(s_oMain).trigger("show_interlevel_ad"); s_oGame.onExit() }; this._init(a); return this } function CPhysicsController() { var a = Box2D.Common.Math.b2Vec2, m = Box2D.Dynamics.b2World, d = Box2D.Dynamics.b2DebugDraw, f, l, g = this, c, h, n; this.init = function() { f = new a(0, GRAVITY); l = new m(f, !0); c = []; h = []; if (DEBUG_BOX2D) { var b = document.createElement("canvas"); b.id = "debug"; b.width = s_oCanvas.width; b.height = s_oCanvas.height; b.style.position = "fixed"; document.body.appendChild(b); $("#debug").css("pointer-events", "none"); n = document.getElementById("debug").getContext("2d"); b = new d; b.SetSprite(n); b.SetDrawScale(WORLD_SCALE * ZOOM); b.SetFillAlpha(DEBUG_BOX2D_ALPHA); b.SetLineThickness(1); b.SetFlags(d.e_shapeBit); l.SetDebugDraw(b); sizeHandler() } this.createAContactListener() }; this.createAContactListener = function() { var b = new Box2D.Dynamics.b2ContactListener; b.BeginContact = function(k) { var e = k.GetFixtureA().GetUserData(), p = k.GetFixtureB().GetUserData(); s_oPhysicsController.processContactEvent(CONTACT_BEGIN, e, k); s_oPhysicsController.processContactEvent(CONTACT_BEGIN, p, k) }; b.EndContact = function(k) { var e = k.GetFixtureA().GetUserData(), p = k.GetFixtureB().GetUserData(); s_oPhysicsController.processContactEvent(CONTACT_END, e, k); s_oPhysicsController.processContactEvent(CONTACT_END, p, k) }; l.SetContactListener(b) }; this.destroyBodyVector = function(b) { l.DestroyBody(b) }; this.destroyAllBodies = function() { for (var b = l.GetBodyList(); b;) { var k = b; b = b.GetNext(); l.DestroyBody(k) } }; this.destroyAllJoints = function() { for (var b = l.GetJointList(); b;) { var k = b; b = b.GetNext(); l.DestroyJoint(k) } }; this.destroyAllContacts = function() { for (var b = l.GetContactList(); b;) { var k = b.GetNext(); l.DestroyJoint(k) } }; this.unload = function() { s_oPhysicsController.destroyAllJoints(); s_oPhysicsController.destroyAllBodies(); s_oPhysicsController.destroyAllContacts(); DEBUG_BOX2D && document.getElementById("debug").remove(); l = s_oPhysicsController = null }; this.processContactEvent = function(b, k, e) { k && k.contacttype === b && k.callback(k.params, e) }; this.startComputing = function(b) { b.GetBody().SetActive(!0) }; this.movePlayer = function(b, k, e) { k = { x: k / WORLD_SCALE, y: e / WORLD_SCALE }; b.GetBody().SetPosition(k) }; this.applyImpulse = function(b) { b.GetBody().ApplyImpulse({ x: .8, y: 1 }, b.GetBody().GetWorldCenter()) }; this.decreaseSpeedRotation = function(b) { var k = .99 * b.GetBody().GetAngularVelocity(); b.GetBody().SetAngularVelocity(k) }; this.getSpeedRotation = function(b) { return b.GetBody().GetAngularVelocity() }; this.moveObject = function(b, k, e) { k = { x: k / WORLD_SCALE, y: e / WORLD_SCALE }; b.GetBody().SetPosition(k) }; this.destroyBody = function(b) { l.DestroyBody(b.GetBody()) }; this.getInstance = function() { null === g && (g = new CPhysicsController); return g }; this.update = function(b) { l.Step(1 / FPS, 8, 8); DEBUG_BOX2D && (n.save(), n.clearRect(0, 0, s_oCanvas.width, s_oCanvas.height), n.translate(b.x, b.y), l.DrawDebugData(), n.restore()); l.ClearForces(); this._deactiveAllBodyInList(); this._activeAllBodyInList() }; this.getWorld = function() { return l }; this.getElementPosition = function(b) { var k = b.GetBody().GetPosition(); return { x: k.x * WORLD_SCALE, y: k.y * WORLD_SCALE, angle: 180 * b.GetBody().GetAngle() / Math.PI } }; this.getElementAngle = function(b) { return 180 * b.GetBody().GetAngle() / Math.PI }; this.enableBody = function(b, k) { h.push({ body: b, pos: k }) }; this.disableBody = function(b, k) { c.push({ body: b, pos: k }) }; this._deactiveAllBodyInList = function() { for (var b = 0; b < c.length; b++) c[b].body.SetActive(!1), c[b].pos && c[b].body.SetPosition({ x: c[b].pos.x / WORLD_SCALE, y: c[b].pos.y / WORLD_SCALE }); c = [] }; this._activeAllBodyInList = function() { for (var b = 0; b < h.length; b++) h[b].body.SetActive(!0), h[b].pos && h[b].body.SetPosition({ x: h[b].pos.x / WORLD_SCALE, y: h[b].pos.y / WORLD_SCALE }); h = [] }; this.init(); s_oPhysicsController = this } var s_oPhysicsController = null; function CObjectBuilder() { var a = Box2D.Common.Math.b2Vec2, m = Box2D.Dynamics.b2BodyDef, d = Box2D.Dynamics.b2Body, f = Box2D.Dynamics.b2FixtureDef, l = Box2D.Collision.Shapes.b2PolygonShape, g = Box2D.Collision.Shapes.b2CircleShape, c = Box2D.Dynamics.Joints.b2RevoluteJointDef, h, n; this.init = function() { n = s_oPhysicsController.getInstance(); h = n.getWorld() }; this.addButton = function(b, k, e, p, u, t, w, q, x) { var r = new f; r.density = t; r.friction = w; r.restitution = q; r.color = 16777215; r.userData = x; t = new m; t.type = d.b2_staticBody; r.shape = new l; r.shape.SetAsBox(b / 2 / WORLD_SCALE, k / 2 / WORLD_SCALE); t.position.Set(e / WORLD_SCALE, p / WORLD_SCALE); t.angle = u * Math.PI / 180; b = h.CreateBody(t); b.CreateFixture(r); return b }; this.addEdge = function(b, k, e, p, u, t) { var w = new f; w.density = p; w.friction = u; w.restitution = t; p = new m; p.type = d.b2_staticBody; w.shape = new l; b = new a(b.x / WORLD_SCALE, b.y / WORLD_SCALE); k = new a(k.x / WORLD_SCALE, k.y / WORLD_SCALE); w.shape.SetAsEdge(b, k); p.angle = e * Math.PI / 180; e = h.CreateBody(p); e.CreateFixture(w); return e }; this.addPolygon = function(b, k, e, p, u) { var t = new f; t.density = e; t.friction = p; t.restitution = u; e = new m; e.type = d.b2_staticBody; t.shape = new l; p = []; for (u = 0; u < b.length; u++) { var w = new a; w.Set(b[u].x / WORLD_SCALE, b[u].y / WORLD_SCALE); p.push(w) } t.shape.SetAsArray(p, p.length); e.angle = k * Math.PI / 180; h.CreateBody(e).CreateFixture(t) }; this.addBall = function(b, k, e, p, u, t) { var w = new f; w.density = p; w.friction = u; w.restitution = t; w.userData = { id: "ball" }; p = new m; p.type = d.b2_dynamicBody; w.shape = new g(b / WORLD_SCALE); p.allowSleep = !1; p.bullet = !0; p.position.x = k / WORLD_SCALE; p.position.y = e / WORLD_SCALE; b = h.CreateBody(p); b.CreateFixture(w); return b }; this.addCircle = function(b, k, e, p, u, t) { var w = new f; w.density = p; w.friction = u; w.restitution = t; p = new m; p.type = d.b2_dynamicBody; w.shape = new g(b / WORLD_SCALE); p.position.x = k / WORLD_SCALE; p.position.y = e / WORLD_SCALE; return h.CreateBody(p).CreateFixture(w) }; this.addStaticCircle = function(b, k, e, p, u, t, w) { var q = new f; q.density = p; q.friction = u; q.restitution = t; q.userData = w; p = new m; p.type = d.b2_staticBody; q.shape = new g(b / WORLD_SCALE); p.position.x = k / WORLD_SCALE; p.position.y = e / WORLD_SCALE; return h.CreateBody(p).CreateFixture(q) }; this.addRevoluteRectangle = function(b, k, e, p, u, t, w, q) { var x = new f; x.density = u; x.friction = t; x.restitution = w; u = new m; u.type = d.b2_dynamicBody; q && (u.angularVelocity = 3); x.shape = new l; x.shape.SetAsBox(b / WORLD_SCALE, k / WORLD_SCALE); u.position.Set(e / WORLD_SCALE, p / WORLD_SCALE); b = h.CreateBody(u); x = b.CreateFixture(x); k = new f; k.density = 3; k.friction = 1; k.restitution = .1; q = new m; q.type = d.b2_staticBody; k.shape = new g(10 / WORLD_SCALE); q.position.Set(e / WORLD_SCALE, p / WORLD_SCALE); e = h.CreateBody(q); p = e.CreateFixture(k); k = new c; k.Initialize(b, e, b.GetWorldCenter()); h.CreateJoint(k); return { fixture1: x, fixture2: p } }; this.addLeftFlipper = function(b, k, e, p, u, t) { var w = new f; w.density = p; w.friction = u; w.restitution = t; var q = new m; q.type = d.b2_dynamicBody; w.shape = new l; for (var x = [], r = 0; r < b.length; r++) { var C = new a; C.Set(b[r].x / WORLD_SCALE * -1, b[r].y / WORLD_SCALE); x.push(C) } w.shape.SetAsArray(x, x.length); q.position.Set(k / WORLD_SCALE, (e + 28) / WORLD_SCALE); b = h.CreateBody(q); b.CreateFixture(w); w = new f; w.density = p; w.friction = u; w.restitution = t; p = new m; p.type = d.b2_staticBody; w.shape = new g(11 / WORLD_SCALE); p.position.Set(k / WORLD_SCALE, e / WORLD_SCALE); k = h.CreateBody(p); k.CreateFixture(w); e = new c; p = { x: k.GetWorldCenter().x, y: k.GetWorldCenter().y }; e.Initialize(b, k, p); e.lowerAngle = 5 * Math.PI / 180; e.upperAngle = 50 * Math.PI / 180; e.enableLimit = !0; e.maxMotorTorque = 1E3; e.enableMotor = !0; k = h.CreateJoint(e); k.EnableMotor(!0); return k }; this.addRightFlipper = function(b, k, e, p, u, t) { var w = new f; w.density = p; w.friction = u; w.restitution = t; var q = new m; q.type = d.b2_dynamicBody; w.shape = new l; for (var x = [], r = 0; r < b.length; r++) { var C = new a; C.Set(b[r].x / WORLD_SCALE, b[r].y / WORLD_SCALE); x.push(C) } w.shape.SetAsArray(x, x.length); q.position.Set(k / WORLD_SCALE, (e + 28) / WORLD_SCALE); b = h.CreateBody(q); b.CreateFixture(w); w = new f; w.density = p; w.friction = u; w.restitution = t; p = new m; p.type = d.b2_staticBody; w.shape = new g(11 / WORLD_SCALE); p.position.Set(k / WORLD_SCALE, e / WORLD_SCALE); k = h.CreateBody(p); k.CreateFixture(w); e = new c; p = { x: k.GetWorldCenter().x, y: k.GetWorldCenter().y }; e.Initialize(b, k, p); e.lowerAngle = -50 * Math.PI / 180; e.upperAngle = -5 * Math.PI / 180; e.enableLimit = !0; e.maxMotorTorque = 1E3; e.enableMotor = !0; k = h.CreateJoint(e); k.EnableMotor(!0); return k }; this.addRectangle = function(b, k, e, p, u, t, w, q) { var x = new f; x.density = t; x.friction = w; x.restitution = q; t = new m; t.type = d.b2_staticBody; x.shape = new l; x.shape.SetAsBox(b / WORLD_SCALE, k / WORLD_SCALE); t.position.Set(e / WORLD_SCALE, p / WORLD_SCALE); t.angle = u * Math.PI / 180; return h.CreateBody(t).CreateFixture(x) }; this.init(); s_oObjectBuilder = this } var s_oObjectBuilder = null, EDGE_FRAME = "edge_frame", TOP_CHANNELLERS = "top_channellers", LEFT_ROUTER = "left_router", BOT_CHANNELLERS = "bot_channellers", FLIPPER_BUMPER = "flipper_bumper", RIGHT_CHANNELLER = "right_channeller", CIRCLE_BUMPER = "circle_bumper", PLATFORM = "platforms", CENTERSAFE = "centersafe", FLIPPER = "flipper"; function CTable(a, m) { var d, f, l, g, c, h, n, b, k, e, p, u; this._init = function(t, w) { var q = s_oSpriteLibrary.getSprite("pinball_bg"); d = q.width; f = q.height; l = createBitmap(q); l.alpha = 1; t.addChild(l); ZOOM_TABLE_SIZE = { w: d * ZOOM, h: f * ZOOM }; u = new CModuleStart(t, w); g = new CModuleMultiplier(t, w); c = new CModuleBumper(t, w); h = new CModuleHole(t, w); n = new CModuleRouter(t, w); b = new CModuleLetters(t, w); k = new CModuleJumper(t, w); e = new CModuleJackpot(t, w); p = new CModuleShield(t, w); this._buildTable(); this._addCheckPoints() }; this._buildTable = function() { for (var t = TileMaps.levelsettings.layers, w = GENERAL_RESTITUTION, q = 0; q < t.length; q++) if ("objectgroup" === t[q].type) { var x = t[q].objects; switch (t[q].name) { case EDGE_FRAME: this._addShapes(x, 0); break; case CENTERSAFE: var r = t[q].objects[0], C = this.getAdjustedPoints(0, 0, [{ x: r.x, y: r.y }]); s_oObjectBuilder.addStaticCircle(r.width / 2, C[0].x + r.width / 2, C[0].y + r.width / 2, 0, 0, .75); C = createBitmap(s_oSpriteLibrary.getSprite("safe_pin")); C.x = r.x; C.y = r.y; a.addChild(C); break; case TOP_CHANNELLERS: for (r = 0; r < x.length; r++) this._addPolygons(x[r], 3 * w / 2); break; case LEFT_ROUTER: this._addShapes(x, 0); break; case BOT_CHANNELLERS: for (r = 0; r < x.length; r++) x[r].ellipse ? (C = this.getAdjustedPoints(0, 0, [{ x: x[r].x, y: x[r].y }]), s_oObjectBuilder.addStaticCircle(x[r].width / 2, C[0].x + x[r].width / 2, C[0].y + x[r].width / 2, 0, 0, 0)) : this._addPolygons(x[r], w / 2); break; case FLIPPER_BUMPER: c.buildFlipperBumper(x); break; case CIRCLE_BUMPER: c.buildCircularBumper(x); break; case RIGHT_CHANNELLER: for (r = 0; r < x.length; r++) this._addPolygons(x[r], .7); break; case FLIPPER: x = t[q].objects, C = x[0], C = this.getAdjustedPoints(0, 0, C.polygon), r = s_oObjectBuilder.addRightFlipper(C, 726, 1706, 1, 0, w), x = t[q].objects, C = x[0], C = this.getAdjustedPoints(0, 0, C.polygon), C = s_oObjectBuilder.addLeftFlipper(C.reverse(), 326, 1706, 1, 0, w), s_oGame.setFlippers(r, C) } } }; this._addPolygons = function(t, w) { var q = this.getAdjustedPoints(t.x, t.y, t.polygon); s_oObjectBuilder.addPolygon(q, 0, 1, GENERAL_FRICTION, w) }; this._addShapes = function(t, w) { for (var q = 0; q < t.length; q++) for (var x = this.getAdjustedPoints(t[q].x, t[q].y, t[q].polyline), r = 0; r < x.length - 1; r++) s_oObjectBuilder.addEdge({ x: x[r].x, y: x[r].y }, { x: x[r + 1].x, y: x[r + 1].y }, 0, 1, GENERAL_FRICTION, w) }; this._addCheckPoints = function() { var t = 140, w = 1460, q = s_oSpriteLibrary.getSprite("button_light_0"); q = new CLightIndicator(q, t, w, a); q = { contacttype: CONTACT_END, callback: this._onCheckPoint, params: q }; s_oObjectBuilder.addButton(8, 40, t, w, 0, 0, 0, 0, q).GetFixtureList().SetSensor(!0); t = 936; w = 1460; q = s_oSpriteLibrary.getSprite("button_light_0"); q = new CLightIndicator(q, t, w, a); q = { contacttype: CONTACT_END, callback: this._onCheckPoint, params: q }; s_oObjectBuilder.addButton(8, 40, t, w, 0, 0, 0, 0, q).GetFixtureList().SetSensor(!0); t = 56; w = 1460; q = s_oSpriteLibrary.getSprite("button_light_1"); q = new CLightIndicator(q, t, w, a); q = { contacttype: CONTACT_END, callback: this._onCheckPoint, params: q }; t = s_oObjectBuilder.addButton(8, 40, t, w, 0, 0, 0, 0, q); t.GetFixtureList().SetSensor(!0); t = 1016; w = 1460; q = s_oSpriteLibrary.getSprite("button_light_1"); q = new CLightIndicator(q, t, w, a); q = { contacttype: CONTACT_END, callback: this._onCheckPoint, params: q }; s_oObjectBuilder.addButton(8, 40, t, w, 0, 0, 0, 0, q).GetFixtureList().SetSensor(!0); q = { contacttype: CONTACT_END, callback: s_oGame.onBallOut, params: "checkpoint" }; t = s_oObjectBuilder.addButton(320, 8, 520, 1900, 0, 0, 0, 0, q); t.GetFixtureList().SetSensor(!0) }; this._onCheckPoint = function(t) { playSound("toggle", 1, !1); s_oScoreController.addButtonScore(); t.flashing() }; this.resetOnExtraBall = function() { e.reset() }; this.reset = function() { s_oScoreController.resetJackpot(); s_oScoreController.resetMultiplier(); s_oScoreController.resetCircleBumperLevel(); g.reset(); c.reset(); n.reset(); h.reset(); b.reset(); k.reset(); e.reset(); p.reset() }; this.stopLogoAnim = function() { b.stopAnimLogo() }; this.blockLaunch = function() { u.block() }; this.unblockLaunch = function() { u.unBlock(); u.startLighting(); b.animLogo() }; this.loadSpring = function() { u.loadSpring() }; this.releaseSpring = function() { u.releaseSpring() }; this.shiftElementsToRight = function() { g.shiftElementsToRight(); k.shiftElementsToRight() }; this.shiftElementsToLeft = function() { g.shiftElementsToLeft(); k.shiftElementsToLeft() }; this.enableShieldBonus = function() { h.activeShieldLight() }; this.activeShield = function() { p.enableShield() }; this.enableExtraBallBonus = function() { h.activeExtraBallLight() }; this.activeExtraBall = function() { s_oGame.setExtraBall() }; this.enableJackpot = function() { e.enableJackpot() }; this.onJackpotIncreased = function(t) { e.setJackpotAmount(t) }; this.getTableSize = function() { return { w: d, h: f } }; this.getAdjustedPoints = function(t, w, q) { for (var x = [], r = 0; r < q.length; r++) x[r] = { x: l.x + t + q[r].x, y: l.y + w + q[r].y }; return x }; this.update = function() { e.update(); n.update(); b.update() }; s_oTable = this; this._init(a, m) } var s_oTable; (function(a, m) { "undefined" === typeof onTileMapLoaded ? ("undefined" === typeof TileMaps && (TileMaps = {}), TileMaps[a] = m) : onTileMapLoaded(a, m); "object" === typeof module && module && module.exports && (module.exports = m) })("levelsettings", { height: 1, infinite: !1, layers: [{ data: [0], height: 1, name: "Livello tile 1", opacity: 1, type: "tilelayer", visible: !0, width: 1, x: 0, y: 0 }, { image: "../sprites/pinball_reference(old).jpg", name: "Livello immagine 1", opacity: .5, type: "imagelayer", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "edge_frame", objects: [{ height: 0, id: 32, name: "outer", polyline: [{ x: 0, y: 0 }, { x: -.333334, y: -1260.334 }, { x: -4.33334, y: -1320.334 }, { x: -10.33334, y: -1369.666 }, { x: -20.3334, y: -1419.666 }, { x: -33.6666, y: -1459 }, { x: -50.3334, y: -1496.334 }, { x: -77.6666, y: -1549 }, { x: -115, y: -1594.334 }, { x: -153.6666, y: -1633.666 }, { x: -210.334, y: -1685 }, { x: -241.666, y: -1709.666 }, { x: -295, y: -1735 }, { x: -345, y: -1755.666 }, { x: -398.334, y: -1768.334 }, { x: -451, y: -1776.334 }, { x: -501, y: -1779 }, { x: -549, y: -1781 }, { x: -605, y: -1775 }, { x: -661, y: -1767 }, { x: -713, y: -1753 }, { x: -757, y: -1735 }, { x: -811, y: -1711 }, { x: -857, y: -1683 }, { x: -899, y: -1651 }, { x: -949, y: -1607 }, { x: -989, y: -1563 }, { x: -1027, y: -1517 }, { x: -1055, y: -1465 }, { x: -1075, y: -1411 }, { x: -1089, y: -1349 }, { x: -1099, y: -1281 }, { x: -1098.334, y: -613 }, { x: -1025.668, y: -541 }, { x: -1025.666, y: -511.666 }, { x: -1102.334, y: -434.334 }, { x: -1103, y: -115 }, { x: -1093, y: -96.3334 }, { x: -1082.334, y: -87 }, { x: -786.334, y: 51 }, { x: -786.334, y: 96.3334 } ], rotation: 0, type: "", visible: !0, width: 0, x: 1127, y: 1805 }, { height: 0, id: 33, name: "inner", polyline: [{ x: 53.3334, y: 0 }, { x: 0, y: 0 }, { x: -1.333334, y: -1218.666 }, { x: -5.33334, y: -1308.666 }, { x: -24, y: -1405.334 }, { x: -58, y: -1486.666 }, { x: -84.6666, y: -1529.334 }, { x: -106.6666, y: -1552.666 }, { x: -164, y: -1606 }, { x: -188, y: -1602.666 }, { x: -200, y: -1592 }, { x: -198, y: -1515.334 }, { x: -188, y: -1503.334 }, { x: -124.6666, y: -1502.666 }, { x: -37, y: -1127.666 }, { x: -48.8334, y: -1090.334 }, { x: -106.9166, y: -942.25 }, { x: -110.8126, y: -931.48 }, { x: -113.7084, y: -921.708 }, { x: -116.5, y: -911.166 }, { x: -118.9166, y: -900.834 }, { x: -121.875, y: -889.916 }, { x: -123.8334, y: -879 }, { x: -126.2916, y: -867.25 }, { x: -128.25, y: -856 }, { x: -129.6666, y: -842.5 }, { x: -128.6666, y: -584 }, { x: -123.3334, y: -568.666 }, { x: -11.33334, y: -452 }, { x: -11.33334, y: -157.3334 }, { x: -22, y: -121.3334 }, { x: -36.6666, y: -103.3334 }, { x: -360, y: 46 }, { x: -359.334, y: 95.3334 } ], rotation: 0, type: "", visible: !0, width: 0, x: 1060, y: 1805.334 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "left_router", objects: [{ height: 0, id: 50, name: "router_head", polyline: [{ x: 0, y: 0 }, { x: 50, y: 14 }, { x: 48, y: 88 }], rotation: 0, type: "", visible: !0, width: 0, x: 290, y: 198 }, { height: 0, id: 53, name: "router_tail", polyline: [{ x: 181, y: 0 }, { x: 131, y: 44 }, { x: 91, y: 88 }, { x: 53, y: 134 }, { x: 25, y: 186 }, { x: 5, y: 240 }, { x: 0, y: 291 }, { x: 9, y: 339 }, { x: 34.6666, y: 403.666 }, { x: 43.3334, y: 380.334 }, { x: 51.3334, y: 359 }, { x: 62.6666, y: 332.334 }, { x: 78, y: 302.334 }, { x: 94, y: 274.334 }, { x: 116, y: 244.334 }, { x: 148.6666, y: 201.666 }, { x: 185.3334, y: 156 }, { x: 229.334, y: 89.3334 }], rotation: 0, type: "", visible: !0, width: 0, x: 108, y: 198 }, { height: 0, id: 95, name: "fork_right", polyline: [{ x: 33, y: -37 }, { x: 32, y: -18 }, { x: 31, y: 2 }, { x: 31, y: 32 }, { x: 31, y: 56 }, { x: 31, y: 86 }, { x: 31, y: 111 }, { x: 30, y: 145 }, { x: 30, y: 181 }, { x: 31, y: 211 }, { x: 42, y: 244 }, { x: 63, y: 274 }, { x: 103, y: 313 }, { x: 123.6666, y: 338.334 }, { x: 144, y: 368.666 }, { x: 160.6668, y: 394.666 }, { x: 172.6668, y: 423.666 }, { x: 177.3334, y: 449 }, { x: 175.3334, y: 473.334 }, { x: 167.6666, y: 506.666 }, { x: 161.6668, y: 474.334 }, { x: 144.6666, y: 437.334 }, { x: 125, y: 408.334 }, { x: 102.6666, y: 381.666 }, { x: 84, y: 362 }, { x: 60, y: 339 }, { x: 37, y: 317 }, { x: 15, y: 295 }, { x: -8, y: 267 }, { x: -16, y: 242 }, { x: -20, y: 208 }, { x: -19, y: 182 }, { x: -21, y: 146 }, { x: -20, y: 118 }, { x: -20, y: 89 }, { x: -20, y: 58 }, { x: -16, y: -39 } ], rotation: 0, type: "", visible: !0, width: 0, x: 419, y: 337 }, { height: 0, id: 96, name: "fork_left", polyline: [{ x: 0, y: 0 }, { x: -3, y: 18 }, { x: -11, y: 30 }, { x: -20, y: 40 }, { x: -30, y: 61 }, { x: -42, y: 80 }, { x: -53, y: 99 }, { x: -64, y: 113 }, { x: -79, y: 130 }, { x: -94, y: 150 }, { x: -113, y: 176 }, { x: -127, y: 197 }, { x: -139, y: 219 }, { x: -149, y: 236 }, { x: -160, y: 256 }, { x: -173, y: 280 }, { x: -188, y: 308 }, { x: -204.5, y: 338.5 }, { x: -218, y: 370.334 }, { x: -228.334, y: 406.666 }, { x: -227.668, y: 435 }, { x: -225, y: 456.666 }, { x: -219.334, y: 474.5 }, { x: -209.5, y: 494.668 }, { x: -181, y: 529 }, { x: -186, y: 503 }, { x: -185, y: 463.332 }, { x: -177, y: 434.332 }, { x: -167.3332, y: 408.334 }, { x: -150.3334, y: 372 }, { x: -129, y: 334.666 }, { x: -111.2552, y: 305.252 }, { x: -93, y: 279 }, { x: -75, y: 251 }, { x: -65, y: 231 }, { x: -54, y: 201 }, { x: -34, y: 173 }, { x: -23, y: 149 }, { x: -4, y: 126 }, { x: 11, y: 110 }, { x: 31, y: 84 }, { x: 37, y: 71 }, { x: 47, y: 44 }, { x: 48, y: 20 }, { x: 50, y: 4 } ], rotation: 0, type: "", visible: !0, width: 0, x: 401, y: 313 }, { height: 0, id: 97, name: "curve_top", polyline: [{ x: -8, y: -5 }, { x: 10, y: -33 }, { x: 23, y: -45 }, { x: 35, y: -52 }, { x: 45, y: -55 }, { x: 60, y: -58 }, { x: 74, y: -56 }, { x: 86, y: -49 }, { x: 97, y: -41 }, { x: 106, y: -30 }, { x: 115, y: -20 }, { x: 125, y: -6 }], rotation: 0, type: "", visible: !0, width: 0, x: 298, y: 625 }, { height: 0, id: 100, name: "curve_bot", polyline: [{ x: 28, y: -60 }, { x: 26, y: -83 }, { x: 34, y: -108 }, { x: 43, y: -130 }, { x: 51, y: -148 }, { x: 59, y: -165 }, { x: 68, y: -177 }, { x: 76, y: -183 }, { x: 85, y: -186 }, { x: 94, y: -188 }, { x: 104.75, y: -186.25 }, { x: 116, y: -181 }, { x: 126, y: -173 }, { x: 140, y: -158 }, { x: 151, y: -146 }, { x: 164, y: -134 }, { x: 176, y: -119 }, { x: 190, y: -102 }, { x: 202, y: -87 }, { x: 208.666, y: -78.3334 }, { x: 212, y: -67 }, { x: 208, y: -59 }, { x: 191, y: -55 }, { x: 38, y: -59 }], rotation: 0, type: "", visible: !0, width: 0, x: 269, y: 856 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "Livello di oggetti 10", objects: [{ height: 1920, id: 120, name: "", rotation: 0, type: "", visible: !0, width: 1152, x: 0, y: 0 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "centersafe", objects: [{ ellipse: !0, height: 20, id: 115, name: "center", rotation: 0, type: "", visible: !0, width: 20, x: 520, y: 1862 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "top_channellers", objects: [{ height: 0, id: 56, name: "4", polygon: [{ x: 0, y: 0 }, { x: 10, y: -2 }, { x: 20, y: 0 }, { x: 30, y: 6 }, { x: 36, y: 16 }, { x: 36, y: 90 }, { x: 32, y: 98 }, { x: 22, y: 106 }, { x: 2, y: 106 }, { x: -6, y: 102 }, { x: -14, y: 90 }, { x: -14, y: 18 }, { x: -8, y: 8 }], rotation: 0, type: "", visible: !0, width: 0, x: 760, y: 228 }, { height: 0, id: 57, name: "3", polygon: [{ x: 0, y: 0 }, { x: 10, y: -2 }, { x: 20, y: 0 }, { x: 30, y: 6 }, { x: 36, y: 16 }, { x: 36, y: 90 }, { x: 32, y: 98 }, { x: 22, y: 106 }, { x: 2, y: 106 }, { x: -6, y: 102 }, { x: -14, y: 90 }, { x: -14, y: 18 }, { x: -8, y: 8 }], rotation: 0, type: "", visible: !0, width: 0, x: 644, y: 252 }, { height: 0, id: 58, name: "2", polygon: [{ x: 0, y: 0 }, { x: 10, y: -2 }, { x: 20, y: 0 }, { x: 30, y: 6 }, { x: 36, y: 16 }, { x: 36, y: 90 }, { x: 32, y: 98 }, { x: 22, y: 106 }, { x: 2, y: 106 }, { x: -6, y: 102 }, { x: -14, y: 90 }, { x: -14, y: 18 }, { x: -8, y: 8 }], rotation: 0, type: "", visible: !0, width: 0, x: 528, y: 252 }, { height: 0, id: 59, name: "1", polygon: [{ x: 0, y: 0 }, { x: 10, y: -2 }, { x: 20, y: 0 }, { x: 25, y: 3 }, { x: 30, y: 6 }, { x: 36, y: 16 }, { x: 36, y: 90 }, { x: 32, y: 98 }, { x: 22, y: 106 }, { x: 2, y: 106 }, { x: -6, y: 102 }, { x: -14, y: 90 }, { x: -14, y: 18 }, { x: -8, y: 8 }], rotation: 0, type: "", visible: !0, width: 0, x: 416, y: 228 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "bot_channellers", objects: [{ height: 0, id: 79, name: "vertical_right", polygon: [{ x: -2, y: 0 }, { x: 8, y: 0 }, { x: 10, y: 196 }, { x: 6, y: 202 }, { x: 0, y: 206 }, { x: -4, y: 202 }, { x: -6, y: 196 }, { x: -6, y: 192 }], rotation: 0, type: "", visible: !0, width: 0, x: 978, y: 1402 }, { height: 0, id: 80, name: "horizontal_right", polygon: [{ x: 0, y: 0 }, { x: 8, y: 14 }, { x: -224, y: 122 }, { x: -236, y: 86 }], rotation: 0, type: "", visible: !0, width: 0, x: 972, y: 1592 }, { height: 0, id: 83, name: "vertical_left", polygon: [{ x: -2, y: 0 }, { x: 8, y: 0 }, { x: 10, y: 196 }, { x: 6, y: 202 }, { x: 0, y: 206 }, { x: -4, y: 202 }, { x: -6, y: 196 }, { x: -6, y: 192 } ], rotation: 0, type: "", visible: !0, width: 0, x: 92, y: 1406 }, { height: 0, id: 84, name: "horizontal_left", polygon: [{ x: 0, y: 0 }, { x: 222, y: 84 }, { x: 204, y: 120 }, { x: -4, y: 20 }], rotation: 0, type: "", visible: !0, width: 0, x: 96, y: 1592 }, { ellipse: !0, height: 20, id: 85, name: "head_left", rotation: 0, type: "", visible: !0, width: 20, x: 86, y: 1392 }, { ellipse: !0, height: 20, id: 87, name: "head_right", rotation: 0, type: "", visible: !0, width: 20, x: 972, y: 1386 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "flipper_bumper", objects: [{ height: 0, id: 88, name: "right", polygon: [{ x: 2.41666, y: -9.91666 }, { x: 0, y: 200 }, { x: -96, y: 236 }, { x: -126, y: 216 }, { x: -42.1212, y: 12.18184 }, { x: -36.6666, y: 2 }, { x: -29.1818, y: -7.0227 }, { x: -21.5152, y: -14.8636 }, { x: -11.72726, y: -23.197 }, { x: 2.14396, y: -29.7348 }], rotation: 0, type: "", visible: !0, width: 0, x: 904, y: 1348 }, { height: 0, id: 89, name: "left", polygon: [{ x: 0, y: 0 }, { x: 90, y: 210 }, { x: 68, y: 232 }, { x: -36, y: 192 }, { x: -33.3334, y: -7.33334 }, { x: -32.7272, y: -34.0606 }, { x: -23.6666, y: -27.697 }, { x: -16.33332, y: -20.6666 }, { x: -7.66666, y: -10 } ], rotation: 0, type: "", visible: !0, width: 0, x: 210, y: 1354 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "right_channeller", objects: [{ height: 0, id: 90, name: "channeller", polygon: [{ x: 69.909, y: -156.1666 }, { x: 73.5758, y: -145.1666 }, { x: 76.7424, y: -132.8334 }, { x: 77.2424, y: -121.5 }, { x: -38, y: 128.8334 }, { x: -44.6666, y: 129.5 }, { x: -53.3334, y: 128.8334 }, { x: -62.6666, y: 124.1666 }, { x: -68.1818, y: 115.1364 }, { x: -68.6666, y: 105.5 }, { x: -67.2728, y: 97.1364 }, { x: 52.909, y: -155.1666 }, { x: 62.409, y: -173.6666 }], rotation: 0, type: "", visible: !0, width: 0, x: 924, y: 691.334 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "circle_bumper", objects: [{ ellipse: !0, height: 120, id: 94, name: "3", rotation: 0, type: "", visible: !0, width: 120, x: 739.334, y: 422.666 }, { ellipse: !0, height: 120, id: 91, name: "2", rotation: 0, type: "", visible: !0, width: 120, x: 678, y: 608 }, { ellipse: !0, height: 120, id: 93, name: "1", rotation: 0, type: "", visible: !0, width: 120, x: 517.334, y: 467.334 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 }, { draworder: "topdown", name: "flipper", objects: [{ height: 0, id: 113, name: "right", polygon: [{ x: 0, y: 0 }, { x: -144, y: 55.3334 }, { x: -150.6666, y: 53.3334 }, { x: -154.5, y: 49.5834 }, { x: -156.6666, y: 46 }, { x: -158.6666, y: 41.3334 }, { x: -159.25, y: 35.5 }, { x: -158.0834, y: 30.6666 }, { x: -153.5, y: 26.4166 }, { x: -20.5834, y: -44.5834 }, { x: -13.83334, y: -46.1666 }, { x: -8, y: -45.3334 }, { x: -2, y: -42.6666 }, { x: 2, y: -39.3334 }, { x: 5.33334, y: -32.6666 }, { x: 8.83334, y: -24.5834 }, { x: 9.33334, y: -14.66666 }, { x: 6.66666, y: -6.66666 }], rotation: 0, type: "", visible: !0, width: 0, x: 735.334, y: 1730 }, { height: 0, id: 114, name: "left", polygon: [{ x: 0, y: 9.1668 }, { x: -144, y: -46.1666 }, { x: -150.6666, y: -44.1666 }, { x: -154.5, y: -40.4166 }, { x: -156.6666, y: -36.8332 }, { x: -158.6666, y: -32.1666 }, { x: -159.25, y: -26.3332 }, { x: -158.0834, y: -21.4998 }, { x: -153.5, y: -17.2498 }, { x: -20.5834, y: 53.7502 }, { x: -13.83334, y: 55.3334 }, { x: -8, y: 54.5002 }, { x: -2, y: 51.8334 }, { x: 2, y: 48.5002 }, { x: 5.33334, y: 41.8334 }, { x: 8.83334, y: 33.7502 }, { x: 9.33334, y: 23.8334 }, { x: 6.66666, y: 15.83346 }], rotation: 180, type: "", visible: !0, width: 0, x: 315.584, y: 1735.666 }], opacity: 1, type: "objectgroup", visible: !0, x: 0, y: 0 } ], nextobjectid: 122, orientation: "orthogonal", renderorder: "right-down", tiledversion: "2018.03.21", tileheight: 960, tilesets: [], tilewidth: 576, type: "map", version: 1.2, width: 1 }); function CButtonSystem() { var a, m, d, f, l, g, c, h; this._init = function() { a = !0; d = m = !1; l = []; f = []; g = [] }; this.setAutoReset = function(b) { a = b }; this.setReturn = function(b) { m = b }; this.restart = function() { d = !1; for (var b = 0; b < f.length; b++) f[b] = !1, l[b].SetActive(!0), g[b].flashing() }; this.reset = function() { d = !1; for (var b = 0; b < f.length; b++) f[b] = !1, l[b].SetActive(!0), g[b].slowOff(500, 100 * (f.length - b - 1)) }; this.addButton = function(b, k, e, p, u, t, w, q, x) { l.push(s_oObjectBuilder.addButton(b, k, e, p, u, 0, 1, .8, { contacttype: CONTACT_BEGIN, callback: this._buttonHit, params: l.length })); f.push(!1); b = new CLightIndicator(t, e + w, p + q, x); b.rotate(u); g.push(b) }; this.flipButtonX = function() { for (var b = 0; b < l.length; b++) g[b].flipX() }; this.setResititution = function(b) { for (var k = 0; k < l.length; k++) l[k].GetFixtureList().SetRestitution(b) }; this._buttonHit = function(b) { f[b] ? playSound("pinball_button_off", 1, !1) : playSound("pinball_button_on", 1, !1); f[b] = !0; var k = l[b]; m && s_oPhysicsController.disableBody(k); g[b].lit(!0); h && h(); n.checkTriggerEvent() }; this.addSingleButtonListener = function(b) { h = b }; this.addAllButtonHitListener = function(b) { c = b }; this.checkTriggerEvent = function() { for (var b = 0; b < f.length; b++) if (!f[b] || d) return; d = !0; if (a) { d = !1; for (b = 0; b < f.length; b++) g[b].flashing(), f[b] = !1; setTimeout(function() { for (var k = 0; k < f.length; k++) l[k].SetActive(!0) }, 500) } playSound("all_lights_on_1", 1, !1); c && c() }; var n = this; this._init() } function CToggleSystem() { var a, m, d, f, l; this._init = function() { m = []; a = []; d = [] }; this.restart = function() { for (var c = 0; c < a.length; c++) a[c] = !1, d[c].flashing() }; this.reset = function() { for (var c = 0; c < a.length; c++) a[c] = !1, d[c].slowOff(500, 100 * (a.length - c - 1)) }; this.addButton = function(c, h, n, b, k, e, p, u, t, w) { m.push(s_oObjectBuilder.addButton(c, h, n, b, k, 0, 1, 1, { contacttype: CONTACT_BEGIN, callback: this._buttonHit, params: m.length })); m[m.length - 1].GetFixtureList().SetSensor(!0); a.push(!1); c = new CLightIndicator(e, n + p, b + u, t); c.addText(w, 0, 0, 40, "#000000"); d.push(c) }; this._buttonHit = function(c) { a[c] = !0; playSound("toggle", 1, !1); d[c].lit(a[c]); l && l(c); g.checkTriggerEvent() }; this.addSingleButtonListener = function(c) { l = c }; this.addAllButtonHitListener = function(c) { f = c }; this.shiftRight = function() { var c = a.pop(); a.unshift(c); for (c = 0; c < d.length; c++) d[c].lit(a[c]) }; this.shiftLeft = function() { var c = a.shift(); a.push(c); for (c = 0; c < d.length; c++) d[c].lit(a[c]) }; this.checkTriggerEvent = function() { for (var c = 0; c < a.length; c++) if (!a[c]) return; g.restart(); playSound("all_lights_on_2", 1, !1); f && f() }; var g = this; this._init() } function CHoleSystem(a, m, d) { var f, l, g; this._init = function(h, n, b) { l = s_oObjectBuilder.addStaticCircle(1, h, n, 0, 0, 0, { contacttype: CONTACT_BEGIN, callback: this._holeHit, params: "hole_enabled" }); l.GetBody().GetFixtureList().SetSensor(!0) }; this.addHoleEventListener = function(h) { f = h }; this.setLaunchImpulse = function(h, n) { g = { x: h, y: n } }; this._disableHole = function() { l.SetUserData({ contacttype: CONTACT_BEGIN, callback: c._wakeUpHole, params: "hole_disabled" }) }; this._wakeUpHole = function() { l.SetUserData({ contacttype: CONTACT_END, callback: c._enableHole, params: "hole_wake" }) }; this._enableHole = function() { l.SetUserData({ contacttype: CONTACT_BEGIN, callback: c._holeHit, params: "hole_enabled" }) }; this._releaseBall = function(h) { h.SetActive(!0); g && (c._enableHole(), h.ApplyImpulse(g, h.GetPosition())) }; this._centerBallInHole = function(h) { c._disableHole(); h.SetLinearVelocity({ x: 0, y: 0 }); h.SetAngularVelocity(0); s_oPhysicsController.disableBody(h, { x: a, y: m }); playSound("in_hole", 1, !1); setTimeout(function() { playSound("out_hole", 1, !1); c._releaseBall(h) }, d) }; this._getBall = function(h) { var n = h.GetFixtureA().GetUserData(), b = h.GetFixtureB().GetUserData(), k; n.id && "ball" === n.id && (k = h.GetFixtureA().GetBody()); b.id && "ball" === b.id && (k = h.GetFixtureB().GetBody()); return k }; this._holeHit = function(h, n) { var b = c._getBall(n); c._centerBallInHole(b); f && f() }; this.getHole = function() { return l.GetBody() }; var c = this; this._init(a, m, d) } var GATE_LISTENER_STATE_CLOSED = 0, GATE_LISTENER_STATE_OPEN = 1; function CGateSystem(a, m) { var d, f, l, g; this._init = function(h, n) { f = d = null }; this.addGate = function(h, n, b) { g = s_oObjectBuilder.addButton(h, n, a, m, b, 0, 1, .4) }; this.addSprite = function(h, n, b, k, e) { h = createBitmap(h); h.x = a; h.y = m; h.regX = e; h.regY = k; h.rotation = b; n.addChild(h) }; this.addOpener = function(h, n, b, k, e) { s_oObjectBuilder.addStaticCircle(b, a + h, m + n, 0, 0, 0, { contacttype: CONTACT_BEGIN, callback: this._openGate, params: { openingid: k, gateid: e } }).GetBody().GetFixtureList().SetSensor(!0) }; this.addCloser = function(h, n, b, k, e) { s_oObjectBuilder.addStaticCircle(b, a + h, m + n, 0, 0, 0, { contacttype: CONTACT_BEGIN, callback: this._closeGate, params: { openingid: k, gateid: e } }).GetBody().GetFixtureList().SetSensor(!0) }; this.addPassingGateListener = function(h) { l = h }; this.setRestitution = function(h) { g.GetFixtureList().SetRestitution(h) }; this._openGate = function(h) { d = h.openingid; null === f && (f = h.gateid); f !== h.gateid && c._gatePassedCorrectly(); s_oPhysicsController.disableBody(g) }; this._closeGate = function(h) { d === h.openingid && c._gatePassedCorrectly(); f = d = null; g.SetActive(!0) }; this._gatePassedCorrectly = function() { l && l(f); playSound("gate", 1, !1); f = d = null }; var c = this; this._init(a, m) } var SINGLE_BUTTON_SCORE = 50, CIRCLE_BUMPER_SCORE = [10, 20, 50, 100, 200, 500, 1E3], GATE_SCORE = 100, ROUTER_GATE_SCORE = [50, 100, 200, 500, 1E3, 2E3, 5E3], MULTIPLIER_TOGGLE_SCORE = 100, HOLE_BONUS_SCORE = [1E3, 5E3, 1E4, 5E4, 1E5, 5E5, 1E6], HOLE_STANDARD_SCORE = 500, SINGLE_LETTERS_LIT_SCORE = 5E4, ALL_LETTERS_LIT_SCORE = 5E6, JUMPER_SCORE = 500, ALL_JUMPER_BUTTONS_SCORE = 5E3; function CSCoreController() { var a, m, d, f, l, g, c, h; this._init = function() { a = []; m = []; d = 0; f = 1; c = g = l = 0; h = -1 }; this._increaseJackpot = function(n) { l += Math.floor(n * SCORE_RATIO_TO_ADD_AT_JACKPOT); a[ON_INCREASE_JACKPOT] && a[ON_INCREASE_JACKPOT].call(m[ON_INCREASE_JACKPOT], l) }; this._addScore = function(n) { d += n; s_oScoreController._increaseJackpot(n); a[ON_INCREASE_SCORE] && a[ON_INCREASE_SCORE].call(m[ON_INCREASE_SCORE], d) }; this.resetScore = function() { d = 0; s_oScoreController._addScore(0) }; this.getScore = function() { return d }; this.addEventListener = function(n, b, k) { a[n] = b; m[n] = k }; this.resetCircleBumperLevel = function() { g = 0 }; this.resetJackpot = function() { l = 0; a[ON_INCREASE_JACKPOT] && a[ON_INCREASE_JACKPOT].call(m[ON_INCREASE_JACKPOT], l) }; this.resetMultiplier = function() { f = 1 }; this.getJackpotAmount = function() { return l }; this.addButtonScore = function() { s_oScoreController._addScore(SINGLE_BUTTON_SCORE * f) }; this.increaseCircleBumperLevel = function() { g++; g === CIRCLE_BUMPER_SCORE.length && (g = CIRCLE_BUMPER_SCORE.length - 1) }; this.getBumperValue = function() { return CIRCLE_BUMPER_SCORE[g] }; this.addCircleBumperScore = function() { s_oScoreController._addScore(CIRCLE_BUMPER_SCORE[g] * f) }; this.addGateScore = function() { s_oScoreController._addScore(GATE_SCORE * f) }; this.addRouterScore = function() { s_oScoreController._addScore(ROUTER_GATE_SCORE[c] * f) }; this.increaseRouterLevel = function() { c++; c === ROUTER_GATE_SCORE.length && (c = ROUTER_GATE_SCORE.length - 1) }; this.decreaseRouterLevel = function() { c--; 0 > c && (c = 0) }; this.getCurRouterLevel = function() { return c }; this.resetRouterLevel = function() { c = 0 }; this.addMultiplierToggleScore = function() { s_oScoreController._addScore(MULTIPLIER_TOGGLE_SCORE * f) }; this.addTotalMultiplierToggleScore = function() { s_oScoreController._addScore(10 * MULTIPLIER_TOGGLE_SCORE * f) }; this.increaseMultiplier = function() { f++; f >= MAX_MULTIPLIER && (f = MAX_MULTIPLIER) }; this.getCurMultiplier = function() { return f }; this.addTotalHoleButtonScore = function() { s_oScoreController._addScore(10 * SINGLE_BUTTON_SCORE * f) }; this.addStandardHoleScore = function() { s_oScoreController._addScore(HOLE_STANDARD_SCORE * f) }; this.addHoleScoreBonus = function() { s_oScoreController._addScore(HOLE_BONUS_SCORE[h] * f) }; this.increaseHoleBonusLevel = function() { h++ }; this.decreaseHoleBonusLevel = function() { h-- }; this.resetHoleBonusLevel = function() { h = -1 }; this.getCurHoleBonusLevel = function() { return h }; this.addSingleLettersScore = function() { s_oScoreController._addScore(SINGLE_LETTERS_LIT_SCORE * f) }; this.addAllLettersScore = function() { s_oScoreController._addScore(ALL_LETTERS_LIT_SCORE * f) }; this.addAllJumperButtonsScore = function() { s_oScoreController._addScore(ALL_JUMPER_BUTTONS_SCORE * f) }; this.addJumperScore = function() { s_oScoreController._addScore(JUMPER_SCORE * f) }; this.addJackpotScore = function() { s_oScoreController._addScore(l) }; s_oScoreController = this; this._init() } var s_oScoreController; function CLightIndicator(a, m, d, f) { var l, g, c, h; this._init = function(n, b, k, e) { l = new createjs.Container; l.x = b; l.y = k; e.addChild(l); b = new createjs.SpriteSheet({ images: [n], frames: { width: n.width / 2, height: n.height, regX: n.width / 2 / 2, regY: n.height / 2 }, animations: { state_true: [0], state_false: [1] } }); c = createSprite(b, "state_false", n.width / 2 / 2, n.height / 2, n.width / 2, n.height); l.addChild(c); g = createSprite(b, "state_true", n.width / 2 / 2, n.height / 2, n.width / 2, n.height); g.alpha = 0; l.addChild(g) }; this.unload = function() { createjs.Tween.removeTweens(g); f.removeChild(g) }; this.lit = function(n) { createjs.Tween.removeTweens(g); g.alpha = n ? 1 : 0 }; this.slowOn = function(n, b) { createjs.Tween.get(g, { override: !0 }).wait(b).to({ alpha: 1 }, n) }; this.highlight = function(n) { g.alpha = 0; createjs.Tween.get(g, { override: !0, loop: !0 }).to({ alpha: 1 }, n / 3).wait(n / 3).to({ alpha: 0 }, n / 3) }; this.slowHighlight = function(n, b, k) { g.alpha = 0; createjs.Tween.get(g, { override: !0 }).wait(b).to({ alpha: 1 }, n / 3).wait(n / 3).to({ alpha: 0 }, n / 3).call(function() { k() }) }; this.slowOff = function(n, b) { createjs.Tween.get(g, { override: !0 }).wait(b).to({ alpha: 0 }, n) }; this.flashing = function() { createjs.Tween.get(g, { override: !0 }).to({ alpha: 0 }, 100).to({ alpha: 1 }, 100).to({ alpha: 0 }, 100).to({ alpha: 1 }, 100).to({ alpha: 0 }, 100).to({ alpha: 1 }, 100).to({ alpha: 0 }, 100) }; this.addPreciseText = function(n, b, k, e, p, u, t) { h = (new CTLText(l, b - u / 2, k - t / 2, u, t, e, "center", p, PRIMARY_FONT, 1.3, 2, 2, n, !0, !0, !0, !1)).getText() }; this.addText = function(n, b, k, e, p) { h = new createjs.Text(n, e + "px " + PRIMARY_FONT, p); h.x = b; h.y = k; h.textAlign = "center"; h.textBaseline = "middle"; h.lineWidth = 200; l.addChild(h); h.cache(-l.getBounds().width / 2, -l.getBounds().height / 2, l.getBounds().width, l.getBounds().height) }; this.setText = function(n) { h.text = n; h.updateCache() }; this.textRotate = function(n) { h.rotation = n }; this.rotate = function(n) { l.rotation = n }; this.scale = function(n) { l.scaleX = l.scaleY = n }; this.flipX = function() { l.scaleX = -1 }; this._init(a, m, d, f) } function CModuleMultiplier(a, m) { var d, f, l; this._init = function(c, h) { this._addCapsule(); this._addToggle(); this._addMultiplierIndicator() }; this._addCapsule = function() { d = []; var c = s_oSpriteLibrary.getSprite("capsule_0"); c = new CLightIndicator(c, 428, 286, m); d.push(c); c = s_oSpriteLibrary.getSprite("capsule_1"); c = new CLightIndicator(c, 540, 312, m); d.push(c); c = s_oSpriteLibrary.getSprite("capsule_2"); c = new CLightIndicator(c, 656, 312, m); d.push(c); c = s_oSpriteLibrary.getSprite("capsule_3"); c = new CLightIndicator(c, 770, 286, m); d.push(c) }; this._addToggle = function() { var c = s_oSpriteLibrary.getSprite("multiplier_toggle_light"); l = new CToggleSystem; l.addButton(4, 8, 380, 280, 0, c, 0, -80, a, TEXT_MULTI[0]); l.addButton(4, 8, 490, 304, 0, c, 0, -80, a, TEXT_MULTI[1]); l.addButton(4, 8, 600, 320, 0, c, 0, -80, a, TEXT_MULTI[2]); l.addButton(4, 8, 710, 304, 0, c, 0, -80, a, TEXT_MULTI[3]); l.addButton(4, 8, 820, 280, 0, c, 0, -80, a, TEXT_MULTI[4]); l.addAllButtonHitListener(this._onAllLightOn); l.addSingleButtonListener(this._onToggle) }; this._onToggle = function(c) { s_oScoreController.addMultiplierToggleScore(); g._radialAnim(c) }; this._onAllLightOn = function() { s_oScoreController.increaseMultiplier(); s_oScoreController.addTotalMultiplierToggleScore(); for (var c = s_oScoreController.getCurMultiplier(), h = 2; h <= MAX_MULTIPLIER; h++) f[h].lit(!1); f[c].lit(!0) }; this._addMultiplierIndicator = function() { f = []; var c = new createjs.Container; c.x = 526; c.y = 1680; a.addChild(c); var h = Math.floor((MAX_MULTIPLIER - 1) / 2), n = 2, b = new createjs.Container; b.x = -440; c.addChild(b); for (var k = 0; k < h; k++) { var e = s_oSpriteLibrary.getSprite("multiplier_light"); e = new CLightIndicator(e, 112 * k, 54 * k, b); e.addText("x" + n, 0, 0, 50, "#8416ff"); e.rotate(25); f[n] = e; n++ } b = new createjs.Container; b.x = 430; c.addChild(b); for (k = 0; k < h; k++) e = s_oSpriteLibrary.getSprite("multiplier_light"), e = new CLightIndicator(e, 112 * -k, 54 * k, b), e.addText("x" + n, 0, 0, 50, "#8416ff"), e.rotate(-25), f[n] = e, n++; n === MAX_MULTIPLIER && (e = s_oSpriteLibrary.getSprite("multiplier_light"), e = new CLightIndicator(e, 0, 160, c), e.addText("x" + n, 0, 0, 50, "#8416ff"), f[n] = e) }; this._radialAnim = function(c) { for (var h = 0, n = c; n < d.length; n++) d[n].slowHighlight(500, 150 * h, function() {}), h++; if (0 < c) for (h = 0, n = c - 1; 0 <= n; n--) d[n].slowHighlight(500, 150 * h, function() {}), h++ }; this.reset = function() { l.reset(); f.forEach(function(c) { c.lit(!1) }) }; this.shiftElementsToRight = function() { l.shiftRight() }; this.shiftElementsToLeft = function() { l.shiftLeft() }; var g = this; this._init(a, m) } function CModuleBumper(a, m) { var d, f, l, g, c, h; this._init = function(n, b) { this._addLinearBumper(); this._addCircularBumperSystemButton() }; this.buildFlipperBumper = function(n) { for (var b = 0; b < n.length; b++) { var k = n[b]; k = s_oTable.getAdjustedPoints(k.x, k.y, k.polygon); s_oObjectBuilder.addPolygon(k, 0, 1, .7, .3) } b = s_oSpriteLibrary.getSprite("flipper_bumper"); n = { images: [b], frames: { width: b.width / 2, height: b.height, regX: b.width / 2 / 2, regY: b.height / 2 }, animations: { state_true: [0], state_false: [1] } }; n = new createjs.SpriteSheet(n); c = createSprite(n, "state_false", b.width / 2 / 2, b.height / 2, b.width / 2, b.height); c.x = 840; c.y = 1460; a.addChild(c); h = createSprite(n, "state_false", b.width / 2 / 2, b.height / 2, b.width / 2, b.height); h.x = 240; h.y = 1460; h.scaleX = -1; a.addChild(h) }; this._addLinearBumper = function() { var n = { contacttype: CONTACT_BEGIN, callback: this._leftFlipperBumperCollision, params: "bumper" }; n = s_oObjectBuilder.addButton(220, 12, 252, 1460, 66.7, 0, 0, 0, n); n.GetFixtureList().SetSensor(!0); n = { contacttype: CONTACT_BEGIN, callback: this._rightFlipperBumperCollision, params: "bumper" }; n = s_oObjectBuilder.addButton(220, 12, 824, 1460, -69, 0, 0, 0, n); n.GetFixtureList().SetSensor(!0) }; this._leftFlipperBumperCollision = function(n, b) { var k = new Box2D.Common.Math.b2Vec2(-.4, .5), e = b.GetFixtureA().GetUserData(), p = b.GetFixtureB().GetUserData(), u; e.id && "ball" === e.id && (u = b.GetFixtureA().GetBody()); p.id && "ball" === p.id && (u = b.GetFixtureB().GetBody()); u.SetLinearVelocity({ x: 0, y: 0 }); u.SetAngularVelocity(0); k.Multiply(20 * -u.GetMass()); u.ApplyImpulse(k, u.GetPosition()); h.gotoAndStop("state_true"); setTimeout(function() { h.gotoAndStop("state_false") }, 100); playSound("bumper", 1, !1); s_oScoreController.addButtonScore() }; this._rightFlipperBumperCollision = function(n, b) { var k = new Box2D.Common.Math.b2Vec2(.4, .5), e = b.GetFixtureA().GetUserData(), p = b.GetFixtureB().GetUserData(), u; e.id && "ball" === e.id && (u = b.GetFixtureA().GetBody()); p.id && "ball" === p.id && (u = b.GetFixtureB().GetBody()); u.SetLinearVelocity({ x: 0, y: 0 }); u.SetAngularVelocity(0); k.Multiply(20 * -u.GetMass()); u.ApplyImpulse(k, u.GetPosition()); c.gotoAndStop("state_true"); setTimeout(function() { c.gotoAndStop("state_false") }, 100); playSound("bumper", 1, !1); s_oScoreController.addButtonScore() }; this.buildCircularBumper = function(n) { l = new createjs.Text(s_oScoreController.getBumperValue(), "40px " + PRIMARY_FONT, "#c6c6c6"); l.x = 694; l.y = 570; l.rotation = -25; l.textAlign = "center"; l.textBaseline = "middle"; l.lineWidth = 200; l.outline = 3; a.addChild(l); f = new createjs.Text(s_oScoreController.getBumperValue(), "40px " + PRIMARY_FONT, "#88028b"); f.x = 694; f.y = 570; f.rotation = -25; f.textAlign = "center"; f.textBaseline = "middle"; f.lineWidth = 200; a.addChild(f); d = []; for (var b = 0; b < n.length; b++) { var k = n[b], e = s_oTable.getAdjustedPoints(0, 0, [{ x: k.x, y: k.y }]); this._addCircularBumper(k.width / 2, e[0].x + k.width / 2, e[0].y + k.width / 2, b) } }; this._addCircularBumper = function(n, b, k, e) { s_oObjectBuilder.addStaticCircle(n, b, k, 0, 0, 0, { contacttype: CONTACT_BEGIN, callback: this._circularBumperCollision, params: e }); d[e] = new createjs.Container; d[e].x = b; d[e].y = k; m.addChild(d[e]); k = s_oSpriteLibrary.getSprite("bumper"); n = k.width / 7; b = k.height / 2; k = new createjs.SpriteSheet({ images: [k], frames: { width: n, height: b, regX: n / 2, regY: b / 2 }, animations: { idle: [0], hit: [0, 13, "idle"] } }); n = createSprite(k, "hit", n / 2, b / 2, n, b); d[e].addChild(n) }; this._circularBumperCollision = function(n, b) { d[n].scaleX = .9; d[n].scaleY = .9; d[n].children[0].gotoAndPlay("hit"); createjs.Tween.get(d[n], { override: !0 }).to({ scaleX: 1, scaleY: 1 }, .1); var k = new Box2D.Collision.b2WorldManifold; b.GetWorldManifold(k); k = k.m_normal; var e = b.GetFixtureA().GetUserData(), p = b.GetFixtureB().GetUserData(), u; e.id && "ball" === e.id && (u = b.GetFixtureA().GetBody()); p.id && "ball" === p.id && (u = b.GetFixtureB().GetBody()); u.SetLinearVelocity({ x: 0, y: 0 }); u.SetAngularVelocity(0); k.Multiply(14 * -u.GetMass()); u.ApplyImpulse(k, u.GetPosition()); playSound("bumper", 1, !1); s_oScoreController.addCircleBumperScore() }; this._addCircularBumperSystemButton = function() { g = new CButtonSystem; for (var n = s_oSpriteLibrary.getSprite("bumper_button"), b = 0; 3 > b; b++) g.addButton(8, 60, 930 + 18 * b, 340 + 70 * b, -13, n, 0, 0, a); g.setReturn(!0); g.addAllButtonHitListener(this._onBumperLevelUp); g.addSingleButtonListener(s_oScoreController.addButtonScore) }; this._onBumperLevelUp = function() { s_oScoreController.increaseCircleBumperLevel(); f.text = s_oScoreController.getBumperValue(); l.text = s_oScoreController.getBumperValue(); for (var n = f.getBounds().width, b = 40; 80 <= n;) b--, f.font = " " + b + "px " + PRIMARY_FONT, l.font = " " + b + "px " + PRIMARY_FONT, n = f.getBounds().width }; this.reset = function() { g.reset(); f.font = " 40px " + PRIMARY_FONT; f.text = s_oScoreController.getBumperValue(); l.font = " 40px " + PRIMARY_FONT; l.text = s_oScoreController.getBumperValue() }; this._init(a, m) } function CModuleHole(a, m) { var d, f, l, g, c, h, n; this._init = function(k, e) { l = f = d = !1; this._addHole(); this._addRightSystemButton(); this._addLabels() }; this._addHole = function() { var k = new CHoleSystem(988, 680, 1E3); k.addHoleEventListener(this._onHole); k.setLaunchImpulse(0, .8); k = s_oSpriteLibrary.getSprite("hole"); k = createBitmap(k); k.x = 932; k.y = 600; m.addChild(k) }; this._addRightSystemButton = function() { n = new CButtonSystem; for (var k = 2, e = 0; 4 > e; e++) { var p = s_oSpriteLibrary.getSprite("button_light_" + k); n.addButton(8, 56, 924, 980 + 68 * e, 0, p, -52, 0, a); p = s_oSpriteLibrary.getSprite("bumper_button"); new CLightIndicator(p, 918, 980 + 68 * e, a); k++ } n.addAllButtonHitListener(this._onAllButtonActive); n.addSingleButtonListener(s_oScoreController.addButtonScore) }; this._onAllButtonActive = function() { s_oScoreController.addTotalHoleButtonScore(); if (!d) { d = !0; s_oScoreController.increaseHoleBonusLevel(); var k = s_oScoreController.getCurHoleBonusLevel(); g[k].highlight(2E3) } }; this._onHole = function() { n.reset(); if (d) { d = !1; s_oScoreController.addHoleScoreBonus(); var k = s_oScoreController.getCurHoleBonusLevel(); g[k].lit(!0); k === HOLE_BONUS_SCORE.length - 1 && b.reset() } else s_oScoreController.addStandardHoleScore(); l && (playSound("bonus_win_1", 1, !1), b._activeExtraBall()); f && (playSound("bonus_win_1", 1, !1), b._activeShield()) }; this._activeShield = function() { b.disableShieldLight(); s_oTable.activeShield() }; this._activeExtraBall = function() { b.disableExtraBallLight(); s_oTable.activeExtraBall() }; this._addLabels = function() { g = []; var k = 0, e = s_oSpriteLibrary.getSprite("light_indicator_0"); e = new CLightIndicator(e, 1008, 880, a); e.addText(TEXT_HOLE_VALUE[k], 0, 0, 46, "#f68eff"); e.textRotate(-20); e.scale(.68); k++; g.push(e); e = s_oSpriteLibrary.getSprite("light_indicator_0"); e = new CLightIndicator(e, 1008, 940, a); e.addText(TEXT_HOLE_VALUE[k], 0, 0, 46, "#f68eff"); e.textRotate(-20); e.scale(.68); k++; g.push(e); e = s_oSpriteLibrary.getSprite("light_indicator_0"); e = new CLightIndicator(e, 1008, 1E3, a); e.addText(TEXT_HOLE_VALUE[k], 0, 0, 36, "#f68eff"); e.textRotate(-20); e.scale(.68); k++; g.push(e); e = s_oSpriteLibrary.getSprite("light_indicator_0"); e = new CLightIndicator(e, 1008, 1060, a); e.addText(TEXT_HOLE_VALUE[k], 0, 0, 34, "#f68eff"); e.textRotate(-20); e.scale(.68); k++; g.push(e); e = s_oSpriteLibrary.getSprite("light_indicator_0"); e = new CLightIndicator(e, 1008, 1120, a); e.addText(TEXT_HOLE_VALUE[k], 0, 0, 26, "#f68eff"); e.textRotate(-20); e.scale(.68); k++; g.push(e); e = s_oSpriteLibrary.getSprite("light_indicator_0"); e = new CLightIndicator(e, 1008, 1180, a); e.addText(TEXT_HOLE_VALUE[k], 0, 0, 26, "#f68eff"); e.textRotate(-20); e.scale(.68); k++; g.push(e); e = s_oSpriteLibrary.getSprite("light_indicator_2"); e = new CLightIndicator(e, 1008, 1240, a); e.addText(TEXT_HOLE_VALUE[k], 0, 0, 50, "#ff4040"); e.textRotate(-20); e.scale(.68); g.push(e); k = new createjs.Container; k.x = 928; k.y = 820; a.addChild(k); e = s_oSpriteLibrary.getSprite("light_indicator_1"); c = new CLightIndicator(e, 0, 0, k); c.addPreciseText(TEXT_SHIELD, 0, 0, 20, "#000000", 90, 70); c.scale(.7); c.rotate(25); e = s_oSpriteLibrary.getSprite("light_indicator_2"); h = new CLightIndicator(e, -28, 60, k); h.addPreciseText(TEXT_EXTRABALL, 0, -2, 20, "#000000", 90, 70); h.scale(.7); h.rotate(25) }; this.reset = function() { d = !1; s_oScoreController.resetHoleBonusLevel(); for (var k = 0; k < g.length; k++) g[k].slowOff(500, 100 * (g.length - k - 1)); n.reset(); this.disableShieldLight(); this.disableExtraBallLight() }; this.disableShieldLight = function() { f = !1; c.lit(!1) }; this.disableExtraBallLight = function() { l = !1; h.lit(!1) }; this.activeShieldLight = function() { f = !0; c.highlight(2E3) }; this.activeExtraBallLight = function() { l = !0; h.highlight(2E3) }; var b = this; this._init(a, m) } function CModuleRouter(a, m) { var d, f; this._init = function(g, c) { d = 0; this._addRouterGate(); this._addLabels(); var h = s_oScoreController.getCurRouterLevel(); f[h].highlight(2E3); this._setIntervalTime() }; this._setIntervalTime = function() { d = TIME_ROUTER_SCORE_DECREASE }; this._addRouterGate = function() { var g = new CGateSystem(256, 176); g.addGate(60, 8, 45); var c = s_oSpriteLibrary.getSprite("gate"); g.addSprite(c, m, 25, c.height / 8, c.width / 2 + 16); g.addOpener(-40, 40, 12, !0); g.addCloser(56, -32, 12, !0); g.addCloser(-148, 176, 12, !1); g.addPassingGateListener(this._routerPassed) }; this._routerPassed = function() { var g = s_oScoreController.getCurRouterLevel(); f[g].lit(!0); s_oScoreController.addRouterScore(); s_oScoreController.increaseRouterLevel(); g = s_oScoreController.getCurRouterLevel(); f[g].highlight(2E3); l._setIntervalTime() }; this._addLabels = function() { f = []; var g = 0, c = s_oSpriteLibrary.getSprite("router_light_0"); c = new CLightIndicator(c, 72, 624, a); c.addText(TEXT_ROUTER_VALUE[g], 0, 0, 26, "#f947ce"); g++; f.push(c); c = s_oSpriteLibrary.getSprite("router_light_1"); c = new CLightIndicator(c, 72, 556, a); c.addText(TEXT_ROUTER_VALUE[g], 0, 0, 20, "#55bdf5"); g++; f.push(c); c = s_oSpriteLibrary.getSprite("router_light_2"); c = new CLightIndicator(c, 72, 488, a); c.addText(TEXT_ROUTER_VALUE[g], 0, 0, 18, "#73ec34"); g++; f.push(c); c = s_oSpriteLibrary.getSprite("router_light_3"); c = new CLightIndicator(c, 80, 420, a); c.addText(TEXT_ROUTER_VALUE[g], 0, 0, 18, "#f2a937"); g++; f.push(c); c = s_oSpriteLibrary.getSprite("router_light_4"); c = new CLightIndicator(c, 104, 360, a); c.addText(TEXT_ROUTER_VALUE[g], 0, 0, 26, "#f22935"); g++; f.push(c); c = s_oSpriteLibrary.getSprite("router_light_5"); c = new CLightIndicator(c, 140, 300, a); c.addText(TEXT_ROUTER_VALUE[g], 0, 0, 26, "#f3dc47"); g++; f.push(c); c = s_oSpriteLibrary.getSprite("router_light_6"); c = new CLightIndicator(c, 188, 240, a); c.addText(TEXT_ROUTER_VALUE[g], 0, 0, 26, "#9e2bf2"); f.push(c) }; this._levelDecreased = function() { var g = s_oScoreController.getCurRouterLevel(); 0 < g && (f[g].lit(!1), s_oScoreController.decreaseRouterLevel(), g = s_oScoreController.getCurRouterLevel(), f[g].highlight(2E3)) }; this.reset = function() { s_oScoreController.resetRouterLevel(); for (var g = 0; g < f.length; g++) f[g].slowOff(500, 100 * (f.length - g - 1)); g = s_oScoreController.getCurRouterLevel(); f[g].highlight(2E3) }; this.update = function() { d -= s_iTimeElaps; 0 > d && (l._setIntervalTime(), l._levelDecreased()) }; var l = this; this._init(a, m) } var CURVE_FROM_RIGHT = 0, CURVE_FROM_LEFT = 1; function CModuleLetters(a, m) { var d, f, l, g, c = 0, h, n, b, k, e, p, u, t; this._init = function(q, x) { g = l = f = d = !1; this._addSprite(); this._addCurveGate(); this._addCurveSystemButton(); this._addArrows(); this._addLetters(); this._addLogo() }; this._addSprite = function() { var q = new createjs.Container; q.x = 382; q.y = 560; m.addChild(q); var x = s_oSpriteLibrary.getSprite("curve_tunnel"), r = createBitmap(x); r.regX = x.width / 2; r.regY = x.height / 2; q.addChild(r); r = new createjs.Container; r.x = -16; r.y = -52; q.addChild(r); x = s_oSpriteLibrary.getSprite("eye"); k = createBitmap(x); k.regX = x.width / 2; k.regY = x.height / 2; r.addChild(k) }; this._addCurveSystemButton = function() { u = new CButtonSystem; u.setAutoReset(!1); for (var q = s_oSpriteLibrary.getSprite("curve_light_button"), x = 0; 3 > x; x++) u.addButton(40, 8, 324 + 60 * x, 806, 0, q, 0, 20, a); u.addAllButtonHitListener(this._onAllButtonPress); u.addSingleButtonListener(s_oScoreController.addButtonScore); u.setResititution(.33) }; this._onAllButtonPress = function() { d || l ? d && !l ? (l = !0, e.highlight(500)) : !d && l && (d = !0, p.highlight(500)) : .5 > Math.random() ? (d = !0, p.highlight(500)) : (l = !0, e.highlight(500)) }; this._allLettersAreLit = function() { for (var q = 0; q < n.length; q++) if (!n[q]) return !1; return !0 }; this._onAllLettersLit = function() { playSound("all_letters_complete", 1, !1); s_oScoreController.addAllLettersScore(); w.hardReset(); s_oTable.enableShieldBonus(); s_oTable.enableExtraBallBonus() }; this._addCurveGate = function() { var q = new CGateSystem(368, 620); q.addGate(60, 8, 90); q.addOpener(40, 32, 12, 0, CURVE_FROM_RIGHT); q.addOpener(-52, 32, 12, 0, CURVE_FROM_LEFT); q.addCloser(-116, 176, 12, 1); q.addCloser(152, 176, 12, 1); q.addPassingGateListener(this._curvePassed) }; this._curvePassed = function(q) { s_oScoreController.addGateScore(); q === CURVE_FROM_RIGHT && d && !f ? (trace("CURVE FROM RIGHT"), f = !0, p.lit(!0), u.restart(), w._tryToFlashARandomLetter()) : q === CURVE_FROM_LEFT && l && !g && (trace("CURVE FROM LEFT"), g = !0, e.lit(!0), u.restart(), w._tryToFlashARandomLetter()); f && g && (trace("LETTER LIT"), w.restart(), h[c].lit(!0), n[c] = !0, b[c] = !0, playSound("letter", 1, !1), s_oScoreController.addSingleLettersScore(), w._allLettersAreLit() && w._onAllLettersLit()) }; this._tryToFlashARandomLetter = function() { if (!f && g || f && !g) { trace("FLASHING A RANDOM LETTER"); do c = Math.floor(Math.random() * h.length); while (n[c]); h[c].highlight(1E3); n[c] = !1 } }; this._addArrows = function() { var q = s_oSpriteLibrary.getSprite("arrow_light_0"); e = new CLightIndicator(q, 272, 880, a); e.rotate(-20); q = s_oSpriteLibrary.getSprite("arrow_light_0"); p = new CLightIndicator(q, 520, 860, a); p.rotate(0) }; this._addLetters = function() { h = []; n = []; b = []; for (var q = 0; 7 > q; q++) { var x = s_oSpriteLibrary.getSprite("letter_" + q); x = new CLightIndicator(x, LETTERS_POSITION[q].x, LETTERS_POSITION[q].y, a); h.push(x); n[q] = !1; b[q] = !1 } n = []; b = []; for (q = 0; q < h.length; q++) n[q] = !1, b[q] = !1 }; this._addLogo = function() { var q = s_oSpriteLibrary.getSprite("logo"); t = new CLightIndicator(q, 540, 1140, a); this.animLogo() }; this.animLogo = function() { t.slowHighlight(2E3, 1E3, w.animLogo) }; this.stopAnimLogo = function() { t.slowOff(1E3, 0) }; this.restart = function() { g = l = f = d = !1; p.flashing(); e.flashing(); u.restart() }; this.reset = function() { w.restart(); p.slowOff(); e.slowOff(); u.reset(); for (var q = 0; q < h.length; q++) n[q] = !1, b[q] ? h[q].lit(!0) : h[q].lit(!1) }; this.hardReset = function() { this.restart(); for (var q = 0; q < h.length; q++) n[q] = !1, b[q] = !1, h[q].flashing(), t.flashing() }; this.update = function() { k.x = s_oGame.getBallSprite().x - k.parent.parent.x; k.y = s_oGame.getBallSprite().y - k.parent.parent.y; var q = Math.atan2(k.y, k.x); Math.pow(k.x, 2) + Math.pow(k.y, 2) > Math.pow(14, 2) && (k.x = 14 * Math.cos(q), k.y = 14 * Math.sin(q)) }; var w = this; this._init(a, m) } var STATE_START = 0, STATE_JUMPER = 1, STATE_SHIELD = 2, STATE_EXTRABALL = 3, STATE_DIRECTIONAL_JUMPER = 4, DIRECTION_UP = 0, DIRECTION_MID = 1, DIRECTION_RIGHT = 2; function CModuleJumper(a, m) { var d, f, l, g, c, h; this._init = function(b, k) { d = STATE_START; f = DIRECTION_UP; this._addJumper(); this._addJumperButtons(); this._addArrows() }; this._addJumper = function() { var b = { contacttype: CONTACT_BEGIN, callback: this._onJumper, params: "bumper" }; g = s_oObjectBuilder.addButton(100, 12, 68, 1220, 45, 0, 0, 0, b); g.GetFixtureList().SetSensor(!0); s_oPhysicsController.disableBody(g); b = s_oSpriteLibrary.getSprite("jumper"); var k = new createjs.SpriteSheet({ images: [b], frames: { width: b.width / 2, height: b.height, regX: b.width / 2 / 2, regY: b.height / 2 }, animations: { state_true: [0], state_false: [1] } }); c = createSprite(k, "state_false", b.width / 2 / 2, b.height / 2, b.width / 2, b.height); c.x = 68; c.y = 1220; c.rotation = 45; c.visible = !1; a.addChild(c); b = { contacttype: CONTACT_BEGIN, callback: function() {}, params: "bumper" }; s_oObjectBuilder.addButton(60, 8, 188, 800, 60, 0, 0, 1, b).GetFixtureList().SetSensor(!0) }; this._onJumper = function(b, k) { s_oScoreController.addJumperScore(); var e = k.GetFixtureA().GetUserData(), p = k.GetFixtureB().GetUserData(), u; e.id && "ball" === e.id && (u = k.GetFixtureA().GetBody()); p.id && "ball" === p.id && (u = k.GetFixtureB().GetBody()); d >= STATE_DIRECTIONAL_JUMPER ? n._jumperModeDirectional(u) : n._jumperModeWeak(u); c.gotoAndStop("state_true"); setTimeout(function() { c.gotoAndStop("state_false") }, 100); playSound("jumper", 1, !1) }; this._jumperModeWeak = function(b) { var k = new Box2D.Common.Math.b2Vec2(b.GetPosition().x * WORLD_SCALE, b.GetPosition().y * WORLD_SCALE), e = new Box2D.Common.Math.b2Vec2(960 * Math.random(), 960); k.Subtract(e); k.Normalize(); k = new Box2D.Common.Math.b2Vec2(k.x, k.y); e = 6 + 2 * Math.random(); b.SetLinearVelocity({ x: 0, y: 0 }); b.SetAngularVelocity(0); k.Multiply(-b.GetMass() * e); b.ApplyImpulse(k, b.GetPosition()) }; this._jumperModeDirectional = function(b) { var k = new Box2D.Common.Math.b2Vec2(b.GetPosition().x * WORLD_SCALE, b.GetPosition().y * WORLD_SCALE), e = n._getDirection(); k.Subtract(e); k.Normalize(); k = new Box2D.Common.Math.b2Vec2(k.x, k.y); b.SetLinearVelocity({ x: 0, y: 0 }); b.SetAngularVelocity(0); k.Multiply(32 * -b.GetMass()); b.ApplyImpulse(k, b.GetPosition()) }; this._getDirection = function() { switch (f) { case DIRECTION_UP: var b = new Box2D.Common.Math.b2Vec2(78, 640); break; case DIRECTION_MID: b = new Box2D.Common.Math.b2Vec2(740, 640); break; case DIRECTION_RIGHT: b = new Box2D.Common.Math.b2Vec2(1408, 600) } return b }; this._addJumperButtons = function() { h = new CButtonSystem; for (var b = s_oSpriteLibrary.getSprite("bumper_button"), k = 0; 5 > k; k++) h.addButton(8, 56, 38, 860 + 68 * k, 0, b, 0, 0, a); h.addAllButtonHitListener(this._onAllButtonActive); h.addSingleButtonListener(s_oScoreController.addButtonScore); h.flipButtonX() }; this._onAllButtonActive = function() { s_oScoreController.addAllJumperButtonsScore(); n.changeState() }; this._addArrows = function() { l = []; var b = s_oSpriteLibrary.getSprite("arrow_light_1"); b = new CLightIndicator(b, 88, 1060, a); b.rotate(-5); l.push(b); b = s_oSpriteLibrary.getSprite("arrow_light_1"); b = new CLightIndicator(b, 180, 1100, a); b.rotate(40); l.push(b); b = s_oSpriteLibrary.getSprite("arrow_light_1"); b = new CLightIndicator(b, 240, 1160, a); b.rotate(55); l.push(b) }; this.reset = function() { h.reset(); d = STATE_START; f = DIRECTION_UP; for (var b = 0; b < l.length; b++) l[b].slowOff(1E3, 0); s_oPhysicsController.disableBody(g); c.visible = !1 }; this.shiftElementsToRight = function() { if (!(d < STATE_DIRECTIONAL_JUMPER)) { f++; f === l.length && (f = 0); for (var b = 0; b < l.length; b++) l[b].lit(!1); l[f].lit(!0) } }; this.shiftElementsToLeft = function() { if (!(d < STATE_DIRECTIONAL_JUMPER)) { f--; 0 > f && (f = l.length - 1); for (var b = 0; b < l.length; b++) l[b].lit(!1); l[f].lit(!0) } }; this.changeState = function() { s_oTable.enableJackpot(); d++; switch (d) { case STATE_START: break; case STATE_JUMPER: g.SetActive(!0); c.visible = !0; break; case STATE_SHIELD: s_oTable.enableShieldBonus(); break; case STATE_EXTRABALL: s_oTable.enableExtraBallBonus(); break; case STATE_DIRECTIONAL_JUMPER: l[f].lit(!0); break; default: 0 === d % SHIELD_ACTIVATION_THRESHOLD && s_oTable.enableShieldBonus() } }; var n = this; this._init(a, m) } function CModuleJackpot(a, m) { var d, f, l, g; this._init = function(h, n) { d = !1; f = 0; this._addGate(); this._addActiveIndicator(); this._addJackpotAmountIndicator() }; this._addGate = function() { var h = new CGateSystem(172, 620); h.addGate(60, 8, 35); var n = s_oSpriteLibrary.getSprite("gate"); h.addSprite(n, m, 5, 80, n.width / 2 - 6); h.setRestitution(0); h.addOpener(24, -60, 12, !0); h.addCloser(-40, 56, 12, !0); h.addPassingGateListener(this._onJackpot) }; this._onJackpot = function() { s_oScoreController.addGateScore(); d && (playSound("bonus_win_2", 1, !1), s_oScoreController.addJackpotScore(), s_oScoreController.getJackpotAmount() >= EXTRABALL_JACKPOT_SCORE_ACTIVATION && s_oTable.enableExtraBallBonus(), s_oScoreController.resetJackpot(), d = !1, l.flashing()) }; this._addActiveIndicator = function() { var h = s_oSpriteLibrary.getSprite("jackpot"); l = new CLightIndicator(h, 190, 360, a) }; this._addJackpotAmountIndicator = function() { g = new createjs.Text((0).toLocaleString(), "28px " + SECONDARY_FONT, "#ff56b0"); g.x = 220; g.y = 388; g.textAlign = "center"; g.textBaseline = "middle"; g.lineWidth = 200; g.rotation = -55; a.addChild(g); g.cache(-110, -20, 220, 40) }; this.reset = function() { c.disableJackpot() }; this.enableJackpot = function() { d = !0; l.highlight(1E3); f = TIME_LAST_ACTIVE_JACKPOT }; this.disableJackpot = function() { d = !1; l.slowOff(1E3, 0) }; this.setJackpotAmount = function(h) { g.text = h.toLocaleString(); g.updateCache() }; this.update = function() { d && (f -= s_iTimeElaps, 0 > f && c.disableJackpot()) }; var c = this; this._init(a, m) } function CModuleShield(a, m) { var d, f, l, g; this._init = function(c, h) { this._addRightShield(); this._addLeftShield() }; this._addRightShield = function() { f = new CHoleSystem(1016, 1580, 1E3); f.addHoleEventListener(this._onRightShieldUsed); f.setLaunchImpulse(0, -(.3 + .2 * Math.random())); s_oPhysicsController.disableBody(f.getHole()); var c = s_oSpriteLibrary.getSprite("shield"); g = new CLightIndicator(c, 1016, 1580, a); g.lit(!0) }; this._addLeftShield = function() { d = new CHoleSystem(54, 1580, 1E3); d.addHoleEventListener(this._onLeftShieldUsed); d.setLaunchImpulse(0, -(.3 + .2 * Math.random())); var c = s_oSpriteLibrary.getSprite("shield"); l = new CLightIndicator(c, 54, 1580, a); l.lit(!0) }; this._onRightShieldUsed = function() { s_oPhysicsController.disableBody(f.getHole()); g.slowOff(1E3, 500) }; this._onLeftShieldUsed = function() { s_oPhysicsController.disableBody(d.getHole()); l.slowOff(1E3, 500) }; this.reset = function() { s_oPhysicsController.disableBody(f.getHole()); s_oPhysicsController.disableBody(d.getHole()); g.lit(!1); l.lit(!1) }; this.enableShield = function() { s_oPhysicsController.enableBody(f.getHole()); s_oPhysicsController.enableBody(d.getHole()); g.slowOn(500, 0); l.slowOn(500, 0) }; this._init(a, m) } function CModuleStart(a, m) { var d, f, l, g, c, h, n, b; this._init = function(e, p) { l = !0; g = !1; d = 1976; f = 1876; c = 1E3; this._addTunnelSprites(); this._addStartGate(); this._addLaunchPlatform(); this._addLauncher() }; this._addTunnelSprites = function() { var e = s_oSpriteLibrary.getSprite("tunnel_start"), p = createBitmap(e); p.x = 880; p.y = 140; m.addChild(p); h = 0; n = []; e = s_oSpriteLibrary.getSprite("arrow_start"); e = new CLightIndicator(e, 994, 252, a); e.rotate(-35); n.unshift(e); e = s_oSpriteLibrary.getSprite("arrow_start"); e = new CLightIndicator(e, 1044, 332, a); e.rotate(-25); n.unshift(e); e = s_oSpriteLibrary.getSprite("arrow_start"); e = new CLightIndicator(e, 1074, 422, a); e.rotate(-10); n.unshift(e); e = s_oSpriteLibrary.getSprite("arrow_start"); e = new CLightIndicator(e, 1088, 522, a); e.rotate(-5); n.unshift(e); for (p = 0; 11 > p; p++) e = s_oSpriteLibrary.getSprite("arrow_start"), e = new CLightIndicator(e, 1090, 632 + 100 * p, a), n.unshift(e); this.startLighting() }; this.startLighting = function() { for (var e = h = 0; e < n.length; e++) n[e].slowHighlight(1E3, 100 * e, this.endLighting) }; this.endLighting = function() { h++; h >= n.length && k.startLighting() }; this.stopAnimLighting = function() { for (var e = 0; e < n.length; e++) n[e].slowOff(1E3, 0) }; this._addStartGate = function() { var e = new CGateSystem(924, 176); e.addGate(60, 8, -45); var p = s_oSpriteLibrary.getSprite("gate"); e.addSprite(p, m, -68, p.height / 3, p.width / 2 + 6); e.addOpener(60, 60, 12, 0); e.addCloser(-56, -32, 12, 0); e.addCloser(132, 176, 12, 1); e.addPassingGateListener(this._onStartGatePassed) }; this._onStartGatePassed = function() { s_oGame.ballInGame(!0); s_oScoreController.addGateScore(); g = !0; s_oTable.stopLogoAnim(); k.stopAnimLighting() }; this._addLaunchPlatform = function() { var e = { contacttype: CONTACT_BEGIN, callback: this._onPlatform, params: "platform" }; s_oObjectBuilder.addButton(60, 4, 1092, 1800, 0, 0, .33, .33, e); e = { contacttype: CONTACT_BEGIN, callback: this._onAir, params: "platform" }; s_oObjectBuilder.addButton(60, 4, 1092, 1732, 0, 0, .33, .33, e).GetFixtureList().SetSensor(!0) }; this._onPlatform = function() { l = !0 }; this._onAir = function() { l = !1 }; this._addLauncher = function() { var e = s_oSpriteLibrary.getSprite("spring"); b = createBitmap(e); b.regY = e.height; b.x = 1069; b.y = 1876; m.addChild(b); e = s_oSpriteLibrary.getSprite("start_platform"); var p = createBitmap(e); p.regX = e.width; p.regY = e.height; p.x = s_oTable.getTableSize().w; p.y = s_oTable.getTableSize().h; m.addChild(p) }; this.block = function() { g = !0 }; this.unBlock = function() { g = !1 }; this.loadSpring = function() { g || createjs.Tween.get(b, { override: !0 }).to({ y: d }, c) }; this.releaseSpring = function() { if (!g) { createjs.Tween.get(b, { override: !0 }).to({ y: f }, 300, createjs.Ease.elasticOut); var e = linearFunction(b.y, f, d, 0, SPRING_MAX_STRENGTH); l && (playSound("launch", 1, !1), s_oGame.launchBall(e)) } }; var k = this; this._init(a, m) } function CGUIExpandible(a, m, d, f) { var l, g, c, h, n, b, k, e; this._init = function(u, t, w, q) { h = []; b = new createjs.Container; b.x = u; b.y = t; q.addChild(b); k = new createjs.Container; b.addChild(k); e = new createjs.Container; b.addChild(e); c = !1; n = new CGfxButton(0, 0, w, e); n.addEventListener(ON_MOUSE_UP, this._onMenu, this); g = l = 120 }; this.unload = function() { n.unload(); f.removeChild(b) }; this.refreshPos = function(u, t) { b.x = a - u; b.y = m + t }; this.addButton = function(u) { u = u.getButtonImage(); u.x = 0; u.y = 0; u.visible = 0; k.addChildAt(u, 0); h.push(u) }; this._onMenu = function() { (c = !c) ? (p._expand(), s_oGame.onPause()) : (p._collapse(), s_oGame.onResume()) }; this._expand = function() { for (var u = 0; u < h.length; u++) h[u].visible = !0, createjs.Tween.get(h[u], { override: !0 }).wait(300 * u / 2).to({ y: l + u * g }, 300, createjs.Ease.cubicOut) }; this._collapse = function() { for (var u = 0; u < h.length; u++) { var t = h[h.length - 1 - u]; createjs.Tween.get(t, { override: !0 }).wait(300 * u / 2).to({ y: 0 }, 300, createjs.Ease.cubicOut).call(function(w) { w.visible = !1 }, [t]) } }; var p = this; this._init(a, m, d, f) } function CPausePanel(a) { var m, d; this._init = function(f) { m = new createjs.Shape; m.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); m.alpha = 0; m.on("mousedown", function() {}); f.addChild(m); d = new createjs.Container; f.addChild(d); d.x = CANVAS_WIDTH / 2; d.y = CANVAS_HEIGHT / 2; f = new createjs.Text(TEXT_PAUSE, " 54px " + PRIMARY_FONT, PRIMARY_FONT_COLOUR); f.y = 0; f.textAlign = "center"; f.textBaseline = "middle"; f.lineWidth = 400; d.addChild(f); m.alpha = 0; d.alpha = 0 }; this.show = function() { createjs.Tween.get(m).to({ alpha: .7 }, 500); createjs.Tween.get(d).to({ alpha: 1 }, 500) }; this.hide = function() { createjs.Tween.get(m).to({ alpha: 0 }, 500); createjs.Tween.get(d).to({ alpha: 0 }, 500) }; this._init(a) } var LOCALSTORAGE_TOTALSCORE = "totalscore", s_iTotalScore = 0; function CLocalStorage(a) { var m = !0; this._init = function(d) { try { var f = window.localStorage.getItem(d); this.resetData(); null !== f && void 0 !== f && this.loadData() } catch (l) { this.resetData() } }; this.isDirty = function() { return 0 < s_iTotalScore ? !0 : !1 }; this.isUsed = function() { try { window.localStorage.setItem("ls_available", "ok") } catch (d) { m = !1 } return m }; this.resetData = function() { s_iTotalScore = 0 }; this.deleteData = function() { window.localStorage.removeItem(a) }; this.saveData = function() { var d = {}; d[LOCALSTORAGE_TOTALSCORE] = s_iTotalScore; window.localStorage.setItem(a, JSON.stringify(d)) }; this.loadData = function() { var d = JSON.parse(window.localStorage.getItem(a))[LOCALSTORAGE_TOTALSCORE]; s_iTotalScore = parseInt(d) }; this._init(a) } function CMsgBox(a, m) { var d, f, l, g, c, h, n; this._init = function(k, e) { c = new createjs.Shape; c.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); c.alpha = 0; n = c.on("mousedown", function() {}); s_oStage.addChild(c); (new createjs.Tween.get(c)).to({ alpha: .7 }, 500); h = new createjs.Container; s_oStage.addChild(h); var p = s_oSpriteLibrary.getSprite("msg_box"), u = createBitmap(p); u.regX = p.width / 2; u.regY = p.height / 2; h.addChild(u); h.x = CANVAS_WIDTH / 2; h.y = CANVAS_HEIGHT + p.height / 2; d = h.y; (new createjs.Tween.get(h)).to({ y: CANVAS_HEIGHT / 2 - 40 }, 500, createjs.Ease.quartIn); f = new createjs.Text(k, " 20px " + PRIMARY_FONT, "#000000"); f.y = -p.height / 2 + 60; f.textAlign = "center"; f.textBaseline = "middle"; f.lineWidth = 550; f.outline = 5; h.addChild(f); l = new createjs.Text(k, " 20px " + PRIMARY_FONT, "#ffffff"); l.y = f.y; l.textAlign = "center"; l.textBaseline = "middle"; l.lineWidth = 550; h.addChild(l); g = new CGfxButton(0, 80, s_oSpriteLibrary.getSprite("but_yes"), h); g.addEventListener(ON_MOUSE_UP, this._onButYes, this); g.pulseAnimation() }; this._onButYes = function() { g.setClickable(!1); (new createjs.Tween.get(c)).to({ alpha: 0 }, 500); (new createjs.Tween.get(h)).to({ y: d }, 400, createjs.Ease.backIn).call(function() { b.unload(); m && m() }) }; this.changeMessage = function(k) { f.text = k; l.text = k }; this.unload = function() { g.unload(); s_oStage.removeChild(c); s_oStage.removeChild(h); c.off("mousedown", n) }; var b = this; this._init(a, m) } CTLText.prototype = { constructor: CTLText, __autofit: function() { if (this._bFitText) { for (var a = this._iFontSize; (this._oText.getBounds().height > this._iHeight - 2 * this._iPaddingV || this._oText.getBounds().width > this._iWidth - 2 * this._iPaddingH) && !(a--, this._oText.font = a + "px " + this._szFont, this._oText.lineHeight = Math.round(a * this._fLineHeightFactor), this.__updateY(), this.__verticalAlign(), 8 > a);); this._iFontSize = a } }, __verticalAlign: function() { if (this._bVerticalAlign) { var a = this._oText.getBounds().height; this._oText.y -= (a - this._iHeight) / 2 + this._iPaddingV } }, __updateY: function() { this._oText.y = this._y + this._iPaddingV; switch (this._oText.textBaseline) { case "middle": this._oText.y += this._oText.lineHeight / 2 + (this._iFontSize * this._fLineHeightFactor - this._iFontSize) } }, __createText: function(a) { this._bDebug && (this._oDebugShape = new createjs.Shape, this._oDebugShape.graphics.beginFill("rgba(255,0,0,0.5)").drawRect(this._x, this._y, this._iWidth, this._iHeight), this._oContainer.addChild(this._oDebugShape)); this._oText = new createjs.Text(a, this._iFontSize + "px " + this._szFont, this._szColor); this._oText.textBaseline = "middle"; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this._oText.textAlign = this._szAlign; this._oText.lineWidth = this._bMultiline ? this._iWidth - 2 * this._iPaddingH : null; switch (this._szAlign) { case "center": this._oText.x = this._x + this._iWidth / 2; break; case "left": this._oText.x = this._x + this._iPaddingH; break; case "right": this._oText.x = this._x + this._iWidth - this._iPaddingH } this._oContainer.addChild(this._oText); this.refreshText(a) }, setVerticalAlign: function(a) { this._bVerticalAlign = a }, setOutline: function(a) { null !== this._oText && (this._oText.outline = a) }, setShadow: function(a, m, d, f) { null !== this._oText && (this._oText.shadow = new createjs.Shadow(a, m, d, f)) }, setColor: function(a) { this._oText.color = a }, setAlpha: function(a) { this._oText.alpha = a }, setY: function(a) { this._y = this._oText.y = a }, removeTweens: function() { createjs.Tween.removeTweens(this._oText) }, getText: function() { return this._oText }, getY: function() { return this._y }, getFontSize: function() { return this._iFontSize }, refreshText: function(a) { "" === a && (a = " "); null === this._oText && this.__createText(a); this._oText.text = a; this._oText.font = this._iFontSize + "px " + this._szFont; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this.__autofit(); this.__updateY(); this.__verticalAlign() } }; function CTLText(a, m, d, f, l, g, c, h, n, b, k, e, p, u, t, w, q) { this._oContainer = a; this._x = m; this._y = d; this._iWidth = f; this._iHeight = l; this._bMultiline = w; this._iFontSize = g; this._szAlign = c; this._szColor = h; this._szFont = n; this._iPaddingH = k; this._iPaddingV = e; this._bVerticalAlign = t; this._bFitText = u; this._bDebug = q; this._oDebugShape = null; this._fLineHeightFactor = b; this._oText = null; p && this.__createText(p) } function extractHostname(a) { a = -1 < a.indexOf("://") ? a.split("/")[2] : a.split("/")[0]; a = a.split(":")[0]; return a = a.split("?")[0] } function extractRootDomain(a) { a = extractHostname(a); var m = a.split("."), d = m.length; 2 < d && (a = m[d - 2] + "." + m[d - 1]); return a } var getClosestTop = function() { var a = window, m = !1; try { for (; a.parent.document !== a.document;) if (a.parent.document) a = a.parent; else { m = !0; break } } catch (d) { m = !0 } return { topFrame: a, err: m } }, getBestPageUrl = function(a) { var m = a.topFrame, d = ""; if (a.err) try { try { d = window.top.location.href } catch (l) { var f = window.location.ancestorOrigins; d = f[f.length - 1] } } catch (l) { d = m.document.referrer } else d = m.location.href; return d }, TOPFRAMEOBJ = getClosestTop(), PAGE_URL = getBestPageUrl(TOPFRAMEOBJ); function seekAndDestroy() { for (var a = extractRootDomain(PAGE_URL), m = [String.fromCharCode(99, 111, 100, 101, 116, 104, 105, 115, 108, 97, 98, 46, 99, 111, 109), String.fromCharCode(101, 110, 118, 97, 116, 111, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 110, 101, 116)], d = 0; d < m.length; d++) if (m[d] === a) return !0; return !1 };
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка