Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/link_the_dots/js/main.js
�азад
/* TweenJS Visit http://createjs.com/ for documentation, updates and examples. Copyright (c) 2010 gskinner.com, inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 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> */ this.createjs = this.createjs || {}; createjs.extend = function(a, e) { function b() { this.constructor = a } b.prototype = e.prototype; return a.prototype = new b }; this.createjs = this.createjs || {}; createjs.promote = function(a, e) { var b = a.prototype, d = Object.getPrototypeOf && Object.getPrototypeOf(b) || b.__proto__; if (d) { b[(e += "_") + "constructor"] = d.constructor; for (var c in d) b.hasOwnProperty(c) && "function" == typeof d[c] && (b[e + c] = d[c]) } return a }; this.createjs = this.createjs || {}; createjs.deprecate = function(a, e) { return function() { var b = "Deprecated property or method '" + e + "'. See docs for info."; console && (console.warn ? console.warn(b) : console.log(b)); return a && a.apply(this, arguments) } }; this.createjs = this.createjs || {}; (function() { function a(b, d, c) { this.type = b; this.currentTarget = this.target = null; this.eventPhase = 0; this.bubbles = !!d; this.cancelable = !!c; this.timeStamp = (new Date).getTime(); this.removed = this.immediatePropagationStopped = this.propagationStopped = this.defaultPrevented = !1 } var e = a.prototype; e.preventDefault = function() { this.defaultPrevented = this.cancelable && !0 }; e.stopPropagation = function() { this.propagationStopped = !0 }; e.stopImmediatePropagation = function() { this.immediatePropagationStopped = this.propagationStopped = !0 }; e.remove = function() { this.removed = !0 }; e.clone = function() { return new a(this.type, this.bubbles, this.cancelable) }; e.set = function(b) { for (var d in b) this[d] = b[d]; return this }; e.toString = function() { return "[Event (type=" + this.type + ")]" }; createjs.Event = a })(); this.createjs = this.createjs || {}; (function() { function a() { this._captureListeners = this._listeners = null } var e = a.prototype; a.initialize = function(b) { b.addEventListener = e.addEventListener; b.on = e.on; b.removeEventListener = b.off = e.removeEventListener; b.removeAllEventListeners = e.removeAllEventListeners; b.hasEventListener = e.hasEventListener; b.dispatchEvent = e.dispatchEvent; b._dispatchEvent = e._dispatchEvent; b.willTrigger = e.willTrigger }; e.addEventListener = function(b, d, c) { var f = c ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {}; var g = f[b]; g && this.removeEventListener(b, d, c); (g = f[b]) ? g.push(d): f[b] = [d]; return d }; e.on = function(b, d, c, f, g, h) { d.handleEvent && (c = c || d, d = d.handleEvent); c = c || this; return this.addEventListener(b, function(k) { d.call(c, k, g); f && k.remove() }, h) }; e.removeEventListener = function(b, d, c) { if (c = c ? this._captureListeners : this._listeners) { var f = c[b]; if (f) for (var g = 0, h = f.length; g < h; g++) if (f[g] == d) { 1 == h ? delete c[b] : f.splice(g, 1); break } } }; e.off = e.removeEventListener; e.removeAllEventListeners = function(b) { b ? (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null }; e.dispatchEvent = function(b, d, c) { if ("string" == typeof b) { var f = this._listeners; if (!(d || f && f[b])) return !0; b = new createjs.Event(b, d, c) } else b.target && b.clone && (b = b.clone()); try { b.target = this } catch (g) {} if (b.bubbles && this.parent) { c = this; for (d = [c]; c.parent;) d.push(c = c.parent); f = d.length; for (c = f - 1; 0 <= c && !b.propagationStopped; c--) d[c]._dispatchEvent(b, 1 + (0 == c)); for (c = 1; c < f && !b.propagationStopped; c++) d[c]._dispatchEvent(b, 3) } else this._dispatchEvent(b, 2); return !b.defaultPrevented }; e.hasEventListener = function(b) { var d = this._listeners, c = this._captureListeners; return !!(d && d[b] || c && c[b]) }; e.willTrigger = function(b) { for (var d = this; d;) { if (d.hasEventListener(b)) return !0; d = d.parent } return !1 }; e.toString = function() { return "[EventDispatcher]" }; e._dispatchEvent = function(b, d) { var c, f, g = 2 >= d ? this._captureListeners : this._listeners; if (b && g && (f = g[b.type]) && (c = f.length)) { try { b.currentTarget = this } catch (k) {} try { b.eventPhase = d | 0 } catch (k) {} b.removed = !1; f = f.slice(); for (g = 0; g < c && !b.immediatePropagationStopped; g++) { var h = f[g]; h.handleEvent ? h.handleEvent(b) : h(b); b.removed && (this.off(b.type, h, 1 == d), b.removed = !1) } } 2 === d && this._dispatchEvent(b, 2.1) }; createjs.EventDispatcher = a })(); this.createjs = this.createjs || {}; (function() { function a() { throw "Ticker cannot be instantiated."; } a.RAF_SYNCHED = "synched"; a.RAF = "raf"; a.TIMEOUT = "timeout"; a.timingMode = null; a.maxDelta = 0; a.paused = !1; a.removeEventListener = null; a.removeAllEventListeners = null; a.dispatchEvent = null; a.hasEventListener = null; a._listeners = null; createjs.EventDispatcher.initialize(a); a._addEventListener = a.addEventListener; a.addEventListener = function() { !a._inited && a.init(); return a._addEventListener.apply(a, arguments) }; a._inited = !1; a._startTime = 0; a._pausedTime = 0; a._ticks = 0; a._pausedTicks = 0; a._interval = 50; a._lastTime = 0; a._times = null; a._tickTimes = null; a._timerId = null; a._raf = !0; a._setInterval = function(d) { a._interval = d; a._inited && a._setupTick() }; a.setInterval = createjs.deprecate(a._setInterval, "Ticker.setInterval"); a._getInterval = function() { return a._interval }; a.getInterval = createjs.deprecate(a._getInterval, "Ticker.getInterval"); a._setFPS = function(d) { a._setInterval(1E3 / d) }; a.setFPS = createjs.deprecate(a._setFPS, "Ticker.setFPS"); a._getFPS = function() { return 1E3 / a._interval }; a.getFPS = createjs.deprecate(a._getFPS, "Ticker.getFPS"); try { Object.defineProperties(a, { interval: { get: a._getInterval, set: a._setInterval }, framerate: { get: a._getFPS, set: a._setFPS } }) } catch (d) { console.log(d) } a.init = function() { a._inited || (a._inited = !0, a._times = [], a._tickTimes = [], a._startTime = a._getTime(), a._times.push(a._lastTime = 0), a.interval = a._interval) }; a.reset = function() { if (a._raf) { var d = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame; d && d(a._timerId) } else clearTimeout(a._timerId); a.removeAllEventListeners("tick"); a._timerId = a._times = a._tickTimes = null; a._startTime = a._lastTime = a._ticks = a._pausedTime = 0; a._inited = !1 }; a.getMeasuredTickTime = function(d) { var c = 0, f = a._tickTimes; if (!f || 1 > f.length) return -1; d = Math.min(f.length, d || a._getFPS() | 0); for (var g = 0; g < d; g++) c += f[g]; return c / d }; a.getMeasuredFPS = function(d) { var c = a._times; if (!c || 2 > c.length) return -1; d = Math.min(c.length - 1, d || a._getFPS() | 0); return 1E3 / ((c[0] - c[d]) / d) }; a.getTime = function(d) { return a._startTime ? a._getTime() - (d ? a._pausedTime : 0) : -1 }; a.getEventTime = function(d) { return a._startTime ? (a._lastTime || a._startTime) - (d ? a._pausedTime : 0) : -1 }; a.getTicks = function(d) { return a._ticks - (d ? a._pausedTicks : 0) }; a._handleSynch = function() { a._timerId = null; a._setupTick(); a._getTime() - a._lastTime >= .97 * (a._interval - 1) && a._tick() }; a._handleRAF = function() { a._timerId = null; a._setupTick(); a._tick() }; a._handleTimeout = function() { a._timerId = null; a._setupTick(); a._tick() }; a._setupTick = function() { if (null == a._timerId) { var d = a.timingMode; if (d == a.RAF_SYNCHED || d == a.RAF) { var c = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame; if (c) { a._timerId = c(d == a.RAF ? a._handleRAF : a._handleSynch); a._raf = !0; return } } a._raf = !1; a._timerId = setTimeout(a._handleTimeout, a._interval) } }; a._tick = function() { var d = a.paused, c = a._getTime(), f = c - a._lastTime; a._lastTime = c; a._ticks++; d && (a._pausedTicks++, a._pausedTime += f); if (a.hasEventListener("tick")) { var g = new createjs.Event("tick"), h = a.maxDelta; g.delta = h && f > h ? h : f; g.paused = d; g.time = c; g.runTime = c - a._pausedTime; a.dispatchEvent(g) } for (a._tickTimes.unshift(a._getTime() - c); 100 < a._tickTimes.length;) a._tickTimes.pop(); for (a._times.unshift(c); 100 < a._times.length;) a._times.pop() }; var e = window, b = e.performance.now || e.performance.mozNow || e.performance.msNow || e.performance.oNow || e.performance.webkitNow; a._getTime = function() { return (b && b.call(e.performance) || (new Date).getTime()) - a._startTime }; createjs.Ticker = a })(); this.createjs = this.createjs || {}; (function() { function a(b) { this.EventDispatcher_constructor(); this.ignoreGlobalPause = !1; this.loop = 0; this.bounce = this.reversed = this.useTicks = !1; this.timeScale = 1; this.position = this.duration = 0; this.rawPosition = -1; this._paused = !0; this._labelList = this._labels = this._parent = this._prev = this._next = null; b && (this.useTicks = !!b.useTicks, this.ignoreGlobalPause = !!b.ignoreGlobalPause, this.loop = !0 === b.loop ? -1 : b.loop || 0, this.reversed = !!b.reversed, this.bounce = !!b.bounce, this.timeScale = b.timeScale || 1, b.onChange && this.addEventListener("change", b.onChange), b.onComplete && this.addEventListener("complete", b.onComplete)) } var e = createjs.extend(a, createjs.EventDispatcher); e._setPaused = function(b) { createjs.Tween._register(this, b); return this }; e.setPaused = createjs.deprecate(e._setPaused, "AbstractTween.setPaused"); e._getPaused = function() { return this._paused }; e.getPaused = createjs.deprecate(e._getPaused, "AbstactTween.getPaused"); e._getCurrentLabel = function(b) { var d = this.getLabels(); null == b && (b = this.position); for (var c = 0, f = d.length; c < f && !(b < d[c].position); c++); return 0 === c ? null : d[c - 1].label }; e.getCurrentLabel = createjs.deprecate(e._getCurrentLabel, "AbstractTween.getCurrentLabel"); try { Object.defineProperties(e, { paused: { set: e._setPaused, get: e._getPaused }, currentLabel: { get: e._getCurrentLabel } }) } catch (b) {} e.advance = function(b, d) { this.setPosition(this.rawPosition + b * this.timeScale, d) }; e.setPosition = function(b, d, c, f) { var g = this.duration, h = this.loop, k = this.rawPosition, l = 0; 0 > b && (b = 0); if (0 === g) { var r = !0; if (-1 !== k) return r } else { var p = b / g | 0; l = b - p * g; (r = -1 !== h && b >= h * g + g) && (b = (l = g) * (p = h) + g); if (b === k) return r; !this.reversed !== !(this.bounce && p % 2) && (l = g - l) } this.position = l; this.rawPosition = b; this._updatePosition(c, r); r && (this.paused = !0); f && f(this); d || this._runActions(k, b, c, !c && -1 === k); this.dispatchEvent("change"); r && this.dispatchEvent("complete") }; e.calculatePosition = function(b) { var d = this.duration, c = this.loop, f = 0; if (0 === d) return 0; - 1 !== c && b >= c * d + d ? (b = d, f = c) : 0 > b ? b = 0 : (f = b / d | 0, b -= f * d); return !this.reversed !== !(this.bounce && f % 2) ? d - b : b }; e.getLabels = function() { var b = this._labelList; if (!b) { b = this._labelList = []; var d = this._labels, c; for (c in d) b.push({ label: c, position: d[c] }); b.sort(function(f, g) { return f.position - g.position }) } return b }; e.setLabels = function(b) { this._labels = b; this._labelList = null }; e.addLabel = function(b, d) { this._labels || (this._labels = {}); this._labels[b] = d; var c = this._labelList; if (c) { for (var f = 0, g = c.length; f < g && !(d < c[f].position); f++); c.splice(f, 0, { label: b, position: d }) } }; e.gotoAndPlay = function(b) { this.paused = !1; this._goto(b) }; e.gotoAndStop = function(b) { this.paused = !0; this._goto(b) }; e.resolve = function(b) { var d = Number(b); isNaN(d) && (d = this._labels && this._labels[b]); return d }; e.toString = function() { return "[AbstractTween]" }; e.clone = function() { throw "AbstractTween can not be cloned."; }; e._init = function(b) { b && b.paused || (this.paused = !1); b && null != b.position && this.setPosition(b.position) }; e._updatePosition = function(b, d) {}; e._goto = function(b) { b = this.resolve(b); null != b && this.setPosition(b, !1, !0) }; e._runActions = function(b, d, c, f) { if (this._actionHead || this.tweens) { var g = this.duration, h = this.reversed, k = this.bounce, l = this.loop, r, p, m; if (0 === g) { var t = r = p = m = 0; h = k = !1 } else t = b / g | 0, r = d / g | 0, p = b - t * g, m = d - r * g; - 1 !== l && (r > l && (m = g, r = l), t > l && (p = g, t = l)); if (c) return this._runActionsRange(m, m, c, f); if (t !== r || p !== m || c || f) { -1 === t && (t = p = 0); b = b <= d; d = t; do { l = d === t ? p : b ? 0 : g; var q = d === r ? m : b ? g : 0; !h !== !(k && d % 2) && (l = g - l, q = g - q); if ((!k || d === t || l !== q) && this._runActionsRange(l, q, c, f || d !== t && !k)) return !0; f = !1 } while (b && ++d <= r || !b && --d >= r) } } }; e._runActionsRange = function(b, d, c, f) {}; createjs.AbstractTween = createjs.promote(a, "EventDispatcher") })(); this.createjs = this.createjs || {}; (function() { function a(c, f) { this.AbstractTween_constructor(f); this.pluginData = null; this.target = c; this.passive = !1; this._stepTail = this._stepHead = new e(null, 0, 0, {}, null, !0); this._stepPosition = 0; this._injected = this._pluginIds = this._plugins = this._actionTail = this._actionHead = null; f && (this.pluginData = f.pluginData, f.override && a.removeTweens(c)); this.pluginData || (this.pluginData = {}); this._init(f) } function e(c, f, g, h, k, l) { this.next = null; this.prev = c; this.t = f; this.d = g; this.props = h; this.ease = k; this.passive = l; this.index = c ? c.index + 1 : 0 } function b(c, f, g, h, k) { this.next = null; this.prev = c; this.t = f; this.d = 0; this.scope = g; this.funct = h; this.params = k } var d = createjs.extend(a, createjs.AbstractTween); a.IGNORE = {}; a._tweens = []; a._plugins = null; a._tweenHead = null; a._tweenTail = null; a.get = function(c, f) { return new a(c, f) }; a.tick = function(c, f) { for (var g = a._tweenHead; g;) { var h = g._next; f && !g.ignoreGlobalPause || g._paused || g.advance(g.useTicks ? 1 : c); g = h } }; a.handleEvent = function(c) { "tick" === c.type && this.tick(c.delta, c.paused) }; a.removeTweens = function(c) { if (c.tweenjs_count) { for (var f = a._tweenHead; f;) { var g = f._next; f.target === c && a._register(f, !0); f = g } c.tweenjs_count = 0 } }; a.removeAllTweens = function() { for (var c = a._tweenHead; c;) { var f = c._next; c._paused = !0; c.target && (c.target.tweenjs_count = 0); c._next = c._prev = null; c = f } a._tweenHead = a._tweenTail = null }; a.hasActiveTweens = function(c) { return c ? !!c.tweenjs_count : !!a._tweenHead }; a._installPlugin = function(c) { for (var f = c.priority = c.priority || 0, g = a._plugins = a._plugins || [], h = 0, k = g.length; h < k && !(f < g[h].priority); h++); g.splice(h, 0, c) }; a._register = function(c, f) { var g = c.target; if (!f && c._paused) g && (g.tweenjs_count = g.tweenjs_count ? g.tweenjs_count + 1 : 1), (g = a._tweenTail) ? (a._tweenTail = g._next = c, c._prev = g) : a._tweenHead = a._tweenTail = c, !a._inited && createjs.Ticker && (createjs.Ticker.addEventListener("tick", a), a._inited = !0); else if (f && !c._paused) { g && g.tweenjs_count--; g = c._next; var h = c._prev; g ? g._prev = h : a._tweenTail = h; h ? h._next = g : a._tweenHead = g; c._next = c._prev = null } c._paused = f }; d.wait = function(c, f) { 0 < c && this._addStep(+c, this._stepTail.props, null, f); return this }; d.to = function(c, f, g) { if (null == f || 0 > f) f = 0; f = this._addStep(+f, null, g); this._appendProps(c, f); return this }; d.label = function(c) { this.addLabel(c, this.duration); return this }; d.call = function(c, f, g) { return this._addAction(g || this.target, c, f || [this]) }; d.set = function(c, f) { return this._addAction(f || this.target, this._set, [c]) }; d.play = function(c) { return this._addAction(c || this, this._set, [{ paused: !1 }]) }; d.pause = function(c) { return this._addAction(c || this, this._set, [{ paused: !0 }]) }; d.w = d.wait; d.t = d.to; d.c = d.call; d.s = d.set; d.toString = function() { return "[Tween]" }; d.clone = function() { throw "Tween can not be cloned."; }; d._addPlugin = function(c) { var f = this._pluginIds || (this._pluginIds = {}), g = c.ID; if (g && !f[g]) { f[g] = !0; f = this._plugins || (this._plugins = []); g = c.priority || 0; for (var h = 0, k = f.length; h < k; h++) if (g < f[h].priority) { f.splice(h, 0, c); return } f.push(c) } }; d._updatePosition = function(c, f) { var g = this._stepHead.next, h = this.position, k = this.duration; if (this.target && g) { for (var l = g.next; l && l.t <= h;) g = g.next, l = g.next; this._updateTargetProps(g, f ? 0 === k ? 1 : h / k : (h - g.t) / g.d, f) } this._stepPosition = g ? h - g.t : 0 }; d._updateTargetProps = function(c, f, g) { if (!(this.passive = !!c.passive)) { var h, k = c.prev.props, l = c.props; if (h = c.ease) f = h(f, 0, 1, 1); h = this._plugins; var r; a: for (r in k) { var p = k[r]; var m = l[r]; p = p !== m && "number" === typeof p ? p + (m - p) * f : 1 <= f ? m : p; if (h) { m = 0; for (var t = h.length; m < t; m++) { var q = h[m].change(this, c, r, p, f, g); if (q === a.IGNORE) continue a; void 0 !== q && (p = q) } } this.target[r] = p } } }; d._runActionsRange = function(c, f, g, h) { var k = (g = c > f) ? this._actionTail : this._actionHead, l = f, r = c; g && (l = c, r = f); for (var p = this.position; k;) { var m = k.t; if (m === f || m > r && m < l || h && m === c) if (k.funct.apply(k.scope, k.params), p !== this.position) return !0; k = g ? k.prev : k.next } }; d._appendProps = function(c, f, g) { var h = this._stepHead.props, k = this.target, l = a._plugins, r, p, m = f.prev, t = m.props, q = f.props || (f.props = this._cloneProps(t)), z = {}; for (r in c) if (c.hasOwnProperty(r) && (z[r] = q[r] = c[r], void 0 === h[r])) { var u = void 0; if (l) for (p = l.length - 1; 0 <= p; p--) { var A = l[p].init(this, r, u); void 0 !== A && (u = A); if (u === a.IGNORE) { delete q[r]; delete z[r]; break } } u !== a.IGNORE && (void 0 === u && (u = k[r]), t[r] = void 0 === u ? null : u) } for (r in z) { var n; for (c = m; (n = c) && (c = n.prev);) if (c.props !== n.props) { if (void 0 !== c.props[r]) break; c.props[r] = t[r] } } if (!1 !== g && (l = this._plugins)) for (p = l.length - 1; 0 <= p; p--) l[p].step(this, f, z); if (g = this._injected) this._injected = null, this._appendProps(g, f, !1) }; d._injectProp = function(c, f) { (this._injected || (this._injected = {}))[c] = f }; d._addStep = function(c, f, g, h) { f = new e(this._stepTail, this.duration, c, f, g, h || !1); this.duration += c; return this._stepTail = this._stepTail.next = f }; d._addAction = function(c, f, g) { c = new b(this._actionTail, this.duration, c, f, g); this._actionTail ? this._actionTail.next = c : this._actionHead = c; this._actionTail = c; return this }; d._set = function(c) { for (var f in c) this[f] = c[f] }; d._cloneProps = function(c) { var f = {}, g; for (g in c) f[g] = c[g]; return f }; createjs.Tween = createjs.promote(a, "AbstractTween") })(); this.createjs = this.createjs || {}; (function() { function a(b) { if (b instanceof Array || null == b && 1 < arguments.length) { var d = b; var c = arguments[1]; b = arguments[2] } else b && (d = b.tweens, c = b.labels); this.AbstractTween_constructor(b); this.tweens = []; d && this.addTween.apply(this, d); this.setLabels(c); this._init(b) } var e = createjs.extend(a, createjs.AbstractTween); e.addTween = function(b) { b._parent && b._parent.removeTween(b); var d = arguments.length; if (1 < d) { for (var c = 0; c < d; c++) this.addTween(arguments[c]); return arguments[d - 1] } if (0 === d) return null; this.tweens.push(b); b._parent = this; b.paused = !0; d = b.duration; 0 < b.loop && (d *= b.loop + 1); d > this.duration && (this.duration = d); 0 <= this.rawPosition && b.setPosition(this.rawPosition); return b }; e.removeTween = function(b) { var d = arguments.length; if (1 < d) { for (var c = !0, f = 0; f < d; f++) c = c && this.removeTween(arguments[f]); return c } if (0 === d) return !0; d = this.tweens; for (f = d.length; f--;) if (d[f] === b) return d.splice(f, 1), b._parent = null, b.duration >= this.duration && this.updateDuration(), !0; return !1 }; e.updateDuration = function() { for (var b = this.duration = 0, d = this.tweens.length; b < d; b++) { var c = this.tweens[b], f = c.duration; 0 < c.loop && (f *= c.loop + 1); f > this.duration && (this.duration = f) } }; e.toString = function() { return "[Timeline]" }; e.clone = function() { throw "Timeline can not be cloned."; }; e._updatePosition = function(b, d) { for (var c = this.position, f = 0, g = this.tweens.length; f < g; f++) this.tweens[f].setPosition(c, !0, b) }; e._runActionsRange = function(b, d, c, f) { for (var g = this.position, h = 0, k = this.tweens.length; h < k; h++) if (this.tweens[h]._runActions(b, d, c, f), g !== this.position) return !0 }; createjs.Timeline = createjs.promote(a, "AbstractTween") })(); this.createjs = this.createjs || {}; (function() { function a() { throw "Ease cannot be instantiated."; } a.linear = function(e) { return e }; a.none = a.linear; a.get = function(e) { -1 > e ? e = -1 : 1 < e && (e = 1); return function(b) { return 0 == e ? b : 0 > e ? b * (b * -e + 1 + e) : b * ((2 - b) * e + (1 - e)) } }; a.getPowIn = function(e) { return function(b) { return Math.pow(b, e) } }; a.getPowOut = function(e) { return function(b) { return 1 - Math.pow(1 - b, e) } }; a.getPowInOut = function(e) { return function(b) { return 1 > (b *= 2) ? .5 * Math.pow(b, e) : 1 - .5 * Math.abs(Math.pow(2 - b, e)) } }; a.quadIn = a.getPowIn(2); a.quadOut = a.getPowOut(2); a.quadInOut = a.getPowInOut(2); a.cubicIn = a.getPowIn(3); a.cubicOut = a.getPowOut(3); a.cubicInOut = a.getPowInOut(3); a.quartIn = a.getPowIn(4); a.quartOut = a.getPowOut(4); a.quartInOut = a.getPowInOut(4); a.quintIn = a.getPowIn(5); a.quintOut = a.getPowOut(5); a.quintInOut = a.getPowInOut(5); a.sineIn = function(e) { return 1 - Math.cos(e * Math.PI / 2) }; a.sineOut = function(e) { return Math.sin(e * Math.PI / 2) }; a.sineInOut = function(e) { return -.5 * (Math.cos(Math.PI * e) - 1) }; a.getBackIn = function(e) { return function(b) { return b * b * ((e + 1) * b - e) } }; a.backIn = a.getBackIn(1.7); a.getBackOut = function(e) { return function(b) { return --b * b * ((e + 1) * b + e) + 1 } }; a.backOut = a.getBackOut(1.7); a.getBackInOut = function(e) { e *= 1.525; return function(b) { return 1 > (b *= 2) ? .5 * b * b * ((e + 1) * b - e) : .5 * ((b -= 2) * b * ((e + 1) * b + e) + 2) } }; a.backInOut = a.getBackInOut(1.7); a.circIn = function(e) { return -(Math.sqrt(1 - e * e) - 1) }; a.circOut = function(e) { return Math.sqrt(1 - --e * e) }; a.circInOut = function(e) { return 1 > (e *= 2) ? -.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1) }; a.bounceIn = function(e) { return 1 - a.bounceOut(1 - e) }; a.bounceOut = function(e) { return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375 }; a.bounceInOut = function(e) { return .5 > e ? .5 * a.bounceIn(2 * e) : .5 * a.bounceOut(2 * e - 1) + .5 }; a.getElasticIn = function(e, b) { var d = 2 * Math.PI; return function(c) { if (0 == c || 1 == c) return c; var f = b / d * Math.asin(1 / e); return -(e * Math.pow(2, 10 * --c) * Math.sin((c - f) * d / b)) } }; a.elasticIn = a.getElasticIn(1, .3); a.getElasticOut = function(e, b) { var d = 2 * Math.PI; return function(c) { return 0 == c || 1 == c ? c : e * Math.pow(2, -10 * c) * Math.sin((c - b / d * Math.asin(1 / e)) * d / b) + 1 } }; a.elasticOut = a.getElasticOut(1, .3); a.getElasticInOut = function(e, b) { var d = 2 * Math.PI; return function(c) { var f = b / d * Math.asin(1 / e); return 1 > (c *= 2) ? -.5 * e * Math.pow(2, 10 * --c) * Math.sin((c - f) * d / b) : e * Math.pow(2, -10 * --c) * Math.sin((c - f) * d / b) * .5 + 1 } }; a.elasticInOut = a.getElasticInOut(1, .3 * 1.5); createjs.Ease = a })(); this.createjs = this.createjs || {}; (function() { function a() { throw "MotionGuidePlugin cannot be instantiated."; } a.priority = 0; a.ID = "MotionGuide"; a.install = function() { createjs.Tween._installPlugin(a); return createjs.Tween.IGNORE }; a.init = function(e, b, d) { "guide" == b && e._addPlugin(a) }; a.step = function(e, b, d) { for (var c in d) if ("guide" === c) { var f = b.props.guide, g = a._solveGuideData(d.guide, f); f.valid = !g; var h = f.endData; e._injectProp("x", h.x); e._injectProp("y", h.y); if (g || !f.orient) break; f.startOffsetRot = (void 0 === b.prev.props.rotation ? e.target.rotation || 0 : b.prev.props.rotation) - f.startData.rotation; if ("fixed" == f.orient) f.endAbsRot = h.rotation + f.startOffsetRot, f.deltaRotation = 0; else { g = void 0 === d.rotation ? e.target.rotation || 0 : d.rotation; h = g - f.endData.rotation - f.startOffsetRot; var k = h % 360; f.endAbsRot = g; switch (f.orient) { case "auto": f.deltaRotation = h; break; case "cw": f.deltaRotation = (k + 360) % 360 + 360 * Math.abs(h / 360 | 0); break; case "ccw": f.deltaRotation = (k - 360) % 360 + -360 * Math.abs(h / 360 | 0) } } e._injectProp("rotation", f.endAbsRot) } }; a.change = function(e, b, d, c, f, g) { if ((c = b.props.guide) && b.props !== b.prev.props && c !== b.prev.props.guide) { if ("guide" === d && !c.valid || "x" == d || "y" == d || "rotation" === d && c.orient) return createjs.Tween.IGNORE; a._ratioToPositionData(f, c, e.target) } }; a.debug = function(e, b, d) { e = e.guide || e; var c = a._findPathProblems(e); c && console.error("MotionGuidePlugin Error found: \n" + c); if (!b) return c; var f, g = e.path, h = g.length; b.save(); b.lineCap = "round"; b.lineJoin = "miter"; b.beginPath(); b.moveTo(g[0], g[1]); for (f = 2; f < h; f += 4) b.quadraticCurveTo(g[f], g[f + 1], g[f + 2], g[f + 3]); b.strokeStyle = "black"; b.lineWidth = 4.5; b.stroke(); b.strokeStyle = "white"; b.lineWidth = 3; b.stroke(); b.closePath(); g = d.length; if (d && g) { h = {}; var k = {}; a._solveGuideData(e, h); for (f = 0; f < g; f++) h.orient = "fixed", a._ratioToPositionData(d[f], h, k), b.beginPath(), b.moveTo(k.x, k.y), b.lineTo(k.x + 9 * Math.cos(.0174533 * k.rotation), k.y + 9 * Math.sin(.0174533 * k.rotation)), b.strokeStyle = "black", b.lineWidth = 4.5, b.stroke(), b.strokeStyle = "red", b.lineWidth = 3, b.stroke(), b.closePath() } b.restore(); return c }; a._solveGuideData = function(e, b) { var d; if (d = a.debug(e)) return d; var c = b.path = e.path; b.orient = e.orient; b.subLines = []; b.totalLength = 0; b.startOffsetRot = 0; b.deltaRotation = 0; b.startData = { ratio: 0 }; b.endData = { ratio: 1 }; b.animSpan = 1; var f = c.length, g, h = {}; var k = c[0]; var l = c[1]; for (d = 2; d < f; d += 4) { var r = c[d]; var p = c[d + 1]; var m = c[d + 2]; var t = c[d + 3]; var q = { weightings: [], estLength: 0, portion: 0 }, z = k; var u = l; for (g = 1; 10 >= g; g++) a._getParamsForCurve(k, l, r, p, m, t, g / 10, !1, h), z = h.x - z, u = h.y - u, u = Math.sqrt(z * z + u * u), q.weightings.push(u), q.estLength += u, z = h.x, u = h.y; b.totalLength += q.estLength; for (g = 0; 10 > g; g++) u = q.estLength, q.weightings[g] /= u; b.subLines.push(q); k = m; l = t } u = b.totalLength; c = b.subLines.length; for (d = 0; d < c; d++) b.subLines[d].portion = b.subLines[d].estLength / u; d = isNaN(e.start) ? 0 : e.start; c = isNaN(e.end) ? 1 : e.end; a._ratioToPositionData(d, b, b.startData); a._ratioToPositionData(c, b, b.endData); b.startData.ratio = d; b.endData.ratio = c; b.animSpan = b.endData.ratio - b.startData.ratio }; a._ratioToPositionData = function(e, b, d) { var c = b.subLines, f, g = 0, h = e * b.animSpan + b.startData.ratio; var k = c.length; for (f = 0; f < k; f++) { var l = c[f].portion; if (g + l >= h) { var r = f; break } g += l } void 0 === r && (r = k - 1, g -= l); c = c[r].weightings; var p = l; k = c.length; for (f = 0; f < k; f++) { l = c[f] * p; if (g + l >= h) break; g += l } r = 4 * r + 2; k = b.path; a._getParamsForCurve(k[r - 2], k[r - 1], k[r], k[r + 1], k[r + 2], k[r + 3], f / 10 + (h - g) / l * .1, b.orient, d); b.orient && (d.rotation = .99999 <= e && 1.00001 >= e && void 0 !== b.endAbsRot ? b.endAbsRot : d.rotation + (b.startOffsetRot + e * b.deltaRotation)); return d }; a._getParamsForCurve = function(e, b, d, c, f, g, h, k, l) { var r = 1 - h; l.x = r * r * e + 2 * r * h * d + h * h * f; l.y = r * r * b + 2 * r * h * c + h * h * g; k && (l.rotation = 57.2957795 * Math.atan2((c - b) * r + (g - c) * h, (d - e) * r + (f - d) * h)) }; a._findPathProblems = function(e) { var b = e.path, d = b && b.length || 0; if (6 > d || (d - 2) % 4) return "\tCannot parse 'path' array due to invalid number of entries in path. There should be an odd number of points, at least 3 points, and 2 entries per point (x & y). See 'CanvasRenderingContext2D.quadraticCurveTo' for details as 'path' models a quadratic bezier.\n\nOnly [ " + (d + " ] values found. Expected: " + Math.max(4 * Math.ceil((d - 2) / 4) + 2, 6)); for (var c = 0; c < d; c++) if (isNaN(b[c])) return "All data in path array must be numeric"; b = e.start; if (isNaN(b) && void 0 !== b) return "'start' out of bounds. Expected 0 to 1, got: " + b; b = e.end; if (isNaN(b) && void 0 !== b) return "'end' out of bounds. Expected 0 to 1, got: " + b; if ((e = e.orient) && "fixed" != e && "auto" != e && "cw" != e && "ccw" != e) return 'Invalid orientation value. Expected ["fixed", "auto", "cw", "ccw", undefined], got: ' + e }; createjs.MotionGuidePlugin = a })(); this.createjs = this.createjs || {}; (function() { var a = createjs.TweenJS = createjs.TweenJS || {}; a.version = "1.0.0"; a.buildDate = "Thu, 14 Sep 2017 19:47:47 GMT" })(); (function() { var a = "undefined" !== typeof window && "undefined" !== typeof window.document ? window.document : {}, e = "undefined" !== typeof module && module.exports, b = function() { for (var f, g = ["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, k = g.length, l = {}; h < k; h++) if ((f = g[h]) && f[1] in a) { for (h = 0; h < f.length; h++) l[g[0][h]] = f[h]; return l } return !1 }(), d = { change: b.fullscreenchange, error: b.fullscreenerror }, c = { request: function(f) { return new Promise(function(g, h) { var k = function() { this.off("change", k); g() }.bind(this); this.on("change", k); f = f || a.documentElement; Promise.resolve(f[b.requestFullscreen]())["catch"](h) }.bind(this)) }, exit: function() { return new Promise(function(f, g) { if (this.isFullscreen) { var h = function() { this.off("change", h); f() }.bind(this); this.on("change", h); Promise.resolve(a[b.exitFullscreen]())["catch"](g) } else f() }.bind(this)) }, toggle: function(f) { return this.isFullscreen ? this.exit() : this.request(f) }, onchange: function(f) { this.on("change", f) }, onerror: function(f) { this.on("error", f) }, on: function(f, g) { var h = d[f]; h && a.addEventListener(h, g, !1) }, off: function(f, g) { var h = d[f]; h && a.removeEventListener(h, g, !1) }, raw: b }; b ? (Object.defineProperties(c, { isFullscreen: { get: function() { return !!a[b.fullscreenElement] } }, element: { enumerable: !0, get: function() { return a[b.fullscreenElement] } }, isEnabled: { enumerable: !0, get: function() { return !!a[b.fullscreenEnabled] } } }), e ? module.exports = c : window.screenfull = c) : e ? module.exports = { isEnabled: !1 } : window.screenfull = { isEnabled: !1 } })(); (function() { function a(n) { n = String(n); return n.charAt(0).toUpperCase() + n.slice(1) } function e(n, y) { var B = -1, v = n ? n.length : 0; if ("number" == typeof v && -1 < v && v <= t) for (; ++B < v;) y(n[B], B, n); else d(n, y) } function b(n) { n = String(n).replace(/^ +| +$/g, ""); return /^(?:webOS|i(?:OS|P))/.test(n) ? n : a(n) } function d(n, y) { for (var B in n) z.call(n, B) && y(n[B], B, n) } function c(n) { return null == n ? a(n) : u.call(n).slice(8, -1) } function f(n, y) { var B = null != n ? typeof n[y] : "number"; return !/^(?:boolean|number|string|undefined)$/.test(B) && ("object" == B ? !!n[y] : !0) } function g(n) { return String(n).replace(/([ -])(?!$)/g, "$1?") } function h(n, y) { var B = null; e(n, function(v, D) { B = y(B, v, D, n) }); return B } function k(n) { function y(X) { return h(X, function(U, S) { var Y = S.pattern || g(S); !U && (U = RegExp("\\b" + Y + " *\\d+[.\\w_]*", "i").exec(n) || RegExp("\\b" + Y + " *\\w+-[\\w]*", "i").exec(n) || RegExp("\\b" + Y + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(n)) && ((U = String(S.label && !RegExp(Y, "i").test(S.label) ? S.label : U).split("/"))[1] && !/[\d.]+/.test(U[0]) && (U[0] += " " + U[1]), S = S.label || S, U = b(U[0].replace(RegExp(Y, "i"), S).replace(RegExp("; *(?:" + S + "[_-])?", "i"), " ").replace(RegExp("(" + S + ")[-_.]?(\\w)", "i"), "$1 $2"))); return U }) } function B(X) { return h(X, function(U, S) { return U || (RegExp(S + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(n) || 0)[1] || null }) } var v = r, D = n && "object" == typeof n && "String" != c(n); D && (v = n, n = null); var G = v.navigator || {}, E = G.userAgent || ""; n || (n = E); var Q = D ? !!G.likeChrome : /\bChrome\b/.test(n) && !/internal|\n/i.test(u.toString()), O = D ? "Object" : "ScriptBridgingProxyObject", I = D ? "Object" : "Environment", J = D && v.java ? "JavaPackage" : c(v.java), P = D ? "Object" : "RuntimeObject"; I = (J = /\bJava/.test(J) && v.java) && c(v.environment) == I; var R = J ? "a" : "\u03b1", L = J ? "b" : "\u03b2", T = v.document || {}, V = v.operamini || v.opera, Z = q.test(Z = D && V ? V["[[Class]]"] : c(V)) ? Z : V = null, w, M = n; D = []; var x = null, K = n == E; E = K && V && "function" == typeof V.version && V.version(); var F = function(X) { return h(X, function(U, S) { return U || RegExp("\\b" + (S.pattern || g(S)) + "\\b", "i").exec(n) && (S.label || S) }) }([{ label: "EdgeHTML", pattern: "Edge" }, "Trident", { label: "WebKit", pattern: "AppleWebKit" }, "iCab", "Presto", "NetFront", "Tasman", "KHTML", "Gecko"]), C = function(X) { return h(X, function(U, S) { return U || RegExp("\\b" + (S.pattern || g(S)) + "\\b", "i").exec(n) && (S.label || S) }) }(["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" ]), N = y([{ 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" ]), W = function(X) { return h(X, function(U, S, Y) { return U || (S[N] || S[/^[a-z]+(?: +[a-z]+\b)*/i.exec(N)] || RegExp("\\b" + g(Y) + "(?:\\b|\\w*\\d)", "i").exec(n)) && Y }) }({ 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 } }), H = function(X) { return h(X, function(U, S) { var Y = S.pattern || g(S); if (!U && (U = RegExp("\\b" + Y + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(n))) { var aa = U, ba = S.label || S, ca = { "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" }; Y && ba && /^Win/i.test(aa) && !/^Windows Phone /i.test(aa) && (ca = ca[/[\d.]+$/.exec(aa)]) && (aa = "Windows " + ca); aa = String(aa); Y && ba && (aa = aa.replace(RegExp(Y, "i"), ba)); U = aa = b(aa.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 U }) }(["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]); W && !N && (N = y([W])); if (w = /\bGoogle TV\b/.exec(N)) N = w[0]; /\bSimulator\b/i.test(n) && (N = (N ? N + " " : "") + "Simulator"); "Opera Mini" == C && /\bOPiOS\b/.test(n) && D.push("running in Turbo/Uncompressed mode"); "IE" == C && /\blike iPhone OS\b/.test(n) ? (w = k(n.replace(/like iPhone OS/, "")), W = w.manufacturer, N = w.product) : /^iP/.test(N) ? (C || (C = "Safari"), H = "iOS" + ((w = / OS ([\d_]+)/i.exec(n)) ? " " + w[1].replace(/_/g, ".") : "")) : "Konqueror" != C || /buntu/i.test(H) ? W && "Google" != W && (/Chrome/.test(C) && !/\bMobile Safari\b/i.test(n) || /\bVita\b/.test(N)) || /\bAndroid\b/.test(H) && /^Chrome/.test(C) && /\bVersion\//i.test(n) ? (C = "Android Browser", H = /\bAndroid\b/.test(H) ? H : "Android") : "Silk" == C ? (/\bMobi/i.test(n) || (H = "Android", D.unshift("desktop mode")), /Accelerated *= *true/i.test(n) && D.unshift("accelerated")) : "PaleMoon" == C && (w = /\bFirefox\/([\d.]+)\b/.exec(n)) ? D.push("identifying as Firefox " + w[1]) : "Firefox" == C && (w = /\b(Mobile|Tablet|TV)\b/i.exec(n)) ? (H || (H = "Firefox OS"), N || (N = w[1])) : !C || (w = !/\bMinefield\b/i.test(n) && /\b(?:Firefox|Safari)\b/.exec(C)) ? (C && !N && /[\/,]|^[^(]+?\)/.test(n.slice(n.indexOf(w + "/") + 8)) && (C = null), (w = N || W || H) && (N || W || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(H)) && (C = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(H) ? H : w) + " Browser")) : "Electron" == C && (w = (/\bChrome\/([\d.]+)\b/.exec(n) || 0)[1]) && D.push("Chromium " + w) : H = "Kubuntu"; E || (E = B(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))", "Version", g(C), "(?:Firefox|Minefield|NetFront)" ])); if (w = "iCab" == F && 3 < parseFloat(E) && "WebKit" || /\bOpera\b/.test(C) && (/\bOPR\b/.test(n) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(n) && !/^(?:Trident|EdgeHTML)$/.test(F) && "WebKit" || !F && /\bMSIE\b/i.test(n) && ("Mac OS" == H ? "Tasman" : "Trident") || "WebKit" == F && /\bPlayStation\b(?! Vita\b)/i.test(C) && "NetFront") F = [w]; "IE" == C && (w = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(n) || 0)[1]) ? (C += " Mobile", H = "Windows Phone " + (/\+$/.test(w) ? w : w + ".x"), D.unshift("desktop mode")) : /\bWPDesktop\b/i.test(n) ? (C = "IE Mobile", H = "Windows Phone 8.x", D.unshift("desktop mode"), E || (E = (/\brv:([\d.]+)/.exec(n) || 0)[1])) : "IE" != C && "Trident" == F && (w = /\brv:([\d.]+)/.exec(n)) && (C && D.push("identifying as " + C + (E ? " " + E : "")), C = "IE", E = w[1]); if (K) { if (f(v, "global")) if (J && (w = J.lang.System, M = w.getProperty("os.arch"), H = H || w.getProperty("os.name") + " " + w.getProperty("os.version")), I) { try { E = v.require("ringo/engine").version.join("."), C = "RingoJS" } catch (X) { (w = v.system) && w.global.system == v.system && (C = "Narwhal", H || (H = w[0].os || null)) } C || (C = "Rhino") } else "object" == typeof v.process && !v.process.browser && (w = v.process) && ("object" == typeof w.versions && ("string" == typeof w.versions.electron ? (D.push("Node " + w.versions.node), C = "Electron", E = w.versions.electron) : "string" == typeof w.versions.nw && (D.push("Chromium " + E, "Node " + w.versions.node), C = "NW.js", E = w.versions.nw)), C || (C = "Node.js", M = w.arch, H = w.platform, E = (E = /[\d.]+/.exec(w.version)) ? E[0] : null)); else c(w = v.runtime) == O ? (C = "Adobe AIR", H = w.flash.system.Capabilities.os) : c(w = v.phantom) == P ? (C = "PhantomJS", E = (w = w.version || null) && w.major + "." + w.minor + "." + w.patch) : "number" == typeof T.documentMode && (w = /\bTrident\/(\d+)/i.exec(n)) ? (E = [E, T.documentMode], (w = +w[1] + 4) != E[1] && (D.push("IE " + E[1] + " mode"), F && (F[1] = ""), E[1] = w), E = "IE" == C ? String(E[1].toFixed(1)) : E[0]) : "number" == typeof T.documentMode && /^(?:Chrome|Firefox)\b/.test(C) && (D.push("masking as " + C + " " + E), C = "IE", E = "11.0", F = ["Trident"], H = "Windows"); H = H && b(H) } E && (w = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(E) || /(?:alpha|beta)(?: ?\d)?/i.exec(n + ";" + (K && G.appMinorVersion)) || /\bMinefield\b/i.test(n) && "a") && (x = /b/i.test(w) ? "beta" : "alpha", E = E.replace(RegExp(w + "\\+?$"), "") + ("beta" == x ? L : R) + (/\d+\+?/.exec(w) || "")); if ("Fennec" == C || "Firefox" == C && /\b(?:Android|Firefox OS)\b/.test(H)) C = "Firefox Mobile"; else if ("Maxthon" == C && E) E = E.replace(/\.[\d.]+/, ".x"); else if (/\bXbox\b/i.test(N)) "Xbox 360" == N && (H = null), "Xbox 360" == N && /\bIEMobile\b/.test(n) && D.unshift("mobile mode"); else if (!/^(?:Chrome|IE|Opera)$/.test(C) && (!C || N || /Browser|Mobi/.test(C)) || "Windows CE" != H && !/Mobi/i.test(n)) if ("IE" == C && K) try { null === v.external && D.unshift("platform preview") } catch (X) { D.unshift("embedded") } else(/\bBlackBerry\b/.test(N) || /\bBB10\b/.test(n)) && (w = (RegExp(N.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(n) || 0)[1] || E) ? (w = [w, /BB10/.test(n)], H = (w[1] ? (N = null, W = "BlackBerry") : "Device Software") + " " + w[0], E = null) : this != d && "Wii" != N && (K && V || /Opera/.test(C) && /\b(?:MSIE|Firefox)\b/i.test(n) || "Firefox" == C && /\bOS X (?:\d+\.){2,}/.test(H) || "IE" == C && (H && !/^Win/.test(H) && 5.5 < E || /\bWindows XP\b/.test(H) && 8 < E || 8 == E && !/\bTrident\b/.test(n))) && !q.test(w = k.call(d, n.replace(q, "") + ";")) && w.name && (w = "ing as " + w.name + ((w = w.version) ? " " + w : ""), q.test(C) ? (/\bIE\b/.test(w) && "Mac OS" == H && (H = null), w = "identify" + w) : (w = "mask" + w, C = Z ? b(Z.replace(/([a-z])([A-Z])/g, "$1 $2")) : "Opera", /\bIE\b/.test(w) && (H = null), K || (E = null)), F = ["Presto"], D.push(w)); else C += " Mobile"; if (w = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(n) || 0)[1]) { w = [parseFloat(w.replace(/\.(\d)$/, ".0$1")), w]; if ("Safari" == C && "+" == w[1].slice(-1)) C = "WebKit Nightly", x = "alpha", E = w[1].slice(0, -1); else if (E == w[1] || E == (w[2] = (/\bSafari\/([\d.]+\+?)/i.exec(n) || 0)[1])) E = null; w[1] = (/\bChrome\/([\d.]+)/i.exec(n) || 0)[1]; 537.36 == w[0] && 537.36 == w[2] && 28 <= parseFloat(w[1]) && "WebKit" == F && (F = ["Blink"]); K && (Q || w[1]) ? (F && (F[1] = "like Chrome"), w = w[1] || (w = w[0], 530 > w ? 1 : 532 > w ? 2 : 532.05 > w ? 3 : 533 > w ? 4 : 534.03 > w ? 5 : 534.07 > w ? 6 : 534.1 > w ? 7 : 534.13 > w ? 8 : 534.16 > w ? 9 : 534.24 > w ? 10 : 534.3 > w ? 11 : 535.01 > w ? 12 : 535.02 > w ? "13+" : 535.07 > w ? 15 : 535.11 > w ? 16 : 535.19 > w ? 17 : 536.05 > w ? 18 : 536.1 > w ? 19 : 537.01 > w ? 20 : 537.11 > w ? "21+" : 537.13 > w ? 23 : 537.18 > w ? 24 : 537.24 > w ? 25 : 537.36 > w ? 26 : "Blink" != F ? "27" : "28")) : (F && (F[1] = "like Safari"), w = (w = w[0], 400 > w ? 1 : 500 > w ? 2 : 526 > w ? 3 : 533 > w ? 4 : 534 > w ? "4+" : 535 > w ? 5 : 537 > w ? 6 : 538 > w ? 7 : 601 > w ? 8 : "8")); F && (F[1] += " " + (w += "number" == typeof w ? ".x" : /[.+]/.test(w) ? "" : "+")); "Safari" == C && (!E || 45 < parseInt(E)) && (E = w) } "Opera" == C && (w = /\bzbov|zvav$/.exec(H)) ? (C += " ", D.unshift("desktop mode"), "zvav" == w ? (C += "Mini", E = null) : C += "Mobile", H = H.replace(RegExp(" *" + w + "$"), "")) : "Safari" == C && /\bChrome\b/.exec(F && F[1]) && (D.unshift("desktop mode"), C = "Chrome Mobile", E = null, /\bOS X\b/.test(H) ? (W = "Apple", H = "iOS 4.3+") : H = null); E && 0 == E.indexOf(w = /[\d.]+$/.exec(H)) && -1 < n.indexOf("/" + w + "-") && (H = String(H.replace(w, "")).replace(/^ +| +$/g, "")); F && !/\b(?:Avant|Nook)\b/.test(C) && (/Browser|Lunascape|Maxthon/.test(C) || "Safari" != C && /^iOS/.test(H) && /\bSafari\b/.test(F[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(C) && F[1]) && (w = F[F.length - 1]) && D.push(w); D.length && (D = ["(" + D.join("; ") + ")"]); W && N && 0 > N.indexOf(W) && D.push("on " + W); N && D.push((/^on /.test(D[D.length - 1]) ? "" : "on ") + N); if (H) { var da = (w = / ([\d.+]+)$/.exec(H)) && "/" == H.charAt(H.length - w[0].length - 1); H = { architecture: 32, family: w && !da ? H.replace(w[0], "") : H, version: w ? w[1] : null, toString: function() { var X = this.version; return this.family + (X && !da ? " " + X : "") + (64 == this.architecture ? " 64-bit" : "") } } }(w = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(M)) && !/\bi686\b/i.test(M) ? (H && (H.architecture = 64, H.family = H.family.replace(RegExp(" *" + w), "")), C && (/\bWOW64\b/i.test(n) || K && /\w(?:86|32)$/.test(G.cpuClass || G.platform) && !/\bWin64; x64\b/i.test(n)) && D.unshift("32-bit")) : H && /^OS X/.test(H.family) && "Chrome" == C && 39 <= parseFloat(E) && (H.architecture = 64); n || (n = null); v = {}; v.description = n; v.layout = F && F[0]; v.manufacturer = W; v.name = C; v.prerelease = x; v.product = N; v.ua = n; v.version = C && E; v.os = H || { architecture: null, family: null, version: null, toString: function() { return "null" } }; v.parse = k; v.toString = function() { return this.description || "" }; v.version && D.unshift(E); v.name && D.unshift(C); H && C && (H != String(H).split(" ")[0] || H != C.split(" ")[0] && !N) && D.push(N ? "(" + H + ")" : "on " + H); D.length && (v.description = D.join(" ")); return v } var l = { "function": !0, object: !0 }, r = l[typeof window] && window || this, p = l[typeof exports] && exports; l = l[typeof module] && module && !module.nodeType && module; var m = p && l && "object" == typeof global && global; !m || m.global !== m && m.window !== m && m.self !== m || (r = m); var t = Math.pow(2, 53) - 1, q = /\bOpera/; m = Object.prototype; var z = m.hasOwnProperty, u = m.toString, A = k(); "function" == typeof define && "object" == typeof define.amd && define.amd ? (r.platform = A, define(function() { return A })) : p && l ? d(A, function(n, y) { p[y] = n }) : r.platform = A }).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" }], e = 0; e < a.length; e++) { var b = document.createElement("meta"); b.name = a[e].name; b.content = a[e].content; var d = window.document.head.querySelector('meta[name="' + b.name + '"]'); d && d.parentNode.removeChild(d); window.document.head.appendChild(b) } } function hideIOSFullscreenPanel() { jQuery(".xxx-ios-fullscreen-message").css("display", "none"); jQuery(".xxx-ios-fullscreen-scroll").css("display", "none"); jQuery(".xxx-game-iframe-full").removeClass("xxx-game-iframe-iphone-se") } function buildIOSFullscreenPanel() { jQuery("body").append('<div class="xxx-ios-fullscreen-message"><div class="xxx-ios-fullscreen-swipe"></div></div><div class="xxx-ios-fullscreen-scroll"></div>') } function showIOSFullscreenPanel() { jQuery(".xxx-ios-fullscreen-message").css("display", "block"); jQuery(".xxx-ios-fullscreen-scroll").css("display", "block") } 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 && jQuery(".xxx-game-iframe-full").addClass("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, e = a.family.toLowerCase(); a = parseFloat(a.version); return "ios" === e && 13 > a ? !0 : !1 } $(document).ready(function() { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && (buildIOSFullscreenPanel(), buildIOSMeta()) }); jQuery(window).resize(function() { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && iosResize() }); var s_iOffsetX, s_iOffsetY, s_iScaleFactor = 1, s_bIsIphone = !1, s_bFocus = !0, s_bLandscape = !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 e = a.toLowerCase(), b = window.document, d = b.documentElement; if (void 0 === window["inner" + a]) a = d["client" + a]; else if (window["inner" + a] != d["client" + a]) { var c = b.createElement("body"); c.id = "vpw-test-b"; c.style.cssText = "overflow:scroll"; var f = b.createElement("div"); f.id = "vpw-test-d"; f.style.cssText = "position:absolute;top:-1000px"; f.innerHTML = "<style>@media(" + e + ":" + d["client" + a] + "px){body#vpw-test-b div#vpw-test-d{" + e + ":7px!important}}</style>"; c.appendChild(f); d.insertBefore(c, b.head); a = 7 == f["offset" + a] ? d["client" + a] : window["inner" + a]; d.removeChild(c) } 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 isMobile() { return isIpad() ? !0 : jQuery.browser.mobile } function isIpad() { var a = -1 !== navigator.userAgent.toLowerCase().indexOf("ipad"); return !a && navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && 2 < navigator.maxTouchPoints ? !0 : a } function isIOS() { 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 _checkOrientation(a, e) { s_bMobile && ENABLE_CHECK_ORIENTATION && (a > e ? "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 sizeHandler() { window.scrollTo(0, 1); if ($("#canvas")) { var a = null !== platform.name && "safari" === platform.name.toLowerCase() ? getIOSWindowHeight() : getSize("Height"); var e = getSize("Width"); s_bFocus && _checkOrientation(e, a); var b = Math.min(a / CANVAS_HEIGHT, e / CANVAS_WIDTH), d = Math.round(CANVAS_WIDTH * b); b = Math.round(CANVAS_HEIGHT * b); if (b < a) { var c = a - b; b += c; d += CANVAS_WIDTH / CANVAS_HEIGHT * c } else d < e && (c = e - d, d += c, b += CANVAS_HEIGHT / CANVAS_WIDTH * c); s_bLandscape = e > a ? !0 : !1; c = a / 2 - b / 2; var f = e / 2 - d / 2, g = CANVAS_WIDTH / d; if (f * g < -EDGEBOARD_X || c * g < -EDGEBOARD_Y) b = Math.min(a / (CANVAS_HEIGHT - 2 * EDGEBOARD_Y), e / (CANVAS_WIDTH - 2 * EDGEBOARD_X)), d = Math.round(CANVAS_WIDTH * b), b = Math.round(CANVAS_HEIGHT * b), c = (a - b) / 2, f = (e - d) / 2, g = CANVAS_WIDTH / d; s_iOffsetX = -1 * f * g; s_iOffsetY = -1 * c * g; 0 <= c && (s_iOffsetY = 0); 0 <= f && (s_iOffsetX = 0); null !== s_oGame && (s_oGame.refreshButtonPos(s_iOffsetX, s_iOffsetY), s_oGame.refreshChangedOrientation(s_bLandscape)); null !== s_oMenu && s_oMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); null !== s_oLevelMenu && s_oLevelMenu.refreshButtonsPos(s_iOffsetX, s_iOffsetY); null !== s_oDifficultyMenu && s_oDifficultyMenu.refreshButtonsPos(s_iOffsetX, s_iOffsetY); $("#canvas").css("width", d + "px"); $("#canvas").css("height", b + "px"); 0 > c || (c = (a - b) / 2); $("#canvas").css("top", c + "px"); $("#canvas").css("left", f + "px"); fullscreenHandler() } } function playSound(a, e, b) { return !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (s_aSounds[a].play(), s_aSounds[a].volume(e), s_aSounds[a].loop(b), s_aSounds[a]) : null } function stopSound(a) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].stop() } function setVolume(a, e) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].volume(e) } function setMute(a, e) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].mute(e) } function tweenSoundVolume(a, e, b) { var d = { num: s_aSounds[a].volume() }; createjs.Tween.get(d).to({ num: e }, b).on("change", function(c) { setVolume(a, d.num) }, this) } function createBitmap(a, e, b) { var d = new createjs.Bitmap(a), c = new createjs.Shape; e && b ? c.graphics.beginFill("#fff").drawRect(0, 0, e, b) : c.graphics.beginFill("#ff0").drawRect(0, 0, a.width, a.height); d.hitArea = c; return d } function createSprite(a, e, b, d, c, f) { a = null !== e ? new createjs.Sprite(a, e) : new createjs.Sprite(a); e = new createjs.Shape; e.graphics.beginFill("#000000").drawRect(-b, -d, c, f); a.hitArea = e; return a } function pad(a, e, b) { a += ""; return a.length >= e ? a : Array(e - a.length + 1).join(b || "0") + a } function randomFloatBetween(a, e, b) { "undefined" === typeof b && (b = 2); return parseFloat(Math.min(a + Math.random() * (e - a), e).toFixed(b)) } function getRandomColor() { for (var a = "#", e = 0; 6 > e; e++) a += "0123456789ABCDEF" [Math.floor(16 * Math.random())]; return a } function rotateVector2D(a, e) { var b = e.getX() * Math.cos(a) + e.getY() * Math.sin(a), d = e.getX() * -Math.sin(a) + e.getY() * Math.cos(a); e.set(b, d) } function tweenVectorsOnX(a, e, b) { return a + b * (e - a) } function shuffle(a) { for (var e = a.length, b, d; 0 !== e;) d = Math.floor(Math.random() * e), --e, b = a[e], a[e] = a[d], a[d] = b; return a } Array.prototype.sortOn = function() { var a = this.slice(); if (!arguments.length) return a.sort(); var e = Array.prototype.slice.call(arguments); return a.sort(function(b, d) { for (var c = e.slice(), f = c.shift(); b[f] == d[f] && c.length;) f = c.shift(); return b[f] == d[f] ? 0 : b[f] > d[f] ? 1 : -1 }) }; function bubbleSort(a) { do { var e = !1; for (var b = 0; b < a.length - 1; b++) a[b] > a[b + 1] && (e = a[b], a[b] = a[b + 1], a[b + 1] = e, e = !0) } while (e) } function compare(a, e) { return a.index > e.index ? -1 : a.index < e.index ? 1 : 0 } function easeLinear(a, e, b, d) { return b * a / d + e } function easeInQuad(a, e, b, d) { return b * (a /= d) * a + e } function easeOutQuad(a, e, b, d) { a /= d; return -b * a * (a - 2) + e } function easeInSine(a, e, b, d) { return -b * Math.cos(a / d * (Math.PI / 2)) + b + e } function easeOutSine(a, e, b, d) { return b * Math.sin(a / d * (Math.PI / 2)) + e } function easeInCubic(a, e, b, d) { return b * (a /= d) * a * a + e } function easeOutCubic(a, e, b, d) { return b * ((a = a / d - 1) * a * a + 1) + e } function easeInOutCubic(a, e, b, d) { a /= d / 2; if (1 > a) return b / 2 * a * a * a + e; a -= 2; return b / 2 * (a * a * a + 2) + e } function easeInQuart(a, e, b, d) { a /= d; return b * a * a * a * a + e } function easeOutQuart(a, e, b, d) { a /= d; a--; return -b * (a * a * a * a - 1) + e } function easeCircularIn(a, e, b, d) { return b * Math.pow(2, 10 * (a / d - 1)) + e } function getTrajectoryPoint(a, e) { var b = new createjs.Point, d = (1 - a) * (1 - a), c = a * a; b.x = d * e.start.x + 2 * (1 - a) * a * e.traj.x + c * e.end.x; b.y = d * e.start.y + 2 * (1 - a) * a * e.traj.y + c * e.end.y; return b } function getEaseByID(a, e, b, d, c) { switch (a) { case EASE_CUBIC_IN: return easeInCubic(e, b, d, c); case EASE_CUBIC_OUT: return easeOutCubic(e, b, d, c); case EASE_CUBIC_IN_OUT: return easeInOutCubic(e, b, d, c); case EASE_LINEAR: return easeLinear(e, b, d, c); case EASE_QUAD_IN: return easeInQuad(e, b, d, c); case EASE_QUAD_OUT: return easeOutQuad(e, b, d, c); case EASE_QUART_IN: return easeInQuart(e, b, d, c); case EASE_QUART_OUT: return easeOutQuart(e, b, d, c); case EASE_CIRCULAR_IN: return easeCircularIn(e, b, d, c) } } function getAngle(a, e) { if (0 !== a) { var b = 180 * (Math.atan(e / a) + (0 > a ? Math.PI : 0)) / Math.PI; 0 > b && (b += 0) } else b = 0 < e ? 90 : 270; return b } function getAngleBetweenPoints(a, e) { return getAngle(a.x - e.x, a.y - e.y) } function formatTime(a) { a /= 1E3; var e = Math.floor(a / 60); a = parseFloat(a - 60 * e).toFixed(1); var b = ""; b = 10 > e ? b + ("0" + e + ":") : b + (e + ":"); return 10 > a ? b + ("0" + a) : b + a } function linearFunction(a, e, b, d, c) { return (a - e) * (c - d) / (b - e) + d } function linearAngularCoefficient(a, e, b, d) { return (a - e) / (b - d) } function lineIntersect(a, e) { var b = (a[0].y - a[1].y) / (a[0].x - a[1].x), d = (e[0].y - e[1].y) / (e[0].x - e[1].x); return b - d < Number.EPSILON ? void 0 : { x: (b * a[0].x - d * e[0].x + e[0].y - a[0].y) / (b - d), y: (b * d * (e[0].x - a[0].x) + d * a[0].y - b * e[0].y) / (d - b) } } function quadraticBezierLength(a, e, b) { var d = a.x - 2 * e.x + b.x, c = a.y - 2 * e.y + b.y; b = 2 * e.x - 2 * a.x; e = 2 * e.y - 2 * a.y; a = 4 * (d * d + c * c); d = 4 * (d * b + c * e); b = b * b + e * e; c = 2 * Math.sqrt(a + d + b); e = Math.sqrt(a); var f = 2 * a * e, g = 2 * Math.sqrt(b), h = d / e; return (f * c + e * d * (c - g) + (4 * b * a - d * d) * Math.log((2 * e + h + c) / (h + g))) / (4 * f) } function radinatBetweenTwoPoints(a, e, b, d) { return Math.atan2(a - e, b - d) } function degreesToRadians(a) { return a * Math.PI / 180 } function checkRectCollision(a, e) { var b = getBounds(a, .9); var d = getBounds(e, .98); return calculateIntersection(b, d) } function calculateIntersection(a, e) { var b, d, c, f; var g = a.x + (b = a.width / 2); var h = a.y + (d = a.height / 2); var k = e.x + (c = e.width / 2); var l = e.y + (f = e.height / 2); g = Math.abs(g - k) - (b + c); h = Math.abs(h - l) - (d + f); return 0 > g && 0 > h ? (g = Math.min(Math.min(a.width, e.width), -g), h = Math.min(Math.min(a.height, e.height), -h), { x: Math.max(a.x, e.x), y: Math.max(a.y, e.y), width: g, height: h, rect1: a, rect2: e }) : null } function calculateProspective(a, e, b) { e = getAngleBetweenPoints(a, e) - 90; a = { skewX: e, skewY: 0 }; e = b * Math.abs(Math.cos(degreesToRadians(e))); a.skewY = b / e; return a } function lineDistance(a, e) { var b = e.x - a.x; var d = e.y - a.y; return Math.sqrt(b * b + d * d) } function getBounds(a, e) { var b = { x: Infinity, y: Infinity, width: 0, height: 0 }; if (a instanceof createjs.Container) { b.x2 = -Infinity; b.y2 = -Infinity; var d = a.children, c = d.length, f; for (f = 0; f < c; f++) { var g = getBounds(d[f], 1); g.x < b.x && (b.x = g.x); g.y < b.y && (b.y = g.y); g.x + g.width > b.x2 && (b.x2 = g.x + g.width); g.y + g.height > b.y2 && (b.y2 = g.y + g.height) } Infinity == b.x && (b.x = 0); Infinity == b.y && (b.y = 0); Infinity == b.x2 && (b.x2 = 0); Infinity == b.y2 && (b.y2 = 0); b.width = b.x2 - b.x; b.height = b.y2 - b.y; delete b.x2; delete b.y2 } else { if (a instanceof createjs.Bitmap) { c = a.sourceRect || a.image; f = c.width * e; var h = c.height * e } else if (a instanceof createjs.Sprite) if (a.spriteSheet._frames && a.spriteSheet._frames[a.currentFrame] && a.spriteSheet._frames[a.currentFrame].image) { c = a.spriteSheet.getFrame(a.currentFrame); f = c.rect.width; h = c.rect.height; d = c.regX; var k = c.regY } else b.x = a.x || 0, b.y = a.y || 0; else b.x = a.x || 0, b.y = a.y || 0; d = d || 0; f = f || 0; k = k || 0; h = h || 0; b.regX = d; b.regY = k; c = a.localToGlobal(0 - d, 0 - k); g = a.localToGlobal(f - d, h - k); f = a.localToGlobal(f - d, 0 - k); d = a.localToGlobal(0 - d, h - k); b.x = Math.min(Math.min(Math.min(c.x, g.x), f.x), d.x); b.y = Math.min(Math.min(Math.min(c.y, g.y), f.y), d.y); b.width = Math.max(Math.max(Math.max(c.x, g.x), f.x), d.x) - b.x; b.height = Math.max(Math.max(Math.max(c.y, g.y), f.y), d.y) - b.y } return b } function createGenericText(a, e) { var b = null, d = a.width, c = a.height, f = 0; "center" === a.align && (f = -d / 2); f = a.pos.x + f; var g = a.pos.y + -c / 2; a.outline && (b = new CTLText(e, f, g, d, c, a.size, a.align, FONT_STROKE, PRIMARY_FONT, a.line_height, 2, 2, a.text, !0, !0, a.multiline, !1), b.setOutline(a.outline_size)); return { text: new CTLText(e, f, g, d, c, a.size, a.align, FONT_COLOR, PRIMARY_FONT, a.line_height, 2, 2, a.text, !0, !0, a.multiline, !1), outline: b } } function NoClickDelay(a) { this.element = a; window.Touch && this.element.addEventListener("touchstart", this, !1) } function shuffle(a) { for (var e = a.length, b, d; 0 < e;) d = Math.floor(Math.random() * e), e--, b = a[e], a[e] = a[d], a[d] = b; 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 e = document.createEvent("MouseEvents"); e.initEvent("click", !0, !0); a.dispatchEvent(e) } } }; (function() { function a(b) { var d = { focus: "visible", focusin: "visible", pageshow: "visible", blur: "hidden", focusout: "hidden", pagehide: "hidden" }; b = b || window.event; b.type in d ? document.body.className = d[b.type] : (document.body.className = this[e] ? "hidden" : "visible", "hidden" === document.body.className ? (s_oMain.stopUpdate(), s_bFocus = !1) : (s_oMain.startUpdate(), s_bFocus = !0)) } var e = "hidden"; e in document ? document.addEventListener("visibilitychange", a) : (e = "mozHidden") in document ? document.addEventListener("mozvisibilitychange", a) : (e = "webkitHidden") in document ? document.addEventListener("webkitvisibilitychange", a) : (e = "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 e = window.location.search.substring(1).split("&"), b = 0; b < e.length; b++) { var d = e[b].split("="); if (d[0] == a) return d[1] } } function saveItem(a, e) { s_bStorageAvailable && localStorage.setItem(a, e) } function getItem(a) { return s_bStorageAvailable ? localStorage.getItem(a) : null } function randomIntBetween(a, e) { return Math.floor(Math.random() * (e - a + 1) + a) } function getDevicePixelRatio() { return window.devicePixelRatio } 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 = {}, e, b, d, c, f, g; this.init = function(h, k, l) { e = {}; d = b = 0; c = h; f = k; g = l }; this.addSprite = function(h, k) { if (!a.hasOwnProperty(h)) { var l = new Image; a[h] = e[h] = { szPath: k, oSprite: l, bLoaded: !1 }; b++ } }; this.getSprite = function(h) { return a.hasOwnProperty(h) ? a[h].oSprite : null }; this._onSpritesLoaded = function() { b = 0; f.call(g) }; this._onSpriteLoaded = function() { c.call(g); ++d === b && this._onSpritesLoaded() }; this.loadSprites = function() { for (var h in e) e[h].oSprite.oSpriteLibrary = this, e[h].oSprite.szKey = h, e[h].oSprite.onload = function() { this.oSpriteLibrary.setLoaded(this.szKey); this.oSpriteLibrary._onSpriteLoaded(this.szKey) }, e[h].oSprite.onerror = function(k) { var l = k.currentTarget; setTimeout(function() { e[l.szKey].oSprite.src = e[l.szKey].szPath }, 500) }, e[h].oSprite.src = e[h].szPath }; this.setLoaded = function(h) { a[h].bLoaded = !0 }; this.isLoaded = function(h) { return a[h].bLoaded }; this.getNumSprites = function() { return b } } var CANVAS_WIDTH = 1920, CANVAS_HEIGHT = 1920, EDGEBOARD_X = 520, EDGEBOARD_Y = 520, PRIMARY_FONT = "arialrounded", FONT_COLOR = "#fff", FONT_STROKE = "#002a59", FONT_OUTLINE = 3, FPS = 60, FPS_TIME = 1E3 / FPS, DISABLE_SOUND_MOBILE = !1, ENABLE_FULLSCREEN = !0, SOUNDTRACK_VOLUME_IN_GAME = .75, STATE_LOADING = 0, STATE_MENU = 1, STATE_DIFFICULTY_MENU = 2, STATE_LEVEL_MENU = 3, STATE_GAME = 4, 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_MSG_BOX_LEFT_BUT = 6, ON_MSG_BOX_CENTER_BUT = 7, ON_MSG_BOX_RIGHT_BUT = 8, ON_PRESS_EXIT = 9, ON_PRESS_PAUSE = 10, ON_PRESS_DOWN_BUT_ARROW_LEFT = 11, ON_PRESS_DOWN_BUT_ARROW_RIGHT = 12, ON_PRESS_RESTART = 13, ON_PRESS_YES = 14, ON_PRESS_NO = 15, ON_PRESS_HOME = 16, ON_PRESS_CONTINUE = 17, SAVED_GAME_STORAGE = "connect_dots_saved", BACKGROUND_COLOR = "#0F0055", EASY = 0, HARD = 1, MOUSE_DOWN_DOTS_DISTANCE_MOBILE = 90, DOTS_TUTORIAL = 0, ON_END_TUTORIAL = 0, GAME_STATE_HELP = 0, GAME_STATE_PLAY = 1, GAME_STATE_GAME_OVER = 2, GAME_STATE_PAUSE = 3, START_CONNECTED_RATIO = .2, MS_BEND_EFFECT_TIME = 300, MS_FILL_LINE_EFFECT_TIME = 500, MS_FILL_DOT_EFFECT_TIME = 500, MS_STROKE_DOT_EFFECT_TIME = 200, EASE_LINEAR = 0, EASE_QUAD_IN = 1, EASE_QUAD_OUT = 2, EASE_SINE_IN = 3, EASE_CUBIC_IN = 4, EASE_CUBIC_OUT = 5, EASE_CUBIC_IN_OUT = 6, EASE_QUART_IN = 7, EASE_QUART_OUT = 8, EASE_CIRCULAR_IN = 9, UNLOCK_ALL_LEVEL = !1, SHOW_DOT_TEXT_ID = !1, SHOW_PRESSMOVE_DISTANCE = !1, SHOW_DOT_HIT_AREA = !1, ENABLE_CHECK_ORIENTATION, DOTS_PROPERTY, LINES_PROPERTY, CATCH_DOT_TOLLERANCE; this.createjs = this.createjs || {}; (function() { function a(c, f) { if ("#" === c[0]) { var g = [0, 0, 0, 1], h = d.HEX_RE.exec(c); h && (h = h[1], 3 === h.length && (h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2]), h = parseInt(h, 16), g[0] = h >> 16, g[1] = h >> 8 & 255, g[2] = h & 255, "rgb" !== f && e(g)); return g } g = [0, 0, 0, 1]; if (h = d.RGB_HSL_RE.exec(c)) { var k = "r" === c[0], l = k && -1 !== c.lastIndexOf("%") ? 2.55 : 1; g[0] = parseInt(h[1]) * l; g[1] = parseInt(h[2]) * l; g[2] = parseInt(h[3]) * l; g[3] = void 0 === h[4] ? 1 : parseFloat(h[4]); if (k || "rgb" !== f) k && "rgb" !== f && e(g); else { h = g[0] % 360 / 360; l = g[1] / 100; k = g[2] / 100; if (0 == l) k = l = h = k; else { var r = .5 > k ? k * (1 + l) : k + l - k * l, p = 2 * k - r; k = b(p, r, h + 1 / 3); l = b(p, r, h); h = b(p, r, h - 1 / 3) } g[0] = 255 * k; g[1] = 255 * l; g[2] = 255 * h } } return g } function e(c) { var f = c[0], g = c[1], h = c[2], k = 1 / 255; f *= k; g *= k; h *= k; var l = Math.max(f, g, h), r = Math.min(f, g, h); k = .5 * (l + r); if (l === r) f = r = 0; else { var p = l - r; r = .5 < k ? p / (2 - l - r) : p / (l + r); f = (l === f ? (g - h) / p + (g < h ? 6 : 0) : l === g ? (h - f) / p + 2 : (f - g) / p + 4) / 6 } c[0] = 360 * f; c[1] = 100 * r; c[2] = 100 * k } function b(c, f, g) { 0 > g ? g += 1 : 1 < g && --g; return g < 1 / 6 ? c + 6 * (f - c) * g : .5 > g ? f : g < 2 / 3 ? c + (f - c) * (2 / 3 - g) * 6 : c } var d = function() { throw "ColorPlugin cannot be instantiated."; }; d.COLOR_RE = /^#[0-9a-fA-F]{3}|^hsla?\(|^rgba?\(/; d.RGB_HSL_RE = /^(?:rgb|hsl)a?\((\d{1,3})%?, ?(\d{1,3})%?, ?(\d{1,3})%?(?:, ?([0-9.]+))?\)$/; d.HEX_RE = /^#((?:[a-f0-9]{3}){1,2})$/i; d._mode = "rgb"; d.ID = "Color"; d.install = function(c) { d._mode = c || d._mode; createjs.Tween._installPlugin(d) }; d.init = function(c, f, g) { var h = c.pluginData; g = void 0 === g ? c.target[f] : g; if (!h.Color_disabled && "string" === typeof g && d.COLOR_RE.exec(g)) return c._addPlugin(d), (h.Color || (h.Color = {}))[f] = !0, a(g, d._mode) }; d.step = function(c, f, g) { var h; c = c.pluginData.Color; for (h in g) c[h] && (f.props[h] = a(f.props[h], d._mode)) }; d.change = function(c, f, g, h, k, l) { if (c.pluginData.Color[g]) { c = f.prev.props[g]; l = f.props[g]; f = l[0] - c[0]; g = c[1] + (l[1] - c[1]) * k + .5 | 0; h = c[2] + (l[2] - c[2]) * k + .5 | 0; l = (c[3] + (l[3] - c[3]) * k).toFixed(3); if ("rgb" === d._mode) return "rgba(" + (c[0] + f * k + .5 | 0) + ", " + g + ", " + h + ", " + l + ")"; 180 < f ? f -= 360 : -180 > f && (f += 360); return "hsla(" + ((c[0] + f * k + 360) % 360 + .5 | 0) + ", " + g + "%, " + h + "%, " + l + ")" } }; createjs.ColorPlugin = d })(); function CPreloader() { var a, e, b, d, c, f, g, h, k; 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(); k = new createjs.Container; s_oStage.addChild(k) }; this.unload = function() { k.removeAllChildren() }; this._onImagesLoaded = function() {}; this._onAllImagesLoaded = function() { this.attachSprites(); s_oMain.preloaderReady() }; this.attachSprites = function() { var l = new createjs.Shape; l.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); k.addChild(l); l = s_oSpriteLibrary.getSprite("200x200"); g = createBitmap(l); g.regX = .5 * l.width; g.regY = .5 * l.height; g.x = CANVAS_WIDTH / 2; g.y = CANVAS_HEIGHT / 2 - 80; k.addChild(g); h = new createjs.Shape; h.graphics.beginFill("rgba(0,0,0,0.01)").drawRoundRect(g.x - 100, g.y - 100, 200, 200, 10); k.addChild(h); g.mask = h; l = s_oSpriteLibrary.getSprite("progress_bar"); d = createBitmap(l); d.x = CANVAS_WIDTH / 2 - l.width / 2; d.y = CANVAS_HEIGHT / 2 + 50; k.addChild(d); a = l.width; e = l.height; c = new createjs.Shape; c.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(d.x, d.y, 1, e); k.addChild(c); d.mask = c; b = new createjs.Text("", "40px " + PRIMARY_FONT, "#fff"); b.x = CANVAS_WIDTH / 2; b.y = CANVAS_HEIGHT / 2 + 110; b.textBaseline = "alphabetic"; b.textAlign = "center"; k.addChild(b); f = new createjs.Shape; f.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); k.addChild(f); createjs.Tween.get(f).to({ alpha: 0 }, 500).call(function() { createjs.Tween.removeTweens(f); k.removeChild(f) }) }; this._onButStartRelease = function() { s_oMain.onRemovePreloader() }; this.refreshLoader = function(l) { b.text = l + "%"; 100 === l && (s_oMain.onRemovePreloader(), b.visible = !1, d.visible = !1); c.graphics.clear(); l = Math.floor(l * a / 100); c.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(d.x, d.y, l, e) }; this._init() } function CMain(a) { var e, b = 0, d = 0, c = STATE_LOADING, f, g; this.initContainer = function() { s_oCanvas = document.getElementById("canvas"); s_oStage = new createjs.Stage(s_oCanvas); s_oStage.preventSelection = !1; createjs.Touch.enable(s_oStage, !0); s_bMobile = isMobile(); !1 === s_bMobile ? (s_oHammer = null, s_oStage.enableMouseOver(FPS), $("body").on("contextmenu", "#canvas", function(h) { return !1 })) : (s_oHammer = new Hammer(s_oCanvas), s_oHammer.get("pinch").set({ enable: !0 }), s_oHammer.get("pan").set({ enable: !0 }), s_oHammer.get("press").set({ enable: !1 }), s_oHammer.get("rotate").set({ enable: !1 }), s_oHammer.get("swipe").set({ enable: !0 }), s_oHammer.get("tap").set({ enable: !1 }), s_oHammer.get("swipe").set({ direction: Hammer.DIRECTION_ALL }), s_oHammer.get("swipe").set({ velocity: .5 }), s_oHammer.get("swipe").set({ threshold: 2 })); 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; createjs.ColorPlugin.install(); f = new CPreloader; }; this.preloaderReady = function() { e = !0; s_oMain._loadImages(); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_oMain._initSounds() }; this.soundLoaded = function() { b++; f.refreshLoader(Math.floor(b / d * 100)) }; this._initSounds = function() { Howler.mute(!s_bAudioActive); s_aSoundsInfo = []; s_aSoundsInfo.push({ path: "./sounds/", filename: "press_but", loop: !1, volume: 1, ingamename: "press_but" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "game_over", loop: !1, volume: 1, ingamename: "game_over" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "soundtrack", loop: !0, volume: 1, ingamename: "soundtrack" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "dot_linked", loop: !1, volume: 1, ingamename: "dot_linked" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "star", loop: !1, volume: 1, ingamename: "star" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "win", loop: !1, volume: 1, ingamename: "win" }); d += s_aSoundsInfo.length; s_aSounds = []; for (var h = 0; h < s_aSoundsInfo.length; h++) this.tryToLoadSound(s_aSoundsInfo[h], !1) }; this.tryToLoadSound = function(h, k) { setTimeout(function() { s_aSounds[h.ingamename] = new Howl({ src: [h.path + h.filename + ".mp3"], autoplay: !1, preload: !0, loop: h.loop, volume: h.volume, onload: s_oMain.soundLoaded, onloaderror: function(l, r) { for (var p = 0; p < s_aSoundsInfo.length; p++) if (l === s_aSounds[s_aSoundsInfo[p].ingamename]._sounds[0]._id) { s_oMain.tryToLoadSound(s_aSoundsInfo[p], !0); break } }, onplayerror: function(l) { for (var r = 0; r < s_aSoundsInfo.length; r++) if (l === s_aSounds[s_aSoundsInfo[r].ingamename]._sounds[0]._id) { s_aSounds[s_aSoundsInfo[r].ingamename].once("unlock", function() { s_aSounds[s_aSoundsInfo[r].ingamename].play(); "soundtrack" === s_aSoundsInfo[r].ingamename && null !== s_oGame && setVolume("soundtrack", SOUNDTRACK_VOLUME_IN_GAME) }); break } } }) }, k ? 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("ctl_logo", "./sprites/ctl_logo.png"); s_oSpriteLibrary.addSprite("logo_menu", "./sprites/logo_menu.png"); s_oSpriteLibrary.addSprite("but_info", "./sprites/but_info.png"); s_oSpriteLibrary.addSprite("but_pause", "./sprites/but_pause.png"); s_oSpriteLibrary.addSprite("but_restart", "./sprites/but_restart.png"); s_oSpriteLibrary.addSprite("but_home", "./sprites/but_home.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("but_arrow_left", "./sprites/but_arrow_left.png"); s_oSpriteLibrary.addSprite("but_arrow_right", "./sprites/but_arrow_right.png"); s_oSpriteLibrary.addSprite("but_continue", "./sprites/but_continue.png"); s_oSpriteLibrary.addSprite("but_no", "./sprites/but_no.png"); s_oSpriteLibrary.addSprite("but_yes", "./sprites/but_yes.png"); s_oSpriteLibrary.addSprite("hand", "./sprites/hand.png"); s_oSpriteLibrary.addSprite("score_panel", "./sprites/score_panel.png"); s_oSpriteLibrary.addSprite("timer_panel", "./sprites/timer_panel.png"); s_oSpriteLibrary.addSprite("bg_game", "./sprites/bg_game.jpg"); s_oSpriteLibrary.addSprite("bg_menu", "./sprites/bg_menu.jpg"); s_oSpriteLibrary.addSprite("bg_level_menu", "./sprites/bg_level_menu.jpg"); s_oSpriteLibrary.addSprite("but_level", "./sprites/but_level.png"); s_oSpriteLibrary.addSprite("star", "./sprites/star.png"); s_oSpriteLibrary.addSprite("but_easy", "./sprites/but_easy.png"); s_oSpriteLibrary.addSprite("but_hard", "./sprites/but_hard.png"); s_oSpriteLibrary.addSprite("but_continue_big", "./sprites/but_continue_big.png"); try { for (var h = 0; h < s_oLevelConfigEasy.length; h++) for (var k = s_oLevelConfigEasy[h].img_used, l = 0; l < k.length; l++) { var r = k[l].name; s_oSpriteLibrary.addSprite(r, "./sprites/levels_images/" + r) } if (!s_bMobile) for (h = 0; h < s_oLevelConfigHard.length; h++) for (k = s_oLevelConfigHard[h].img_used, l = 0; l < k.length; l++) r = k[l].name, s_oSpriteLibrary.addSprite(r, "./sprites/levels_images/" + r) } catch (p) { console.log(p) } d += s_oSpriteLibrary.getNumSprites(); s_oSpriteLibrary.loadSprites() }; this._onImagesLoaded = function() { b++; f.refreshLoader(Math.floor(b / d * 100)) }; this.onRemovePreloader = function() { f.unload(); try { saveItem("ls_available", "ok") } catch (h) { s_bStorageAvailable = !1 } s_oSoundTrack = playSound("soundtrack", 1, !0); this.gotoMenu() }; this._onAllImagesLoaded = function() {}; this.clearLocalStorage = function() { s_iLastLevel = 1; s_bStorageAvailable && localStorage.clear() }; this.gotoMenu = function() { new CMenu; c = STATE_MENU }; this.gotoDifficultyMenu = function() { new CDifficultyMenu; c = STATE_DIFFICULTY_MENU }; this.gotoLevelMenu = function(h) { new CLevelMenu(h); c = STATE_LEVEL_MENU }; this.gotoGame = function(h) { g = new CGame(h); c = STATE_GAME }; this.stopUpdate = function() { e = !1; createjs.Ticker.paused = !0; $("#block_game").css("display", "block"); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || Howler.mute(!0) }; this.startUpdate = function() { s_iPrevTime = (new Date).getTime(); e = !0; createjs.Ticker.paused = !1; $("#block_game").css("display", "none"); (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) && s_bAudioActive && Howler.mute(!1) }; this._update = function(h) { if (!1 !== e) { var k = (new Date).getTime(); s_iTimeElaps = k - s_iPrevTime; s_iCntTime += s_iTimeElaps; s_iCntFps++; s_iPrevTime = k; 1E3 <= s_iCntTime && (s_iCurFps = s_iCntFps, s_iCntTime -= 1E3, s_iCntFps = 0); c === STATE_GAME && g.update(); s_oStage.update(h) } }; s_oMain = this; ENABLE_FULLSCREEN = a.fullscreen; ENABLE_CHECK_ORIENTATION = a.check_orientation; DOTS_PROPERTY = a.dots_property; LINES_PROPERTY = a.lines_property; CATCH_DOT_TOLLERANCE = a.catch_dot_tollerance; SCORE_TIME_MULTIPLIER = a.score_time_multiplier; 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_iLastLevel = 1, s_iDifficultyChoose = EASY, s_bStorageAvailable = !0, s_oLevelConfig, s_oLevelProperties, s_oDrawLayer, s_oStage, s_oMain, s_oGame = null, s_oLevelMenu = null, s_oDifficultyMenu = null, s_oSpriteLibrary, s_oSoundTrack = null, s_oCanvas, s_aSounds, s_aSoundsInfo, s_oHammer; function CTextButton(a, e, b, d, c, f) { var g, h, k, l, r, p, m, t, q, z; this._init = function(u, A, n, y, B, v) { t = []; q = []; z = []; m = !1; g = v; h = new createjs.Container; h.x = u; h.y = A; h.regX = n.width / 2; h.regY = n.height / 2; u = createBitmap(n); h.addChild(u); u = n.width - 20; A = n.height - 20; v = n.width / 2; n = n.height / 2; l = new CTLText(h, v - u / 2, n - A / 2, u, A, B, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, y, !0, !0, !0, !1); l.setOutline(FONT_OUTLINE); k = new CTLText(h, v - u / 2, n - A / 2, u, A, B, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, y, !0, !0, !0, !1); g.addChild(h); s_bMobile || (h.cursor = "pointer"); this._initListener() }; this.unload = function() { h.off("mousedown", r); h.off("pressup", p); g.removeChild(h) }; this.setVisible = function(u) { h.visible = u }; this._initListener = function() { r = h.on("mousedown", this.buttonDown); p = h.on("pressup", this.buttonRelease) }; this.addEventListener = function(u, A, n, y) { t[u] = A; q[u] = n; z[u] = y }; this.buttonRelease = function() { m || (h.scaleX = 1, h.scaleY = 1, playSound("press_but", 1, !1), t[ON_MOUSE_UP] && t[ON_MOUSE_UP].call(q[ON_MOUSE_UP], z[ON_MOUSE_UP])) }; this.buttonDown = function() { m || (h.scaleX = .9, h.scaleY = .9, t[ON_MOUSE_DOWN] && t[ON_MOUSE_DOWN].call(q[ON_MOUSE_DOWN], z[ON_MOUSE_DOWN])) }; this.changeText = function(u) { k.refreshText(u); l.refreshText(u) }; this.block = function(u) { m = u }; this.setPosition = function(u, A) { h.x = u; h.y = A }; this.setX = function(u) { h.x = u }; this.setY = function(u) { h.y = u }; this.setTextPosition = function(u, A) { k.setX(u); k.setY(A); l.setX(u); l.setY(A) }; this.setTextX = function(u) { k.setX(u); l.setX(u) }; this.setTextY = function(u) { k.setY(u); l.setY(u) }; this.getContainer = function() { return h }; this.getX = function() { return h.x }; this.getY = function() { return h.y }; this._init(a, e, b, d, c, f); return this } function CToggle(a, e, b, d, c) { var f, g, h, k, l, r, p; this._init = function(m, t, q, z, u) { p = void 0 !== u ? u : s_oStage; g = []; h = []; u = new createjs.SpriteSheet({ images: [q], frames: { width: q.width / 2, height: q.height, regX: q.width / 2 / 2, regY: q.height / 2 }, animations: { state_true: [0], state_false: [1] } }); f = z; k = createSprite(u, "state_" + f, q.width / 2 / 2, q.height / 2, q.width / 2, q.height); k.x = m; k.y = t; k.stop(); s_bMobile || (k.cursor = "pointer"); p.addChild(k); this._initListener() }; this.unload = function() { k.off("mousedown", l); k.off("pressup", r); p.removeChild(k) }; this._initListener = function() { l = k.on("mousedown", this.buttonDown); r = k.on("pressup", this.buttonRelease) }; this.addEventListener = function(m, t, q) { g[m] = t; h[m] = q }; this.setCursorType = function(m) { k.cursor = m }; this.setActive = function(m) { f = m; k.gotoAndStop("state_" + f) }; this.buttonRelease = function() { k.scaleX = 1; k.scaleY = 1; playSound("press_but", 1, !1); f = !f; k.gotoAndStop("state_" + f); g[ON_MOUSE_UP] && g[ON_MOUSE_UP].call(h[ON_MOUSE_UP], f) }; this.buttonDown = function() { k.scaleX = .9; k.scaleY = .9; g[ON_MOUSE_DOWN] && g[ON_MOUSE_DOWN].call(h[ON_MOUSE_DOWN]) }; this.setPosition = function(m, t) { k.x = m; k.y = t }; this._init(a, e, b, d, c) } function CGfxButton(a, e, b, d) { var c, f, g, h, k, l, r, p, m = !1; this._init = function(q, z, u) { c = []; f = []; h = []; g = createBitmap(u); g.x = q; g.y = z; l = k = 1; g.regX = u.width / 2; g.regY = u.height / 2; s_bMobile || (g.cursor = "pointer"); t.addChild(g); this._initListener() }; this.unload = function() { g.off("mousedown", r); g.off("pressup", p); t.removeChild(g) }; this.setVisible = function(q) { g.visible = q }; this.setCursorType = function(q) { g.cursor = q }; this._initListener = function() { r = g.on("mousedown", this.buttonDown); p = g.on("pressup", this.buttonRelease) }; this.addEventListener = function(q, z, u) { c[q] = z; f[q] = u }; this.addEventListenerWithParams = function(q, z, u, A) { c[q] = z; f[q] = u; h[q] = A }; this.buttonRelease = function() { m || (g.scaleX = 0 < k ? k : -k, g.scaleY = l, playSound("press_but", 1, !1), c[ON_MOUSE_UP] && c[ON_MOUSE_UP].call(f[ON_MOUSE_UP], h[ON_MOUSE_UP])) }; this.buttonDown = function() { m || (g.scaleX = 0 < k ? .9 * k : .9 * -k, g.scaleY = .9 * l, c[ON_MOUSE_DOWN] && c[ON_MOUSE_DOWN].call(f[ON_MOUSE_DOWN], h[ON_MOUSE_DOWN])) }; this.rotation = function(q) { g.rotation = q }; this.getButton = function() { return g }; this.setPosition = function(q, z) { g.x = q; g.y = z }; this.setX = function(q) { g.x = q }; this.setY = function(q) { g.y = q }; this.setRotation = function(q) { g.rotation = q }; this.getButtonImage = function() { return g }; this.block = function(q) { m = q; g.scaleX = k; g.scaleY = l }; this.setScaleX = function(q) { k = g.scaleX = q }; this.setScale = function(q) { l = k = q; g.scaleX = g.scaleY = q }; this.getX = function() { return g.x }; this.getY = function() { return g.y }; this.pulseAnimation = function() { createjs.Tween.get(g, { override: !0, loop: -1 }).to({ scaleX: .9 * k, scaleY: .9 * l }, 850, createjs.Ease.quadOut).to({ scaleX: k, scaleY: l }, 650, createjs.Ease.quadIn) }; this.trebleAnimation = function() { createjs.Tween.get(g, { override: !0, loop: -1 }).to({ rotation: 5 }, 75, createjs.Ease.quadOut).to({ rotation: -5 }, 140, createjs.Ease.quadIn).to({ rotation: 0 }, 75, createjs.Ease.quadIn).wait(750) }; this.removeAllTweens = function() { createjs.Tween.removeTweens(g) }; var t = void 0 !== d ? d : s_oStage; this._init(a, e, b); return this } function CMenu() { var a, e, b, d, c, f, g, h, k, l, r, p, m = null, t, q, z, u, A, n = null, y = null, B; this._init = function() { r = createBitmap(s_oSpriteLibrary.getSprite("bg_menu")); s_oStage.addChild(r); var v = s_oSpriteLibrary.getSprite("but_play"); b = CANVAS_WIDTH / 2; d = CANVAS_HEIGHT / 2 + 300; m = null; if (null !== getItem(SAVED_GAME_STORAGE)) { var D = s_oSpriteLibrary.getSprite("but_continue_big"); b = CANVAS_WIDTH / 2 - v.width; a = CANVAS_WIDTH / 2 + v.width; e = d; m = new CGfxButton(a, e, D, s_oStage); m.addEventListener(ON_MOUSE_UP, this._onButContinueRelease, this); m.pulseAnimation() } p = new CGfxButton(b, d, v, s_oStage); p.addEventListener(ON_MOUSE_UP, this._onButPlayRelease, this); null === m && p.pulseAnimation(); v = s_oSpriteLibrary.getSprite("but_info"); k = v.height / 2 + 10; l = v.height / 2 + 10; z = new CGfxButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT - 240, v, s_oStage); z.addEventListener(ON_MOUSE_UP, this._onCreditsBut, this); v = s_oSpriteLibrary.getSprite("logo_menu"); A = createBitmap(v); A.regX = v.width / 2; A.regY = v.height / 2; A.x = CANVAS_WIDTH / 2; A.y = CANVAS_HEIGHT / 2 + 100; A.scaleX = A.scaleY = 0; s_oStage.addChild(A); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) v = s_oSpriteLibrary.getSprite("audio_icon"), g = CANVAS_WIDTH - v.height / 2 - 10, h = v.height / 2 + 10, q = new CToggle(g, h, v, s_bAudioActive, s_oStage), q.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); v = window.document; D = v.documentElement; n = D.requestFullscreen || D.mozRequestFullScreen || D.webkitRequestFullScreen || D.msRequestFullscreen; y = v.exitFullscreen || v.mozCancelFullScreen || v.webkitExitFullscreen || v.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (n = !1); n && screenfull.isEnabled && (v = s_oSpriteLibrary.getSprite("but_fullscreen"), c = k + v.width / 2, f = v.height / 2 + 10, u = new CToggle(c, f, v, s_bFullscreen, s_oStage), u.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); B = new CAreYouSurePanel(TEXT_SAVE_DELETE, s_oStage); B.addEventListener(ON_PRESS_YES, this._onPressUpButYes, this); B.addEventListener(ON_PRESS_NO, this._onPressUpButNo, this); t = new createjs.Shape; t.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(t); createjs.Tween.get(t).to({ alpha: 0 }, 150).call(function() { t.visible = !1; createjs.Tween.get(A).to({ scaleX: 1, scaleY: 1, y: CANVAS_HEIGHT / 2 - 50 }, 400, createjs.Ease.backOut).call(function() { createjs.Tween.removeTweens(t) }) }); if (!s_bStorageAvailable) { var G = new CMsgBox(20, TEXT_ERR_LS, "", TEXT_OK, ""); G.addEventListener(ON_MSG_BOX_CENTER_BUT, function() { G.hide() }, this) } this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.unload = function() { p.unload(); p = null; t.visible = !1; z.unload(); null !== m && (m.unload(), m = null); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) q.unload(), q = null; n && screenfull.isEnabled && u.unload(); s_oStage.removeChild(r, A); s_oMenu = r = null }; this.refreshButtonPos = function(v, D) { z.setPosition(k + v, l + D); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || q.setPosition(g - v, h + D); n && screenfull.isEnabled && u.setPosition(c + v, f + D) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onCreditsBut = function() { new CCreditsPanel }; this._exitFromMenu = function() { null !== m && m.block(!0); p.block(!0); this.unload(); s_oLevelConfig = s_oLevelConfigEasy; s_oLevelProperties = LEVELS_PROPERTIES_EASY; s_iDifficultyChoose = EASY; s_bMobile ? s_oMain.gotoLevelMenu() : s_oMain.gotoDifficultyMenu() }; this._onButContinueRelease = function() { s_oMenu._exitFromMenu() }; this._onButPlayRelease = function() { null === getItem(SAVED_GAME_STORAGE) ? s_oMenu._exitFromMenu() : B.show() }; this._onPressUpButYes = function() { s_oMain.clearLocalStorage(); s_oMenu._exitFromMenu() }; this._onPressUpButNo = function() { B.hide() }; this.resetFullscreenBut = function() { u.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? y.call(window.document) : n.call(window.document.documentElement); sizeHandler() }; s_oMenu = this; this._init() } var s_oMenu = null; function CGame(a) { var e, b, d, c, f, g, h, k, l, r, p, m, t, q, z, u, A, n, y, B, v, D, G, E, Q, O, I, J, P, R, L, T, V, Z, w, M; this._init = function(x) { $(s_oMain).trigger("start_session"); r = new createjs.Container; s_oStage.addChild(r); v = x; g = R = Z = V = null; Q = s_bMobile ? CATCH_DOT_TOLLERANCE.mobile : CATCH_DOT_TOLLERANCE.desktop; Q *= getDevicePixelRatio(); Q += s_bMobile ? DOTS_PROPERTY.radius.mobile : DOTS_PROPERTY.radius.desktop; x = s_oSpriteLibrary.getSprite("bg_game"); A = createBitmap(x); r.addChild(A); A.cache(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); q = new createjs.Container; r.addChild(q); p = new createjs.Container; r.addChild(p); z = new createjs.Container; r.addChild(z); m = new createjs.Container; r.addChild(m); t = new createjs.Container; x = new createjs.Shape; x.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); t.hitArea = x; r.addChild(t); M = []; this.createLevel(); b = new CInterface(z); b.addEventListener(ON_PRESS_EXIT, this._onPressExit, this); b.addEventListener(ON_PRESS_PAUSE, this._onPauseButton, this); this.resetValuesLevel(); this.createPanels(); n = new CCompletedLevelEffect(s_oStage); u = new createjs.Shape; u.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); l = u.on("mousedown", function() {}); createjs.Tween.get(u, { override: !0 }).to({ alpha: 0, visible: !1 }, 300, createjs.Ease.cubicIn); s_oStage.addChild(u); h.setTimer(1E3 * s_oLevelProperties[v].time); e = GAME_STATE_HELP; 0 === v ? this._startInteractiveHelp() : (r.setChildIndex(z, r.numChildren - 1), this.startGame(), this.addDotsEventMouseDown()); SHOW_PRESSMOVE_DISTANCE && (x = new createjs.Shape, I = x.graphics.beginFill("rgba(255,0,0,0.5)").drawCircle(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2, Q).command, r.addChild(x)); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this._startInteractiveHelp = function() { g = new CInteractiveHelp(z); g.addEventListener(ON_END_TUTORIAL, this._onEndInteractiveTutorial, this); g.startTutorial({ tutorial: DOTS_TUTORIAL, info: { dots: M, mouse_down: this._onPressDownDot, press_move: this._onStagePressMove, reset: this.restartGame, scope: this } }) }; this._onEndInteractiveTutorial = function() { this.restartGame(); r.setChildIndex(z, r.numChildren - 1); setTimeout(function() { M[0].animPulse(); if (null !== O || void 0 !== O) O.reset(), O = null, s_oGame.addDotsEventMouseDown(), e = GAME_STATE_PLAY }, MS_FILL_DOT_EFFECT_TIME); this.removeGradientLineAnimation(); this.startGame(); e = GAME_STATE_HELP; r.setChildIndex(z, r.numChildren - 1); g = null }; this.createPanels = function() { var x = s_oSpriteLibrary.getSprite("timer_panel"); h = new CTimerPanel(z, x.width / 2 + 10, x.height + x.height / 2 + 20, x); h.addEventListener(ON_END_TIMER, this._onEndTime, this); x = s_oSpriteLibrary.getSprite("msg_box"); c = new CPause(z); c.addEventListener(ON_PRESS_PAUSE_PANEL, this._onPausePanel, this); f = new CAreYouSurePanel(TEXT_ARE_SURE, z); f.addEventListener(ON_PRESS_YES, this._onPressYes, this); f.addEventListener(ON_PRESS_NO, this._onPressNo, this); d = new CGameOverPanel(x, z); d.addEventListener(ON_PRESS_RESTART, this._onPressRestart, this); d.addEventListener(ON_PRESS_HOME, this.onExit, this); k = new CWinPanel(x, z); k.addEventListener(ON_PRESS_RESTART, this._onPressRestart, this); k.addEventListener(ON_PRESS_HOME, this.onExit, this); k.addEventListener(ON_PRESS_CONTINUE, this._onNextLevel, this) }; this.resetValuesLevel = function() { D = E = G = 0; L = null; w = !1; t.alpha = 1; m.alpha = 1; this.refreshTotalScore() }; this.createLevel = function() { M = []; y = []; T = new createjs.Shape; for (var x = s_oLevelConfig[v], K = x.img_used, F = 0; F < K.length; F++) { var C = s_oSpriteLibrary.getSprite(K[F].name), N = createBitmap(C); N.scaleX = N.scaleY = K[F].scale; N.x = K[F].pos.x; N.y = K[F].pos.y; N.regX = C.width / 2; N.regY = C.height / 2; p.addChild(N); y.push(N) } x = x.dots; K = s_bMobile ? DOTS_PROPERTY.radius.mobile : DOTS_PROPERTY.radius.desktop; for (F = 0; F < x.length; F++) C = new CDot(t, { x: x[F].pos.x, y: x[F].pos.y, stroke_color: DOTS_PROPERTY.stroke_color, main_color: DOTS_PROPERTY.main_color, radius: K, stroke_thickness: DOTS_PROPERTY.stroke_thickness }, F), C.setOffsetTextRadiants(x[F].text_radiant_offset), M.push(C); K = T.graphics; K.beginFill(s_oLevelProperties[v].shape_color).moveTo(x[0].pos.x, x[0].pos.y); M[0].refreshTextPos(M[M.length - 1], M[1]); for (F = 1; F < M.length - 1; F++) M[F].refreshTextPos(M[F - 1], M[F + 1]), x = M[F].getPos(), K.lineTo(x.x, x.y); M[M.length - 1].refreshTextPos(M[M.length - 2], M[0]); x = M[M.length - 1].getPos(); K.lineTo(x.x, x.y); q.addChild(T); q.alpha = 0; p.alpha = 0 }; this.addDotsEventMouseDown = function() { t.on("mousedown", this._onPressDownDot, this) }; this.refreshTotalScore = function() { B = 0; for (var x = JSON.parse(getItem(SAVED_GAME_STORAGE)), K = 0; K < v; K++) B += x[s_iDifficultyChoose][K].score; b.refreshScore(B) }; this._onEndTime = function() { w = !0; this.disableStageEvents(); m.removeChild(J); d.show(0, 0); playSound("game_over", 1, !1).on("end", function() { tweenSoundVolume("soundtrack", SOUNDTRACK_VOLUME_IN_GAME, 500) }); tweenSoundVolume("soundtrack", .2, 500) }; this.getState = function() { return e }; this.unload = function() { b.unload(); d.unload(); c.unload(); f.unload(); k.unload(); u.off("mousedown", l); r.removeAllEventListeners(); M.forEach(function(x) { return x.unload() }); t.removeAllEventListeners(); this.disableStageEvents(); createjs.Tween.removeAllTweens(); s_oStage.removeAllChildren(); s_oStage.removeAllEventListeners(); s_oGame = null }; this.onExit = function() { u.alpha = .01; u.visible = !0; var x = createjs.Tween.get(u); x.to({ alpha: 1 }, 500, createjs.Ease.cubicIn); x.call(function() { s_oGame.unload(); s_oMain.gotoMenu() }); $(s_oMain).trigger("end_session") }; this._onPressRestart = function() { u.visible = !0; u.alpha = 0; var x = createjs.Tween.get(u); x.to({ alpha: 1 }, 500, createjs.Ease.cubicIn); x.call(this.restartGame, null, this); x.wait(200); x.to({ alpha: 0, visible: !1 }, 500, createjs.Ease.cubicOut); x.call(this.startGame, null, this) }; this._onPressHome = function() { this.onExit() }; this._onPauseButton = function() { e = GAME_STATE_PAUSE; c.show() }; this._onPausePanel = function() { e = GAME_STATE_PLAY; c.hide() }; this._onPressExit = function() { e = GAME_STATE_PAUSE; f.show() }; this._onLeaveHelp = function() { this.startGame(); g.unload() }; this._onPressNo = function() { f.hide(function() { e = GAME_STATE_PLAY }, this) }; this._onPressYes = function() { this.onExit() }; this.restartGame = function() { t.removeAllEventListeners(); s_oGame.resetValuesLevel(); m.removeAllChildren(); for (var x = 0; x < M.length; x++) M[x].reset(); c.hide(); f.hide(null); d.hide(); k.hide(); q.alpha = 0; p.alpha = 0; this.addDotsEventMouseDown(); $(s_oMain).trigger("restart_level", v) }; this.startGame = function() { tweenSoundVolume("soundtrack", SOUNDTRACK_VOLUME_IN_GAME, 700); e = GAME_STATE_PLAY; h.setTimer(1E3 * s_oLevelProperties[v].time); M[0].animPulse(); this.disableStageEvents(); $(s_oMain).trigger("start_level", v) }; this._onPressDownDot = function(x) { w || (x = this.getDotIDByDistance({ x: x.stageX, y: x.stageY }), null !== x && (O = M[x], O.removeAnimPulse(), O.getLinked() || O.animFillColor(DOTS_PROPERTY.connected_color), e === GAME_STATE_HELP ? this.checkSelectedDot(x) : (this.checkSelectedDot(x) && (V = s_oStage.on("pressmove", this._onStagePressMove, this)), Z = s_oStage.on("pressup", this._onStagePressUp, this)))) }; this.getDotIDByDistance = function(x) { var K = M[G].getPos(); return Math.abs(K.x - x.x) + Math.abs(K.y - x.y) < (s_bMobile ? MOUSE_DOWN_DOTS_DISTANCE_MOBILE : DOTS_PROPERTY.radius.desktop) ? G : null }; this.checkSelectedDot = function(x) { var K = x + 1 < M.length ? x + 1 : 0; if (D !== x || x !== M.length && 0 !== K && M[K].getLinked()) return !1; G = x; E = G + 1; O = M[G]; E >= M.length && (E = 0); x = O.getPos(); J = new createjs.Shape; J.graphics.setStrokeStyle(LINES_PROPERTY.thickness); P = { stroke: null, curve: null }; P.stroke = J.graphics.beginLinearGradientStroke([LINES_PROPERTY.connected_color, LINES_PROPERTY.main_color], [0, START_CONNECTED_RATIO], 0, 0, x.x, x.y).command; J.graphics.moveTo(x.x, x.y); K = this.calculateMidCurvePoint(x, x, { x: 0, y: 0 }); L = null; P.curve = J.graphics.curveTo(K.x, K.y, x.x, x.y).command; R = this.loopGradientLineAnimation(); m.addChild(J); return !0 }; this._onStagePressMove = function(x) { if (null !== O) { var K = M[E].getPos(), F = Math.abs(K.x - x.stageX) + Math.abs(K.y - x.stageY) - Q; x = { x: x.stageX, y: x.stageY }; this.lineUpdate(x); this.debugGraphicDistance(x, F); F < Q && this.linkDot(K) } }; this.debugGraphicDistance = function(x) { SHOW_PRESSMOVE_DISTANCE && (I.x = x.x, I.y = x.y) }; this._onStagePressUp = function() { null !== O && (O.getLinked() || O.animFillColor(DOTS_PROPERTY.main_color), O = null, this.disableStageEvents(), this.removeGradientLineAnimation(), m.removeChild(J)) }; this.linkDot = function(x) { M[G].setLinked(!0); M[E].setLinked(!0); this.lineUpdate(x); this.gradientFillLineLinkedAnimation(); D = E; E === M.length - 1 ? e === GAME_STATE_PLAY && this._endLevel() : this.checkSelectedDot(E) }; this._onNextLevel = function() { u.visible = !0; u.alpha = 0; var x = createjs.Tween.get(u); x.to({ alpha: 1 }, 500, createjs.Ease.cubicIn); x.call(function() { M.forEach(function(K) { return K.unload() }); v += 1; p.removeAllChildren(); t.removeAllChildren(); m.removeAllChildren(); q.removeAllChildren(); this.createLevel(); this.addDotsEventMouseDown(); this.resetValuesLevel(); k.hide() }, null, this); x.wait(200); x.to({ alpha: 0, visible: !1 }, 500, createjs.Ease.cubicOut); x.call(this.startGame, null, this) }; this._endLevel = function() { e = GAME_STATE_GAME_OVER; J = null; t.removeAllEventListeners(); this.disableStageEvents(); w = !0; var x = null; s_bStorageAvailable && (x = JSON.parse(getItem(SAVED_GAME_STORAGE))); void 0 === x[s_iDifficultyChoose][v] && (x[s_iDifficultyChoose][v] = { score: null, time: null }); var K = Math.round(h.getTimerValue() / (1E3 / SCORE_TIME_MULTIPLIER), 0), F = s_bStorageAvailable ? x[s_iDifficultyChoose][v].score : 0; F = null === F ? 0 : F; F < K && (x[s_iDifficultyChoose][v].score = K); var C = s_bStorageAvailable ? x[s_iDifficultyChoose][v].time : s_oLevelProperties[v].time, N = s_oLevelProperties[v].time - h.getTimerValue() / 1E3; C = null === C ? s_oLevelProperties[v].time : C; C > N && (x[s_iDifficultyChoose][v].time = N); saveItem(SAVED_GAME_STORAGE, JSON.stringify(x)); var W = 1; x = s_oLevelProperties[v].star; for (C = 0; C < x.length; C++) N < x[C] && W++; createjs.Tween.get(q).to({ alpha: 1 }, 500, createjs.Ease.cubicIn); createjs.Tween.get(p).to({ alpha: 1 }, 500, createjs.Ease.cubicIn); createjs.Tween.get(m).to({ alpha: 0 }, 500, createjs.Ease.cubicIn); M.forEach(function(H) { return H.hideTextNumber() }); playSound("win", 1, !1).on("end", function() { tweenSoundVolume("soundtrack", SOUNDTRACK_VOLUME_IN_GAME, 500) }); tweenSoundVolume("soundtrack", .2, 500); n.addEventListener(ON_PRESSUP_COMPLETED_LEVEL, this._showWinPanel, this, function() { u.alpha = 0; u.visible = !1; k.show(K, F, s_oLevelConfig.length - 1 <= v, W) }); n.show() }; this._showWinPanel = function(x) { u.alpha = .01; u.visible = !0; x.call(this); n.hide() }; this.disableStageEvents = function() { s_oStage.off("pressmove", V); s_oStage.off("pressup", Z) }; this.refreshButtonPos = function(x, K) { b.refreshButtonPos(x, K); h.refreshOffset(x, K); n.refreshPos(x, K) }; this.refreshChangedOrientation = function(x) { b._onChangeOrientation(x) }; this.gradientFillLineLinkedAnimation = function() { this.removeGradientLineAnimation(); var x = P.stroke.style.props, K = { end: x.ratios[1], connected: x.ratios[0] }, F = createjs.Tween.get(K); F.to({ connected: 1, end: 1 }, MS_FILL_LINE_EFFECT_TIME, createjs.Ease.cubicIn); var C = E, N = P; F.on("change", function(W) { N.stroke.linearGradient([LINES_PROPERTY.connected_color, LINES_PROPERTY.main_color], [K.connected, K.end], x.x0, x.y0, x.x1, x.y1) }); F.on("complete", function(W) { M[C].animFillColor(DOTS_PROPERTY.connected_color, M[C].animStrokeColor, M[C], LINES_PROPERTY.connected_color); W.target.removeAllEventListeners() }) }; this.lineUpdate = function(x) { var K = O.getPos(), F = this.calculateMidCurvePoint(K, x, { x: 0, y: 0 }); P.curve.x = x.x; P.curve.y = x.y; null === L && (L = F); var C = createjs.Tween.get(P.curve, { override: !0 }); C.to({ cpx: F.x, cpy: F.y }, MS_BEND_EFFECT_TIME, createjs.Ease.cubicOut); C.call(function() { L = F }); P.stroke.linearGradient([LINES_PROPERTY.connected_color, LINES_PROPERTY.main_color ], P.stroke.style.props.ratios, K.x, K.y, x.x, x.y) }; this.calculateMidCurvePoint = function(x, K, F) { return { x: .5 * (x.x + K.x) + F.x, y: .5 * (x.y + K.y) + F.y } }; this.removeGradientLineAnimation = function() { null !== R && (R.tween.removeAllEventListeners(), createjs.Tween.removeTweens(R.object), R = null) }; this.loopGradientLineAnimation = function() { var x = { start: 0 }, K = createjs.Tween.get(x, { loop: -1, override: !0, bounce: !0 }).to({ start: .25 }, 500, createjs.Ease.cubicOut).to({ start: 0 }, 500, createjs.Ease.cubicIn); K.on("change", function() { var F = P.stroke.style.props; P.stroke.linearGradient([LINES_PROPERTY.connected_color, LINES_PROPERTY.main_color], [x.start, .5], F.x0, F.y0, F.x1, F.y1) }); return { tween: K, object: x } }; this.update = function() { switch (e) { case GAME_STATE_PLAY: h.update(s_iTimeElaps) } }; s_oGame = this; this._init(a) } function CInterface(a) { var e, b, d, c, f, g, h, k, l, r, p, m, t, q, z, u, A, n, y, B, v, D, G, E, Q, O = null, I = null, J, P, R; this._init = function(L) { z = L; u = new createjs.Container; z.addChild(u); A = new createjs.Container; u.addChild(A); n = new createjs.Container; u.addChild(n); Q = new createjs.Container; A.addChild(Q); L = s_oSpriteLibrary.getSprite("score_panel"); var T = createBitmap(L); T.regX = L.width / 2; T.regY = L.height / 2; var V = T.regY + 0; Q.x = T.regX + 0; Q.y = V; Q.addChild(T); G = new CTLText(Q, -L.width / 4 - 30, -53, 250, 120, 56, "right", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, sprintf(TEXT_SCORE, 0), !0, !0, !1, !1); E = new CRollingScore; this.refreshScore(0); L = s_oSpriteLibrary.getSprite("but_exit"); t = CANVAS_WIDTH - L.height / 2 - 5; q = L.height / 2; B = new CGfxButton(t, q, L, n); B.addEventListenerWithParams(ON_MOUSE_UP, this.triggerEvent, this, ON_PRESS_EXIT); p = t; m = q + L.height + 0; l = t - L.height + 5; r = q; v = new CGfxButton(p, m, s_oSpriteLibrary.getSprite("but_pause"), n); v.addEventListenerWithParams(ON_MOUSE_UP, this.triggerEvent, this, ON_PRESS_PAUSE); h = p; k = m + L.height + 0; f = l - L.height + 5; g = r; !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (L = s_oSpriteLibrary.getSprite("audio_icon"), y = new CToggle(h, k, L, s_bAudioActive, n), y.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this), d = h, c = k + L.height + 0, e = f - L.height + 5, b = g) : (d = p, c = m + L.height + 0, e = l - L.height + 5, b = r); L = window.document; T = L.documentElement; O = T.requestFullscreen || T.mozRequestFullScreen || T.webkitRequestFullScreen || T.msRequestFullscreen; I = L.exitFullscreen || L.mozCancelFullScreen || L.webkitExitFullscreen || L.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (D = null, O = !1); O && screenfull.isEnabled && (L = s_oSpriteLibrary.getSprite("but_fullscreen"), D = new CToggle(d, c, L, s_bFullscreen, n), D.addEventListener(ON_MOUSE_UP, this._onFullscreen, this)); this.refreshButtonPos(s_iOffsetX, s_iOffsetY); this._onChangeOrientation(s_bLandscape); J = []; P = []; R = [] }; this.unload = function() { if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) y.unload(), y = null; B.unload(); v.unload(); O && screenfull.isEnabled && D.unload() }; this._onFullscreen = function() { s_bFullscreen ? I.call(window.document) : O.call(window.document.documentElement); sizeHandler() }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this.getScoreContainer = function() { return Q }; this.refreshButtonPos = function(L, T) { A.x = L; A.y = T; n.x = -L; n.y = T }; this._onChangeOrientation = function(L) { L ? (v.setPosition(p, m), !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || y.setPosition(h, k), O && screenfull.isEnabled && D.setPosition(d, c)) : (v.setPosition(l, r), !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || y.setPosition(f, g), O && screenfull.isEnabled && D.setPosition(e, b)) }; this.triggerEvent = function(L) { J[L] && J[L].call(P[L], R[L]) }; this.addEventListener = function(L, T, V, Z) { J[L] = T; P[L] = V; R[L] = Z }; this.refreshScore = function(L) { E.rolling(G, TEXT_SCORE, L) }; this.resetFullscreenBut = function() { D.setActive(s_bFullscreen) }; this._init(a); s_oInterface = this; return this } s_oInterface = null; function CCreditsPanel() { var a, e, b, d, c, f, g; this._init = function() { d = new createjs.Shape; d.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); d.alpha = 0; d.on("mousedown", function() {}); s_oStage.addChild(d); (new createjs.Tween.get(d)).to({ alpha: .7 }, 500); c = new createjs.Container; s_oStage.addChild(c); var h = s_oSpriteLibrary.getSprite("msg_box"), k = createBitmap(h); k.x = 0; k.y = 0; k.regX = h.width / 2; k.regY = h.height / 2; c.addChild(k); c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT + h.height / 2; a = c.y; (new createjs.Tween.get(c)).to({ y: CANVAS_HEIGHT / 2 }, 500, createjs.Ease.quartIn); var l = h.width - 100; h = -h.height / 2 + 200; (new CTLText(c, -(l / 2), h - 21, l, 42, 48, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, TEXT_DEVELOPED, !0, !0, !1, !1)).setOutline(2); new CTLText(c, -(l / 2), h - 21, l, 42, 48, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, TEXT_DEVELOPED, !0, !0, !1, !1); h = 90; (new CTLText(c, -(l / 2), h - 21, l, 42, 40, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, "www.codethislab.com", !0, !0, !1, !1)).setOutline(2); new CTLText(c, -(l / 2), h - 21, l, 42, 40, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, "www.codethislab.com", !0, !0, !1, !1); h = s_oSpriteLibrary.getSprite("ctl_logo"); g = createBitmap(h); g.on("click", this._onLogoButRelease); g.regX = h.width / 2; g.regY = h.height / 2; g.y = 0; c.addChild(g); b = new createjs.Shape; b.graphics.beginFill("#0f0f0f").drawRect(-CANVAS_WIDTH / 2, -CANVAS_HEIGHT / 2, CANVAS_WIDTH, CANVAS_HEIGHT); b.alpha = .01; e = b.on("click", this._onLogoButRelease); c.addChild(b); h = s_oSpriteLibrary.getSprite("but_exit"); f = new CGfxButton(k.x + k.regX - h.width / 2 - 30, k.y - k.regY + h.height / 2 + 30, h, c); f.addEventListener(ON_MOUSE_UP, this.unload, this) }; this.unload = function() { b.off("click", e); f.block(); (new createjs.Tween.get(d)).to({ alpha: 0 }, 500); (new createjs.Tween.get(c)).to({ y: a }, 400, createjs.Ease.backIn).call(function() { s_oStage.removeChild(d); s_oStage.removeChild(c); f.unload() }); d.removeAllEventListeners(); g.removeAllEventListeners() }; this._onLogoButRelease = function() { window.open("http://www.codethislab.com/index.php?&l=en") }; this._init() } function CAreYouSurePanel(a, e) { var b, d, c, f, g, h, k, l, r, p; this._init = function(m, t) { c = t; h = new createjs.Shape; h.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); h.on("click", function() {}); h.visible = !1; k = new createjs.Container; c.addChild(h, k); var q = s_oSpriteLibrary.getSprite("msg_box"), z = createBitmap(q); z.regX = q.width / 2; z.regY = q.height / 2; z.x = -20; k.addChild(z); k.x = CANVAS_WIDTH / 2; k.y = CANVAS_HEIGHT / 2 - 40; b = k.x; d = k.y; z = q.width - 100; q = -q.height / 2 + 200; (new CTLText(k, -(z / 2), q - 30, z, 60, 54, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, m, !0, !0, !0, !1)).setOutline(5); new CTLText(k, -(z / 2), q - 30, z, 60, 54, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, m, !0, !0, !0, !1); k.visible = !1; k.alpha = 0; f = new CGfxButton(160, 100, s_oSpriteLibrary.getSprite("but_yes"), k); f.addEventListenerWithParams(ON_MOUSE_UP, this.triggerEvent, this, ON_PRESS_YES); g = new CGfxButton(-160, 100, s_oSpriteLibrary.getSprite("but_no"), k); g.addEventListenerWithParams(ON_MOUSE_UP, this.triggerEvent, this, ON_PRESS_NO); g.pulseAnimation(); l = []; r = []; p = [] }; this.show = function() { h.alpha = 0; k.x = b; k.y = d; h.visible = !0; k.visible = !0; k.alpha = 0; createjs.Tween.get(k, { override: !0 }).to({ alpha: 1 }, 300, createjs.Ease.cubicOut); createjs.Tween.get(h).to({ alpha: .8 }, 300) }; this.hide = function(m, t) { createjs.Tween.get(k, { override: !0 }).to({ alpha: 0, visible: !1 }, 300, createjs.Ease.cubicIn).call(function() { h.visible = !1; h.alpha = 0; null !== m && void 0 !== m && m.call(t) }) }; this.triggerEvent = function(m) { l[m] && l[m].call(r[m], p[m]) }; this.addEventListener = function(m, t, q, z) { l[m] = t; r[m] = q; p[m] = z }; this.unload = function() { g.unload(); f.unload(); s_oStage.removeChild(h); s_oStage.removeChild(k); h.removeAllEventListeners() }; this._init(a, e) } function CGameOverPanel(a, e) { var b, d, c, f, g, h, k, l, r, p, m, t, q, z, u; this._init = function(A, n) { b = n; c = new createjs.Container; c.alpha = 0; c.visible = !1; b.addChild(c); t = new createjs.Shape; t.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); t.alpha = .7; t.on("mousedown", function() {}); c.addChild(t); d = createBitmap(A); d.x = CANVAS_WIDTH / 2; d.y = CANVAS_HEIGHT / 2; d.regX = A.width / 2; d.regY = A.height / 2; c.addChild(d); var y = 400, B = 70, v = CANVAS_WIDTH / 2, D = CANVAS_HEIGHT / 2 - .5 * A.height + .5 * B + 40; f = new CTLText(c, v - y / 2, D - B / 2, y, B, 60, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, TEXT_GAMEOVER, !0, !0, !1, !1); f.setOutline(5); g = new CTLText(c, v - y / 2, D - B / 2, y, B, 60, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, TEXT_GAMEOVER, !0, !0, !1, !1); y = 350; B = 60; v = CANVAS_WIDTH / 2; D = g.getY() + 130; h = new CTLText(c, v - y / 2, D - B / 2, y, B, 50, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, " ", !0, !0, !1, !1); h.setOutline(3); k = new CTLText(c, v - y / 2, D - B / 2, y, B, 50, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, " ", !0, !0, !1, !1); y = 350; B = 50; v = CANVAS_WIDTH / 2; D = k.getY() + 100; l = new CTLText(c, v - y / 2, D - B / 2, y, B, 40, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, " ", !0, !0, !1, !1); l.setOutline(3); r = new CTLText(c, v - y / 2, D - B / 2, y, B, 40, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, " ", !0, !0, !1, !1); p = new CGfxButton(CANVAS_WIDTH / 2 + 110, CANVAS_HEIGHT / 2 + 170, s_oSpriteLibrary.getSprite("but_restart"), c); p.addEventListenerWithParams(ON_MOUSE_UP, this.triggerEvent, this, ON_PRESS_RESTART); p.pulseAnimation(); m = new CGfxButton(CANVAS_WIDTH / 2 - 110, CANVAS_HEIGHT / 2 + 170, s_oSpriteLibrary.getSprite("but_home"), c); m.addEventListenerWithParams(ON_MOUSE_UP, this.triggerEvent, this, ON_PRESS_HOME); q = []; z = []; u = [] }; this.unload = function() { t.removeAllEventListeners(); m.unload(); p.unload(); s_oStage.removeChild(c) }; this.hide = function() { c.visible = !1; c.aplha = 0; createjs.Tween.removeTweens(c) }; this.show = function(A, n) { h.refreshText(sprintf(TEXT_SCORE_GAME_OVER, A)); k.refreshText(sprintf(TEXT_SCORE_GAME_OVER, A)); l.refreshText(sprintf(TEXT_BEST_SCORE, n)); r.refreshText(sprintf(TEXT_BEST_SCORE, n)); c.alpha = 0; c.visible = !0; createjs.Tween.get(c, { override: !0 }).wait(500).to({ alpha: 1 }, 500, createjs.Ease.cubicOut); $(s_oMain).trigger("save_score", A); $(s_oMain).trigger("show_interlevel_ad"); var y = "You collected <strong>" + A + " points</strong>!<br><br>Share your score with your friends!", B = "My score is " + A + " points! Can you do better?"; $(s_oMain).trigger("share_event", A, "200x200.jpg", "Congratulations!", y, B) }; this.triggerEvent = function(A) { q[A] && q[A].call(z[A], u[A]) }; this.addEventListener = function(A, n, y, B) { q[A] = n; z[A] = y; u[A] = B }; this._init(a, e); return this } function CWinPanel(a, e) { var b, d, c, f, g, h, k, l, r, p, m, t, q, z, u, A, n, y, B; this._init = function(v, D) { b = D; t = null; c = new createjs.Container; c.alpha = 0; c.visible = !1; b.addChild(c); A = new createjs.Shape; A.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); A.alpha = .7; A.on("mousedown", function() {}); c.addChild(A); d = createBitmap(v); d.x = CANVAS_WIDTH / 2; d.y = CANVAS_HEIGHT / 2; d.regX = v.width / 2; d.regY = v.height / 2; c.addChild(d); var G = 400, E = 70, Q = CANVAS_WIDTH / 2, O = CANVAS_HEIGHT / 2 - 210; g = new CTLText(c, Q - G / 2, O - E / 2, G, E, 60, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, TEXT_WIN, !0, !0, !1, !1); g.setOutline(5); h = new CTLText(c, Q - G / 2, O - E / 2, G, E, 60, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, TEXT_WIN, !0, !0, !1, !1); G = 350; E = 60; Q = CANVAS_WIDTH / 2; O = h.getY() + 110; k = new CTLText(c, Q - G / 2, O - E / 2, G, E, 40, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, " ", !0, !0, !1, !1); k.setOutline(3); l = new CTLText(c, Q - G / 2, O - E / 2, G, E, 40, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, " ", !0, !0, !1, !1); G = 350; E = 50; Q = CANVAS_WIDTH / 2; O = l.getY() + 100; r = new CTLText(c, Q - G / 2, O - E / 2, G, E, 30, "center", FONT_STROKE, PRIMARY_FONT, 1, 2, 2, " ", !0, !0, !1, !1); r.setOutline(3); p = new CTLText(c, Q - G / 2, O - E / 2, G, E, 30, "center", FONT_COLOR, PRIMARY_FONT, 1, 2, 2, " ", !0, !0, !1, !1); G = s_oSpriteLibrary.getSprite("star"); E = -G.width / 2 - 20; Q = p.getY() + p.getBounds().height / 2 + G.height + 40; m = []; for (O = 0; 3 > O; O++) { var I = new CStar(c, CANVAS_WIDTH / 2 + E, Q, G); E += G.width / 2 + 20; m.push(I) } G = s_oSpriteLibrary.getSprite("but_home"); u = new CGfxButton(CANVAS_WIDTH / 2 - G.width - 40, CANVAS_HEIGHT / 2 + 180, G, c); u.addEventListenerWithParams(ON_MOUSE_UP, this.triggerEvent, this, ON_PRESS_HOME); G = s_oSpriteLibrary.getSprite("but_restart"); z = new CGfxButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2 + 180, G, c); z.addEventListenerWithParams(ON_MOUSE_UP, this.triggerEvent, this, ON_PRESS_RESTART); G = s_oSpriteLibrary.getSprite("but_continue"); q = new CGfxButton(CANVAS_WIDTH / 2 + G.width + 40, CANVAS_HEIGHT / 2 + 180, G, c); q.addEventListenerWithParams(ON_MOUSE_UP, this.triggerEvent, this, ON_PRESS_CONTINUE); q.pulseAnimation(); f = new CRollingScore; n = []; y = []; B = [] }; this.unload = function() { A.removeAllEventListeners(); u.unload(); z.unload(); q.unload(); s_oStage.removeChild(c) }; this.hide = function() { null !== t && t.removeAllEventListeners(); c.visible = !1; c.aplha = 0; createjs.Tween.removeTweens(c) }; this.show = function(v, D, G, E) { k.refreshText(sprintf(TEXT_SCORE_GAME_OVER, 0)); l.refreshText(sprintf(TEXT_SCORE_GAME_OVER, 0)); r.refreshText(sprintf(TEXT_BEST_SCORE, D)); p.refreshText(sprintf(TEXT_BEST_SCORE, D)); c.alpha = 0; c.visible = !0; G && (q.setVisible(!1), z.setPosition(CANVAS_WIDTH / 2 + 110, CANVAS_HEIGHT / 2 + 170), z.pulseAnimation(), u.setPosition(CANVAS_WIDTH / 2 - 110, CANVAS_HEIGHT / 2 + 170)); m.forEach(function(Q) { return Q.setState(!1) }); createjs.Tween.get(c, { override: !0 }).wait(500).to({ alpha: 1 }, 500, createjs.Ease.cubicOut).call(function() { f.rolling(l, TEXT_SCORE_GAME_OVER, v, k, 2E3); this._animationStars(E, 2E3) }, this, this); $(s_oMain).trigger("save_score", v); $(s_oMain).trigger("show_interlevel_ad"); D = "You collected <strong>" + v + " points</strong>!<br><br>Share your score with your friends!"; G = "My score is " + v + " points! Can you do better?"; $(s_oMain).trigger("share_event", v, "200x200.jpg", "Congratulations!", D, G) }; this._animationStars = function(v, D) { var G = { val: 0 }; t = createjs.Tween.get(G); t.to({ val: v - 1 }, D, createjs.Ease.cubicOut); t.on("change", function() { var E = Math.floor(G.val); m[E].getState() || (m[E].setState(!0), playSound("star", 1, !1), m[E].animationScale(m[E].setState, m, !0)) }) }; this.triggerEvent = function(v) { n[v] && n[v].call(y[v], B[v]) }; this.addEventListener = function(v, D, G, E) { n[v] = D; y[v] = G; B[v] = E }; this._init(a, e); return this } var ON_END_TIMER = 0; function CTimerPanel(a, e, b, d) { var c, f, g, h, k, l, r, p, m, t; this._init = function(q, z, u, A) { g = q; k = f = c = 0; h = new createjs.Container; g.addChild(h); c = h.x = z; f = h.y = u; h.regX = A.width / 2; h.regY = A.height / 2; q = createBitmap(A); h.addChild(q); r = !0; l = createGenericText({ pos: { x: h.regX + 56, y: h.regY + 2 }, size: 60, text: sprintf(TEXT_TIMER, "00:00"), outline: !1, outline_size: 3, multiline: !1, width: A.width - 30, height: A.height - 30, align: "center", line_height: 1.1 }, h); p = []; m = []; t = [] }; this.setTimer = function(q) { k = q; r = !1; this._refreshText() }; this.getTimerValue = function() { return k }; this.setPos = function(q, z) { c = q; f = z }; this._refreshText = function() { var q = Math.floor(k / 6E4), z = (k % 6E4 / 1E3).toFixed(0); q = sprintf(TEXT_TIMER, (10 > q ? "0" : "") + q + ":" + (10 > z ? "0" : "") + z); l.text.refreshText(q); null !== l.outline && l.outline.refreshText(q) }; this.refreshOffset = function(q, z) { h.x = c + q; h.y = f + z }; this.triggerEvent = function(q) { p[q] && p[q].call(m[q], t[q]) }; this.addEventListener = function(q, z, u, A) { p[q] = z; m[q] = u; t[q] = A }; this.update = function(q) { r || (k -= q, 0 > k && (r = !0, k = 0, this.triggerEvent(ON_END_TIMER)), this._refreshText()) }; this._init(a, e, b, d) } function CMsgBox(a, e, b, d, c) { var f, g, h, k, l, r, p, m; this._init = function(t, q, z, u, A) { f = []; g = []; m = new createjs.Container; s_oStage.addChild(m); var n = new createjs.Shape; n.graphics.beginFill("rgba(0,0,0,0.7)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); n.on("mousedown", function() {}); m.addChild(n); n = s_oSpriteLibrary.getSprite("msg_box"); var y = createBitmap(n); y.regX = n.width / 2; y.regY = n.height / 2; y.x = CANVAS_WIDTH / 2 - 20; y.y = CANVAS_HEIGHT / 2; m.addChild(y); n = n.width - 100; y = CANVAS_WIDTH / 2; k = new CTLText(m, y - n / 2, 266, n, 180, t, "center", FONT_STROKE, PRIMARY_FONT, 1.2, 2, 2, " ", !0, !0, !0, !1); k.setOutline(3); h = new CTLText(m, y - n / 2, 266, n, 180, t, "center", FONT_COLOR, PRIMARY_FONT, 1.2, 2, 2, " ", !0, !0, !0, !1); l = new CTextButton(CANVAS_WIDTH / 2 - 100, CANVAS_HEIGHT - 320, s_oSpriteLibrary.getSprite("but_generic"), "LEFT", PRIMARY_FONT, "#ffffff", 30, m); l.addEventListener(ON_MOUSE_UP, this._onButLeftDownRelease, this); r = new CTextButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT - 320, s_oSpriteLibrary.getSprite("but_generic"), "CENTER", PRIMARY_FONT, "#ffffff", 30, m); r.addEventListener(ON_MOUSE_UP, this._onButCenterDownRelease, this); p = new CTextButton(CANVAS_WIDTH / 2 + 90, CANVAS_HEIGHT - 320, s_oSpriteLibrary.getSprite("but_generic"), "LEFT", PRIMARY_FONT, "#ffffff", 30, m); p.addEventListener(ON_MOUSE_UP, this._onButRightDownRelease, this); this.show(q, z, u, A) }; this.show = function(t, q, z, u) { h.refreshText(t); k.refreshText(t); "" !== q ? (l.changeText(q), l.setVisible(!0)) : l.setVisible(!1); "" !== z ? (r.changeText(z), r.setVisible(!0)) : r.setVisible(!1); "" !== u ? (p.changeText(u), p.setVisible(!0)) : p.setVisible(!1) }; this.hide = function() { this.unload(); s_oStage.removeChild(m) }; this.unload = function() { l.unload(); r.unload(); p.unload() }; this.addEventListener = function(t, q, z) { f[t] = q; g[t] = z }; this._onButLeftDownRelease = function() { f[ON_MSG_BOX_LEFT_BUT] && (f[ON_MSG_BOX_LEFT_BUT].call(g[ON_MSG_BOX_LEFT_BUT]), m.visible = !1) }; this._onButCenterDownRelease = function() { f[ON_MSG_BOX_CENTER_BUT] && (f[ON_MSG_BOX_CENTER_BUT].call(g[ON_MSG_BOX_CENTER_BUT]), m.visible = !1) }; this._onButRightDownRelease = function() { f[ON_MSG_BOX_RIGHT_BUT] && (f[ON_MSG_BOX_RIGHT_BUT].call(g[ON_MSG_BOX_RIGHT_BUT]), m.visible = !1) }; this._init(a, e, b, d, c) } var ON_PRESS_PAUSE_PANEL = 0; function CPause(a) { var e, b, d, c, f, g; this._init = function(h) { e = h; d = new createjs.Container; d.visible = !1; d.on("click", this.triggerEvent, null, !1, ON_PRESS_PAUSE_PANEL); e.addChild(d); b = new createjs.Shape; b.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); b.alpha = .5; d.addChild(b); h = new createjs.Text(TEXT_PAUSE, " 100px " + PRIMARY_FONT, FONT_STROKE); h.x = CANVAS_WIDTH / 2; h.y = CANVAS_HEIGHT / 2; h.textAlign = "center"; h.textBaseline = "alphabetic"; h.outline = 4; d.addChild(h); h = new createjs.Text(TEXT_PAUSE, " 100px " + PRIMARY_FONT, FONT_COLOR); h.x = CANVAS_WIDTH / 2; h.y = CANVAS_HEIGHT / 2; h.textAlign = "center"; h.textBaseline = "alphabetic"; d.addChild(h); c = []; f = []; g = [] }; this.show = function() { d.alpha = 0; d.visible = !0; createjs.Tween.get(d).to({ alpha: 1 }, 600) }; this.unload = function() { d.removeAllEventListeners(); b.removeAllEventListeners(); e.removeChild(d) }; this.hide = function() { d.visible = !1 }; this.triggerEvent = function(h, k) { c[k] && c[k].call(f[k], g[k]) }; this.addEventListener = function(h, k, l, r) { c[h] = k; f[h] = l; g[h] = r }; this._init(a) } 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 }, setVisible: function(a) { this._oText.visible = a }, setOutline: function(a) { null !== this._oText && (this._oText.outline = a) }, setShadow: function(a, e, b, d) { null !== this._oText && (this._oText.shadow = new createjs.Shadow(a, e, b, d)) }, 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 }, getX: function() { return this._x }, getY: function() { return this._y }, getFontSize: function() { return this._iFontSize }, getBounds: function() { return this._oText.getBounds() }, 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, e, b, d, c, f, g, h, k, l, r, p, m, t, q, z, u) { this._oContainer = a; this._x = e; this._y = b; this._iWidth = d; this._iHeight = c; this._bMultiline = z; this._iFontSize = f; this._szAlign = g; this._szColor = h; this._szFont = k; this._iPaddingH = r; this._iPaddingV = p; this._bVerticalAlign = q; this._bFitText = t; this._bDebug = u; this._oDebugShape = null; this._fLineHeightFactor = l; this._oText = null; m && this.__createText(m) }! function() { function a(c) { var f = c; if (d[f]) f = d[f]; else { for (var g = f, h, k = [], l = 0; g;) { if (null !== (h = b.text.exec(g))) k.push(h[0]); else if (null !== (h = b.modulo.exec(g))) k.push("%"); else if (null !== (h = b.placeholder.exec(g))) { if (h[2]) { l |= 1; var r = [], p = h[2], m; if (null !== (m = b.key.exec(p))) for (r.push(m[1]); "" !== (p = p.substring(m[0].length));) if (null !== (m = b.key_access.exec(p))) r.push(m[1]); else if (null !== (m = b.index_access.exec(p))) r.push(m[1]); else throw new SyntaxError("[sprintf] failed to parse named argument key"); else throw new SyntaxError("[sprintf] failed to parse named argument key"); h[2] = r } else l |= 2; if (3 === l) throw Error("[sprintf] mixing positional and named placeholders is not (yet) supported"); k.push({ placeholder: h[0], param_no: h[1], keys: h[2], sign: h[3], pad_char: h[4], align: h[5], width: h[6], precision: h[7], type: h[8] }) } else throw new SyntaxError("[sprintf] unexpected placeholder"); g = g.substring(h[0].length) } f = d[f] = k } g = arguments; h = 1; k = f.length; r = ""; var t, q; for (p = 0; p < k; p++) if ("string" === typeof f[p]) r += f[p]; else if ("object" === typeof f[p]) { m = f[p]; if (m.keys) for (l = g[h], t = 0; t < m.keys.length; t++) { if (void 0 == l) throw Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"', m.keys[t], m.keys[t - 1])); l = l[m.keys[t]] } else l = m.param_no ? g[m.param_no] : g[h++]; b.not_type.test(m.type) && b.not_primitive.test(m.type) && l instanceof Function && (l = l()); if (b.numeric_arg.test(m.type) && "number" !== typeof l && isNaN(l)) throw new TypeError(a("[sprintf] expecting number but found %T", l)); b.number.test(m.type) && (q = 0 <= l); switch (m.type) { case "b": l = parseInt(l, 10).toString(2); break; case "c": l = String.fromCharCode(parseInt(l, 10)); break; case "d": case "i": l = parseInt(l, 10); break; case "j": l = JSON.stringify(l, null, m.width ? parseInt(m.width) : 0); break; case "e": l = m.precision ? parseFloat(l).toExponential(m.precision) : parseFloat(l).toExponential(); break; case "f": l = m.precision ? parseFloat(l).toFixed(m.precision) : parseFloat(l); break; case "g": l = m.precision ? String(Number(l.toPrecision(m.precision))) : parseFloat(l); break; case "o": l = (parseInt(l, 10) >>> 0).toString(8); break; case "s": l = String(l); l = m.precision ? l.substring(0, m.precision) : l; break; case "t": l = String(!!l); l = m.precision ? l.substring(0, m.precision) : l; break; case "T": l = Object.prototype.toString.call(l).slice(8, -1).toLowerCase(); l = m.precision ? l.substring(0, m.precision) : l; break; case "u": l = parseInt(l, 10) >>> 0; break; case "v": l = l.valueOf(); l = m.precision ? l.substring(0, m.precision) : l; break; case "x": l = (parseInt(l, 10) >>> 0).toString(16); break; case "X": l = (parseInt(l, 10) >>> 0).toString(16).toUpperCase() } if (b.json.test(m.type)) r += l; else { if (!b.number.test(m.type) || q && !m.sign) var z = ""; else z = q ? "+" : "-", l = l.toString().replace(b.sign, ""); t = m.pad_char ? "0" === m.pad_char ? "0" : m.pad_char.charAt(1) : " "; var u = m.width - (z + l).length; u = m.width ? 0 < u ? t.repeat(u) : "" : ""; r += m.align ? z + l + u : "0" === t ? z + u + l : u + z + l } } return r } function e(c, f) { return a.apply(null, [c].concat(f || [])) } var b = { not_string: /[^s]/, not_bool: /[^t]/, not_type: /[^T]/, not_primitive: /[^v]/, number: /[diefg]/, numeric_arg: /[bcdiefguxX]/, json: /[j]/, not_json: /[^j]/, text: /^[^\x25]+/, modulo: /^\x25{2}/, placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, key: /^([a-z_][a-z_\d]*)/i, key_access: /^\.([a-z_][a-z_\d]*)/i, index_access: /^\[(\d+)\]/, sign: /^[+-]/ }, d = Object.create(null); "undefined" !== typeof exports && (exports.sprintf = a, exports.vsprintf = e); "undefined" !== typeof window && (window.sprintf = a, window.vsprintf = e, "function" === typeof define && define.amd && define(function() { return { sprintf: a, vsprintf: e } })) }(); var FONT_COLOR_DEACTIVE = "#b4b4b4", FONT_STROKE_DEACTIVE = "#606161"; function CLevelBut(a, e, b, d, c, f) { var g, h, k, l = [], r = [], p, m, t, q; this._init = function(u, A, n, y, B) { h = []; k = []; q = new createjs.Container; z.addChild(q); var v = new createjs.SpriteSheet({ images: [y], frames: { width: y.width / 2, height: y.height, regX: y.width / 2 / 2, regY: y.height / 2 }, animations: { state_true: [0], state_false: [1] } }); g = B; t = createSprite(v, "state_" + g, y.width / 2 / 2, y.height / 2, y.width / 2, y.height); t.mouseEnabled = B; t.x = u; t.y = A; t.stop(); s_bMobile || (q.cursor = "pointer"); q.addChild(t); l.push(t); p = new createjs.Text(n, "60px " + PRIMARY_FONT, FONT_STROKE); p.x = u; p.y = A - 5; p.textAlign = "center"; p.textBaseline = "alphabetic"; p.lineWidth = 200; p.outline = 6; q.addChild(p); m = new createjs.Text(n, "60px " + PRIMARY_FONT, FONT_COLOR); m.x = u; m.y = A - 5; m.textAlign = "center"; m.textBaseline = "alphabetic"; m.lineWidth = 200; q.addChild(m); B || (m.color = FONT_COLOR_DEACTIVE, p.color = FONT_STROKE_DEACTIVE); this._initListener() }; this.unload = function() { q.off("mousedown", this.buttonDown); q.off("pressup", this.buttonRelease); q.removeChild(t) }; this._initListener = function() { q.on("mousedown", this.buttonDown); q.on("pressup", this.buttonRelease) }; this.viewBut = function(u) { q.addChild(u) }; this.addEventListener = function(u, A, n) { h[u] = A; k[u] = n }; this.addEventListenerWithParams = function(u, A, n, y) { h[u] = A; k[u] = n; r = y }; this.ifClickable = function() { return !0 === q.mouseEnabled ? 1 : 0 }; this.setActive = function(u, A) { g = A; l[u].gotoAndStop("state_" + g); l[u].mouseEnabled = !0; g ? (m.color = FONT_COLOR, p.color = FONT_STROKE) : (m.color = FONT_COLOR_DEACTIVE, p.color = FONT_STROKE_DEACTIVE) }; this.buttonRelease = function() { g && h[ON_MOUSE_UP] && h[ON_MOUSE_UP].call(k[ON_MOUSE_UP], r) }; this.buttonDown = function() { h[ON_MOUSE_DOWN] && h[ON_MOUSE_DOWN].call(k[ON_MOUSE_DOWN], r) }; this.setPosition = function(u, A) { q.x = u; q.y = A }; this.setVisible = function(u) { q.visible = u }; var z = f; this._init(a, e, b, d, c, f) } var NUM_ROWS_PAGE_LEVEL = 2, NUM_COLS_PAGE_LEVEL = 2; function CLevelMenu() { var a, e, b, d, c, f, g, h, k, l, r, p, m, t, q, z, u, A, n = null, y = null, B, v, D, G = null, E = null, Q, O; this._init = function() { p = 0; Q = new createjs.Container; s_oStage.addChild(Q); var I = createBitmap(s_oSpriteLibrary.getSprite("bg_level_menu")); Q.addChild(I); r = 90; B = new CTLText(s_oStage, CANVAS_WIDTH / 2 - 248, r + 2, 500, 50, 50, "center", FONT_STROKE, PRIMARY_FONT, 1, 0, 0, TEXT_SELECT_LEVEL, !0, !0, !0, !1); v = new CTLText(s_oStage, CANVAS_WIDTH / 2 - 250, r, 500, 50, 50, "center", FONT_COLOR, PRIMARY_FONT, 1, 0, 0, TEXT_SELECT_LEVEL, !0, !0, !0, !1); I = s_oSpriteLibrary.getSprite("but_exit"); k = CANVAS_WIDTH - I.height / 2 - 10; l = I.height / 2 + 10; u = new CGfxButton(k, l, I, s_oStage); u.addEventListener(ON_MOUSE_UP, this._onExit, this); m = I.height; if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) g = u.getX() - I.width, h = I.height / 2 + 10, A = new CToggle(g, h, s_oSpriteLibrary.getSprite("audio_icon"), s_bAudioActive, s_oStage), A.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); I = window.document; var J = I.documentElement; G = J.requestFullscreen || J.mozRequestFullScreen || J.webkitRequestFullScreen || J.msRequestFullscreen; E = I.exitFullscreen || I.mozCancelFullScreen || I.webkitExitFullscreen || I.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (G = !1); G && screenfull.enabled && (I = s_oSpriteLibrary.getSprite("but_fullscreen"), a = I.width / 4 + 10, e = l, D = new CToggle(a, e, I, s_bFullscreen, s_oStage), D.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); s_iDifficultyChoose === HARD && (s_oLevelConfig = s_oLevelConfigHard, s_oLevelProperties = LEVELS_PROPERTIES_HARD); if (s_bStorageAvailable && null !== getItem(SAVED_GAME_STORAGE)) { I = JSON.parse(getItem(SAVED_GAME_STORAGE)); var P = I[EASY]; for (J = 0; J < s_oLevelConfigEasy.length; J++) void 0 === P[J] && P.push({ score: null, time: null }); P = I[HARD]; for (J = 0; J < s_oLevelConfigHard.length; J++) void 0 === P[J] && P.push({ score: null, time: null }) } else { I = []; P = []; for (J = 0; J < s_oLevelConfigEasy.length; J++) P.push({ score: null, time: null }); var R = []; for (J = 0; J < s_oLevelConfigHard.length; J++) R.push({ score: null, time: null }); I[EASY] = P; I[HARD] = R } saveItem(SAVED_GAME_STORAGE, JSON.stringify(I)); for (J = 0; J < I[s_iDifficultyChoose].length && null !== I[s_iDifficultyChoose][J].time; J++); s_iLastLevel = UNLOCK_ALL_LEVEL ? s_oLevelConfig.length : J + 1; this._checkBoundLimits(); q = []; P = Math.floor((CANVAS_WIDTH - 2 * EDGEBOARD_X) / NUM_COLS_PAGE_LEVEL) - 20; for (J = R = 0; J < NUM_COLS_PAGE_LEVEL; J++) q.push(R), R += P; z = []; this._createNewLevelPage(0, s_oLevelConfig.length, I[s_iDifficultyChoose]); if (1 < z.length) { for (I = 1; I < z.length; I++) z[I].visible = !1; c = CANVAS_WIDTH - 80; f = CANVAS_HEIGHT - 80; n = new CGfxButton(c, f, s_oSpriteLibrary.getSprite("but_arrow_right"), s_oStage); n.addEventListener(ON_MOUSE_UP, this._onRight, this); b = 80; d = CANVAS_HEIGHT - 80; y = new CGfxButton(b, d, s_oSpriteLibrary.getSprite("but_arrow_left"), s_oStage); y.addEventListener(ON_MOUSE_UP, this._onLeft, this); s_bMobile && (s_oHammer.on("swipeleft", this._onRight), s_oHammer.on("swiperight", this._onLeft)) } this.refreshButtonsPos(s_iOffsetX, s_iOffsetY); O = new createjs.Shape; O.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); O.on("click", function() {}); s_oStage.addChild(O); createjs.Tween.get(O, { override: !0 }).to({ alpha: 0 }, 300, createjs.Ease.cubicOut) }; this.unload = function() { for (var I = 0; I < t.length; I++) t[I].unload(); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || A.unload(); G && screenfull.enabled && D.unload(); u.unload(); null !== y && (y.unload(), n.unload()); s_bMobile && (s_oHammer.off("swipeleft", this._onRight), s_oHammer.off("swiperight", this._onLeft)); O.removeAllEventListeners(); s_oStage.removeChild(Q); s_oLevelMenu = null }; this.refreshButtonsPos = function(I, J) { v.setY(r + J); B.setY(r + J); u.setPosition(k - I, l + J); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || A.setPosition(g - I, J + h); G && screenfull.enabled && D.setPosition(a + I, e + J); null !== y && (n.setPosition(c - I, f - J), y.setPosition(b + I, d - J)) }; this.resetFullscreenBut = function() { D.setActive(s_bFullscreen) }; this._checkBoundLimits = function() { for (var I = s_oSpriteLibrary.getSprite("but_level"), J = 0, P = CANVAS_HEIGHT - 2 * EDGEBOARD_Y - 2 * m, R = 0; J < P;) J += I.height + 20, R++; NUM_ROWS_PAGE_LEVEL > R && (NUM_ROWS_PAGE_LEVEL = R); P = J = 0; for (R = CANVAS_WIDTH - 2 * EDGEBOARD_X; P < R;) P += I.width / 2 + 5, J++; NUM_COLS_PAGE_LEVEL > J && (NUM_COLS_PAGE_LEVEL = J) }; this._createNewLevelPage = function(I, J, P) { var R = new createjs.Container; Q.addChild(R); z.push(R); t = []; for (var L = 0, T = 0, V = 1, Z = !1, w = s_oSpriteLibrary.getSprite("but_level"), M = s_oSpriteLibrary.getSprite("star"); I < J; I++) { var x = q[L] + w.width / 4, K = T + w.height / 2, F = new createjs.Container; R.addChild(F); F.x = x; F.y = K + w.height / 4 + 7; x = new CLevelBut(x, K, I + 1, w, I + 1 > s_iLastLevel ? !1 : !0, R); x.addEventListenerWithParams(ON_MOUSE_UP, this._onButLevelRelease, this, I); t.push(x); x = -M.width / 2; K = JSON.parse(JSON.stringify(s_oLevelProperties[I])); K.star.unshift(K.time); for (var C = 0; 3 > C; C++) { var N = new CStar(F, x, 0, M); x += M.width / 2; null !== P[I].time && P[I].time < K.star[C] && N.setState(!0) } L++; if (L === q.length && (L = 0, T += w.height + 2 * F.getBounds().height, V++, V > NUM_ROWS_PAGE_LEVEL)) { Z = !0; break } } R.x = CANVAS_WIDTH / 2; R.y = CANVAS_HEIGHT / 2 - 300; R.regX = R.getBounds().width / 2 - M.width / 4; Z && this._createNewLevelPage(I + 1, J, P) }; this._onRight = function() { z[p].visible = !1; p++; p >= z.length && (p = 0); z[p].visible = !0 }; this._onLeft = function() { z[p].visible = !1; p--; 0 > p && (p = z.length - 1); z[p].visible = !0 }; this._onButLevelRelease = function(I) { var J = createjs.Tween.get(O); J.to({ alpha: 1 }, 300, createjs.Ease.cubicIn); J.call(function() { this.unload(); s_oMain.gotoGame(I) }, this, this) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onExit = function() { s_oMain.gotoMenu() }; this._onFullscreenRelease = function() { s_bFullscreen ? E.call(window.document) : G.call(window.document.documentElement); sizeHandler() }; s_oLevelMenu = this; this._init() } s_oLevelMenu = null; function CDifficultyMenu() { var a, e, b, d, c, f, g, h, k, l, r, p, m, t, q = null, z = null, u, A; this._init = function() { u = new createjs.Container; s_oStage.addChild(u); var n = createBitmap(s_oSpriteLibrary.getSprite("bg_level_menu")); u.addChild(n); g = 90; l = new CTLText(s_oStage, CANVAS_WIDTH / 2 - 248, g + 2, 500, 50, 50, "center", FONT_STROKE, PRIMARY_FONT, 1, 0, 0, TEXT_CHOOSE_DIFFICULTY, !0, !0, !0, !1); r = new CTLText(s_oStage, CANVAS_WIDTH / 2 - 250, g, 500, 50, 50, "center", FONT_COLOR, PRIMARY_FONT, 1, 0, 0, TEXT_CHOOSE_DIFFICULTY, !0, !0, !0, !1); n = s_oSpriteLibrary.getSprite("but_exit"); c = CANVAS_WIDTH - n.height / 2 - 10; f = n.height / 2 + 10; h = new CGfxButton(c, f, n, s_oStage); h.addEventListener(ON_MOUSE_UP, this._onExit, this); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) b = h.getX() - n.width, d = n.height / 2 + 10, k = new CToggle(b, d, s_oSpriteLibrary.getSprite("audio_icon"), s_bAudioActive, s_oStage), k.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); n = window.document; var y = n.documentElement; q = y.requestFullscreen || y.mozRequestFullScreen || y.webkitRequestFullScreen || y.msRequestFullscreen; z = n.exitFullscreen || n.mozCancelFullScreen || n.webkitExitFullscreen || n.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (p = null, q = !1); q && screenfull.isEnabled && (n = s_oSpriteLibrary.getSprite("but_fullscreen"), a = n.width / 4 + 10, e = f, p = new CToggle(a, e, n, s_bFullscreen, s_oStage), p.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); n = s_oSpriteLibrary.getSprite("but_easy"); m = new CTextButton(CANVAS_WIDTH / 2 - n.width / 2 - 50, CANVAS_HEIGHT / 2, n, TEXT_EASY, 38, u); m.addEventListener(ON_MOUSE_UP, this._onPressUpButEasy, this); m.setTextY(177); n = s_oSpriteLibrary.getSprite("but_hard"); t = new CTextButton(CANVAS_WIDTH / 2 + n.width / 2 + 50, CANVAS_HEIGHT / 2, n, TEXT_HARD, 38, u); t.setTextY(177); t.addEventListener(ON_MOUSE_UP, this._onPressUpButHard, this); A = new createjs.Shape; A.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(A); createjs.Tween.get(A, { override: !0 }).to({ alpha: 0 }, 500, createjs.Ease.cubicOut); this.refreshButtonsPos(s_iOffsetX, s_iOffsetY) }; this.refreshButtonsPos = function(n, y) { r.setY(g + y); l.setY(g + y); h.setPosition(c - n, f + y); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || k.setPosition(b - n, y + d); q && screenfull.isEnabled && p.setPosition(a + n, e + y) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onExit = function() { this._fadeTransition(function() { this._unload(); s_oMain.gotoMenu() }, this) }; this._fadeTransition = function(n, y) { createjs.Tween.get(A, { override: !0 }).to({ alpha: 1 }, 500, createjs.Ease.cubicOut).call(function() { n.call(y) }) }; this._onFullscreenRelease = function() { s_bFullscreen ? z.call(window.document) : q.call(window.document.documentElement); sizeHandler() }; this._onPressUpButEasy = function() { this._onChooseDifficulty(EASY) }; this._onPressUpButHard = function() { this._onChooseDifficulty(HARD) }; this._onChooseDifficulty = function(n) { m.block(!0); t.block(!0); s_iDifficultyChoose = n; this._fadeTransition(function() { this._unload(); s_oMain.gotoLevelMenu() }, this) }; this._unload = function() { if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) k.unload(), k = null; h.unload(); q && screenfull.isEnabled && p.unload(); s_oStage.removeAllChildren(); s_oDifficultyMenu = null }; this._init(); s_oDifficultyMenu = this } var MS_ROLLING_SCORE = 1E3; function CRollingScore() { this.rolling = function(a, e, b, d, c) { c = void 0 === c ? MS_ROLLING_SCORE : c; var f = new createjs.Text(parseInt(a.getText().text.replace(/\D/g, "")), "1px " + PRIMARY_FONT, FONT_COLOR); createjs.Tween.get(f, { override: !0 }).to({ text: b }, c, createjs.Ease.cubicOut).addEventListener("change", function() { var g = sprintf(e, Math.floor(f.text)); a.refreshText(g); null !== d && void 0 !== d && d.refreshText(g) }).call(function() { createjs.Tween.removeTweens(f) }) }; return this } function CDot(a, e, b) { var d, c, f, g, h, k, l, r, p, m, t, q, z, u, A, n; this._init = function(y, B, v) { d = y; c = v; r = !1; p = 0; q = null; v = B.stroke_color; var D = B.main_color; y = B.radius; f = new createjs.Container; d.addChild(f); f.x = B.x; f.y = B.y; h = new createjs.Shape; var G = h.graphics; l = G.beginStroke(v).command; G.setStrokeStyle(B.stroke_thickness); k = G.beginFill(D).command; G.drawCircle(0, 0, y); B = new createjs.Shape; v = getDevicePixelRatio(); 1 > v && (v = 1); v *= y; B.graphics.beginFill("#f00").drawRect(.5 * -v, .5 * -v, v, v); h.hitArea = B; m = new createjs.Rectangle; m.x = -y; m.y = -y; m.width = y; m.height = y; f.addChild(h); SHOW_DOT_HIT_AREA && f.addChild(B); this.createTextID(); this.refreshBounds(); z = []; u = []; A = []; n = [] }; this.createTextID = function() { g = new createjs.Container; f.addChild(g); t = 2 * m.width + 20; g.x = 0; g.y = -t; createGenericText({ pos: { x: 0, y: 0 }, size: 40, text: (c + 1).toString(), outline: !0, outline_size: 3, multiline: !1, width: 80, height: 80, align: "center", line_height: 1 }, g) }; this.setPos = function(y, B) { f.x = y; f.y = B; this.refreshBounds() }; this.getPos = function() { return { x: f.x, y: f.y } }; this.getGraphic = function() { return f }; this.getReg = function() { return { regX: f.regX, regY: f.regY } }; this.getID = function() { return c }; this.setID = function(y) { c = y }; this.setVisible = function(y) { f.visible = y }; this.setChildIndex = function(y) { d.setChildIndex(f, y) }; this.setOffsetTextRadiants = function(y) { p = y }; this.refreshBounds = function() { f.uncache(); var y = g.getBounds(); f.setBounds(f.x + m.x, f.y + m.y, m.width + .5 * y.width + t, m.height + .5 * y.height + t); this._cache() }; this.getBounds = function() { return f.getBounds() }; this.setLinked = function(y) { y && !r && playSound("dot_linked", 1, !1); r = y }; this.getLinked = function() { return r }; this._cache = function() { var y = f.getBounds(); f.cache(-y.width, -y.height, 2 * y.width, 2 * y.height) }; this.refreshTextPos = function(y, B) { var v = y.getPos(), D = B.getPos(), G = Math.PI + p; G += Math.atan2(.5 * (v.y + D.y) - f.y, .5 * (v.x + D.x) - f.x); v = t * Math.sin(G); g.x = t * Math.cos(G); g.y = v; this.refreshBounds() }; this.animFillColor = function(y, B, v, D) { f.uncache(); var G = createjs.Tween.get(k, { override: !0 }); G.to({ style: y }, MS_FILL_DOT_EFFECT_TIME, createjs.Ease.cubicOut); G.call(function() { this._cache(); void 0 !== B && null !== B && B.call(v, D) }, null, this) }; this.animStrokeColor = function(y) { f.uncache(); var B = createjs.Tween.get(l, { override: !0 }); B.to({ style: y }, MS_STROKE_DOT_EFFECT_TIME, createjs.Ease.cubicOut); B.call(this._cache, null, this) }; this.animPulse = function() { this.removeAnimPulse(); q = createjs.Tween.get(h, { override: !0, loop: -1, bounce: !0 }); q.to({ scaleX: .9, scaleY: .9 }, 500, createjs.Ease.cubicOut); q.on("change", function() { return f.updateCache() }); createjs.Tween.get(k, { override: !0 }).to({ style: DOTS_PROPERTY.connected_color }, 500, createjs.Ease.cubicOut) }; this.removeAnimPulse = function() { null !== q && (createjs.Tween.removeTweens(h), createjs.Tween.removeTweens(k), q.removeAllEventListeners(), h.scaleX = h.scaleY = 1, q = null) }; this.unload = function() { this.removeAnimPulse(); f.uncache(); f.removeAllEventListeners(); d.removeChild(f) }; this.triggerEvent = function(y, B) { z[B] && z[B].call(u[B], A[B], c, y) }; this.hideTextNumber = function() { createjs.Tween.get(g).to({ alpha: 0 }, 500, createjs.Ease.cubicIn).on("change", function() { try { f.updateCache() } catch (y) {} }) }; this.reset = function() { f.uncache(); createjs.Tween.removeTweens(k); createjs.Tween.removeTweens(l); g.alpha = 1; k.style = DOTS_PROPERTY.main_color; l.style = DOTS_PROPERTY.stroke_color; r = !1; this._cache() }; this.addEventListener = function(y, B, v, D, G) { z[B] = v; u[B] = D; A[B] = G; n[B] = f.on(y, this.triggerEvent, this, !1, B) }; this.removeEventListener = function(y, B) { z[B] = null; u[B] = null; A[B] = null; f.off(y, n[B]); n[B] = null }; this._init(a, e, b) } function CStar(a, e, b, d) { var c, f, g, h; this._init = function(k, l, r, p) { c = k; f = new createjs.Container; f.x = l; f.y = r; c.addChild(f); k = new createjs.SpriteSheet({ images: [p], frames: { width: p.width / 2, height: p.height, regX: p.width / 2 / 2, regY: p.height / 2 }, animations: { state_true: [1], state_false: [0] } }); g = createSprite(k, "state_false", p.width / 2 / 2, p.height / 2, p.width / 2, p.height); g.stop(); f.addChild(g) }; this.animationScale = function(k, l, r) { createjs.Tween.get(g).to({ scaleX: 1.1, scaleY: 1.1 }, 750, createjs.Ease.cubicOut).call(function() { null !== k && void 0 !== k && k.call(l, r) }).to({ scaleX: 1, scaleY: 1 }, 750, createjs.Ease.cubicIn) }; this.setState = function(k) { h = k; g.gotoAndStop("state_" + h) }; this.getState = function() { return h }; this._init(a, e, b, d) } var INTERACTIVE_ALPHA_FADE = .5; function CInteractiveHelp(a) { var e, b, d, c, f, g, h, k, l, r; this._init = function(p) { e = p; b = new createjs.Container; e.addChild(b); d = new createjs.Shape; d.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); d.alpha = INTERACTIVE_ALPHA_FADE; b.addChild(d); b.alpha = 0; g = []; g[DOTS_TUTORIAL] = !0; c = !1; h = []; k = []; l = []; r = [] }; this.startTutorial = function(p) { var m = p.tutorial; if (g[m]) if (c) h.push({ info: p.info, tutorial: m }); else { var t = INTERACTIVE_ALPHA_FADE; switch (m) { case DOTS_TUTORIAL: var q = this.dotsTutorial } createjs.Tween.get(b, { override: !0 }).to({ alpha: 1 }, 500, createjs.Ease.cubicOut); createjs.Tween.get(d, { override: !0 }).to({ alpha: t }, 500, createjs.Ease.cubicIn); t = { cb: q, scope: this, param: p.info }; f = m; g[m] = !1; c = !0; p.info.movement ? p.info.item.animMovement(p.info.pos, t, p.info.cb_movement) : t.cb.call(t.scope, t.param) } }; this.dotsTutorial = function(p) { var m = new createjs.Container; b.addChild(m); var t = this.createHand(); s_oStage.addChild(t); var q = p.mouse_down, z = p.press_move, u = p.dots, A = u[0].getPos(); t.x = A.x; t.y = A.y; var n = createjs.Tween.get(t, { loop: -1 }); n.to({ x: A.x, y: A.y }, 500, createjs.Ease.cubicInOut); n.call(function() { q.call(p.scope, { stageX: t.x, stageY: t.y }); n.on("change", function() { z.call(p.scope, { stageX: t.x, stageY: t.y }) }) }); for (var y = 1; y < u.length; y++) A = u[y].getPos(), n.to({ x: A.x, y: A.y }, 500, createjs.Ease.cubicInOut); n.call(function() { n.removeAllEventListeners() }); n.wait(1E3); A = u[0].getPos(); n.to({ x: A.x, y: A.y }, 500, createjs.Ease.cubicInOut).call(p.reset, p.scope, p.scope); d.removeAllEventListeners(); d.on("click", function() { this.endTutorial(m); m.removeChild(); s_oStage.removeChild(t); n.removeAllEventListeners(); createjs.Tween.removeTweens(t); d.removeAllEventListeners(); d.on("click", function() {}) }, this, !1, m); createGenericText({ pos: s_bLandscape ? { x: s_iOffsetX + 300, y: CANVAS_HEIGHT / 2 } : { x: CANVAS_WIDTH - s_iOffsetX - 300, y: s_iOffsetY + 200 + 100 }, size: 80, text: TEXT_INTERACTIVE_HELP_DOTS, outline: !0, outline_size: 3, multiline: !0, width: 600, height: 200, align: "center", line_height: 1 }, m) }; this.removeTweens = function() { createjs.Tween.removeTweens(b) }; this.toExecuteTutorial = function(p) { return g[p] }; this.exeTutorial = function() { return c }; this.endTutorial = function(p) { var m = this, t = createjs.Tween.get(b); 1 > h.length ? (c = !1, t.to({ alpha: 0 }, 500, createjs.Ease.cubicIn), t.call(function() { d.removeAllEventListeners(); b.removeChild(p); m.triggerEvent(ON_END_TUTORIAL) }), r[ON_END_TUTORIAL] = f) : (t = createjs.Tween.get(p), t.to({ alpha: 0 }, 500, createjs.Ease.cubicIn), t.call(function() { c = !1; m.startTutorial(h.shift()) })) }; this.createHand = function() { var p = s_oSpriteLibrary.getSprite("hand"), m = createBitmap(p); m.regX = p.width / 2 - 5; m.regY = 19; return m }; this.triggerEvent = function(p) { k[p] && k[p].call(l[p], r[p]) }; this.addEventListener = function(p, m, t, q) { k[p] = m; l[p] = t; r[p] = q }; this._init(a) } var ON_PRESSUP_COMPLETED_LEVEL = 0; function CCompletedLevelEffect(a) { var e, b, d, c, f, g, h, k, l, r, p, m; this._init = function(t) { d = t; c = new createjs.Container; d.addChild(c); t = s_oSpriteLibrary.getSprite("but_continue"); e = CANVAS_WIDTH; b = CANVAS_HEIGHT - t.height / 2; c.x = e; c.y = b; g = new createjs.Container; c.addChild(g); h = new CGfxButton(-t.width / 2 - 10, 0, t, g); h.trebleAnimation(); l = {}; f = new createjs.Container; l.x = f.x = -t.width - 220; l.y = f.y = 0; c.addChild(f); createGenericText({ pos: { x: 0, y: 3 }, size: 80, text: TEXT_LEVEL_COMPLETED, outline: !0, outline_size: 3, multiline: !1, width: 400, height: 120, align: "center", line_height: 1 }, f); k = new createjs.Shape; k.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); k.alpha = .01; c.addChild(k); c.visible = !1; r = []; p = []; m = [] }; this.show = function() { c.visible = !0; k.visible = !1; c.alpha = 1; k.x = -c.x; k.y = -c.y; k.on("mousedown", this.triggerEvent, this, !0, ON_PRESSUP_COMPLETED_LEVEL); g.alpha = 0; f.alpha = 0; f.scaleX = f.scaleY = 10; var t = f.getBounds(); f.x = -(t.width * f.scaleX) / 2 - c.x; f.y = -(t.height * f.scaleY) / 2 - c.y; createjs.Tween.get(f).to({ x: l.x, y: l.y, scaleX: 1, scaleY: 1, alpha: 1 }, 500, createjs.Ease.cubicOut).call(function() { createjs.Tween.get(g).to({ alpha: 1 }, 500, createjs.Ease.cubicOut); k.visible = !0 }) }; this.hide = function() { createjs.Tween.get(c).to({ alpha: 0, visible: !1 }, 500, createjs.Ease.cubicIn) }; this.refreshPos = function(t, q) { c.x = e - t; c.y = b - q }; this.unload = function() { k.removeAllEventListeners(); h.unload(); d.removeChild(c) }; this.triggerEvent = function(t, q) { r[q] && r[q].call(p[q], m[q]) }; this.addEventListener = function(t, q, z, u) { r[t] = q; p[t] = z; m[t] = u }; this._init(a) } 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 e = a.split("."), b = e.length; 2 < b && (a = e[b - 2] + "." + e[b - 1]); return a } var getClosestTop = function() { var a = window, e = !1; try { for (; a.parent.document !== a.document;) if (a.parent.document) a = a.parent; else { e = !0; break } } catch (b) { e = !0 } return { topFrame: a, err: e } }, getBestPageUrl = function(a) { var e = a.topFrame, b = ""; if (a.err) try { try { b = window.top.location.href } catch (c) { var d = window.location.ancestorOrigins; b = d[d.length - 1] } } catch (c) { b = e.document.referrer } else b = e.location.href; return b }, TOPFRAMEOBJ = getClosestTop(), PAGE_URL = getBestPageUrl(TOPFRAMEOBJ); function seekAndDestroy() { for (var a = extractRootDomain(PAGE_URL), e = [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)], b = 0; b < e.length; b++) if (e[b] === a) return !0; return !1 };
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0.01 |
proxy
|
phpinfo
|
�а�тройка