var isNeedFpsMeter = !1, isLevelEditor = !1, isSkipMenus = !1, isSkipReadyWin = !0, autoLevelToLoad = 1, isLastLevelLoad = !1, isDisableWin = !1, isOpenAllLevels = !1, openedLevels = 20, isPhysicsDebugDraw = !1, isGetAllProperties = !1, isLoadAnimFromJSON = !1, isSkipSplash = !0, isShowLogo = !0, isLevelSelectShow = !1, spriteScale = 1, isWithCache = !1, isTimerUpdateMode = !1, isPageLeaved = !1, isNeedHelperLabel = !1, isDesktopBrowser = !1, isLowQuality = !1, isDesignerSettingsPreferred = !0, STORAGE_PREFIX = "Soccer23", isMobileOnlyResize = !1, // SPONSOR_URL = "http://play68.com", PRELOADER_LOGO = "logo_spele.png", HERO_TYPE = 0, HERO_DOC_TYPE = 1, HERO_WOMAN_TYPE = 2, MONSTER_TYPE = 3, DECOR_BALK_1_TYPE = 21, DECOR_BALK_2_TYPE = 22, DECOR_BALK_3_TYPE = 23, DECOR_BALK_4_TYPE = 24, DECOR_BALK_5_TYPE = 25, DECOR_LAND_TYPE = 26, DECOR_HOUSE_TYPE = 27, DECOR_KUST_TYPE = 28, DECOR_ZABOR_TYPE = 29, DECOR_MELNICA_TYPE = 30, DECOR_MELNICA_ROT_TYPE = 31, DECOR_ARROW_TYPE = 32, DECOR_HOUSE_2_TYPE = 33, DECOR_COW_TYPE = 34, DECOR_CIRCUS_TYPE = 35, DECOR_HOUSE_3_TYPE = 36, DECOR_HOUSE_4_TYPE = 37, DECOR_BALK_6_TYPE = 38, DECOR_WINDOW_TYPE = 39, DECOR_CAT_1_TYPE = 40, DECOR_CAT_2_TYPE = 41, DECOR_GRAM_TYPE = 42, DECOR_PICT_1_TYPE = 43, DECOR_FLOWER_1_TYPE = 44, DECOR_VENT_TYPE = 45, DECOR_ELECTR_TYPE = 46, DECOR_DOOR_TYPE = 47, DECOR_PICT_2_TYPE = 48, DECOR_SVECHA_TYPE = 49, DECOR_TABLE_TYPE = 50, DECOR_STUL_TYPE = 51, DECOR_PICT_3_TYPE = 52, DECOR_VESHALKA_TYPE = 53, DECOR_VELO_TYPE = 54, DECOR_COVER_TYPE = 55, DECOR_BALK_7_TYPE = 56, DECOR_HELP_1_TYPE = 57, PHYSICS_RECT_TYPE = 100, DYNAMIC_BOX_TYPE = 101, TELEPORT_TYPE = 102, BOMB_TYPE = 103, DANGER_TYPE = 104, PHYSICS_MAN_BLOCK_TYPE = 105, PHYSICS_WOMAN_BLOCK_TYPE = 106, GLASS_BLOCK_TYPE = 107, ACTIVATOR_TYPE = 108, DOOR_TYPE = 109, DYNAMIC_CIRCLE_TYPE = 110, DYNAMIC_RECT_TYPE = 111, TELEGA_TYPE = 112, DYNAMIC_TRIANGLE_TYPE = 113, MOVABLE_BALK_TYPE = 114, FAN_TYPE = 115, GLASS_BOX_TYPE = 116, GLASS_TRIANGLE_TYPE = 117, HARD_BOX_TYPE = 118, HARD_RECT_TYPE = 119, HARD_TRIANGLE_TYPE = 120, STATIC_BALK_1_TYPE = 121, LAND_TYPE = 122, STATIC_BOX_TYPE = 123, BONUS_DIAMOND_TYPE = 201, BONUS_MONEY_TYPE = 202, BONUS_STAR_TYPE = 203, BONUS_GHOST_TYPE = 204, AIM_TYPE = 301, STATIC_CATEGORY = 1, WOMAN_CATEGORY = 2, MAN_CATEGORY = 4, WOMAN_BLOCK_CATEGORY = 8, MAN_BLOCK_CATEGORY = 16, FAN_ACTIV_DISTANCE = 130, FAN_MAX_FORCE = 40, GLASS_BREAK_VELOCITY = 70; this.createjs = this.createjs || {}; (function () { var c = function (b, c, a) { this.initialize(b, c, a) }, a = c.prototype; a.type = null; a.target = null; a.currentTarget = null; a.eventPhase = 0; a.bubbles = !1; a.cancelable = !1; a.timeStamp = 0; a.defaultPrevented = !1; a.propagationStopped = !1; a.immediatePropagationStopped = !1; a.removed = !1; a.initialize = function (b, c, a) { this.type = b; this.bubbles = c; this.cancelable = a; this.timeStamp = (new Date) .getTime() }; a.preventDefault = function () { this.defaultPrevented = !0 }; a.stopPropagation = function () { this.propagationStopped = !0 }; a.stopImmediatePropagation = function () { this.immediatePropagationStopped = this.propagationStopped = !0 }; a.remove = function () { this.removed = !0 }; a.clone = function () { return new c(this.type, this.bubbles, this.cancelable) }; a.toString = function () { return "[Event (type=" + this.type + ")]" }; createjs.Event = c })(); this.createjs = this.createjs || {}; (function () { var c = function () {}, a = c.prototype; c.initialize = function (b) { b.addEventListener = a.addEventListener; b.on = a.on; b.removeEventListener = b.off = a.removeEventListener; b.removeAllEventListeners = a.removeAllEventListeners; b.hasEventListener = a.hasEventListener; b.dispatchEvent = a.dispatchEvent; b._dispatchEvent = a._dispatchEvent }; a._listeners = null; a._captureListeners = null; a.initialize = function () {}; a.addEventListener = function (b, c, a) { var d; d = a ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {}; var e = d[b]; e && this.removeEventListener(b, c, a); (e = d[b]) ? e.push(c) : d[b] = [c]; return c }; a.on = function (b, c, a, d, e, h) { c.handleEvent && (a = a || c, c = c.handleEvent); a = a || this; return this.addEventListener(b, function (b) { c.call(a, b, e); d && b.remove() }, h) }; a.removeEventListener = function (b, c, a) { if (a = a ? this._captureListeners : this._listeners) { var d = a[b]; if (d) for (var e = 0, h = d.length; e < h; e++) if (d[e] == c) { 1 == h ? delete a[b] : d.splice(e, 1); break } } }; a.off = a.removeEventListener; a.removeAllEventListeners = function (b) { b ? (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null }; a.dispatchEvent = function (b, c) { if ("string" == typeof b) { var a = this._listeners; if (!a || !a[b]) return !1; b = new createjs.Event(b) } b.target = c || this; if (b.bubbles && this.parent) { for (var d = this, a = [d]; d.parent;) a.push(d = d.parent); for (var e = a.length, d = e - 1; 0 <= d && !b.propagationStopped; d--) a[d]._dispatchEvent(b, 1 + (0 == d)); for (d = 1; d < e && !b.propagationStopped; d++) a[d]._dispatchEvent(b, 3) } else this._dispatchEvent(b, 2); return b.defaultPrevented }; a.hasEventListener = function (b) { var c = this._listeners, a = this._captureListeners; return !!(c && c[b] || a && a[b]) }; a.toString = function () { return "[EventDispatcher]" }; a._dispatchEvent = function (b, c) { var a, d = 1 == c ? this._captureListeners : this._listeners; if (b && d && (d = d[b.type]) && (a = d.length)) { b.currentTarget = this; b.eventPhase = c; b.removed = !1; for (var d = d.slice(), e = 0; e < a && !b.immediatePropagationStopped; e++) { var h = d[e]; h.handleEvent ? h.handleEvent(b) : h(b); b.removed && (this.off(b.type, h, 1 == c), b.removed = !1) } } }; createjs.EventDispatcher = c })(); this.createjs = this.createjs || {}; (function () { createjs.indexOf = function (c, a) { for (var b = 0, g = c.length; b < g; b++) if (a === c[b]) return b; return -1 } })(); this.createjs = this.createjs || {}; (function () { var c = function () { throw "UID cannot be instantiated"; }; c._nextID = 0; c.get = function () { return c._nextID++ }; createjs.UID = c })(); this.createjs = this.createjs || {}; (function () { var c = function () { throw "Ticker cannot be instantiated."; }; c.RAF_SYNCHED = "synched"; c.RAF = "raf"; c.TIMEOUT = "timeout"; c.useRAF = !1; c.timingMode = null; c.maxDelta = 60; c.removeEventListener = null; c.removeAllEventListeners = null; c.dispatchEvent = null; c.hasEventListener = null; c._listeners = null; createjs.EventDispatcher.initialize(c); c._addEventListener = c.addEventListener; c.addEventListener = function () { !c._inited && c.init(); return c._addEventListener.apply(c, arguments) }; c._paused = !1; c._inited = !1; c._startTime = 0; c._pausedTime = 0; c._ticks = 0; c._pausedTicks = 0; c._interval = 50; c._lastTime = 0; c._times = []; c._tickTimes = []; c._timerId = null; c._raf = !0; c._isFirstInit = !0; c.init = function () { c._inited || (c._timerId = null, c._inited = !0, c._isFirstInit = !1, c._times = [], c._tickTimes = [], c._startTime = c._getTime(), c._times.push(c._lastTime = 0), c.setInterval(c._interval)) }; c.reset = function () { c._inited = !1; if (c._raf) { var b = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame; b && b(c._timerId) } else clearTimeout(c._timerId) }; c.setInterval = function (b) { c._interval = b; c._inited && c._setupTick() }; c.getInterval = function () { return c._interval }; c.setFPS = function (b) { c.setInterval(1E3 / b) }; c.getFPS = function () { return 1E3 / c._interval }; c.getMeasuredTickTime = function (b) { var a = 0, f = c._tickTimes; if (1 > f.length) return -1; b = Math.min(f.length, b || c.getFPS() | 0); for (var d = 0; d < b; d++) a += f[d]; return a / b }; c.getMeasuredFPS = function (b) { var a = c._times; if (2 > a.length) return -1; b = Math.min(a.length - 1, b || c.getFPS() | 0); return 1E3 / ((a[0] - a[b]) / b) }; c.setPaused = function (b) { c._paused = b }; c.getPaused = function () { return c._paused }; c.getTime = function (b) { return c._getTime() - c._startTime - (b ? c._pausedTime : 0) }; c.getEventTime = function (b) { return (c._lastTime || c._startTime) - (b ? c._pausedTime : 0) }; c.getTicks = function (b) { return c._ticks - (b ? c._pausedTicks : 0) }; c._handleSynch = function () { var b = c._getTime() - c._startTime; c._timerId = null; c._setupTick(); b - c._lastTime >= 0.97 * (c._interval - 1) && c._tick() }; c._handleRAF = function () { c._timerId = null; c._setupTick(); c._tick() }; c._handleTimeout = function () { c._timerId = null; c._setupTick(); c._tick() }; c._setupTick = function () { if (null != c._timerId) trace("duplicate"); else { var b = c.timingMode || c.useRAF && c.RAF_SYNCHED; if (b == c.RAF_SYNCHED || b == c.RAF) { var a = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame; if (a) { c._timerId = a(b == c.RAF ? c._handleRAF : c._handleSynch); c._raf = !0; return } } c._raf = !1; c._timerId = setTimeout(c._handleTimeout, c._interval) } }; c._tick = function () { var b = c._getTime() - c._startTime, a = b - c._lastTime, f = c._paused; c._ticks++; f && (c._pausedTicks++, c._pausedTime += a); c._lastTime = b; if (c.hasEventListener("tick")) { var d = new createjs.Event("tick"), e = c.maxDelta; d.delta = e && a > e ? e : a; d.paused = f; d.time = b; d.runTime = b - c._pausedTime; c.dispatchEvent(d) } for (c._tickTimes.unshift(c._getTime() - b); 100 < c._tickTimes.length;) c._tickTimes.pop(); for (c._times.unshift(b); 100 < c._times.length;) c._times.pop() }; var a = window.performance && (performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow); c._getTime = function () { return a && a.call(performance) || (new Date) .getTime() }; createjs.Ticker = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, c, a, d, e, h, k, m, n, p) { this.initialize(b, c, a, d, e, h, k, m, n, p) }, a = c.prototype = new createjs.Event; a.stageX = 0; a.stageY = 0; a.rawX = 0; a.rawY = 0; a.nativeEvent = null; a.pointerID = 0; a.primary = !1; a.addEventListener = null; a.removeEventListener = null; a.removeAllEventListeners = null; a.dispatchEvent = null; a.hasEventListener = null; a._listeners = null; createjs.EventDispatcher.initialize(a); a.Event_initialize = a.initialize; a.initialize = function (b, c, a, d, e, h, k, m, n, p) { this.Event_initialize(b, c, a); this.stageX = d; this.stageY = e; this.nativeEvent = h; this.pointerID = k; this.primary = m; this.rawX = null == n ? d : n; this.rawY = null == p ? e : p }; a.clone = function () { return new c(this.type, this.bubbles, this.cancelable, this.stageX, this.stageY, this.target, this.nativeEvent, this.pointerID, this.primary, this.rawX, this.rawY) }; a.toString = function () { return "[MouseEvent (type=" + this.type + " stageX=" + this.stageX + " stageY=" + this.stageY + ")]" }; createjs.MouseEvent = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, c, a, d, e, h) { this.initialize(b, c, a, d, e, h) }, a = c.prototype; c.identity = null; c.DEG_TO_RAD = Math.PI / 180; a.a = 1; a.b = 0; a.c = 0; a.d = 1; a.tx = 0; a.ty = 0; a.alpha = 1; a.shadow = null; a.compositeOperation = null; a.initialize = function (b, c, a, d, e, h) { this.a = null == b ? 1 : b; this.b = c || 0; this.c = a || 0; this.d = null == d ? 1 : d; this.tx = e || 0; this.ty = h || 0; return this }; a.prepend = function (b, c, a, d, e, h) { var k = this.tx; if (1 != b || 0 != c || 0 != a || 1 != d) { var m = this.a, n = this.c; this.a = m * b + this.b * a; this.b = m * c + this.b * d; this.c = n * b + this.d * a; this.d = n * c + this.d * d } this.tx = k * b + this.ty * a + e; this.ty = k * c + this.ty * d + h; return this }; a.append = function (b, c, a, d, e, h) { var k = this.a, m = this.b, n = this.c, p = this.d; this.a = b * k + c * n; this.b = b * m + c * p; this.c = a * k + d * n; this.d = a * m + d * p; this.tx = e * k + h * n + this.tx; this.ty = e * m + h * p + this.ty; return this }; a.prependMatrix = function (b) { this.prepend(b.a, b.b, b.c, b.d, b.tx, b.ty); this.prependProperties(b.alpha, b.shadow, b.compositeOperation); return this }; a.appendMatrix = function (b) { this.append(b.a, b.b, b.c, b.d, b.tx, b.ty); this.appendProperties(b.alpha, b.shadow, b.compositeOperation); return this }; a.prependTransform = function (b, a, f, d, e, h, k, m, n) { if (e % 360) { var p = e * c.DEG_TO_RAD; e = Math.cos(p); p = Math.sin(p) } else e = 1, p = 0; if (m || n) this.tx -= m, this.ty -= n; h || k ? (h *= c.DEG_TO_RAD, k *= c.DEG_TO_RAD, this.prepend(e * f, p * f, -p * d, e * d, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), b, a)) : this.prepend(e * f, p * f, -p * d, e * d, b, a); return this }; a.appendTransform = function (b, a, f, d, e, h, k, m, n) { if (e % 360) { var p = e * c.DEG_TO_RAD; e = Math.cos(p); p = Math.sin(p) } else e = 1, p = 0; h || k ? (h *= c.DEG_TO_RAD, k *= c.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), b, a), this.append(e * f, p * f, -p * d, e * d, 0, 0)) : this.append(e * f, p * f, -p * d, e * d, b, a); if (m || n) this.tx -= m * this.a + n * this.c, this.ty -= m * this.b + n * this.d; return this }; a.rotate = function (b) { var c = Math.cos(b); b = Math.sin(b); var a = this.a, d = this.c, e = this.tx; this.a = a * c - this.b * b; this.b = a * b + this.b * c; this.c = d * c - this.d * b; this.d = d * b + this.d * c; this.tx = e * c - this.ty * b; this.ty = e * b + this.ty * c; return this }; a.skew = function (b, a) { b *= c.DEG_TO_RAD; a *= c.DEG_TO_RAD; this.append(Math.cos(a), Math.sin(a), -Math.sin(b), Math.cos(b), 0, 0); return this }; a.scale = function (b, c) { this.a *= b; this.d *= c; this.c *= b; this.b *= c; this.tx *= b; this.ty *= c; return this }; a.translate = function (b, c) { this.tx += b; this.ty += c; return this }; a.identity = function () { this.alpha = this.a = this.d = 1; this.b = this.c = this.tx = this.ty = 0; this.shadow = this.compositeOperation = null; return this }; a.invert = function () { var b = this.a, c = this.b, a = this.c, d = this.d, e = this.tx, h = b * d - c * a; this.a = d / h; this.b = -c / h; this.c = -a / h; this.d = b / h; this.tx = (a * this.ty - d * e) / h; this.ty = -(b * this.ty - c * e) / h; return this }; a.isIdentity = function () { return 0 == this.tx && 0 == this.ty && 1 == this.a && 0 == this.b && 0 == this.c && 1 == this.d }; a.transformPoint = function (b, c, a) { a = a || {}; a.x = b * this.a + c * this.c + this.tx; a.y = b * this.b + c * this.d + this.ty; return a }; a.decompose = function (b) { null == b && (b = {}); b.x = this.tx; b.y = this.ty; b.scaleX = Math.sqrt(this.a * this.a + this.b * this.b); b.scaleY = Math.sqrt(this.c * this.c + this.d * this.d); var a = Math.atan2(-this.c, this.d), f = Math.atan2(this.b, this.a); a == f ? (b.rotation = f / c.DEG_TO_RAD, 0 > this.a && 0 <= this.d && (b.rotation += 0 >= b.rotation ? 180 : -180), b.skewX = b.skewY = 0) : (b.skewX = a / c.DEG_TO_RAD, b.skewY = f / c.DEG_TO_RAD); return b }; a.reinitialize = function (b, c, a, d, e, h, k, m, n) { this.initialize(b, c, a, d, e, h); this.alpha = null == k ? 1 : k; this.shadow = m; this.compositeOperation = n; return this }; a.copy = function (b) { return this.reinitialize(b.a, b.b, b.c, b.d, b.tx, b.ty, b.alpha, b.shadow, b.compositeOperation) }; a.appendProperties = function (b, c, a) { this.alpha *= b; this.shadow = c || this.shadow; this.compositeOperation = a || this.compositeOperation; return this }; a.prependProperties = function (b, c, a) { this.alpha *= b; this.shadow = this.shadow || c; this.compositeOperation = this.compositeOperation || a; return this }; a.clone = function () { return (new c) .copy(this) }; a.toString = function () { return "[Matrix2D (a=" + this.a + " b=" + this.b + " c=" + this.c + " d=" + this.d + " tx=" + this.tx + " ty=" + this.ty + ")]" }; c.identity = new c; createjs.Matrix2D = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, c) { this.initialize(b, c) }, a = c.prototype; a.x = 0; a.y = 0; a.initialize = function (b, c) { this.x = null == b ? 0 : b; this.y = null == c ? 0 : c; return this }; a.copy = function (b) { return this.initialize(b.x, b.y) }; a.clone = function () { return new c(this.x, this.y) }; a.toString = function () { return "[Point (x=" + this.x + " y=" + this.y + ")]" }; createjs.Point = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, c, a, d) { this.initialize(b, c, a, d) }, a = c.prototype; a.x = 0; a.y = 0; a.width = 0; a.height = 0; a.initialize = function (b, c, a, d) { this.x = b || 0; this.y = c || 0; this.width = a || 0; this.height = d || 0; return this }; a.copy = function (b) { return this.initialize(b.x, b.y, b.width, b.height) }; a.clone = function () { return new c(this.x, this.y, this.width, this.height) }; a.toString = function () { return "[Rectangle (x=" + this.x + " y=" + this.y + " width=" + this.width + " height=" + this.height + ")]" }; createjs.Rectangle = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, c, a, d, e, h, k) { this.initialize(b, c, a, d, e, h, k) }, a = c.prototype; a.target = null; a.overLabel = null; a.outLabel = null; a.downLabel = null; a.play = !1; a._isPressed = !1; a._isOver = !1; a.initialize = function (b, c, a, d, e, h, k) { b.addEventListener && (this.target = b, b.cursor = "pointer", this.overLabel = null == a ? "over" : a, this.outLabel = null == c ? "out" : c, this.downLabel = null == d ? "down" : d, this.play = e, this.setEnabled(!0), this.handleEvent({}), h && (k && (h.actionsEnabled = !1, h.gotoAndStop && h.gotoAndStop(k)), b.hitArea = h)) }; a.setEnabled = function (b) { var c = this.target; b ? (c.addEventListener("rollover", this), c.addEventListener("rollout", this), c.addEventListener("mousedown", this), c.addEventListener("pressup", this)) : (c.removeEventListener("rollover", this), c.removeEventListener("rollout", this), c.removeEventListener("mousedown", this), c.removeEventListener("pressup", this)) }; a.toString = function () { return "[ButtonHelper]" }; a.handleEvent = function (b) { var c = this.target; b = b.type; "mousedown" == b ? (this._isPressed = !0, b = this.downLabel) : "pressup" == b ? (this._isPressed = !1, b = this._isOver ? this.overLabel : this.outLabel) : "rollover" == b ? (this._isOver = !0, b = this._isPressed ? this.downLabel : this.overLabel) : (this._isOver = !1, b = this._isPressed ? this.overLabel : this.outLabel); this.play ? c.gotoAndPlay && c.gotoAndPlay(b) : c.gotoAndStop && c.gotoAndStop(b) }; createjs.ButtonHelper = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, c, a, d) { this.initialize(b, c, a, d) }, a = c.prototype; c.identity = null; a.color = null; a.offsetX = 0; a.offsetY = 0; a.blur = 0; a.initialize = function (b, c, a, d) { this.color = b; this.offsetX = c; this.offsetY = a; this.blur = d }; a.toString = function () { return "[Shadow]" }; a.clone = function () { return new c(this.color, this.offsetX, this.offsetY, this.blur) }; c.identity = new c("transparent", 0, 0, 0); createjs.Shadow = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b) { this.initialize(b) }, a = c.prototype = new createjs.EventDispatcher; a.complete = !0; a.framerate = 0; a._animations = null; a._frames = null; a._images = null; a._data = null; a._loadCount = 0; a._frameHeight = 0; a._frameWidth = 0; a._numFrames = 0; a._regX = 0; a._regY = 0; a.initialize = function (b) { var c, a, d; if (null != b) { this.framerate = b.framerate || 0; if (b.images && 0 < (a = b.images.length)) for (d = this._images = [], c = 0; c < a; c++) { var e = b.images[c]; if ("string" == typeof e) { var h = e, e = document.createElement("img"); e.src = h } d.push(e); e.getContext || e.complete || (this._loadCount++, this.complete = !1, function (b) { e.onload = function () { b._handleImageLoad() } }(this)) } if (null != b.frames) if (b.frames instanceof Array) for (this._frames = [], d = b.frames, c = 0, a = d.length; c < a; c++) h = d[c], this._frames.push({ image: this._images[h[4] ? h[4] : 0], rect: new createjs.Rectangle(h[0], h[1], h[2], h[3]), regX: h[5] || 0, regY: h[6] || 0 }); else a = b.frames, this._frameWidth = a.width, this._frameHeight = a.height, this._regX = a.regX || 0, this._regY = a.regY || 0, this._numFrames = a.count, 0 == this._loadCount && this._calculateFrames(); this._animations = []; if (null != (a = b.animations)) { this._data = {}; for (var k in a) { b = { name: k }; h = a[k]; if ("number" == typeof h) d = b.frames = [h]; else if (h instanceof Array) if (1 == h.length) b.frames = [h[0]]; else for (b.speed = h[3], b.next = h[2], d = b.frames = [], c = h[0]; c <= h[1]; c++) d.push(c); else b.speed = h.speed, b.next = h.next, c = h.frames, d = b.frames = "number" == typeof c ? [c] : c.slice(0); if (!0 === b.next || void 0 === b.next) b.next = k; if (!1 === b.next || 2 > d.length && b.next == k) b.next = null; b.speed || (b.speed = 1); this._animations.push(k); this._data[k] = b } } } }; a.getNumFrames = function (b) { if (null == b) return this._frames ? this._frames.length : this._numFrames; b = this._data[b]; return null == b ? 0 : b.frames.length }; a.getAnimations = function () { return this._animations.slice(0) }; a.getAnimation = function (b) { return this._data[b] }; a.getFrame = function (b) { var c; return this._frames && (c = this._frames[b]) ? c : null }; a.getFrameBounds = function (b, c) { var a = this.getFrame(b); return a ? (c || new createjs.Rectangle) .initialize(-a.regX, -a.regY, a.rect.width, a.rect.height) : null }; a.toString = function () { return "[SpriteSheet]" }; a.clone = function () { var b = new c; b.complete = this.complete; b._animations = this._animations; b._frames = this._frames; b._images = this._images; b._data = this._data; b._frameHeight = this._frameHeight; b._frameWidth = this._frameWidth; b._numFrames = this._numFrames; b._loadCount = this._loadCount; return b }; a._handleImageLoad = function () { 0 == --this._loadCount && (this._calculateFrames(), this.complete = !0, this.dispatchEvent("complete")) }; a._calculateFrames = function () { if (!this._frames && 0 != this._frameWidth) { this._frames = []; for (var b = 0, c = this._frameWidth, a = this._frameHeight, d = 0, e = this._images; d < e.length; d++) { for (var h = e[d], k = (h.width + 1) / c | 0, m = (h.height + 1) / a | 0, m = 0 < this._numFrames ? Math.min(this._numFrames - b, k * m) : k * m, n = 0; n < m; n++) this._frames.push({ image: h, rect: new createjs.Rectangle(n % k * c, (n / k | 0) * a, c, a), regX: this._regX, regY: this._regY }); b += m } this._numFrames = b } }; createjs.SpriteSheet = c })(); this.createjs = this.createjs || {}; (function () { function c(b, c, a) { this.f = b; this.params = c; this.path = null == a ? !0 : a } c.prototype.exec = function (b) { this.f.apply(b, this.params) }; var a = function () { this.initialize() }, b = a.prototype; a.getRGB = function (b, c, a, g) { null != b && null == a && (g = c, a = b & 255, c = b >> 8 & 255, b = b >> 16 & 255); return null == g ? "rgb(" + b + "," + c + "," + a + ")" : "rgba(" + b + "," + c + "," + a + "," + g + ")" }; a.getHSL = function (b, c, a, g) { return null == g ? "hsl(" + b % 360 + "," + c + "%," + a + "%)" : "hsla(" + b % 360 + "," + c + "%," + a + "%," + g + ")" }; a.Command = c; a.BASE_64 = { A: 0, B: 1, C: 2, D: 3, E: 4, F: 5, G: 6, H: 7, I: 8, J: 9, K: 10, L: 11, M: 12, N: 13, O: 14, P: 15, Q: 16, R: 17, S: 18, T: 19, U: 20, V: 21, W: 22, X: 23, Y: 24, Z: 25, a: 26, b: 27, c: 28, d: 29, e: 30, f: 31, g: 32, h: 33, i: 34, j: 35, k: 36, l: 37, m: 38, n: 39, o: 40, p: 41, q: 42, r: 43, s: 44, t: 45, u: 46, v: 47, w: 48, x: 49, y: 50, z: 51, 0: 52, 1: 53, 2: 54, 3: 55, 4: 56, 5: 57, 6: 58, 7: 59, 8: 60, 9: 61, "+": 62, "/": 63 }; a.STROKE_CAPS_MAP = ["butt", "round", "square"]; a.STROKE_JOINTS_MAP = ["miter", "round", "bevel"]; var g = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); if (g.getContext) { var f = a._ctx = g.getContext("2d"); a.beginCmd = new c(f.beginPath, [], !1); a.fillCmd = new c(f.fill, [], !1); a.strokeCmd = new c(f.stroke, [], !1); g.width = g.height = 1 } b._strokeInstructions = null; b._strokeStyleInstructions = null; b._strokeIgnoreScale = !1; b._fillInstructions = null; b._fillMatrix = null; b._instructions = null; b._oldInstructions = null; b._activeInstructions = null; b._active = !1; b._dirty = !1; b.initialize = function () { this.clear(); this._ctx = a._ctx }; b.isEmpty = function () { return !(this._instructions.length || this._oldInstructions.length || this._activeInstructions.length) }; b.draw = function (b) { this._dirty && this._updateInstructions(); for (var c = this._instructions, a = 0, g = c.length; a < g; a++) c[a].exec(b) }; b.drawAsPath = function (b) { this._dirty && this._updateInstructions(); for (var c, a = this._instructions, g = 0, f = a.length; g < f; g++)((c = a[g]) .path || 0 == g) && c.exec(b) }; b.moveTo = function (b, a) { this._activeInstructions.push(new c(this._ctx.moveTo, [b, a])); return this }; b.lineTo = function (b, a) { this._dirty = this._active = !0; this._activeInstructions.push(new c(this._ctx.lineTo, [b, a])); return this }; b.arcTo = function (b, a, g, f, m) { this._dirty = this._active = !0; this._activeInstructions.push(new c(this._ctx.arcTo, [b, a, g, f, m])); return this }; b.arc = function (b, a, g, f, m, n) { this._dirty = this._active = !0; null == n && (n = !1); this._activeInstructions.push(new c(this._ctx.arc, [b, a, g, f, m, n])); return this }; b.quadraticCurveTo = function (b, a, g, f) { this._dirty = this._active = !0; this._activeInstructions.push(new c(this._ctx.quadraticCurveTo, [b, a, g, f])); return this }; b.bezierCurveTo = function (b, a, g, f, m, n) { this._dirty = this._active = !0; this._activeInstructions.push(new c(this._ctx.bezierCurveTo, [b, a, g, f, m, n])); return this }; b.rect = function (b, a, g, f) { this._dirty = this._active = !0; this._activeInstructions.push(new c(this._ctx.rect, [b, a, g, f])); return this }; b.closePath = function () { this._active && (this._dirty = !0, this._activeInstructions.push(new c(this._ctx.closePath, []))); return this }; b.clear = function () { this._instructions = []; this._oldInstructions = []; this._activeInstructions = []; this._strokeStyleInstructions = this._strokeInstructions = this._fillInstructions = this._fillMatrix = null; this._active = this._dirty = this._strokeIgnoreScale = !1; return this }; b.beginFill = function (b) { this._active && this._newPath(); this._fillInstructions = b ? [new c(this._setProp, ["fillStyle", b], !1)] : null; this._fillMatrix = null; return this }; b.beginLinearGradientFill = function (b, a, g, f, m, n) { this._active && this._newPath(); g = this._ctx.createLinearGradient(g, f, m, n); f = 0; for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]); this._fillInstructions = [new c(this._setProp, ["fillStyle", g], !1)]; this._fillMatrix = null; return this }; b.beginRadialGradientFill = function (b, a, g, f, m, n, p, r) { this._active && this._newPath(); g = this._ctx.createRadialGradient(g, f, m, n, p, r); f = 0; for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]); this._fillInstructions = [new c(this._setProp, ["fillStyle", g], !1)]; this._fillMatrix = null; return this }; b.beginBitmapFill = function (b, a, g) { this._active && this._newPath(); b = this._ctx.createPattern(b, a || ""); this._fillInstructions = [new c(this._setProp, ["fillStyle", b], !1)]; this._fillMatrix = g ? [g.a, g.b, g.c, g.d, g.tx, g.ty] : null; return this }; b.endFill = function () { return this.beginFill() }; b.setStrokeStyle = function (b, g, f, k, m) { this._active && this._newPath(); this._strokeStyleInstructions = [new c(this._setProp, ["lineWidth", null == b ? "1" : b], !1), new c(this._setProp, ["lineCap", null == g ? "butt" : isNaN(g) ? g : a.STROKE_CAPS_MAP[g]], !1), new c(this._setProp, ["lineJoin", null == f ? "miter" : isNaN(f) ? f : a.STROKE_JOINTS_MAP[f]], !1), new c(this._setProp, ["miterLimit", null == k ? "10" : k], !1)]; this._strokeIgnoreScale = m; return this }; b.beginStroke = function (b) { this._active && this._newPath(); this._strokeInstructions = b ? [new c(this._setProp, ["strokeStyle", b], !1)] : null; return this }; b.beginLinearGradientStroke = function (b, a, g, f, m, n) { this._active && this._newPath(); g = this._ctx.createLinearGradient(g, f, m, n); f = 0; for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]); this._strokeInstructions = [new c(this._setProp, ["strokeStyle", g], !1)]; return this }; b.beginRadialGradientStroke = function (b, a, g, f, m, n, p, r) { this._active && this._newPath(); g = this._ctx.createRadialGradient(g, f, m, n, p, r); f = 0; for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]); this._strokeInstructions = [new c(this._setProp, ["strokeStyle", g], !1)]; return this }; b.beginBitmapStroke = function (b, a) { this._active && this._newPath(); var g = this._ctx.createPattern(b, a || ""); this._strokeInstructions = [new c(this._setProp, ["strokeStyle", g], !1)]; return this }; b.endStroke = function () { this.beginStroke(); return this }; b.curveTo = b.quadraticCurveTo; b.drawRect = b.rect; b.drawRoundRect = function (b, a, c, g, f) { this.drawRoundRectComplex(b, a, c, g, f, f, f, f); return this }; b.drawRoundRectComplex = function (b, a, g, f, m, n, p, r) { var s = (g < f ? g : f) / 2, t = 0, q = 0, w = 0, u = 0; 0 > m && (m *= t = -1); m > s && (m = s); 0 > n && (n *= q = -1); n > s && (n = s); 0 > p && (p *= w = -1); p > s && (p = s); 0 > r && (r *= u = -1); r > s && (r = s); this._dirty = this._active = !0; var s = this._ctx.arcTo, x = this._ctx.lineTo; this._activeInstructions.push(new c(this._ctx.moveTo, [b + g - n, a]), new c(s, [b + g + n * q, a - n * q, b + g, a + n, n]), new c(x, [b + g, a + f - p]), new c(s, [b + g + p * w, a + f + p * w, b + g - p, a + f, p]), new c(x, [b + r, a + f]), new c(s, [b - r * u, a + f + r * u, b, a + f - r, r]), new c(x, [b, a + m]), new c(s, [b - m * t, a - m * t, b + m, a, m]), new c(this._ctx.closePath)); return this }; b.drawCircle = function (b, a, c) { this.arc(b, a, c, 0, 2 * Math.PI); return this }; b.drawEllipse = function (b, a, g, f) { this._dirty = this._active = !0; var m = 0.5522848 * (g / 2), n = 0.5522848 * (f / 2), p = b + g, r = a + f; g = b + g / 2; f = a + f / 2; this._activeInstructions.push(new c(this._ctx.moveTo, [b, f]), new c(this._ctx.bezierCurveTo, [b, f - n, g - m, a, g, a]), new c(this._ctx.bezierCurveTo, [g + m, a, p, f - n, p, f]), new c(this._ctx.bezierCurveTo, [p, f + n, g + m, r, g, r]), new c(this._ctx.bezierCurveTo, [g - m, r, b, f + n, b, f])); return this }; b.inject = function (b, a) { this._dirty = this._active = !0; this._activeInstructions.push(new c(b, [a])); return this }; b.drawPolyStar = function (b, a, g, f, m, n) { this._dirty = this._active = !0; null == m && (m = 0); m = 1 - m; n = null == n ? 0 : n / (180 / Math.PI); var p = Math.PI / f; this._activeInstructions.push(new c(this._ctx.moveTo, [b + Math.cos(n) * g, a + Math.sin(n) * g])); for (var r = 0; r < f; r++) n += p, 1 != m && this._activeInstructions.push(new c(this._ctx.lineTo, [b + Math.cos(n) * g * m, a + Math.sin(n) * g * m])), n += p, this._activeInstructions.push(new c(this._ctx.lineTo, [b + Math.cos(n) * g, a + Math.sin(n) * g])); return this }; b.decodePath = function (b) { for (var c = [this.moveTo, this.lineTo, this.quadraticCurveTo, this.bezierCurveTo, this.closePath], g = [2, 2, 4, 6, 0], f = 0, m = b.length, n = [], p = 0, r = 0, s = a.BASE_64; f < m;) { var t = b.charAt(f), q = s[t], w = q >> 3, u = c[w]; if (!u || q & 3) throw "bad path data (@" + f + "): " + t; t = g[w]; w || (p = r = 0); n.length = 0; f++; q = (q >> 2 & 1) + 2; for (w = 0; w < t; w++) { var x = s[b.charAt(f)], K = x >> 5 ? -1 : 1, x = (x & 31) << 6 | s[b.charAt(f + 1)]; 3 == q && (x = x << 6 | s[b.charAt(f + 2)]); x = K * x / 10; w % 2 ? p = x += p : r = x += r; n[w] = x; f += q } u.apply(this, n) } return this }; b.clone = function () { var b = new a; b._instructions = this._instructions.slice(); b._activeInstructions = this._activeInstructions.slice(); b._oldInstructions = this._oldInstructions.slice(); this._fillInstructions && (b._fillInstructions = this._fillInstructions.slice()); this._strokeInstructions && (b._strokeInstructions = this._strokeInstructions.slice()); this._strokeStyleInstructions && (b._strokeStyleInstructions = this._strokeStyleInstructions.slice()); b._active = this._active; b._dirty = this._dirty; b._fillMatrix = this._fillMatrix; b._strokeIgnoreScale = this._strokeIgnoreScale; return b }; b.toString = function () { return "[Graphics]" }; b.mt = b.moveTo; b.lt = b.lineTo; b.at = b.arcTo; b.bt = b.bezierCurveTo; b.qt = b.quadraticCurveTo; b.a = b.arc; b.r = b.rect; b.cp = b.closePath; b.c = b.clear; b.f = b.beginFill; b.lf = b.beginLinearGradientFill; b.rf = b.beginRadialGradientFill; b.bf = b.beginBitmapFill; b.ef = b.endFill; b.ss = b.setStrokeStyle; b.s = b.beginStroke; b.ls = b.beginLinearGradientStroke; b.rs = b.beginRadialGradientStroke; b.bs = b.beginBitmapStroke; b.es = b.endStroke; b.dr = b.drawRect; b.rr = b.drawRoundRect; b.rc = b.drawRoundRectComplex; b.dc = b.drawCircle; b.de = b.drawEllipse; b.dp = b.drawPolyStar; b.p = b.decodePath; b._updateInstructions = function () { this._instructions = this._oldInstructions.slice(); this._instructions.push(a.beginCmd); this._appendInstructions(this._fillInstructions); this._appendInstructions(this._strokeInstructions); this._appendInstructions(this._strokeInstructions && this._strokeStyleInstructions); this._appendInstructions(this._activeInstructions); this._fillInstructions && this._appendDraw(a.fillCmd, this._fillMatrix); this._strokeInstructions && this._appendDraw(a.strokeCmd, this._strokeIgnoreScale && [1, 0, 0, 1, 0, 0]) }; b._appendInstructions = function (b) { b && this._instructions.push.apply(this._instructions, b) }; b._appendDraw = function (b, a) { a ? this._instructions.push(new c(this._ctx.save, [], !1), new c(this._ctx.transform, a, !1), b, new c(this._ctx.restore, [], !1)) : this._instructions.push(b) }; b._newPath = function () { this._dirty && this._updateInstructions(); this._oldInstructions = this._instructions; this._activeInstructions = []; this._active = this._dirty = !1 }; b._setProp = function (b, a) { this[b] = a }; createjs.Graphics = a })(); this.createjs = this.createjs || {}; (function () { var c = function () { this.initialize() }, a = c.prototype = new createjs.EventDispatcher; c.suppressCrossDomainErrors = !1; var b = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); b.getContext && (c._hitTestCanvas = b, c._hitTestContext = b.getContext("2d"), b.width = b.height = 1); c._nextCacheID = 1; a.alpha = 1; a.cacheCanvas = null; a.id = -1; a.mouseEnabled = !0; a.name = null; a.parent = null; a.regX = 0; a.regY = 0; a.rotation = 0; a.scaleX = 1; a.scaleY = 1; a.skewX = 0; a.skewY = 0; a.shadow = null; a.visible = !0; a.x = 0; a.y = 0; a.compositeOperation = null; a.snapToPixel = !1; a.filters = null; a.cacheID = 0; a.mask = null; a.hitArea = null; a.cursor = null; a._cacheOffsetX = 0; a._cacheOffsetY = 0; a._cacheScale = 1; a._cacheDataURLID = 0; a._cacheDataURL = null; a._matrix = null; a._rectangle = null; a._bounds = null; a.initialize = function () { this.id = createjs.UID.get(); this._matrix = new createjs.Matrix2D; this._rectangle = new createjs.Rectangle }; a.isVisible = function () { return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY) }; a.draw = function (b, a) { var c = this.cacheCanvas; if (a || !c) return !1; var e = this._cacheScale, h = this._cacheOffsetX, k = this._cacheOffsetY, m; if (m = this._applyFilterBounds(h, k, 0, 0)) h = m.x, k = m.y; b.drawImage(c, h, k, c.width / e, c.height / e); return !0 }; a.updateContext = function (b) { var a, c = this.mask; c && c.graphics && !c.graphics.isEmpty() && (a = c.getMatrix(c._matrix), b.transform(a.a, a.b, a.c, a.d, a.tx, a.ty), c.graphics.drawAsPath(b), b.clip(), a.invert(), b.transform(a.a, a.b, a.c, a.d, a.tx, a.ty)); a = this._matrix.identity() .appendTransform(this.x, this.y, this.scaleX, this.scaleY, this.rotation, this.skewX, this.skewY, this.regX, this.regY); createjs.Stage._snapToPixelEnabled && this.snapToPixel ? b.transform(a.a, a.b, a.c, a.d, a.tx + 0.5 | 0, a.ty + 0.5 | 0) : b.transform(a.a, a.b, a.c, a.d, a.tx, a.ty); b.globalAlpha *= this.alpha; this.compositeOperation && (b.globalCompositeOperation = this.compositeOperation); this.shadow && this._applyShadow(b, this.shadow) }; a.cache = function (b, a, c, e, h) { h = h || 1; this.cacheCanvas || (this.cacheCanvas = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas")); this._cacheWidth = c; this._cacheHeight = e; this._cacheOffsetX = b; this._cacheOffsetY = a; this._cacheScale = h; this.updateCache() }; a.updateCache = function (b) { var a = this.cacheCanvas, d = this._cacheScale, e = this._cacheOffsetX * d, h = this._cacheOffsetY * d, k = this._cacheWidth, m = this._cacheHeight, n; if (!a) throw "cache() must be called before updateCache()"; var p = a.getContext("2d"); if (n = this._applyFilterBounds(e, h, k, m)) e = n.x, h = n.y, k = n.width, m = n.height; k = Math.ceil(k * d); m = Math.ceil(m * d); k != a.width || m != a.height ? (a.width = k, a.height = m) : b || p.clearRect(0, 0, k + 1, m + 1); p.save(); p.globalCompositeOperation = b; p.setTransform(d, 0, 0, d, -e, -h); this.draw(p, !0); this._applyFilters(); p.restore(); this.cacheID = c._nextCacheID++ }; a.uncache = function () { this._cacheDataURL = this.cacheCanvas = null; this.cacheID = this._cacheOffsetX = this._cacheOffsetY = 0; this._cacheScale = 1 }; a.getCacheDataURL = function () { if (!this.cacheCanvas) return null; this.cacheID != this._cacheDataURLID && (this._cacheDataURL = this.cacheCanvas.toDataURL()); return this._cacheDataURL }; a.getStage = function () { for (var b = this; b.parent;) b = b.parent; return b instanceof createjs.Stage ? b : null }; a.localToGlobal = function (b, a) { var c = this.getConcatenatedMatrix(this._matrix); if (null == c) return null; c.append(1, 0, 0, 1, b, a); return new createjs.Point(c.tx, c.ty) }; a.globalToLocal = function (b, a) { var c = this.getConcatenatedMatrix(this._matrix); if (null == c) return null; c.invert(); c.append(1, 0, 0, 1, b, a); return new createjs.Point(c.tx, c.ty) }; a.localToLocal = function (b, a, c) { b = this.localToGlobal(b, a); return c.globalToLocal(b.x, b.y) }; a.setTransform = function (b, a, c, e, h, k, m, n, p) { this.x = b || 0; this.y = a || 0; this.scaleX = null == c ? 1 : c; this.scaleY = null == e ? 1 : e; this.rotation = h || 0; this.skewX = k || 0; this.skewY = m || 0; this.regX = n || 0; this.regY = p || 0; return this }; a.getMatrix = function (b) { return (b ? b.identity() : new createjs.Matrix2D) .appendTransform(this.x, this.y, this.scaleX, this.scaleY, this.rotation, this.skewX, this.skewY, this.regX, this.regY) .appendProperties(this.alpha, this.shadow, this.compositeOperation) }; a.getConcatenatedMatrix = function (b) { b ? b.identity() : b = new createjs.Matrix2D; for (var a = this; null != a;) b.prependTransform(a.x, a.y, a.scaleX, a.scaleY, a.rotation, a.skewX, a.skewY, a.regX, a.regY) .prependProperties(a.alpha, a.shadow, a.compositeOperation), a = a.parent; return b }; a.hitTest = function (b, a) { var d = c._hitTestContext; d.setTransform(1, 0, 0, 1, -b, -a); this.draw(d); var e = this._testHit(d); d.setTransform(1, 0, 0, 1, 0, 0); d.clearRect(0, 0, 2, 2); return e }; a.set = function (b) { for (var a in b) this[a] = b[a]; return this }; a.getBounds = function () { if (this._bounds) return this._rectangle.copy(this._bounds); var b = this.cacheCanvas; if (b) { var a = this._cacheScale; return this._rectangle.initialize(this._cacheOffsetX, this._cacheOffsetY, b.width / a, b.height / a) } return null }; a.getTransformedBounds = function () { return this._getBounds() }; a.setBounds = function (b, a, c, e) { null == b && (this._bounds = b); this._bounds = (this._bounds || new createjs.Rectangle) .initialize(b, a, c, e) }; a.clone = function () { var b = new c; this.cloneProps(b); return b }; a.toString = function () { return "[DisplayObject (name=" + this.name + ")]" }; a.cloneProps = function (b) { b.alpha = this.alpha; b.name = this.name; b.regX = this.regX; b.regY = this.regY; b.rotation = this.rotation; b.scaleX = this.scaleX; b.scaleY = this.scaleY; b.shadow = this.shadow; b.skewX = this.skewX; b.skewY = this.skewY; b.visible = this.visible; b.x = this.x; b.y = this.y; b._bounds = this._bounds; b.mouseEnabled = this.mouseEnabled; b.compositeOperation = this.compositeOperation }; a._applyShadow = function (b, a) { a = a || Shadow.identity; b.shadowColor = a.color; b.shadowOffsetX = a.offsetX; b.shadowOffsetY = a.offsetY; b.shadowBlur = a.blur }; a._tick = function (b) { var a = this._listeners; a && a.tick && (a = new createjs.Event("tick"), a.params = b, this._dispatchEvent(a, this, 2)) }; a._testHit = function (b) { try { var a = 1 < b.getImageData(0, 0, 1, 1) .data[3] } catch (d) { if (!c.suppressCrossDomainErrors) throw "An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images."; } return a }; a._applyFilters = function () { if (this.filters && 0 != this.filters.length && this.cacheCanvas) for (var b = this.filters.length, a = this.cacheCanvas.getContext("2d"), c = this.cacheCanvas.width, e = this.cacheCanvas.height, h = 0; h < b; h++) this.filters[h].applyFilter(a, 0, 0, c, e) }; a._applyFilterBounds = function (b, a, c, e) { var h, k, m = this.filters; if (m && (k = m.length)) { for (m = 0; m < k; m++) { var n = this.filters[m]; if (n = n.getBounds && n.getBounds()) h || (h = this._rectangle.initialize(b, a, c, e)), h.x += n.x, h.y += n.y, h.width += n.width, h.height += n.height } return h } }; a._getBounds = function (b, a) { return this._transformBounds(this.getBounds(), b, a) }; a._transformBounds = function (b, a, c) { if (!b) return b; var e = b.x, h = b.y, k = b.width, m = b.height, n = c ? this._matrix.identity() : this.getMatrix(this._matrix); (e || h) && n.appendTransform(0, 0, 1, 1, 0, 0, 0, -e, -h); a && n.prependMatrix(a); a = k * n.a; k *= n.b; c = m * n.c; var m = m * n.d, p = n.tx, n = n.ty, r = p, s = p, t = n, q = n; (e = a + p) < r ? r = e : e > s && (s = e); (e = a + c + p) < r ? r = e : e > s && (s = e); (e = c + p) < r ? r = e : e > s && (s = e); (h = k + n) < t ? t = h : h > q && (q = h); (h = k + m + n) < t ? t = h : h > q && (q = h); (h = m + n) < t ? t = h : h > q && (q = h); return b.initialize(r, t, s - r, q - t) }; a.isRoot = !1; a.bounding_box = null; a.isCheckMouseWithDraw = !1; a.isOnlyBoundsCheck = !1; a.setBoundingBox = function (b, a, c, e) { return this.bounding_box = new createjs.Rectangle(b, a, c, e) }; createjs.DisplayObject = c })(); this.createjs = this.createjs || {}; (function () { var c = function () { this.initialize() }, a = c.prototype = new createjs.DisplayObject; a.children = null; a.mouseChildren = !0; a.DisplayObject_initialize = a.initialize; a.initialize = function () { this.DisplayObject_initialize(); this.children = [] }; a.isVisible = function () { var b = this.cacheCanvas || this.children.length; return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b) }; a.DisplayObject_draw = a.draw; a.draw = function (b, a) { if (this.DisplayObject_draw(b, a)) return !0; for (var c = this.children.slice(0), d = 0, e = c.length; d < e; d++) { var h = c[d]; h.isVisible() && (b.save(), h.updateContext(b), h.draw(b), b.restore()) } return !0 }; a.addChild = function (b) { if (null == b) return b; var a = arguments.length; if (1 < a) { for (var c = 0; c < a; c++) this.addChild(arguments[c]); return arguments[a - 1] } b.parent && b.parent.removeChild(b); b.parent = this; this.children.push(b); return b }; a.addChildAt = function (b, a) { var c = arguments.length, d = arguments[c - 1]; if (0 > d || d > this.children.length) return arguments[c - 2]; if (2 < c) { for (var e = 0; e < c - 1; e++) this.addChildAt(arguments[e], d + e); return arguments[c - 2] } b.parent && b.parent.removeChild(b); b.parent = this; this.children.splice(a, 0, b); return b }; a.removeChild = function (b) { var a = arguments.length; if (1 < a) { for (var c = !0, d = 0; d < a; d++) c = c && this.removeChild(arguments[d]); return c } return this.removeChildAt(createjs.indexOf(this.children, b)) }; a.removeChildAt = function (b) { var a = arguments.length; if (1 < a) { for (var c = [], d = 0; d < a; d++) c[d] = arguments[d]; c.sort(function (b, a) { return a - b }); for (var e = !0, d = 0; d < a; d++) e = e && this.removeChildAt(c[d]); return e } if (0 > b || b > this.children.length - 1) return !1; if (a = this.children[b]) a.parent = null; this.children.splice(b, 1); return !0 }; a.removeAllChildren = function () { for (var b = this.children; b.length;) b.pop() .parent = null }; a.getChildAt = function (b) { return this.children[b] }; a.getChildByName = function (b) { for (var a = this.children, c = 0, d = a.length; c < d; c++) if (a[c].name == b) return a[c]; return null }; a.sortChildren = function (b) { this.children.sort(b) }; a.getChildIndex = function (b) { return createjs.indexOf(this.children, b) }; a.getNumChildren = function () { return this.children.length }; a.swapChildrenAt = function (b, a) { var c = this.children, d = c[b], e = c[a]; d && e && (c[b] = e, c[a] = d) }; a.swapChildren = function (b, a) { for (var c = this.children, d, e, h = 0, k = c.length; h < k && (c[h] == b && (d = h), c[h] == a && (e = h), null == d || null == e); h++); h != k && (c[d] = a, c[e] = b) }; a.setChildIndex = function (b, a) { var c = this.children, d = c.length; if (!(b.parent != this || 0 > a || a >= d)) { for (var e = 0; e < d && c[e] != b; e++); e != d && e != a && (c.splice(e, 1), c.splice(a, 0, b)) } }; a.contains = function (b) { for (; b;) { if (b == this) return !0; b = b.parent } return !1 }; a.hitTest = function (b, a) { return null != this.getObjectUnderPoint(b, a) }; a.getObjectsUnderPoint = function (b, a) { var c = [], d = this.localToGlobal(b, a); this._getObjectsUnderPoint(d.x, d.y, c); return c }; a.getObjectUnderPoint = function (b, a) { var c = this.localToGlobal(b, a); return this._getObjectsUnderPoint(c.x, c.y) }; a.DisplayObject_getBounds = a.getBounds; a.getBounds = function () { return this._getBounds(null, !0) }; a.getTransformedBounds = function () { return this._getBounds() }; a.clone = function (b) { var a = new c; this.cloneProps(a); if (b) for (var f = a.children = [], d = 0, e = this.children.length; d < e; d++) { var h = this.children[d].clone(b); h.parent = a; f.push(h) } return a }; a.toString = function () { return "[Container (name=" + this.name + ")]" }; a.DisplayObject__tick = a._tick; a._tick = function (b) { for (var a = this.children.length - 1; 0 <= a; a--) { var c = this.children[a]; c._tick && c._tick(b) } this.DisplayObject__tick(b) }; a._getObjectsUnderPoint = function (b, a, f, d) { var e, h; e = this.children.length; if (!isDesktopBrowser) { var k, m; for (e -= 1; 0 <= e; e--) if (h = this.children[e], h.visible && h.mouseEnabled && !(0 >= h.alpha)) { if (k = h.bounding_box) { if (m = h.isRoot ? h.x + k.x <= b && b < h.x + k.x + k.width && h.y + k.y <= a && a < h.y + k.y + k.height : (h.x + k.x) * scaleFactor <= b && b < scaleFactor * (h.x + k.x + k.width) && (h.y + k.y) * scaleFactor <= a && a < scaleFactor * (h.y + k.y + k.height)) if (f) { f.push(h); continue } else return h } else if (h.isCheckMouseWithDraw) { m = createjs.DisplayObject._hitTestContext; var n = this._matrix; k = d && h.hitArea; h.getConcatenatedMatrix(n); k && (n.appendTransform(k.x, k.y, k.scaleX, k.scaleY, k.rotation, k.skewX, k.skewY, k.regX, k.regY), n.alpha = k.alpha); m.globalAlpha = n.alpha; m.setTransform(n.a, n.b, n.c, n.d, n.tx - b, n.ty - a); (k || h) .draw(m); if (!this._testHit(m)) continue; m.setTransform(1, 0, 0, 1, 0, 0); m.clearRect(0, 0, 2, 2); if (f) f.push(h); else return d && !this.mouseChildren ? this : h } if (h instanceof c && (h = h.isRoot ? h._getObjectsUnderPoint(b - (h.x + h.regX), a - (h.y + h.regY), f, d) : h._getObjectsUnderPoint(b - (h.x + h.regX) * scaleFactor, a - (h.y + h.regY) * scaleFactor, f, d))) if (f) f.push(h); else return h } return null } m = createjs.DisplayObject._hitTestContext; n = this._matrix; for (e -= 1; 0 <= e; e--) if (h = this.children[e], k = d && h.hitArea, h.visible && (k || h.isVisible()) && (!d || h.mouseEnabled)) if (!k && h instanceof c) { if (h = h._getObjectsUnderPoint(b, a, f, d), !f && h) return d && !this.mouseChildren ? this : h } else { h.getConcatenatedMatrix(n); k && (n.appendTransform(k.x, k.y, k.scaleX, k.scaleY, k.rotation, k.skewX, k.skewY, k.regX, k.regY), n.alpha = k.alpha); if (h.isOnlyBoundsCheck) { if ((k = h.bounding_box) && !((b - n.tx) / scaleFactor >= k.x && (b - n.tx) / scaleFactor <= k.x + k.width && (a - n.ty) / scaleFactor >= k.y && (a - n.ty) / scaleFactor <= k.y + k.height)) continue } else { m.globalAlpha = n.alpha; m.setTransform(n.a, n.b, n.c, n.d, n.tx - b, n.ty - a); (k || h) .draw(m); if (!this._testHit(m)) continue; m.setTransform(1, 0, 0, 1, 0, 0); m.clearRect(0, 0, 2, 2) } if (f) f.push(h); else return d && !this.mouseChildren ? this : h } return null }; a._getBounds = function (b, a) { var c = this.DisplayObject_getBounds(); if (c) return this._transformBounds(c, b, a); var d, e, h, k, m = a ? this._matrix.identity() : this.getMatrix(this._matrix); b && m.prependMatrix(b); for (var n = this.children.length, p = 0; p < n; p++) { var r = this.children[p]; if (r.visible && (c = r._getBounds(m))) { var r = c.x, s = c.y, t = r + c.width, q = s + c.height; if (r < d || null == d) d = r; if (t > e || null == e) e = t; if (s < h || null == h) h = s; if (q > k || null == k) k = q } } return null == e ? null : this._rectangle.initialize(d, h, e - d, k - h) }; createjs.Container = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b) { this.initialize(b) }, a = c.prototype = new createjs.Container; c._snapToPixelEnabled = !1; a.autoClear = !0; a.canvas = null; a.mouseX = 0; a.mouseY = 0; a.snapToPixelEnabled = !1; a.mouseInBounds = !1; a.tickOnUpdate = !0; a.mouseMoveOutside = !1; a.nextStage = null; a._pointerData = null; a._pointerCount = 0; a._primaryPointerID = null; a._mouseOverIntervalID = null; a.Container_initialize = a.initialize; a.initialize = function (b) { this.Container_initialize(); this.canvas = "string" == typeof b ? document.getElementById(b) : b; this._pointerData = {}; this.enableDOMEvents(!0) }; a.update = function (b) { if (this.canvas) { this.tickOnUpdate && (this.dispatchEvent("tickstart"), this._tick(arguments.length ? arguments : null), this.dispatchEvent("tickend")); this.dispatchEvent("drawstart"); c._snapToPixelEnabled = this.snapToPixelEnabled; this.autoClear && this.clear(); var a = this.canvas.getContext("2d"); a.save(); this.updateContext(a); this.draw(a, !1); a.restore(); this.dispatchEvent("drawend") } }; a.handleEvent = function (b) { "tick" == b.type && this.update(b) }; a.clear = function () { if (this.canvas) { var b = this.canvas.getContext("2d"); b.setTransform(1, 0, 0, 1, 0, 0); b.clearRect(0, 0, this.canvas.width + 1, this.canvas.height + 1) } }; a.toDataURL = function (b, a) { a || (a = "image/png"); var c = this.canvas.getContext("2d"), d = this.canvas.width, e = this.canvas.height, h; if (b) { h = c.getImageData(0, 0, d, e); var k = c.globalCompositeOperation; c.globalCompositeOperation = "destination-over"; c.fillStyle = b; c.fillRect(0, 0, d, e) } var m = this.canvas.toDataURL(a); b && (c.clearRect(0, 0, d + 1, e + 1), c.putImageData(h, 0, 0), c.globalCompositeOperation = k); return m }; a.enableMouseOver = function (b) { this._mouseOverIntervalID && (clearInterval(this._mouseOverIntervalID), this._mouseOverIntervalID = null, 0 == b && this._testMouseOver(!0)); if (null == b) b = 20; else if (0 >= b) return; var a = this; this._mouseOverIntervalID = setInterval(function () { a._testMouseOver() }, 1E3 / Math.min(50, b)) }; a.enableDOMEvents = function (b) { null == b && (b = !0); var a, c = this._eventListeners; if (!b && c) { for (a in c) b = c[a], b.t.removeEventListener(a, b.f, !1); this._eventListeners = null } else if (b && !c && this.canvas) { b = window.addEventListener ? window : document; var d = this, c = this._eventListeners = {}; c.mouseup = { t: b, f: function (b) { d._handleMouseUp(b) } }; c.mousemove = { t: b, f: function (b) { d._handleMouseMove(b) } }; c.dblclick = { t: b, f: function (b) { d._handleDoubleClick(b) } }; c.mousedown = { t: this.canvas, f: function (b) { d._handleMouseDown(b) } }; for (a in c) b = c[a], b.t.addEventListener(a, b.f, !1) } }; a.clone = function () { var b = new c(null); this.cloneProps(b); return b }; a.toString = function () { return "[Stage (name=" + this.name + ")]" }; a._getElementRect = function (b) { var a; try { a = b.getBoundingClientRect() } catch (c) { a = { top: b.offsetTop, left: b.offsetLeft, width: b.offsetWidth, height: b.offsetHeight } } var d = (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || document.body.clientLeft || 0), e = (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || document.body.clientTop || 0), h = window.getComputedStyle ? getComputedStyle(b) : b.currentStyle; b = parseInt(h.paddingLeft) + parseInt(h.borderLeftWidth); var k = parseInt(h.paddingTop) + parseInt(h.borderTopWidth), m = parseInt(h.paddingRight) + parseInt(h.borderRightWidth), h = parseInt(h.paddingBottom) + parseInt(h.borderBottomWidth); return { left: a.left + d + b, right: a.right + d - m, top: a.top + e + k, bottom: a.bottom + e - h } }; a._getPointerData = function (b) { var a = this._pointerData[b]; a || (a = this._pointerData[b] = { x: 0, y: 0 }, null != this._primaryPointerID && -1 != this._primaryPointerID) || (this._primaryPointerID = b); return a }; a._handleMouseMove = function (b) { b || (b = window.event); this._handlePointerMove(-1, b, b.pageX, b.pageY) }; a._handlePointerMove = function (b, a, c, d) { if (this.canvas) { var e = this._getPointerData(b), h = e.inBounds; this._updatePointerPosition(b, a, c, d); if (h || e.inBounds || this.mouseMoveOutside) - 1 == b && e.inBounds == !h && this._dispatchMouseEvent(this, h ? "mouseleave" : "mouseenter", !1, b, e, a), this._dispatchMouseEvent(this, "stagemousemove", !1, b, e, a), this._dispatchMouseEvent(e.target, "pressmove", !0, b, e, a), (h = e.event) && h.hasEventListener("mousemove") && h.dispatchEvent(new createjs.MouseEvent("mousemove", !1, !1, e.x, e.y, a, b, b == this._primaryPointerID, e.rawX, e.rawY), oTarget), this.nextStage && this.nextStage._handlePointerMove(b, a, c, d) } }; a._updatePointerPosition = function (b, a, c, d) { var e = this._getElementRect(this.canvas); c -= e.left; d -= e.top; var h = this.canvas.width, k = this.canvas.height; c /= (e.right - e.left) / h; d /= (e.bottom - e.top) / k; e = this._getPointerData(b); (e.inBounds = 0 <= c && 0 <= d && c <= h - 1 && d <= k - 1) ? (e.x = c, e.y = d) : this.mouseMoveOutside && (e.x = 0 > c ? 0 : c > h - 1 ? h - 1 : c, e.y = 0 > d ? 0 : d > k - 1 ? k - 1 : d); e.posEvtObj = a; e.rawX = c; e.rawY = d; b == this._primaryPointerID && (this.mouseX = e.x, this.mouseY = e.y, this.mouseInBounds = e.inBounds) }; a._handleMouseUp = function (b) { this._handlePointerUp(-1, b, !1) }; a._handlePointerUp = function (b, a, c) { var d = this._getPointerData(b), e = d.target; e && (e.hasEventListener("pressup") || e.hasEventListener("click")) ? (e.hasEventListener("click") && this._getObjectsUnderPoint(d.x, d.y, null, !0) == e && this._dispatchMouseEvent(e, "click", !0, b, d, a), this._dispatchMouseEvent(e, "pressup", !0, b, d, a)) : this._dispatchMouseEvent(this, "stagemouseup", !1, b, d, a); c ? (b == this._primaryPointerID && (this._primaryPointerID = null), delete this._pointerData[b]) : d.event = d.target = null; this.nextStage && this.nextStage._handlePointerUp(b, a, c) }; a._handleMouseDown = function (b) { this._handlePointerDown(-1, b, b.pageX, b.pageY) }; a._handlePointerDown = function (b, a, c, d) { null != d && this._updatePointerPosition(b, a, c, d); var e = this._getPointerData(b); e.target = this._getObjectsUnderPoint(e.x, e.y, null, !0); this._dispatchMouseEvent(e.target, "mousedown", !0, b, e, a); e.target && e.target.hasEventListener("mousedown") || this._dispatchMouseEvent(this, "stagemousedown", !1, b, e, a); this.nextStage && this.nextStage._handlePointerDown(b, a, c, d) }; a._testMouseOver = function (b) { if (-1 == this._primaryPointerID && (b || this.mouseX != this._mouseOverX || this.mouseY != this._mouseOverY || !this.mouseInBounds)) { var a = this._getPointerData(-1), c = a.posEvtObj, d, e = -1, h = "", k; if (b || this.mouseInBounds && c && c.target == this.canvas) d = this._getObjectsUnderPoint(this.mouseX, this.mouseY, null, !0), this._mouseOverX = this.mouseX, this._mouseOverY = this.mouseY; b = this._mouseOverTarget || []; var m = b[b.length - 1], n = this._mouseOverTarget = []; for (k = d; k;) n.unshift(k), null != k.cursor && (h = k.cursor), k = k.parent; this.canvas.style.cursor = h; h = 0; for (k = n.length; h < k && n[h] == b[h]; h++) e = h; m != d && this._dispatchMouseEvent(m, "mouseout", !0, -1, a, c); for (h = b.length - 1; h > e; h--) this._dispatchMouseEvent(b[h], "rollout", !1, -1, a, c); for (h = n.length - 1; h > e; h--) this._dispatchMouseEvent(n[h], "rollover", !1, -1, a, c); m != d && this._dispatchMouseEvent(d, "mouseover", !0, -1, a, c) } }; a._handleDoubleClick = function (b) { var a = this._getPointerData(-1), c = this._getObjectsUnderPoint(a.x, a.y, null, !0); this._dispatchMouseEvent(c, "dblclick", !0, -1, a, b); this.nextStage && this.nextStage._handleDoubleClick(b) }; a._dispatchMouseEvent = function (b, a, c, d, e, h) { b && (c || b.hasEventListener(a)) && (a = new createjs.MouseEvent(a, c, !1, e.x, e.y, h, d, d == this._primaryPointerID, e.rawX, e.rawY), b.dispatchEvent(a)) }; createjs.Stage = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b) { this.initialize(b) }, a = c.prototype = new createjs.DisplayObject; a.image = null; a.snapToPixel = !0; a.sourceRect = null; a.DisplayObject_initialize = a.initialize; a.initialize = function (b) { this.DisplayObject_initialize(); "string" == typeof b ? (this.image = document.createElement("img"), this.image.src = b) : this.image = b }; a.isVisible = function () { var b = this.cacheCanvas || this.image && (this.image.complete || this.image.getContext || 2 <= this.image.readyState); return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b) }; a.DisplayObject_draw = a.draw; a.draw = function (b, a) { if (this.DisplayObject_draw(b, a)) return !0; var c = this.sourceRect; c ? b.drawImage(this.image, c.x, c.y, c.width, c.height, 0, 0, c.width, c.height) : b.drawImage(this.image, 0, 0); return !0 }; a.DisplayObject_getBounds = a.getBounds; a.getBounds = function () { var b = this.DisplayObject_getBounds(); if (b) return b; b = this.sourceRect || this.image; return this.image && (this.image.complete || this.image.getContext || 2 <= this.image.readyState) ? this._rectangle.initialize(0, 0, b.width, b.height) : null }; a.clone = function () { var b = new c(this.image); this.sourceRect && (b.sourceRect = this.sourceRect.clone()); this.cloneProps(b); return b }; a.toString = function () { return "[Bitmap (name=" + this.name + ")]" }; createjs.Bitmap = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a) { this.initialize(b, a) }, a = c.prototype = new createjs.DisplayObject; a.currentFrame = 0; a.currentAnimation = null; a.paused = !0; a.spriteSheet = null; a.snapToPixel = !0; a.isLoop = !0; a.offset = 0; a.currentAnimationFrame = 0; a.framerate = 0; a._advanceCount = 0; a._animation = null; a._currentFrame = null; a.rectMask = null; a.DisplayObject_initialize = a.initialize; a.initialize = function (b, a) { this.DisplayObject_initialize(); this.spriteSheet = b; a && this.gotoAndPlay(a) }; a.isVisible = function () { var b = this.cacheCanvas || this.spriteSheet.complete; return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b) }; a.DisplayObject_draw = a.draw; a.draw = function (b, a) { if (this.DisplayObject_draw(b, a)) return !0; this._normalizeFrame(); var c = this.spriteSheet.getFrame(this._currentFrame | 0); if (!c) return !1; var d = c.rect; this.rectMask ? b.drawImage(c.image, d.x + this.rectMask.x, d.y + this.rectMask.y, d.width + this.rectMask.width, d.height + this.rectMask.height, -c.regX + this.rectMask.x, -c.regY + this.rectMask.y, d.width + this.rectMask.width, d.height + this.rectMask.height) : 1 <= d.width && 1 <= d.height && b.drawImage(c.image, d.x, d.y, d.width, d.height, -c.regX, -c.regY, d.width, d.height); return !0 }; a.play = function () { this.paused = !1 }; a.stop = function () { this.paused = !0 }; a.gotoAndPlay = function (b) { this.paused = !1; this._goto(b) }; a.gotoAndStop = function (b) { this.paused = !0; this._goto(b) }; a.advance = function (b) { var a = this._animation && this._animation.speed || 1, c = this.framerate || this.spriteSheet.framerate; b = c && null != b ? b / (1E3 / c) : 1; this._animation ? this.currentAnimationFrame += b * a : this._currentFrame += b * a; this._normalizeFrame() }; a.DisplayObject_getBounds = a.getBounds; a.getBounds = function () { return this.DisplayObject_getBounds() || this.spriteSheet.getFrameBounds(this.currentFrame, this._rectangle) }; a.clone = function () { var b = new c(this.spriteSheet); this.cloneProps(b); return b }; a.toString = function () { return "[Sprite (name=" + this.name + ")]" }; a.DisplayObject__tick = a._tick; a._tick = function (b) { this.paused || this.advance(b && b[0] && b[0].delta); this.DisplayObject__tick(b) }; a._normalizeFrame = function () { var b = this._animation, a = this.paused, c = this._currentFrame, d = this.currentAnimationFrame, e; if (b) if (e = b.frames.length, (d | 0) >= e) { var h = b.next; if (!this._dispatchAnimationEnd(b, c, a, h, e - 1)) { if (h && this.isLoop) return this._goto(h, d - e); this.paused = !0; d = this.currentAnimationFrame = b.frames.length - 1; this._currentFrame = b.frames[d] } } else this._currentFrame = b.frames[d | 0]; else if (e = this.spriteSheet.getNumFrames(), c >= e && !this._dispatchAnimationEnd(b, c, a, e - 1) && (this._currentFrame -= e) >= e) return this._normalizeFrame(); this.currentFrame = this._currentFrame | 0 }; a._dispatchAnimationEnd = function (b, a, c, d, e) { var h = b ? b.name : null; if (this.hasEventListener("animationend")) { var k = new createjs.Event("animationend"); k.name = h; k.next = d; this.dispatchEvent(k) } b = this._animation != b || this._currentFrame != a; b || c || !this.paused || (this.currentAnimationFrame = e, b = !0); return b }; a.DisplayObject_cloneProps = a.cloneProps; a.cloneProps = function (b) { this.DisplayObject_cloneProps(b); b.currentFrame = this.currentFrame; b._currentFrame = this._currentFrame; b.currentAnimation = this.currentAnimation; b.paused = this.paused; b._animation = this._animation; b.currentAnimationFrame = this.currentAnimationFrame; b.framerate = this.framerate }; a._goto = function (b, a) { if (isNaN(b)) { var c = this.spriteSheet.getAnimation(b); c && (this.currentAnimationFrame = a || 0, this._animation = c, this.currentAnimation = b, this._normalizeFrame()) } else this.currentAnimationFrame = 0, this.currentAnimation = this._animation = null, this._currentFrame = b, this._normalizeFrame() }; createjs.Sprite = c })(); this.createjs = this.createjs || {}; (function () { if (!createjs.Sprite) throw "BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes."; (createjs.BitmapAnimation = function (c) { console.log("BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes."); this.initialize(c) }) .prototype = new createjs.Sprite })(); this.createjs = this.createjs || {}; (function () { var c = function (b) { this.initialize(b) }, a = c.prototype = new createjs.DisplayObject; a.graphics = null; a.DisplayObject_initialize = a.initialize; a.initialize = function (b) { this.DisplayObject_initialize(); this.graphics = b ? b : new createjs.Graphics }; a.isVisible = function () { var b = this.cacheCanvas || this.graphics && !this.graphics.isEmpty(); return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b) }; a.DisplayObject_draw = a.draw; a.draw = function (b, a) { if (this.DisplayObject_draw(b, a)) return !0; this.graphics.draw(b); return !0 }; a.clone = function (b) { b = new c(b && this.graphics ? this.graphics.clone() : this.graphics); this.cloneProps(b); return b }; a.toString = function () { return "[Shape (name=" + this.name + ")]" }; createjs.Shape = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a, c) { this.initialize(b, a, c) }, a = c.prototype = new createjs.DisplayObject, b = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); b.getContext && (c._workingContext = b.getContext("2d"), b.width = b.height = 1); c.H_OFFSETS = { start: 0, left: 0, center: -0.5, end: -1, right: -1 }; c.V_OFFSETS = { top: 0, hanging: -0.01, middle: -0.4, alphabetic: -0.8, ideographic: -0.85, bottom: -1 }; a.text = ""; a.font = null; a.color = null; a.textAlign = "left"; a.textBaseline = "top"; a.maxWidth = null; a.outline = 0; a.lineHeight = 0; a.lineWidth = null; a.DisplayObject_initialize = a.initialize; a.initialize = function (b, a, c) { this.DisplayObject_initialize(); this.text = b; this.font = a; this.color = c }; a.isVisible = function () { var b = this.cacheCanvas || null != this.text && "" !== this.text; return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b) }; a.DisplayObject_draw = a.draw; a.draw = function (b, a) { if (this.DisplayObject_draw(b, a)) return !0; var c = this.color || "#000"; this.outline ? (b.strokeStyle = c, b.lineWidth = 1 * this.outline) : b.fillStyle = c; this._drawText(this._prepContext(b)); return !0 }; a.getMeasuredWidth = function () { return this._prepContext(c._workingContext) .measureText(this.text) .width }; a.getMeasuredLineHeight = function () { return 1.2 * this._prepContext(c._workingContext) .measureText("M") .width }; a.getMeasuredHeight = function () { return this._drawText(null, {}) .height }; a.DisplayObject_getBounds = a.getBounds; a.getBounds = function () { var b = this.DisplayObject_getBounds(); if (b) return b; if (null == this.text || "" == this.text) return null; var b = this._drawText(null, {}), a = this.maxWidth && this.maxWidth < b.width ? this.maxWidth : b.width, d = a * c.H_OFFSETS[this.textAlign || "left"], e = (this.lineHeight || this.getMeasuredLineHeight()) * c.V_OFFSETS[this.textBaseline || "top"]; return this._rectangle.initialize(d, e, a, b.height) }; a.clone = function () { var b = new c(this.text, this.font, this.color); this.cloneProps(b); return b }; a.toString = function () { return "[Text (text=" + (20 < this.text.length ? this.text.substr(0, 17) + "..." : this.text) + ")]" }; a.DisplayObject_cloneProps = a.cloneProps; a.cloneProps = function (b) { this.DisplayObject_cloneProps(b); b.textAlign = this.textAlign; b.textBaseline = this.textBaseline; b.maxWidth = this.maxWidth; b.outline = this.outline; b.lineHeight = this.lineHeight; b.lineWidth = this.lineWidth }; a._prepContext = function (b) { b.font = this.font; b.textAlign = this.textAlign || "left"; b.textBaseline = this.textBaseline || "top"; return b }; a._drawText = function (b, a) { var d = !!b; d || (b = this._prepContext(c._workingContext)); for (var e = this.lineHeight || this.getMeasuredLineHeight(), h = 0, k = 0, m = String(this.text) .split(/(?:\r\n|\r|\n)/), n = 0, p = m.length; n < p; n++) { var r = m[n], s = null; if (null != this.lineWidth && (s = b.measureText(r) .width) > this.lineWidth) for (var t = r.split(/(\s)/), r = t[0], s = b.measureText(r) .width, q = 1, w = t.length; q < w; q += 2) { var u = b.measureText(t[q] + t[q + 1]) .width; s + u > this.lineWidth ? (d && this._drawTextLine(b, r, k * e), s > h && (h = s), r = t[q + 1], s = b.measureText(r) .width, k++) : (r += t[q] + t[q + 1], s += u) } d && this._drawTextLine(b, r, k * e); a && null == s && (s = b.measureText(r) .width); s > h && (h = s); k++ } a && (a.count = k, a.width = h, a.height = k * e); return a }; a._drawTextLine = function (b, a, c) { this.outline ? b.strokeText(a, 0, c, this.maxWidth || 65535) : b.fillText(a, 0, c, this.maxWidth || 65535) }; createjs.Text = c })(); this.createjs = this.createjs || {}; (function () { function c(b, a) { this.initialize(b, a) } var a = c.prototype = new createjs.DisplayObject; a.text = ""; a.spriteSheet = null; a.lineHeight = 0; a.letterSpacing = 0; a.isNeedCenter = !1; a.centerX = 0; a.centerY = 0; a.textBounds; a.spaceWidth = 0; a.postfix = ""; a.DisplayObject_initialize = a.initialize; a.initialize = function (b, c) { this.DisplayObject_initialize(); this.text = b; this.spriteSheet = c; a.textBounds = new createjs.Rectangle }; a.DisplayObject_draw = a.draw; a.draw = function (b, a) { if (this.DisplayObject_draw(b, a)) return !0; this._drawText(b) }; a.isVisible = function () { var b = this.cacheCanvas || this.spriteSheet && this.spriteSheet.complete && this.text; return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b) }; a.getBounds = function () { var b = this._rectangle; this._drawText(null, b); return b.width ? b : null }; a._getFrame = function (b, a) { var c, d = a.getAnimation(b + this.postfix); d || (b != (c = b.toUpperCase()) || b != (c = b.toLowerCase()) || (c = null), c && (d = a.getAnimation(c + this.postfix))); return d && a.getFrame(d.frames[0]) }; a._getLineHeight = function (b) { return (b = this._getFrame("1", b) || this._getFrame("T", b) || this._getFrame("L", b) || b.getFrame(0)) ? b.rect.height : 1 }; a._getSpaceWidth = function (b) { return (b = this._getFrame("1", b) || this._getFrame("l", b) || this._getFrame("e", b) || this._getFrame("a", b) || b.getFrame(0)) ? b.rect.width : 1 }; a._drawText = function (b, a) { var c, d, e, h = 0, k = 0, m = this.spaceWidth, n = this.lineHeight, p = this.spriteSheet; 0 == m && (m = this._getSpaceWidth(p)); 0 == n && (n = this._getLineHeight(p)); for (var r = 0, s = 0, t = this.text.length; s < t; s++) if (c = this.text.charAt(s), " " == c) h += m; else if ("\n" == c || "\r" == c) "\r" == c && "\n" == this.text.charAt(s + 1) && s++, h - e > r && (r = h - e), h = 0, k += n; else { var q = this._getFrame(c, p); if (q) { var w = q.rect; e = q.regX; c = w.width; b && b.drawImage(q.image, w.x, w.y, c, d = w.height, h - e, k - q.regY, c, d); h += c + this.letterSpacing } } h - e > r && (r = h - e); a && (a.width = r - this.letterSpacing, a.height = k + n); this.textBounds.width = r - this.letterSpacing; this.textBounds.height = k + n }; createjs.BitmapText = c })(); this.createjs = this.createjs || {}; (function () { var c = function () { throw "SpriteSheetUtils cannot be instantiated"; }, a = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); a.getContext && (c._workingCanvas = a, c._workingContext = a.getContext("2d"), a.width = a.height = 1); c.addFlippedFrames = function (b, a, f, d) { if (a || f || d) { var e = 0; a && c._flip(b, ++e, !0, !1); f && c._flip(b, ++e, !1, !0); d && c._flip(b, ++e, !0, !0) } }; c.extractFrame = function (b, a) { isNaN(a) && (a = b.getAnimation(a) .frames[0]); var f = b.getFrame(a); if (!f) return null; var d = f.rect, e = c._workingCanvas; e.width = d.width; e.height = d.height; c._workingContext.drawImage(f.image, d.x, d.y, d.width, d.height, 0, 0, d.width, d.height); f = document.createElement("img"); f.src = e.toDataURL("image/png"); return f }; c.mergeAlpha = function (b, a, c) { c || (c = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas")); c.width = Math.max(a.width, b.width); c.height = Math.max(a.height, b.height); var d = c.getContext("2d"); d.save(); d.drawImage(b, 0, 0); d.globalCompositeOperation = "destination-in"; d.drawImage(a, 0, 0); d.restore(); return c }; c._flip = function (b, a, f, d) { for (var e = b._images, h = c._workingCanvas, k = c._workingContext, m = e.length / a, n = 0; n < m; n++) { var p = e[n]; p.__tmp = n; k.setTransform(1, 0, 0, 1, 0, 0); k.clearRect(0, 0, h.width + 1, h.height + 1); h.width = p.width; h.height = p.height; k.setTransform(f ? -1 : 1, 0, 0, d ? -1 : 1, f ? p.width : 0, d ? p.height : 0); k.drawImage(p, 0, 0); var r = document.createElement("img"); r.src = h.toDataURL("image/png"); r.width = p.width; r.height = p.height; e.push(r) } k = b._frames; h = k.length / a; for (n = 0; n < h; n++) { var p = k[n], s = p.rect.clone(), r = e[p.image.__tmp + m * a], t = { image: r, rect: s, regX: p.regX, regY: p.regY }; f && (s.x = r.width - s.x - s.width, t.regX = s.width - p.regX); d && (s.y = r.height - s.y - s.height, t.regY = s.height - p.regY); k.push(t) } f = "_" + (f ? "h" : "") + (d ? "v" : ""); d = b._animations; b = b._data; e = d.length / a; for (n = 0; n < e; n++) { k = d[n]; p = b[k]; m = { name: k + f, frequency: p.frequency, next: p.next, frames: [] }; p.next && (m.next += f); k = p.frames; p = 0; for (r = k.length; p < r; p++) m.frames.push(k[p] + h * a); b[m.name] = m; d.push(m.name) } }; createjs.SpriteSheetUtils = c })(); this.createjs = this.createjs || {}; (function () { var c = function () { this.initialize() }, a = c.prototype = new createjs.EventDispatcher; c.ERR_DIMENSIONS = "frame dimensions exceed max spritesheet dimensions"; c.ERR_RUNNING = "a build is already running"; a.maxWidth = 2048; a.maxHeight = 2048; a.spriteSheet = null; a.scale = 1; a.padding = 1; a.timeSlice = 0.3; a.progress = -1; a._frames = null; a._animations = null; a._data = null; a._nextFrameIndex = 0; a._index = 0; a._timerID = null; a._scale = 1; a.initialize = function () { this._frames = []; this._animations = {} }; a.addFrame = function (b, a, f, d, e, h) { if (this._data) throw c.ERR_RUNNING; a = a || b.bounds || b.nominalBounds; !a && b.getBounds && (a = b.getBounds()); if (!a) return null; f = f || 1; return this._frames.push({ source: b, sourceRect: a, scale: f, funct: d, params: e, scope: h, index: this._frames.length, height: a.height * f }) - 1 }; a.addAnimation = function (b, a, f, d) { if (this._data) throw c.ERR_RUNNING; this._animations[b] = { frames: a, next: f, frequency: d } }; a.addMovieClip = function (b, a, f) { if (this._data) throw c.ERR_RUNNING; var d = b.frameBounds, e = a || b.bounds || b.nominalBounds; !e && b.getBounds && (e = b.getBounds()); if (!e && !d) return null; a = this._frames.length; for (var h = b.timeline.duration, k = 0; k < h; k++) this.addFrame(b, d && d[k] ? d[k] : e, f, function (b) { var a = this.actionsEnabled; this.actionsEnabled = !1; this.gotoAndStop(b); this.actionsEnabled = a }, [k], b); k = b.timeline._labels; b = []; for (var m in k) b.push({ index: k[m], label: m }); if (b.length) for (b.sort(function (b, a) { return b.index - a.index }), k = 0, m = b.length; k < m; k++) { f = b[k].label; for (var d = a + (k == m - 1 ? h : b[k + 1].index), e = [], n = a + b[k].index; n < d; n++) e.push(n); this.addAnimation(f, e, !0) } }; a.build = function () { if (this._data) throw c.ERR_RUNNING; for (this._startBuild(); this._drawNext();); this._endBuild(); return this.spriteSheet }; a.buildAsync = function (b) { if (this._data) throw c.ERR_RUNNING; this.timeSlice = b; this._startBuild(); var a = this; this._timerID = setTimeout(function () { a._run() }, 50 - 50 * Math.max(0.01, Math.min(0.99, this.timeSlice || 0.3))) }; a.stopAsync = function () { clearTimeout(this._timerID); this._data = null }; a.clone = function () { throw "SpriteSheetBuilder cannot be cloned."; }; a.toString = function () { return "[SpriteSheetBuilder]" }; a._startBuild = function () { var b = this.padding || 0; this.progress = 0; this.spriteSheet = null; this._index = 0; this._scale = this.scale; var a = []; this._data = { images: [], frames: a, animations: this._animations }; var f = this._frames.slice(); f.sort(function (b, a) { return b.height <= a.height ? -1 : 1 }); if (f[f.length - 1].height + 2 * b > this.maxHeight) throw c.ERR_DIMENSIONS; for (var d = 0, e = 0, h = 0; f.length;) { var k = this._fillRow(f, d, h, a, b); k.w > e && (e = k.w); d += k.h; if (!k.h || !f.length) { var m = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"); m.width = this._getSize(e, this.maxWidth); m.height = this._getSize(d, this.maxHeight); this._data.images[h] = m; k.h || (e = d = 0, h++) } } }; a._getSize = function (b, a) { for (var c = 4; Math.pow(2, ++c) < b;); return Math.min(a, Math.pow(2, c)) }; a._fillRow = function (b, a, f, d, e) { var h = this.maxWidth, k = this.maxHeight; a += e; for (var k = k - a, m = e, n = 0, p = b.length - 1; 0 <= p; p--) { var r = b[p], s = this._scale * r.scale, t = r.sourceRect, q = r.source, w = Math.floor(s * t.x - e), u = Math.floor(s * t.y - e), x = Math.ceil(s * t.height + 2 * e), t = Math.ceil(s * t.width + 2 * e); if (t > h) throw c.ERR_DIMENSIONS; x > k || m + t > h || (r.img = f, r.rect = new createjs.Rectangle(m, a, t, x), n = n || x, b.splice(p, 1), d[r.index] = [m, a, t, x, f, Math.round(-w + s * q.regX - e), Math.round(-u + s * q.regY - e)], m += t) } return { w: m, h: n } }; a._endBuild = function () { this.spriteSheet = new createjs.SpriteSheet(this._data); this._data = null; this.progress = 1; this.dispatchEvent("complete") }; a._run = function () { for (var b = 50 * Math.max(0.01, Math.min(0.99, this.timeSlice || 0.3)), a = (new Date) .getTime() + b, c = !1; a > (new Date) .getTime();) if (!this._drawNext()) { c = !0; break } if (c) this._endBuild(); else { var d = this; this._timerID = setTimeout(function () { d._run() }, 50 - b) } b = this.progress = this._index / this._frames.length; this.hasEventListener("progress") && (a = new createjs.Event("progress"), a.progress = b, this.dispatchEvent(a)) }; a._drawNext = function () { var b = this._frames[this._index], a = b.scale * this._scale, c = b.rect, d = b.sourceRect, e = this._data.images[b.img].getContext("2d"); b.funct && b.funct.apply(b.scope, b.params); e.save(); e.beginPath(); e.rect(c.x, c.y, c.width, c.height); e.clip(); e.translate(Math.ceil(c.x - d.x * a), Math.ceil(c.y - d.y * a)); e.scale(a, a); b.source.draw(e); e.restore(); return ++this._index < this._frames.length }; createjs.SpriteSheetBuilder = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b) { this.initialize(b) }, a = c.prototype = new createjs.DisplayObject; a.htmlElement = null; a._oldMtx = null; a._visible = !1; a.DisplayObject_initialize = a.initialize; a.initialize = function (b) { "string" == typeof b && (b = document.getElementById(b)); this.DisplayObject_initialize(); this.mouseEnabled = !1; this.htmlElement = b; b = b.style; b.position = "absolute"; b.transformOrigin = b.WebkitTransformOrigin = b.msTransformOrigin = b.MozTransformOrigin = b.OTransformOrigin = "0% 0%" }; a.isVisible = function () { return null != this.htmlElement }; a.draw = function (b, a) { this.visible && (this._visible = !0); return !0 }; a.cache = function () {}; a.uncache = function () {}; a.updateCache = function () {}; a.hitTest = function () {}; a.localToGlobal = function () {}; a.globalToLocal = function () {}; a.localToLocal = function () {}; a.clone = function () { throw "DOMElement cannot be cloned."; }; a.toString = function () { return "[DOMElement (name=" + this.name + ")]" }; a.DisplayObject__tick = a._tick; a._tick = function (b) { var a = this.getStage(); this._visible = !1; a && a.on("drawend", this._handleDrawEnd, this, !0); this.DisplayObject__tick(b) }; a._handleDrawEnd = function (b) { if (b = this.htmlElement) { b = b.style; var a = this._visible ? "visible" : "hidden"; a != b.visibility && (b.visibility = a); if (this._visible) { var a = this.getConcatenatedMatrix(this._matrix), c = this._oldMtx; c && c.alpha == a.alpha || (b.opacity = "" + (1E4 * a.alpha | 0) / 1E4, c && (c.alpha = a.alpha)); if (!c || c.tx != a.tx || c.ty != a.ty || c.a != a.a || c.b != a.b || c.c != a.c || c.d != a.d) { var d = "matrix(" + (1E4 * a.a | 0) / 1E4 + "," + (1E4 * a.b | 0) / 1E4 + "," + (1E4 * a.c | 0) / 1E4 + "," + (1E4 * a.d | 0) / 1E4 + "," + (a.tx + 0.5 | 0); b.transform = b.WebkitTransform = b.OTransform = b.msTransform = d + "," + (a.ty + 0.5 | 0) + ")"; b.MozTransform = d + "px," + (a.ty + 0.5 | 0) + "px)"; this._oldMtx = c ? c.copy(a) : a.clone() } } } }; createjs.DOMElement = c })(); this.createjs = this.createjs || {}; (function () { var c = function () { this.initialize() }, a = c.prototype; a.initialize = function () {}; a.getBounds = function () { return null }; a.applyFilter = function (b, a, c, d, e, h, k, m) {}; a.toString = function () { return "[Filter]" }; a.clone = function () { return new c }; createjs.Filter = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a, c) { this.initialize(b, a, c) }, a = c.prototype = new createjs.Filter; a.initialize = function (b, a, c) { if (isNaN(b) || 0 > b) b = 0; this.blurX = b | 0; if (isNaN(a) || 0 > a) a = 0; this.blurY = a | 0; if (isNaN(c) || 1 > c) c = 1; this.quality = c | 0 }; a.blurX = 0; a.blurY = 0; a.quality = 1; a.mul_table = [1, 171, 205, 293, 57, 373, 79, 137, 241, 27, 391, 357, 41, 19, 283, 265, 497, 469, 443, 421, 25, 191, 365, 349, 335, 161, 155, 149, 9, 278, 269, 261, 505, 245, 475, 231, 449, 437, 213, 415, 405, 395, 193, 377, 369, 361, 353, 345, 169, 331, 325, 319, 313, 307, 301, 37, 145, 285, 281, 69, 271, 267, 263, 259, 509, 501, 493, 243, 479, 118, 465, 459, 113, 446, 55, 435, 429, 423, 209, 413, 51, 403, 199, 393, 97, 3, 379, 375, 371, 367, 363, 359, 355, 351, 347, 43, 85, 337, 333, 165, 327, 323, 5, 317, 157, 311, 77, 305, 303, 75, 297, 294, 73, 289, 287, 71, 141, 279, 277, 275, 68, 135, 67, 133, 33, 262, 260, 129, 511, 507, 503, 499, 495, 491, 61, 121, 481, 477, 237, 235, 467, 232, 115, 457, 227, 451, 7, 445, 221, 439, 218, 433, 215, 427, 425, 211, 419, 417, 207, 411, 409, 203, 202, 401, 399, 396, 197, 49, 389, 387, 385, 383, 95, 189, 47, 187, 93, 185, 23, 183, 91, 181, 45, 179, 89, 177, 11, 175, 87, 173, 345, 343, 341, 339, 337, 21, 167, 83, 331, 329, 327, 163, 81, 323, 321, 319, 159, 79, 315, 313, 39, 155, 309, 307, 153, 305, 303, 151, 75, 299, 149, 37, 295, 147, 73, 291, 145, 289, 287, 143, 285, 71, 141, 281, 35, 279, 139, 69, 275, 137, 273, 17, 271, 135, 269, 267, 133, 265, 33, 263, 131, 261, 130, 259, 129, 257, 1 ]; a.shg_table = [0, 9, 10, 11, 9, 12, 10, 11, 12, 9, 13, 13, 10, 9, 13, 13, 14, 14, 14, 14, 10, 13, 14, 14, 14, 13, 13, 13, 9, 14, 14, 14, 15, 14, 15, 14, 15, 15, 14, 15, 15, 15, 14, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 12, 14, 15, 15, 13, 15, 15, 15, 15, 16, 16, 16, 15, 16, 14, 16, 16, 14, 16, 13, 16, 16, 16, 15, 16, 13, 16, 15, 16, 14, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 14, 16, 16, 15, 16, 16, 10, 16, 15, 16, 14, 16, 16, 14, 16, 16, 14, 16, 16, 14, 15, 16, 16, 16, 14, 15, 14, 15, 13, 16, 16, 15, 17, 17, 17, 17, 17, 17, 14, 15, 17, 17, 16, 16, 17, 16, 15, 17, 16, 17, 11, 17, 16, 17, 16, 17, 16, 17, 17, 16, 17, 17, 16, 17, 17, 16, 16, 17, 17, 17, 16, 14, 17, 17, 17, 17, 15, 16, 14, 16, 15, 16, 13, 16, 15, 16, 14, 16, 15, 16, 12, 16, 15, 16, 17, 17, 17, 17, 17, 13, 16, 15, 17, 17, 17, 16, 15, 17, 17, 17, 16, 15, 17, 17, 14, 16, 17, 17, 16, 17, 17, 16, 15, 17, 16, 14, 17, 16, 15, 17, 16, 17, 17, 16, 17, 15, 16, 17, 14, 17, 16, 15, 17, 16, 17, 13, 17, 16, 17, 17, 16, 17, 14, 17, 16, 17, 16, 17, 16, 17, 9 ]; a.getBounds = function () { var b = 0.5 * Math.pow(this.quality, 0.6); return new createjs.Rectangle(-this.blurX * b, -this.blurY * b, 2 * this.blurX * b, 2 * this.blurY * b) }; a.applyFilter = function (b, a, c, d, e, h, k, m) { h = h || b; null == k && (k = a); null == m && (m = c); try { var n = b.getImageData(a, c, d, e) } catch (p) { return !1 } b = this.blurX / 2; if (isNaN(b) || 0 > b) return !1; b |= 0; var r = this.blurY / 2; if (isNaN(r) || 0 > r) return !1; r |= 0; if (0 == b && 0 == r) return !1; var s = this.quality; if (isNaN(s) || 1 > s) s = 1; s |= 0; 3 < s && (s = 3); 1 > s && (s = 1); var t = n.data, q, w, u, x, K, A, y, C, z, F, J, P, E = b + b + 1; x = r + r + 1; var S = d - 1, N = e - 1, Z = b + 1, T = r + 1, Q = { r: 0, b: 0, g: 0, a: 0, next: null }; a = Q; for (q = 1; q < E; q++) a = a.next = { r: 0, b: 0, g: 0, a: 0, next: null }; a.next = Q; c = E = { r: 0, b: 0, g: 0, a: 0, next: null }; for (q = 1; q < x; q++) c = c.next = { r: 0, b: 0, g: 0, a: 0, next: null }; c.next = E; for (q = null; 0 < s--;) { K = x = 0; var G = this.mul_table[b], M = this.shg_table[b]; for (c = e; - 1 < --c;) { A = Z * (F = t[x]); y = Z * (J = t[x + 1]); C = Z * (P = t[x + 2]); z = Z * (u = t[x + 3]); a = Q; for (q = Z; - 1 < --q;) a.r = F, a.g = J, a.b = P, a.a = u, a = a.next; for (q = 1; q < Z; q++) w = x + ((S < q ? S : q) << 2), A += a.r = t[w], y += a.g = t[w + 1], C += a.b = t[w + 2], z += a.a = t[w + 3], a = a.next; q = Q; for (a = 0; a < d; a++) t[x++] = A * G >>> M, t[x++] = y * G >>> M, t[x++] = C * G >>> M, t[x++] = z * G >>> M, w = K + ((w = a + b + 1) < S ? w : S) << 2, A -= q.r - (q.r = t[w]), y -= q.g - (q.g = t[w + 1]), C -= q.b - (q.b = t[w + 2]), z -= q.a - (q.a = t[w + 3]), q = q.next; K += d } G = this.mul_table[r]; M = this.shg_table[r]; for (a = 0; a < d; a++) { x = a << 2; A = T * (F = t[x]); y = T * (J = t[x + 1]); C = T * (P = t[x + 2]); z = T * (u = t[x + 3]); c = E; for (q = 0; q < T; q++) c.r = F, c.g = J, c.b = P, c.a = u, c = c.next; u = d; for (q = 1; q <= r; q++) x = u + a << 2, A += c.r = t[x], y += c.g = t[x + 1], C += c.b = t[x + 2], z += c.a = t[x + 3], c = c.next, q < N && (u += d); x = a; q = E; if (0 < s) for (c = 0; c < e; c++) w = x << 2, t[w + 3] = u = z * G >>> M, 0 < u ? (t[w] = A * G >>> M, t[w + 1] = y * G >>> M, t[w + 2] = C * G >>> M) : t[w] = t[w + 1] = t[w + 2] = 0, w = a + ((w = c + T) < N ? w : N) * d << 2, A -= q.r - (q.r = t[w]), y -= q.g - (q.g = t[w + 1]), C -= q.b - (q.b = t[w + 2]), z -= q.a - (q.a = t[w + 3]), q = q.next, x += d; else for (c = 0; c < e; c++) w = x << 2, t[w + 3] = u = z * G >>> M, 0 < u ? (u = 255 / u, t[w] = (A * G >>> M) * u, t[w + 1] = (y * G >>> M) * u, t[w + 2] = (C * G >>> M) * u) : t[w] = t[w + 1] = t[w + 2] = 0, w = a + ((w = c + T) < N ? w : N) * d << 2, A -= q.r - (q.r = t[w]), y -= q.g - (q.g = t[w + 1]), C -= q.b - (q.b = t[w + 2]), z -= q.a - (q.a = t[w + 3]), q = q.next, x += d } } h.putImageData(n, k, m); return !0 }; a.clone = function () { return new c(this.blurX, this.blurY, this.quality) }; a.toString = function () { return "[BlurFilter]" }; createjs.BlurFilter = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b) { this.initialize(b) }, a = c.prototype = new createjs.Filter; a.initialize = function (b) { this.alphaMap = b }; a.alphaMap = null; a._alphaMap = null; a._mapData = null; a.applyFilter = function (b, a, c, d, e, h, k, m) { if (!this.alphaMap) return !0; if (!this._prepAlphaMap()) return !1; h = h || b; null == k && (k = a); null == m && (m = c); try { var n = b.getImageData(a, c, d, e) } catch (p) { return !1 } b = n.data; a = this._mapData; c = b.length; for (d = 0; d < c; d += 4) b[d + 3] = a[d] || 0; n.data = b; h.putImageData(n, k, m); return !0 }; a.clone = function () { return new c(this.alphaMap) }; a.toString = function () { return "[AlphaMapFilter]" }; a._prepAlphaMap = function () { if (!this.alphaMap) return !1; if (this.alphaMap == this._alphaMap && this._mapData) return !0; this._mapData = null; var b = this._alphaMap = this.alphaMap, a = b; b instanceof HTMLCanvasElement ? a = a.getContext("2d") : (a = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"), a.width = b.width, a.height = b.height, a = a.getContext("2d"), a.drawImage(b, 0, 0)); try { var c = a.getImageData(0, 0, b.width, b.height) } catch (d) { return !1 } this._mapData = c.data; return !0 }; createjs.AlphaMapFilter = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b) { this.initialize(b) }, a = c.prototype = new createjs.Filter; a.initialize = function (b) { this.mask = b }; a.mask = null; a.applyFilter = function (b, a, c, d, e, h, k, m) { if (!this.mask) return !0; h = h || b; null == k && (k = a); null == m && (m = c); h.save(); h.globalCompositeOperation = "destination-in"; h.drawImage(this.mask, k, m); h.restore(); return !0 }; a.clone = function () { return new c(this.mask) }; a.toString = function () { return "[AlphaMaskFilter]" }; createjs.AlphaMaskFilter = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a, c, d, e, h, k, m) { this.initialize(b, a, c, d, e, h, k, m) }, a = c.prototype = new createjs.Filter; a.redMultiplier = 1; a.greenMultiplier = 1; a.blueMultiplier = 1; a.alphaMultiplier = 1; a.redOffset = 0; a.greenOffset = 0; a.blueOffset = 0; a.alphaOffset = 0; a.initialize = function (b, a, c, d, e, h, k, m) { this.redMultiplier = null != b ? b : 1; this.greenMultiplier = null != a ? a : 1; this.blueMultiplier = null != c ? c : 1; this.alphaMultiplier = null != d ? d : 1; this.redOffset = e || 0; this.greenOffset = h || 0; this.blueOffset = k || 0; this.alphaOffset = m || 0 }; a.applyFilter = function (b, a, c, d, e, h, k, m) { h = h || b; null == k && (k = a); null == m && (m = c); try { var n = b.getImageData(a, c, d, e) } catch (p) { return !1 } b = n.data; a = b.length; for (c = 0; c < a; c += 4) b[c] = b[c] * this.redMultiplier + this.redOffset, b[c + 1] = b[c + 1] * this.greenMultiplier + this.greenOffset, b[c + 2] = b[c + 2] * this.blueMultiplier + this.blueOffset, b[c + 3] = b[c + 3] * this.alphaMultiplier + this.alphaOffset; h.putImageData(n, k, m); return !0 }; a.toString = function () { return "[ColorFilter]" }; a.clone = function () { return new c(this.redMultiplier, this.greenMultiplier, this.blueMultiplier, this.alphaMultiplier, this.redOffset, this.greenOffset, this.blueOffset, this.alphaOffset) }; createjs.ColorFilter = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a, c, d) { this.initialize(b, a, c, d) }, a = c.prototype = []; c.DELTA_INDEX = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10 ]; c.IDENTITY_MATRIX = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]; c.LENGTH = c.IDENTITY_MATRIX.length; a.initialize = function (b, a, c, d) { this.reset(); this.adjustColor(b, a, c, d); return this }; a.reset = function () { return this.copyMatrix(c.IDENTITY_MATRIX) }; a.adjustColor = function (b, a, c, d) { this.adjustHue(d); this.adjustContrast(a); this.adjustBrightness(b); return this.adjustSaturation(c) }; a.adjustBrightness = function (b) { if (0 == b || isNaN(b)) return this; b = this._cleanValue(b, 255); this._multiplyMatrix([1, 0, 0, 0, b, 0, 1, 0, 0, b, 0, 0, 1, 0, b, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]); return this }; a.adjustContrast = function (b) { if (0 == b || isNaN(b)) return this; b = this._cleanValue(b, 100); var a; 0 > b ? a = 127 + 127 * (b / 100) : (a = b % 1, a = 0 == a ? c.DELTA_INDEX[b] : c.DELTA_INDEX[b << 0] * (1 - a) + c.DELTA_INDEX[(b << 0) + 1] * a, a = 127 * a + 127); this._multiplyMatrix([a / 127, 0, 0, 0, 0.5 * (127 - a), 0, a / 127, 0, 0, 0.5 * (127 - a), 0, 0, a / 127, 0, 0.5 * (127 - a), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]); return this }; a.adjustSaturation = function (b) { if (0 == b || isNaN(b)) return this; b = this._cleanValue(b, 100); b = 1 + (0 < b ? 3 * b / 100 : b / 100); this._multiplyMatrix([0.3086 * (1 - b) + b, 0.6094 * (1 - b), 0.082 * (1 - b), 0, 0, 0.3086 * (1 - b), 0.6094 * (1 - b) + b, 0.082 * (1 - b), 0, 0, 0.3086 * (1 - b), 0.6094 * (1 - b), 0.082 * (1 - b) + b, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]); return this }; a.adjustHue = function (b) { if (0 == b || isNaN(b)) return this; b = this._cleanValue(b, 180) / 180 * Math.PI; var a = Math.cos(b); b = Math.sin(b); this._multiplyMatrix([0.213 + 0.787 * a + -0.213 * b, 0.715 + -0.715 * a + -0.715 * b, 0.072 + -0.072 * a + 0.928 * b, 0, 0, 0.213 + -0.213 * a + 0.143 * b, 0.715 + a * (1 - 0.715) + 0.14 * b, 0.072 + -0.072 * a + -0.283 * b, 0, 0, 0.213 + -0.213 * a + -0.787 * b, 0.715 + -0.715 * a + 0.715 * b, 0.072 + 0.928 * a + 0.072 * b, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 ]); return this }; a.concat = function (b) { b = this._fixMatrix(b); if (b.length != c.LENGTH) return this; this._multiplyMatrix(b); return this }; a.clone = function () { return new c(this) }; a.toArray = function () { return this.slice(0, c.LENGTH) }; a.copyMatrix = function (b) { for (var a = c.LENGTH, f = 0; f < a; f++) this[f] = b[f]; return this }; a._multiplyMatrix = function (b) { for (var a = [], c = 0; 5 > c; c++) { for (var d = 0; 5 > d; d++) a[d] = this[d + 5 * c]; for (d = 0; 5 > d; d++) { for (var e = 0, h = 0; 5 > h; h++) e += b[d + 5 * h] * a[h]; this[d + 5 * c] = e } } }; a._cleanValue = function (b, a) { return Math.min(a, Math.max(-a, b)) }; a._fixMatrix = function (b) { b instanceof c && (b = b.slice(0)); b.length < c.LENGTH ? b = b.slice(0, b.length) .concat(c.IDENTITY_MATRIX.slice(b.length, c.LENGTH)) : b.length > c.LENGTH && (b = b.slice(0, c.LENGTH)); return b }; createjs.ColorMatrix = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b) { this.initialize(b) }, a = c.prototype = new createjs.Filter; a.matrix = null; a.initialize = function (b) { this.matrix = b }; a.applyFilter = function (b, a, c, d, e, h, k, m) { h = h || b; null == k && (k = a); null == m && (m = c); try { var n = b.getImageData(a, c, d, e) } catch (p) { return !1 } b = n.data; a = b.length; var r, s, t, q; r = this.matrix; c = r[0]; d = r[1]; e = r[2]; for (var w = r[3], u = r[4], x = r[5], K = r[6], A = r[7], y = r[8], C = r[9], z = r[10], F = r[11], J = r[12], P = r[13], E = r[14], S = r[15], N = r[16], Z = r[17], T = r[18], Q = r[19], G = 0; G < a; G += 4) r = b[G], s = b[G + 1], t = b[G + 2], q = b[G + 3], b[G] = r * c + s * d + t * e + q * w + u, b[G + 1] = r * x + s * K + t * A + q * y + C, b[G + 2] = r * z + s * F + t * J + q * P + E, b[G + 3] = r * S + s * N + t * Z + q * T + Q; h.putImageData(n, k, m); return !0 }; a.toString = function () { return "[ColorMatrixFilter]" }; a.clone = function () { return new c(this.matrix) }; createjs.ColorMatrixFilter = c })(); this.createjs = this.createjs || {}; (function () { var c = function () { throw "Touch cannot be instantiated"; }; c.isSupported = function () { return "ontouchstart" in window || window.navigator.msPointerEnabled && 0 < window.navigator.msMaxTouchPoints }; c.enable = function (a, b, g) { if (!a || !a.canvas || !c.isSupported()) return !1; a.__touch = { pointers: {}, multitouch: !b, preventDefault: !g, count: 0 }; "ontouchstart" in window ? c._IOS_enable(a) : window.navigator.msPointerEnabled && c._IE_enable(a); return !0 }; c.disable = function (a) { a && ("ontouchstart" in window ? c._IOS_disable(a) : window.navigator.msPointerEnabled && c._IE_disable(a)) }; c._IOS_enable = function (a) { var b = a.canvas, g = a.__touch.f = function (b) { c._IOS_handleEvent(a, b) }; b.addEventListener("touchstart", g, !1); b.addEventListener("touchmove", g, !1); b.addEventListener("touchend", g, !1); b.addEventListener("touchcancel", g, !1) }; c._IOS_disable = function (a) { var b = a.canvas; b && (a = a.__touch.f, b.removeEventListener("touchstart", a, !1), b.removeEventListener("touchmove", a, !1), b.removeEventListener("touchend", a, !1), b.removeEventListener("touchcancel", a, !1)) }; c._IOS_handleEvent = function (a, b) { if (a) { a.__touch.preventDefault && b.preventDefault && b.preventDefault(); for (var c = b.changedTouches, f = b.type, d = 0, e = c.length; d < e; d++) { var h = c[d], k = h.identifier; h.target == a.canvas && ("touchstart" == f ? this._handleStart(a, k, b, h.pageX, h.pageY) : "touchmove" == f ? this._handleMove(a, k, b, h.pageX, h.pageY) : "touchend" != f && "touchcancel" != f || this._handleEnd(a, k, b)) } } }; c._IE_enable = function (a) { var b = a.canvas, g = a.__touch.f = function (b) { c._IE_handleEvent(a, b) }; b.addEventListener("MSPointerDown", g, !1); window.addEventListener("MSPointerMove", g, !1); window.addEventListener("MSPointerUp", g, !1); window.addEventListener("MSPointerCancel", g, !1); a.__touch.preventDefault && (b.style.msTouchAction = "none"); a.__touch.activeIDs = {} }; c._IE_disable = function (a) { var b = a.__touch.f; window.removeEventListener("MSPointerMove", b, !1); window.removeEventListener("MSPointerUp", b, !1); window.removeEventListener("MSPointerCancel", b, !1); a.canvas && a.canvas.removeEventListener("MSPointerDown", b, !1) }; c._IE_handleEvent = function (a, b) { if (a) { a.__touch.preventDefault && b.preventDefault && b.preventDefault(); var c = b.type, f = b.pointerId, d = a.__touch.activeIDs; if ("MSPointerDown" == c) b.srcElement == a.canvas && (d[f] = !0, this._handleStart(a, f, b, b.pageX, b.pageY)); else if (d[f]) if ("MSPointerMove" == c) this._handleMove(a, f, b, b.pageX, b.pageY); else if ("MSPointerUp" == c || "MSPointerCancel" == c) delete d[f], this._handleEnd(a, f, b) } }; c._handleStart = function (a, b, c, f, d) { var e = a.__touch; if (e.multitouch || !e.count) { var h = e.pointers; h[b] || (h[b] = !0, e.count++, a._handlePointerDown(b, c, f, d)) } }; c._handleMove = function (a, b, c, f, d) { a.__touch.pointers[b] && a._handlePointerMove(b, c, f, d) }; c._handleEnd = function (a, b, c) { var f = a.__touch, d = f.pointers; d[b] && (f.count--, a._handlePointerUp(b, c, !0), delete d[b]) }; createjs.Touch = c })(); this.createjs = this.createjs || {}; (function () { var c = createjs.EaselJS = createjs.EaselJS || {}; c.version = "NEXT"; c.buildDate = "Sun, 06 Oct 2013 10:56:52 GMT" })(); (function () { var c = createjs.Stage.prototype._handlePointerDown, a = createjs.Stage.prototype._handlePointerUp, b = !1; - 1 < navigator.userAgent.indexOf("Android") && (createjs.Stage.prototype._handlePointerDown = function (a, f, d, e) { f.touches && (b = !0, this.enableDOMEvents(!1)); b ? f.touches && "undefined" != typeof f.touches[0].pageX && (f.screenX = f.touches[0].pageX, f.screenY = f.touches[0].pageY, c.call(this, a, f, d, e)) : (f.screenX = f.x, f.screenY = f.y, c.call(this, a, f, d, e)) }, createjs.Stage.prototype._handlePointerUp = function (c, f, d) { f.changedTouches && (b = !0); b ? f.changedTouches && "undefined" != typeof f.changedTouches[0].pageX && (f.screenX = f.changedTouches[0].pageX, f.screenY = f.changedTouches[0].pageY, a.call(this, c, f, d)) : (f.screenX = f.x, f.screenY = f.y, a.call(this, c, f, d)) }) })(); this.createjs = this.createjs || {}; (function () { var c = createjs.PreloadJS = createjs.PreloadJS || {}; c.version = "0.4.0"; c.buildDate = "Wed, 25 Sep 2013 17:09:35 GMT" })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a, c) { this.initialize(b, a, c) }, a = c.prototype; a.type = null; a.target = null; a.currentTarget = null; a.eventPhase = 0; a.bubbles = !1; a.cancelable = !1; a.timeStamp = 0; a.defaultPrevented = !1; a.propagationStopped = !1; a.immediatePropagationStopped = !1; a.removed = !1; a.initialize = function (b, a, c) { this.type = b; this.bubbles = a; this.cancelable = c; this.timeStamp = (new Date) .getTime() }; a.preventDefault = function () { this.defaultPrevented = !0 }; a.stopPropagation = function () { this.propagationStopped = !0 }; a.stopImmediatePropagation = function () { this.immediatePropagationStopped = this.propagationStopped = !0 }; a.remove = function () { this.removed = !0 }; a.clone = function () { return new c(this.type, this.bubbles, this.cancelable) }; a.toString = function () { return "[Event (type=" + this.type + ")]" }; createjs.Event = c })(); this.createjs = this.createjs || {}; (function () { var c = function () {}, a = c.prototype; c.initialize = function (b) { b.addEventListener = a.addEventListener; b.on = a.on; b.removeEventListener = b.off = a.removeEventListener; b.removeAllEventListeners = a.removeAllEventListeners; b.hasEventListener = a.hasEventListener; b.dispatchEvent = a.dispatchEvent; b._dispatchEvent = a._dispatchEvent }; a._listeners = null; a._captureListeners = null; a.initialize = function () {}; a.addEventListener = function (b, a, c) { var d; d = c ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {}; var e = d[b]; return e && this.removeEventListener(b, a, c), e = d[b], e ? e.push(a) : d[b] = [a], a }; a.on = function (b, a, c, d, e, h) { return a.handleEvent && (c = c || a, a = a.handleEvent), c = c || this, this.addEventListener(b, function (b) { a.call(c, b, e); d && b.remove() }, h) }; a.removeEventListener = function (b, a, c) { if (c = c ? this._captureListeners : this._listeners) { var d = c[b]; if (d) for (var e = 0, h = d.length; h > e; e++) if (d[e] == a) { 1 == h ? delete c[b] : d.splice(e, 1); break } } }; a.off = a.removeEventListener; a.removeAllEventListeners = function (b) { b ? (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null }; a.dispatchEvent = function (b, a) { if ("string" == typeof b) { var c = this._listeners; if (!c || !c[b]) return !1; b = new createjs.Event(b) } if (b.target = a || this, b.bubbles && this.parent) { for (var d = this, c = [d]; d.parent;) c.push(d = d.parent); for (var e = c.length, d = e - 1; 0 <= d && !b.propagationStopped; d--) c[d]._dispatchEvent(b, 1 + (0 == d)); for (d = 1; e > d && !b.propagationStopped; d++) c[d]._dispatchEvent(b, 3) } else this._dispatchEvent(b, 2); return b.defaultPrevented }; a.hasEventListener = function (b) { var a = this._listeners, c = this._captureListeners; return !!(a && a[b] || c && c[b]) }; a.toString = function () { return "[EventDispatcher]" }; a._dispatchEvent = function (b, a) { var c, d = 1 == a ? this._captureListeners : this._listeners; if (b && d && (d = d[b.type]) && (c = d.length)) { b.currentTarget = this; b.eventPhase = a; b.removed = !1; for (var d = d.slice(), e = 0; c > e && !b.immediatePropagationStopped; e++) { var h = d[e]; h.handleEvent ? h.handleEvent(b) : h(b); b.removed && (this.off(b.type, h, 1 == a), b.removed = !1) } } }; createjs.EventDispatcher = c })(); this.createjs = this.createjs || {}; (function () { createjs.indexOf = function (c, a) { for (var b = 0, g = c.length; g > b; b++) if (a === c[b]) return b; return -1 } })(); this.createjs = this.createjs || {}; (function () { createjs.proxy = function (c, a) { var b = Array.prototype.slice.call(arguments, 2); return function () { return c.apply(a, Array.prototype.slice.call(arguments, 0) .concat(b)) } } })(); this.createjs = this.createjs || {}; (function () { var c = function () { this.init() }; c.prototype = {}; var a = c.prototype; c.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/; a.loaded = !1; a.canceled = !1; a.progress = 0; a._item = null; a._basePath = null; a.addEventListener = null; a.removeEventListener = null; a.removeAllEventListeners = null; a.dispatchEvent = null; a.hasEventListener = null; a._listeners = null; createjs.EventDispatcher.initialize(a); a.getItem = function () { return this._item }; a.init = function () {}; a.load = function () {}; a.close = function () {}; a._sendLoadStart = function () { this._isCanceled() || this.dispatchEvent("loadstart") }; a._sendProgress = function (b) { if (!this._isCanceled()) { var a = null; "number" == typeof b ? (this.progress = b, a = new createjs.Event("progress"), a.loaded = this.progress, a.total = 1) : (a = b, this.progress = b.loaded / b.total, (isNaN(this.progress) || 1 / 0 == this.progress) && (this.progress = 0)); a.progress = this.progress; this.hasEventListener("progress") && this.dispatchEvent(a) } }; a._sendComplete = function () { this._isCanceled() || this.dispatchEvent("complete") }; a._sendError = function (b) { !this._isCanceled() && this.hasEventListener("error") && (null == b && (b = new createjs.Event("error")), this.dispatchEvent(b)) }; a._isCanceled = function () { return null == window.createjs || this.canceled ? !0 : !1 }; a._parseURI = function (b) { return b ? b.match(c.FILE_PATTERN) : null }; a._formatQueryString = function (b, a) { if (null == b) throw Error("You must specify data."); var c = [], d; for (d in b) c.push(d + "=" + escape(b[d])); return a && (c = c.concat(a)), c.join("&") }; a.buildPath = function (b, a, c) { if (null != a) { var d = this._parseURI(b); null != d && null != d[1] && "" != d[1] || (b = a + b) } if (null == c) return b; a = []; d = b.indexOf("?"); if (-1 != d) { var e = b.slice(d + 1); a = a.concat(e.split("&")) } return -1 != d ? b.slice(0, d) + "?" + this._formatQueryString(c, a) : b + "?" + this._formatQueryString(c, a) }; a.toString = function () { return "[PreloadJS AbstractLoader]" }; createjs.AbstractLoader = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a) { this.init(b, a) }, a = c.prototype = new createjs.AbstractLoader; c.LOAD_TIMEOUT = 8E3; c.BINARY = "binary"; c.CSS = "css"; c.IMAGE = "image"; c.JAVASCRIPT = "javascript"; c.JSON = "json"; c.JSONP = "jsonp"; c.SOUND = "sound"; c.SVG = "svg"; c.TEXT = "text"; c.XML = "xml"; c.POST = "POST"; c.GET = "GET"; a.useXHR = !0; a.stopOnError = !1; a.maintainScriptOrder = !0; a.next = null; a._typeCallbacks = null; a._extensionCallbacks = null; a._loadStartWasDispatched = !1; a._maxConnections = 1; a._currentlyLoadingScript = null; a._currentLoads = null; a._loadQueue = null; a._loadQueueBackup = null; a._loadItemsById = null; a._loadItemsBySrc = null; a._loadedResults = null; a._loadedRawResults = null; a._numItems = 0; a._numItemsLoaded = 0; a._scriptOrder = null; a._loadedScripts = null; a.init = function (b, a) { this._numItems = this._numItemsLoaded = 0; this._loadStartWasDispatched = this._paused = !1; this._currentLoads = []; this._loadQueue = []; this._loadQueueBackup = []; this._scriptOrder = []; this._loadedScripts = []; this._loadItemsById = {}; this._loadItemsBySrc = {}; this._loadedResults = {}; this._loadedRawResults = {}; this._typeCallbacks = {}; this._extensionCallbacks = {}; this._basePath = a; this.setUseXHR(b) }; a.setUseXHR = function (b) { return this.useXHR = 0 != b && null != window.XMLHttpRequest, this.useXHR }; a.removeAll = function () { this.remove() }; a.remove = function (b) { var a = null; if (!b || b instanceof Array) if (b) a = b; else { if (0 < arguments.length) return } else a = [b]; var c = !1; if (a) { for (; a.length;) { for (var e = a.pop(), h = this.getResult(e), k = this._loadQueue.length - 1; 0 <= k; k--) if (m = this._loadQueue[k].getItem(), m.id == e || m.src == e) { this._loadQueue.splice(k, 1)[0].cancel(); break } for (k = this._loadQueueBackup.length - 1; 0 <= k; k--) if (m = this._loadQueueBackup[k].getItem(), m.id == e || m.src == e) { this._loadQueueBackup.splice(k, 1)[0].cancel(); break } if (h) delete this._loadItemsById[h.id], delete this._loadItemsBySrc[h.src], this._disposeItem(h); else for (var k = this._currentLoads.length - 1; 0 <= k; k--) { var m = this._currentLoads[k].getItem(); if (m.id == e || m.src == e) { this._currentLoads.splice(k, 1)[0].cancel(); c = !0; break } } } c && this._loadNext() } else { this.close(); for (e in this._loadItemsById) this._disposeItem(this._loadItemsById[e]); this.init(this.useXHR) } }; a.reset = function () { this.close(); for (var b in this._loadItemsById) this._disposeItem(this._loadItemsById[b]); b = []; i = 0; for (l = this._loadQueueBackup.length; l > i; i++) b.push(this._loadQueueBackup[i].getItem()); this.loadManifest(b, !1) }; c.isBinary = function (b) { switch (b) { case createjs.LoadQueue.IMAGE: case createjs.LoadQueue.BINARY: return !0; default: return !1 } }; a.installPlugin = function (b) { if (null != b && null != b.getPreloadHandlers) { b = b.getPreloadHandlers(); if (null != b.types) for (var a = 0, c = b.types.length; c > a; a++) this._typeCallbacks[b.types[a]] = b.callback; if (null != b.extensions) for (a = 0, c = b.extensions.length; c > a; a++) this._extensionCallbacks[b.extensions[a]] = b.callback } }; a.setMaxConnections = function (b) { this._maxConnections = b; !this._paused && 0 < this._loadQueue.length && this._loadNext() }; a.loadFile = function (b, a, c) { if (null == b) return b = new createjs.Event("error"), b.text = "PRELOAD_NO_FILE", this._sendError(b), void 0; this._addItem(b, c); !1 !== a ? this.setPaused(!1) : this.setPaused(!0) }; a.loadManifest = function (b, a, c) { var e = null; if (b instanceof Array) { if (0 == b.length) return a = new createjs.Event("error"), a.text = "PRELOAD_MANIFEST_EMPTY", this._sendError(a), void 0; e = b } else { if (null == b) return a = new createjs.Event("error"), a.text = "PRELOAD_MANIFEST_NULL", this._sendError(a), void 0; e = [b] } b = 0; for (var h = e.length; h > b; b++) this._addItem(e[b], c); !1 !== a ? this.setPaused(!1) : this.setPaused(!0) }; a.load = function () { this.setPaused(!1) }; a.getItem = function (b) { return this._loadItemsById[b] || this._loadItemsBySrc[b] }; a.getResult = function (b, a) { var c = this._loadItemsById[b] || this._loadItemsBySrc[b]; if (null == c) return null; c = c.id; return a && this._loadedRawResults[c] ? this._loadedRawResults[c] : this._loadedResults[c] }; a.setPaused = function (b) { (this._paused = b) || this._loadNext() }; a.close = function () { for (; this._currentLoads.length;) this._currentLoads.pop() .cancel(); this._scriptOrder.length = 0; this._loadedScripts.length = 0; this.loadStartWasDispatched = !1 }; a._addItem = function (b, a) { var c = this._createLoadItem(b); if (null != c) { var e = this._createLoader(c, a); null != e && (this._loadQueue.push(e), this._loadQueueBackup.push(e), this._numItems++, this._updateProgress(), this.maintainScriptOrder && c.type == createjs.LoadQueue.JAVASCRIPT && e instanceof createjs.XHRLoader && (this._scriptOrder.push(c), this._loadedScripts.push(null))) } }; a._createLoadItem = function (b) { var a = null; switch (typeof b) { case "string": a = { src: b }; break; case "object": a = window.HTMLAudioElement && b instanceof HTMLAudioElement ? { tag: b, src: a.tag.src, type: createjs.LoadQueue.SOUND } : b; break; default: return null } b = this._parseURI(a.src); if (null != b && (a.ext = b[5]), null == a.type && (a.type = this._getTypeByExtension(a.ext)), a.type == createjs.LoadQueue.JSON && null != a.callback && (a.type = createjs.LoadQueue.JSONP), a.type == createjs.LoadQueue.JSONP && null == a.callback) throw Error("callback is required for loading JSONP requests."); null == a.tag && (a.tag = this._createTag(a.type)); null != a.id && "" != a.id || (a.id = a.src); if (b = this._typeCallbacks[a.type] || this._extensionCallbacks[a.ext]) { b = b(a.src, a.type, a.id, a.data); if (!1 === b) return null; !0 === b || (null != b.src && (a.src = b.src), null != b.id && (a.id = b.id), null != b.tag && b.tag.load instanceof Function && (a.tag = b.tag), null != b.completeHandler && (a.completeHandler = b.completeHandler)); b.type && (a.type = b.type); b = this._parseURI(a.src); null != b && null != b[5] && (a.ext = b[5].toLowerCase()) } return this._loadItemsById[a.id] = a, this._loadItemsBySrc[a.src] = a, a }; a._createLoader = function (b, a) { var c = this.useXHR; switch (b.type) { case createjs.LoadQueue.JSON: case createjs.LoadQueue.XML: case createjs.LoadQueue.TEXT: c = !0; break; case createjs.LoadQueue.SOUND: case createjs.LoadQueue.JSONP: c = !1; break; case null: return null } return null == a && (a = this._basePath), c ? new createjs.XHRLoader(b, a) : new createjs.TagLoader(b, a) }; a._loadNext = function () { if (!this._paused) { this._loadStartWasDispatched || (this._sendLoadStart(), this._loadStartWasDispatched = !0); this._numItems == this._numItemsLoaded ? (this.loaded = !0, this._sendComplete(), this.next && this.next.load && this.next.load()) : this.loaded = !1; for (var b = 0; b < this._loadQueue.length && !(this._currentLoads.length >= this._maxConnections); b++) { var a = this._loadQueue[b]; if (this.maintainScriptOrder && a instanceof createjs.TagLoader && a.getItem() .type == createjs.LoadQueue.JAVASCRIPT) { if (this._currentlyLoadingScript) continue; this._currentlyLoadingScript = !0 } this._loadQueue.splice(b, 1); b--; this._loadItem(a) } } }; a._loadItem = function (b) { b.addEventListener("progress", createjs.proxy(this._handleProgress, this)); b.addEventListener("complete", createjs.proxy(this._handleFileComplete, this)); b.addEventListener("error", createjs.proxy(this._handleFileError, this)); this._currentLoads.push(b); this._sendFileStart(b.getItem()); b.load() }; a._handleFileError = function (b) { var a = b.target; this._numItemsLoaded++; this._updateProgress(); b = new createjs.Event("error"); b.text = "FILE_LOAD_ERROR"; b.item = a.getItem(); this._sendError(b); this.stopOnError || (this._removeLoadItem(a), this._loadNext()) }; a._handleFileComplete = function (b) { b = b.target; var a = b.getItem(); if (this._loadedResults[a.id] = b.getResult(), b instanceof createjs.XHRLoader && (this._loadedRawResults[a.id] = b.getResult(!0)), this._removeLoadItem(b), this.maintainScriptOrder && a.type == createjs.LoadQueue.JAVASCRIPT) { if (!(b instanceof createjs.TagLoader)) return this._loadedScripts[createjs.indexOf(this._scriptOrder, a)] = a, this._checkScriptLoadOrder(b), void 0; this._currentlyLoadingScript = !1 } this._processFinishedLoad(a, b) }; a._processFinishedLoad = function (b, a) { this._numItemsLoaded++; this._updateProgress(); this._sendFileComplete(b, a); this._loadNext() }; a._checkScriptLoadOrder = function () { for (var b = this._loadedScripts.length, a = 0; b > a; a++) { var c = this._loadedScripts[a]; if (null === c) break; !0 !== c && (this._processFinishedLoad(c), this._loadedScripts[a] = !0, a--, b--) } }; a._removeLoadItem = function (b) { for (var a = this._currentLoads.length, c = 0; a > c; c++) if (this._currentLoads[c] == b) { this._currentLoads.splice(c, 1); break } }; a._handleProgress = function (b) { b = b.target; this._sendFileProgress(b.getItem(), b.progress); this._updateProgress() }; a._updateProgress = function () { var b = this._numItemsLoaded / this._numItems, a = this._numItems - this._numItemsLoaded; if (0 < a) { for (var c = 0, e = 0, h = this._currentLoads.length; h > e; e++) c += this._currentLoads[e].progress; b += c / a * (a / this._numItems) } this._sendProgress(b) }; a._disposeItem = function (b) { delete this._loadedResults[b.id]; delete this._loadedRawResults[b.id]; delete this._loadItemsById[b.id]; delete this._loadItemsBySrc[b.src] }; a._createTag = function (b) { var a = null; switch (b) { case createjs.LoadQueue.IMAGE: return document.createElement("img"); case createjs.LoadQueue.SOUND: return a = document.createElement("audio"), a.autoplay = !1, a; case createjs.LoadQueue.JSONP: case createjs.LoadQueue.JAVASCRIPT: return a = document.createElement("script"), a.type = "text/javascript", a; case createjs.LoadQueue.CSS: return a = this.useXHR ? document.createElement("style") : document.createElement("link"), a.rel = "stylesheet", a.type = "text/css", a; case createjs.LoadQueue.SVG: return this.useXHR ? a = document.createElement("svg") : (a = document.createElement("object"), a.type = "image/svg+xml"), a } return null }; a._getTypeByExtension = function (b) { if (null == b) return createjs.LoadQueue.TEXT; switch (b.toLowerCase()) { case "jpeg": case "jpg": case "gif": case "png": case "webp": case "bmp": return createjs.LoadQueue.IMAGE; case "ogg": case "mp3": case "wav": return createjs.LoadQueue.SOUND; case "json": return createjs.LoadQueue.JSON; case "xml": return createjs.LoadQueue.XML; case "css": return createjs.LoadQueue.CSS; case "js": return createjs.LoadQueue.JAVASCRIPT; case "svg": return createjs.LoadQueue.SVG; default: return createjs.LoadQueue.TEXT } }; a._sendFileProgress = function (b, a) { if (this._isCanceled()) return this._cleanUp(), void 0; if (this.hasEventListener("fileprogress")) { var c = new createjs.Event("fileprogress"); c.progress = a; c.loaded = a; c.total = 1; c.item = b; this.dispatchEvent(c) } }; a._sendFileComplete = function (b, a) { if (!this._isCanceled()) { var c = new createjs.Event("fileload"); c.loader = a; c.item = b; c.result = this._loadedResults[b.id]; c.rawResult = this._loadedRawResults[b.id]; b.completeHandler && b.completeHandler(c); this.hasEventListener("fileload") && this.dispatchEvent(c) } }; a._sendFileStart = function (b) { var a = new createjs.Event("filestart"); a.item = b; this.hasEventListener("filestart") && this.dispatchEvent(a) }; a.toString = function () { return "[PreloadJS LoadQueue]" }; createjs.LoadQueue = c; var b = function () {}; b.init = function () { var a = navigator.userAgent; b.isFirefox = -1 < a.indexOf("Firefox"); b.isOpera = null != window.opera; b.isChrome = -1 < a.indexOf("Chrome"); b.isIOS = -1 < a.indexOf("iPod") || -1 < a.indexOf("iPhone") || -1 < a.indexOf("iPad") }; b.init(); createjs.LoadQueue.BrowserDetect = b })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a) { this.init(b, a) }, a = c.prototype = new createjs.AbstractLoader; a._loadTimeout = null; a._tagCompleteProxy = null; a._isAudio = !1; a._tag = null; a._jsonResult = null; a.init = function (b, a) { this._item = b; this._basePath = a; this._tag = b.tag; this._isAudio = window.HTMLAudioElement && b.tag instanceof HTMLAudioElement; this._tagCompleteProxy = createjs.proxy(this._handleLoad, this) }; a.getResult = function () { return this._item.type == createjs.LoadQueue.JSONP ? this._jsonResult : this._tag }; a.cancel = function () { this.canceled = !0; this._clean(); this.getItem() }; a.load = function () { var b = this._item, a = this._tag; clearTimeout(this._loadTimeout); this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), createjs.LoadQueue.LOAD_TIMEOUT); this._isAudio && (a.src = null, a.preload = "auto"); a.onerror = createjs.proxy(this._handleError, this); this._isAudio ? (a.onstalled = createjs.proxy(this._handleStalled, this), a.addEventListener("canplaythrough", this._tagCompleteProxy, !1)) : (a.onload = createjs.proxy(this._handleLoad, this), a.onreadystatechange = createjs.proxy(this._handleReadyStateChange, this)); var c = this.buildPath(b.src, this._basePath, b.values); switch (b.type) { case createjs.LoadQueue.CSS: a.href = c; break; case createjs.LoadQueue.SVG: a.data = c; break; default: a.src = c } if (b.type == createjs.LoadQueue.JSONP) { if (null == b.callback) throw Error("callback is required for loading JSONP requests."); if (null != window[b.callback]) throw Error('JSONP callback "' + b.callback + '" already exists on window. You need to specify a different callback. Or re-name the current one.'); window[b.callback] = createjs.proxy(this._handleJSONPLoad, this) } b.type != createjs.LoadQueue.SVG && b.type != createjs.LoadQueue.JSONP && b.type != createjs.LoadQueue.JSON && b.type != createjs.LoadQueue.JAVASCRIPT && b.type != createjs.LoadQueue.CSS || (this._startTagVisibility = a.style.visibility, a.style.visibility = "hidden", (document.body || document.getElementsByTagName("body")[0]) .appendChild(a)); null != a.load && a.load() }; a._handleJSONPLoad = function (b) { this._jsonResult = b }; a._handleTimeout = function () { this._clean(); var b = new createjs.Event("error"); b.text = "PRELOAD_TIMEOUT"; this._sendError(b) }; a._handleStalled = function () {}; a._handleError = function () { this._clean(); var b = new createjs.Event("error"); this._sendError(b) }; a._handleReadyStateChange = function () { clearTimeout(this._loadTimeout); var b = this.getItem() .tag; "loaded" != b.readyState && "complete" != b.readyState || this._handleLoad() }; a._handleLoad = function () { if (!this._isCanceled()) { var b = this.getItem(), a = b.tag; if (!(this.loaded || this.isAudio && 4 !== a.readyState)) { switch (this.loaded = !0, b.type) { case createjs.LoadQueue.SVG: case createjs.LoadQueue.JSONP: a.style.visibility = this._startTagVisibility, (document.body || document.getElementsByTagName("body")[0]) .removeChild(a) } this._clean(); this._sendComplete() } } }; a._clean = function () { clearTimeout(this._loadTimeout); var b = this.getItem() .tag; b.onload = null; b.removeEventListener && b.removeEventListener("canplaythrough", this._tagCompleteProxy, !1); b.onstalled = null; b.onprogress = null; b.onerror = null; b.parentNode && b.parentNode.removeChild(b); b = this.getItem(); b.type == createjs.LoadQueue.JSONP && (window[b.callback] = null) }; a.toString = function () { return "[PreloadJS TagLoader]" }; createjs.TagLoader = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a) { this.init(b, a) }, a = c.prototype = new createjs.AbstractLoader; a._request = null; a._loadTimeout = null; a._xhrLevel = 1; a._response = null; a._rawResponse = null; a.init = function (b, a) { this._item = b; this._basePath = a; !this._createXHR(b) }; a.getResult = function (b) { return b && this._rawResponse ? this._rawResponse : this._response }; a.cancel = function () { this.canceled = !0; this._clean(); this._request.abort() }; a.load = function () { if (null == this._request) return this._handleError(), void 0; this._request.onloadstart = createjs.proxy(this._handleLoadStart, this); this._request.onprogress = createjs.proxy(this._handleProgress, this); this._request.onabort = createjs.proxy(this._handleAbort, this); this._request.onerror = createjs.proxy(this._handleError, this); this._request.ontimeout = createjs.proxy(this._handleTimeout, this); 1 == this._xhrLevel && (this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), createjs.LoadQueue.LOAD_TIMEOUT)); this._request.onload = createjs.proxy(this._handleLoad, this); this._request.onreadystatechange = createjs.proxy(this._handleReadyStateChange, this); try { this._item.values && this._item.method != createjs.LoadQueue.GET ? this._item.method == createjs.LoadQueue.POST && this._request.send(this._formatQueryString(this._item.values)) : this._request.send() } catch (b) { var a = new createjs.Event("error"); a.error = b; this._sendError(a) } }; a.getAllResponseHeaders = function () { return this._request.getAllResponseHeaders instanceof Function ? this._request.getAllResponseHeaders() : null }; a.getResponseHeader = function (b) { return this._request.getResponseHeader instanceof Function ? this._request.getResponseHeader(b) : null }; a._handleProgress = function (b) { if (b && !(0 < b.loaded && 0 == b.total)) { var a = new createjs.Event("progress"); a.loaded = b.loaded; a.total = b.total; this._sendProgress(a) } }; a._handleLoadStart = function () { clearTimeout(this._loadTimeout); this._sendLoadStart() }; a._handleAbort = function (b) { this._clean(); b = new createjs.Event("error"); b.text = "XHR_ABORTED"; this._sendError(b) }; a._handleError = function () { this._clean(); var b = new createjs.Event("error"); this._sendError(b) }; a._handleReadyStateChange = function () { 4 == this._request.readyState && this._handleLoad() }; a._handleLoad = function () { if (!this.loaded) { if (this.loaded = !0, !this._checkError()) return this._handleError(), void 0; this._response = this._getResponse(); this._clean(); this._generateTag() && this._sendComplete() } }; a._handleTimeout = function (b) { this._clean(); (new createjs.Event("error")) .text = "PRELOAD_TIMEOUT"; this._sendError(b) }; a._checkError = function () { switch (parseInt(this._request.status)) { case 404: case 0: return !1 } return !0 }; a._getResponse = function () { if (null != this._response) return this._response; if (null != this._request.response) return this._request.response; try { if (null != this._request.responseText) return this._request.responseText } catch (b) {} try { if (null != this._request.responseXML) return this._request.responseXML } catch (a) {} return null }; a._createXHR = function (b) { var a = document.createElement("a"); a.href = this.buildPath(b.src, this._basePath); var c = document.createElement("a"); c.href = location.href; a = "" != a.hostname && (a.port != c.port || a.protocol != c.protocol || a.hostname != c.hostname); c = null; if (a && window.XDomainRequest) c = new XDomainRequest; else if (window.XMLHttpRequest) c = new XMLHttpRequest; else try { c = new ActiveXObject("Msxml2.XMLHTTP.6.0") } catch (d) { try { c = new ActiveXObject("Msxml2.XMLHTTP.3.0") } catch (e) { try { c = new ActiveXObject("Msxml2.XMLHTTP") } catch (h) { return !1 } } } b.type == createjs.LoadQueue.TEXT && c.overrideMimeType && c.overrideMimeType("text/plain; charset=x-user-defined"); this._xhrLevel = "string" == typeof c.responseType ? 2 : 1; var k = null; return k = b.method == createjs.LoadQueue.GET ? this.buildPath(b.src, this._basePath, b.values) : this.buildPath(b.src, this._basePath), c.open(b.method || createjs.LoadQueue.GET, k, !0), a && c instanceof XMLHttpRequest && 1 == this._xhrLevel && c.setRequestHeader("Origin", location.origin), b.values && b.method == createjs.LoadQueue.POST && c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), createjs.LoadQueue.isBinary(b.type) && (c.responseType = "arraybuffer"), this._request = c, !0 }; a._clean = function () { clearTimeout(this._loadTimeout); var b = this._request; b.onloadstart = null; b.onprogress = null; b.onabort = null; b.onerror = null; b.onload = null; b.ontimeout = null; b.onloadend = null; b.onreadystatechange = null }; a._generateTag = function () { var b = this._item.tag; switch (this._item.type) { case createjs.LoadQueue.IMAGE: return b.onload = createjs.proxy(this._handleTagReady, this), b.src = this.buildPath(this._item.src, this._basePath, this._item.values), this._rawResponse = this._response, this._response = b, !1; case createjs.LoadQueue.JAVASCRIPT: return b = document.createElement("script"), b.text = this._response, this._rawResponse = this._response, this._response = b, !0; case createjs.LoadQueue.CSS: if (document.getElementsByTagName("head")[0].appendChild(b), b.styleSheet) b.styleSheet.cssText = this._response; else { var a = document.createTextNode(this._response); b.appendChild(a) } return this._rawResponse = this._response, this._response = b, !0; case createjs.LoadQueue.XML: return a = this._parseXML(this._response, "text/xml"), this._response = a, !0; case createjs.LoadQueue.SVG: return a = this._parseXML(this._response, "image/svg+xml"), this._rawResponse = this._response, null != a.documentElement ? (b.appendChild(a.documentElement), this._response = b) : this._response = a, !0; case createjs.LoadQueue.JSON: b = {}; try { b = JSON.parse(this._response) } catch (c) { b = c } return this._rawResponse = this._response, this._response = b, !0 } return !0 }; a._parseXML = function (b, a) { var c = null; window.DOMParser ? c = (new DOMParser) .parseFromString(b, a) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = !1, c.loadXML(b)); return c }; a._handleTagReady = function () { this._sendComplete() }; a.toString = function () { return "[PreloadJS XHRLoader]" }; createjs.XHRLoader = c })(); "object" != typeof JSON && (JSON = {}); (function () { function c(b) { return 10 > b ? "0" + b : b } function a(b) { return f.lastIndex = 0, f.test(b) ? '"' + b.replace(f, function (b) { var a = h[b]; return "string" == typeof a ? a : "\\u" + ("0000" + b.charCodeAt(0) .toString(16)) .slice(-4) }) + '"' : '"' + b + '"' } function b(c, f) { var g, h, s, t, q, w = d, u = f[c]; switch (u && "object" == typeof u && "function" == typeof u.toJSON && (u = u.toJSON(c)), "function" == typeof k && (u = k.call(f, c, u)), typeof u) { case "string": return a(u); case "number": return isFinite(u) ? String(u) : "null"; case "boolean": case "null": return String(u); case "object": if (!u) return "null"; if (d += e, q = [], "[object Array]" === Object.prototype.toString.apply(u)) { t = u.length; for (g = 0; t > g; g += 1) q[g] = b(g, u) || "null"; return s = 0 === q.length ? "[]" : d ? "[\n" + d + q.join(",\n" + d) + "\n" + w + "]" : "[" + q.join(",") + "]", d = w, s } if (k && "object" == typeof k) for (t = k.length, g = 0; t > g; g += 1) "string" == typeof k[g] && (h = k[g], s = b(h, u), s && q.push(a(h) + (d ? ": " : ":") + s)); else for (h in u) Object.prototype.hasOwnProperty.call(u, h) && (s = b(h, u), s && q.push(a(h) + (d ? ": " : ":") + s)); return s = 0 === q.length ? "{}" : d ? "{\n" + d + q.join(",\n" + d) + "\n" + w + "}" : "{" + q.join(",") + "}", d = w, s } } "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function () { return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + c(this.getUTCMonth() + 1) + "-" + c(this.getUTCDate()) + "T" + c(this.getUTCHours()) + ":" + c(this.getUTCMinutes()) + ":" + c(this.getUTCSeconds()) + "Z" : null }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () { return this.valueOf() }); var g = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, f = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, d, e, h = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, k; "function" != typeof JSON.stringify && (JSON.stringify = function (a, c, f) { var g; if (d = "", e = "", "number" == typeof f) for (g = 0; f > g; g += 1) e += " "; else "string" == typeof f && (e = f); if (k = c, c && "function" != typeof c && ("object" != typeof c || "number" != typeof c.length)) throw Error("JSON.stringify"); return b("", { "": a }) }); "function" != typeof JSON.parse && (JSON.parse = function (b, a) { function c(b, f) { var d, g, e = b[f]; if (e && "object" == typeof e) for (d in e) Object.prototype.hasOwnProperty.call(e, d) && (g = c(e, d), void 0 !== g ? e[d] = g : delete e[d]); return a.call(b, f, e) } var f; if (b = String(b), g.lastIndex = 0, g.test(b) && (b = b.replace(g, function (b) { return "\\u" + ("0000" + b.charCodeAt(0) .toString(16)) .slice(-4) })), /^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return f = eval("(" + b + ")"), "function" == typeof a ? c({ "": f }, "") : f; throw new SyntaxError("JSON.parse"); }) })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a, c) { this.initialize(b, a, c) }, a = c.prototype; a.type = null; a.target = null; a.currentTarget = null; a.eventPhase = 0; a.bubbles = !1; a.cancelable = !1; a.timeStamp = 0; a.defaultPrevented = !1; a.propagationStopped = !1; a.immediatePropagationStopped = !1; a.removed = !1; a.initialize = function (b, a, c) { this.type = b; this.bubbles = a; this.cancelable = c; this.timeStamp = (new Date) .getTime() }; a.preventDefault = function () { this.defaultPrevented = !0 }; a.stopPropagation = function () { this.propagationStopped = !0 }; a.stopImmediatePropagation = function () { this.immediatePropagationStopped = this.propagationStopped = !0 }; a.remove = function () { this.removed = !0 }; a.clone = function () { return new c(this.type, this.bubbles, this.cancelable) }; a.toString = function () { return "[Event (type=" + this.type + ")]" }; createjs.Event = c })(); this.createjs = this.createjs || {}; (function () { var c = function () { this.initialize() }, a = c.prototype; c.initialize = function (b) { b.addEventListener = a.addEventListener; b.on = a.on; b.removeEventListener = b.off = a.removeEventListener; b.removeAllEventListeners = a.removeAllEventListeners; b.hasEventListener = a.hasEventListener; b.dispatchEvent = a.dispatchEvent; b._dispatchEvent = a._dispatchEvent }; a._listeners = null; a._captureListeners = null; a.initialize = function () {}; a.addEventListener = function (b, a, c) { var d; d = c ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {}; var e = d[b]; return e && this.removeEventListener(b, a, c), e = d[b], e ? e.push(a) : d[b] = [a], a }; a.on = function (b, a, c, d, e, h) { return a.handleEvent && (c = c || a, a = a.handleEvent), c = c || this, this.addEventListener(b, function (b) { a.call(c, b, e); d && b.remove() }, h) }; a.removeEventListener = function (b, a, c) { if (c = c ? this._captureListeners : this._listeners) { var d = c[b]; if (d) for (var e = 0, h = d.length; h > e; e++) if (d[e] == a) { 1 == h ? delete c[b] : d.splice(e, 1); break } } }; a.off = a.removeEventListener; a.removeAllEventListeners = function (b) { b ? (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null }; a.dispatchEvent = function (b, a) { if ("string" == typeof b) { var c = this._listeners; if (!c || !c[b]) return !1; b = new createjs.Event(b) } if (b.target = a || this, b.bubbles && this.parent) { for (var d = this, c = [d]; d.parent;) c.push(d = d.parent); for (var e = c.length, d = e - 1; 0 <= d && !b.propagationStopped; d--) c[d]._dispatchEvent(b, 1 + (0 == d)); for (d = 1; e > d && !b.propagationStopped; d++) c[d]._dispatchEvent(b, 3) } else this._dispatchEvent(b, 2); return b.defaultPrevented }; a.hasEventListener = function (b) { var a = this._listeners, c = this._captureListeners; return !!(a && a[b] || c && c[b]) }; a.toString = function () { return "[EventDispatcher]" }; a._dispatchEvent = function (b, a) { var c, d = 1 == a ? this._captureListeners : this._listeners; if (b && d && (d = d[b.type]) && (c = d.length)) { b.currentTarget = this; b.eventPhase = a; b.removed = !1; for (var d = d.slice(), e = 0; c > e && !b.immediatePropagationStopped; e++) { var h = d[e]; h.handleEvent ? h.handleEvent(b) : h(b); b.removed && (this.off(b.type, h, 1 == a), b.removed = !1) } } }; createjs.EventDispatcher = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a, c) { this.initialize(b, a, c) }, a = c.prototype = new createjs.EventDispatcher; c.NONE = 0; c.LOOP = 1; c.REVERSE = 2; c.IGNORE = {}; c._tweens = []; c._plugins = {}; c.get = function (b, a, f, d) { return d && c.removeTweens(b), new c(b, a, f) }; c.tick = function (b, a) { for (var f = c._tweens.slice(), d = f.length - 1; 0 <= d; d--) { var e = f[d]; a && !e.ignoreGlobalPause || e._paused || e.tick(e._useTicks ? 1 : b) } }; c.handleEvent = function (b) { "tick" == b.type && this.tick(b.delta, b.paused) }; c.removeTweens = function (b) { if (b.tweenjs_count) { for (var a = c._tweens, f = a.length - 1; 0 <= f; f--) a[f]._target == b && (a[f]._paused = !0, a.splice(f, 1)); b.tweenjs_count = 0 } }; c.removeAllTweens = function () { for (var b = c._tweens, a = 0, f = b.length; f > a; a++) { var d = b[a]; d.paused = !0; d.target.tweenjs_count = 0 } b.length = 0 }; c.hasActiveTweens = function (b) { return b ? b.tweenjs_count : c._tweens && !!c._tweens.length }; c.installPlugin = function (b, a) { var f = b.priority; null == f && (b.priority = f = 0); for (var d = 0, e = a.length, h = c._plugins; e > d; d++) { var k = a[d]; if (h[k]) { for (var m = h[k], n = 0, p = m.length; p > n && !(f < m[n].priority); n++); h[k].splice(n, 0, b) } else h[k] = [b] } }; c._register = function (b, a) { var f = b._target, d = c._tweens; if (a) f && (f.tweenjs_count = f.tweenjs_count ? f.tweenjs_count + 1 : 1), d.push(b), !c._inited && createjs.Ticker && (createjs.Ticker.addEventListener("tick", c), c._inited = !0); else for (f && f.tweenjs_count--, f = d.length; f--;) if (d[f] == b) return d.splice(f, 1), void 0 }; a.ignoreGlobalPause = !1; a.loop = !1; a.duration = 0; a.pluginData = null; a.target = null; a.position = null; a.passive = !1; a._paused = !1; a._curQueueProps = null; a._initQueueProps = null; a._steps = null; a._actions = null; a._prevPosition = 0; a._stepPosition = 0; a._prevPos = -1; a._target = null; a._useTicks = !1; a._inited = !1; a.initialize = function (b, a, f) { this.target = this._target = b; a && (this._useTicks = a.useTicks, this.ignoreGlobalPause = a.ignoreGlobalPause, this.loop = a.loop, a.onChange && this.addEventListener("change", a.onChange), a.override && c.removeTweens(b)); this.pluginData = f || {}; this._curQueueProps = {}; this._initQueueProps = {}; this._steps = []; this._actions = []; a && a.paused ? this._paused = !0 : c._register(this, !0); a && null != a.position && this.setPosition(a.position, c.NONE) }; a.wait = function (b, a) { if (null == b || 0 >= b) return this; var c = this._cloneProps(this._curQueueProps); return this._addStep({ d: b, p0: c, e: this._linearEase, p1: c, v: a }) }; a.to = function (b, a, c) { return (isNaN(a) || 0 > a) && (a = 0), this._addStep({ d: a || 0, p0: this._cloneProps(this._curQueueProps), e: c, p1: this._cloneProps(this._appendQueueProps(b)) }) }; a.call = function (b, a, c) { return this._addAction({ f: b, p: a ? a : [this], o: c ? c : this._target }) }; a.set = function (b, a) { return this._addAction({ f: this._set, o: this, p: [b, a ? a : this._target] }) }; a.play = function (b) { return b || (b = this), this.call(b.setPaused, [!1], b) }; a.pause = function (b) { return b || (b = this), this.call(b.setPaused, [!0], b) }; a.setPosition = function (b, a) { 0 > b && (b = 0); null == a && (a = 1); var c = b, d = !1; if (c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0)), c == this._prevPos) return d; var e = this._prevPos; if (this.position = this._prevPos = c, this._prevPosition = b, this._target) if (d) this._updateTargetProps(null, 1); else if (0 < this._steps.length) { for (var h = 0, k = this._steps.length; k > h && !(this._steps[h].t > c); h++); h = this._steps[h - 1]; this._updateTargetProps(h, (this._stepPosition = c - h.t) / h.d) } return 0 != a && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == a && e > c ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c)), d && this.setPaused(!0), this.dispatchEvent("change"), d }; a.tick = function (b) { this._paused || this.setPosition(this._prevPosition + b) }; a.setPaused = function (b) { return this._paused = !!b, c._register(this, !b), this }; a.w = a.wait; a.t = a.to; a.c = a.call; a.s = a.set; a.toString = function () { return "[Tween]" }; a.clone = function () { throw "Tween can not be cloned."; }; a._updateTargetProps = function (b, a) { var f, d, e, h; if (b || 1 != a) { if (this.passive = !!b.v, this.passive) return; b.e && (a = b.e(a, 0, 1, 1)); f = b.p0; d = b.p1 } else this.passive = !1, f = d = this._curQueueProps; for (var k in this._initQueueProps) { null == (e = f[k]) && (f[k] = e = this._initQueueProps[k]); null == (h = d[k]) && (d[k] = h = e); e = e == h || 0 == a || 1 == a || "number" != typeof e ? 1 == a ? h : e : e + (h - e) * a; var m = !1; if (h = c._plugins[k]) for (var n = 0, p = h.length; p > n; n++) { var r = h[n].tween(this, k, e, f, d, a, !!b && f == d, !b); r == c.IGNORE ? m = !0 : e = r } m || (this._target[k] = e) } }; a._runActions = function (b, a, c) { var d = b, e = a, h = -1, k = this._actions.length, m = 1; for (b > a && (d = a, e = b, h = k, k = m = -1); (h += m) != k;) { a = this._actions[h]; var n = a.t; (n == e || n > d && e > n || c && n == b) && a.f.apply(a.o, a.p) } }; a._appendQueueProps = function (b) { var a, f, d, e, h, k; for (k in b) if (void 0 === this._initQueueProps[k]) { if (f = this._target[k], a = c._plugins[k]) for (d = 0, e = a.length; e > d; d++) f = a[d].init(this, k, f); this._initQueueProps[k] = this._curQueueProps[k] = void 0 === f ? null : f } for (k in b) { if (f = this._curQueueProps[k], a = c._plugins[k]) for (h = h || {}, d = 0, e = a.length; e > d; d++) a[d].step && a[d].step(this, k, f, b[k], h); this._curQueueProps[k] = b[k] } return h && this._appendQueueProps(h), this._curQueueProps }; a._cloneProps = function (b) { var a = {}, c; for (c in b) a[c] = b[c]; return a }; a._addStep = function (b) { return 0 < b.d && (this._steps.push(b), b.t = this.duration, this.duration += b.d), this }; a._addAction = function (b) { return b.t = this.duration, this._actions.push(b), this }; a._set = function (b, a) { for (var c in b) a[c] = b[c] }; createjs.Tween = c })(); this.createjs = this.createjs || {}; (function () { var c = function (b, a, c) { this.initialize(b, a, c) }, a = c.prototype = new createjs.EventDispatcher; a.ignoreGlobalPause = !1; a.duration = 0; a.loop = !1; a.position = null; a._paused = !1; a._tweens = null; a._labels = null; a._labelList = null; a._prevPosition = 0; a._prevPos = -1; a._useTicks = !1; a.initialize = function (b, a, c) { this._tweens = []; c && (this._useTicks = c.useTicks, this.loop = c.loop, this.ignoreGlobalPause = c.ignoreGlobalPause, c.onChange && this.addEventListener("change", c.onChange)); b && this.addTween.apply(this, b); this.setLabels(a); c && c.paused ? this._paused = !0 : createjs.Tween._register(this, !0); c && null != c.position && this.setPosition(c.position, createjs.Tween.NONE) }; a.addTween = function (b) { var a = arguments.length; if (1 < a) { for (var c = 0; a > c; c++) this.addTween(arguments[c]); return arguments[0] } return 0 == a ? null : (this.removeTween(b), this._tweens.push(b), b.setPaused(!0), b._paused = !1, b._useTicks = this._useTicks, b.duration > this.duration && (this.duration = b.duration), 0 <= this._prevPos && b.setPosition(this._prevPos, createjs.Tween.NONE), b) }; a.removeTween = function (b) { var a = arguments.length; if (1 < a) { for (var c = !0, d = 0; a > d; d++) c = c && this.removeTween(arguments[d]); return c } if (0 == a) return !1; a = this._tweens; for (d = a.length; d--;) if (a[d] == b) return a.splice(d, 1), b.duration >= this.duration && this.updateDuration(), !0; return !1 }; a.addLabel = function (b, a) { this._labels[b] = a; var c = this._labelList; if (c) { for (var d = 0, e = c.length; e > d && !(a < c[d].position); d++); c.splice(d, 0, { label: b, position: a }) } }; a.setLabels = function (b) { this._labels = b ? b : {} }; a.getLabels = function () { var b = this._labelList; if (!b) { var b = this._labelList = [], a = this._labels, c; for (c in a) b.push({ label: c, position: a[c] }); b.sort(function (b, a) { return b.position - a.position }) } return b }; a.getCurrentLabel = function () { var b = this.getLabels(), a = this.position, c = b.length; if (c) { for (var d = 0; c > d && !(a < b[d].position); d++); return 0 == d ? null : b[d - 1].label } return null }; a.gotoAndPlay = function (b) { this.setPaused(!1); this._goto(b) }; a.gotoAndStop = function (b) { this.setPaused(!0); this._goto(b) }; a.setPosition = function (b, a) { 0 > b && (b = 0); var c = this.loop ? b % this.duration : b, d = !this.loop && b >= this.duration; if (c == this._prevPos) return d; this._prevPosition = b; this.position = this._prevPos = c; for (var e = 0, h = this._tweens.length; h > e; e++) if (this._tweens[e].setPosition(c, a), c != this._prevPos) return !1; return d && this.setPaused(!0), this.dispatchEvent("change"), d }; a.setPaused = function (a) { this._paused = !!a; createjs.Tween._register(this, !a) }; a.updateDuration = function () { for (var a = this.duration = 0, c = this._tweens.length; c > a; a++) { var f = this._tweens[a]; f.duration > this.duration && (this.duration = f.duration) } }; a.tick = function (a) { this.setPosition(this._prevPosition + a) }; a.resolve = function (a) { var c = parseFloat(a); return isNaN(c) && (c = this._labels[a]), c }; a.toString = function () { return "[Timeline]" }; a.clone = function () { throw "Timeline can not be cloned."; }; a._goto = function (a) { a = this.resolve(a); null != a && this.setPosition(a) }; createjs.Timeline = c })(); this.createjs = this.createjs || {}; (function () { var c = function () { throw "Ease cannot be instantiated."; }; c.linear = function (a) { return a }; c.none = c.linear; c.get = function (a) { return -1 > a && (a = -1), 1 < a && (a = 1), function (b) { return 0 == a ? b : 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a)) } }; c.getPowIn = function (a) { return function (b) { return Math.pow(b, a) } }; c.getPowOut = function (a) { return function (b) { return 1 - Math.pow(1 - b, a) } }; c.getPowInOut = function (a) { return function (b) { return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a)) } }; c.quadIn = c.getPowIn(2); c.quadOut = c.getPowOut(2); c.quadInOut = c.getPowInOut(2); c.cubicIn = c.getPowIn(3); c.cubicOut = c.getPowOut(3); c.cubicInOut = c.getPowInOut(3); c.quartIn = c.getPowIn(4); c.quartOut = c.getPowOut(4); c.quartInOut = c.getPowInOut(4); c.quintIn = c.getPowIn(5); c.quintOut = c.getPowOut(5); c.quintInOut = c.getPowInOut(5); c.sineIn = function (a) { return 1 - Math.cos(a * Math.PI / 2) }; c.sineOut = function (a) { return Math.sin(a * Math.PI / 2) }; c.sineInOut = function (a) { return -0.5 * (Math.cos(Math.PI * a) - 1) }; c.getBackIn = function (a) { return function (b) { return b * b * ((a + 1) * b - a) } }; c.backIn = c.getBackIn(1.7); c.getBackOut = function (a) { return function (b) { return --b * b * ((a + 1) * b + a) + 1 } }; c.backOut = c.getBackOut(1.7); c.getBackInOut = function (a) { return a *= 1.525, function (b) { return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2) } }; c.backInOut = c.getBackInOut(1.7); c.circIn = function (a) { return -(Math.sqrt(1 - a * a) - 1) }; c.circOut = function (a) { return Math.sqrt(1 - --a * a) }; c.circInOut = function (a) { return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1) }; c.bounceIn = function (a) { return 1 - c.bounceOut(1 - a) }; c.bounceOut = function (a) { return 1 / 2.75 > a ? 7.5625 * a * a : 2 / 2.75 > a ? 7.5625 * (a -= 1.5 / 2.75) * a + 0.75 : 2.5 / 2.75 > a ? 7.5625 * (a -= 2.25 / 2.75) * a + 0.9375 : 7.5625 * (a -= 2.625 / 2.75) * a + 0.984375 }; c.bounceInOut = function (a) { return 0.5 > a ? 0.5 * c.bounceIn(2 * a) : 0.5 * c.bounceOut(2 * a - 1) + 0.5 }; c.getElasticIn = function (a, b) { var c = 2 * Math.PI; return function (f) { if (0 == f || 1 == f) return f; var d = b / c * Math.asin(1 / a); return -(a * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - d) * c / b)) } }; c.elasticIn = c.getElasticIn(1, 0.3); c.getElasticOut = function (a, b) { var c = 2 * Math.PI; return function (f) { if (0 == f || 1 == f) return f; var d = b / c * Math.asin(1 / a); return a * Math.pow(2, -10 * f) * Math.sin((f - d) * c / b) + 1 } }; c.elasticOut = c.getElasticOut(1, 0.3); c.getElasticInOut = function (a, b) { var c = 2 * Math.PI; return function (f) { var d = b / c * Math.asin(1 / a); return 1 > (f *= 2) ? -0.5 * a * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - d) * c / b) : 0.5 * a * Math.pow(2, -10 * (f -= 1)) * Math.sin((f - d) * c / b) + 1 } }; c.elasticInOut = c.getElasticInOut(1, 0.3 * 1.5); createjs.Ease = c })(); this.createjs = this.createjs || {}; (function () { var c = function () { throw "MotionGuidePlugin cannot be instantiated."; }; c.priority = 0; c._rotOffS; c._rotOffE; c._rotNormS; c._rotNormE; c.install = function () { return createjs.Tween.installPlugin(c, ["guide", "x", "y", "rotation"]), createjs.Tween.IGNORE }; c.init = function (a, b, c) { var f = a.target; return f.hasOwnProperty("x") || (f.x = 0), f.hasOwnProperty("y") || (f.y = 0), f.hasOwnProperty("rotation") || (f.rotation = 0), "rotation" == b && (a.__needsRot = !0), "guide" == b ? null : c }; c.step = function (a, b, g, f, d) { if ("rotation" == b && (a.__rotGlobalS = g, a.__rotGlobalE = f, c.testRotData(a, d)), "guide" != b) return f; var e; f.hasOwnProperty("path") || (f.path = []); b = f.path; if (f.hasOwnProperty("end") || (f.end = 1), f.hasOwnProperty("start") || (f.start = g && g.hasOwnProperty("end") && g.path === b ? g.end : 0), f.hasOwnProperty("_segments") && f._length) return f; g = b.length; if (!(6 <= g && 0 == (g - 2) % 4)) throw "invalid 'path' data, please see documentation for valid paths"; f._segments = []; f._length = 0; for (var h = 2; g > h; h += 4) { for (var k, m, n = b[h - 2], p = b[h - 1], r = b[h + 0], s = b[h + 1], t = b[h + 2], q = b[h + 3], w = n, u = p, x = 0, K = [], A = 1; 10 >= A; A++) { m = A / 10; var y = 1 - m; k = y * y * n + 2 * y * m * r + m * m * t; m = y * y * p + 2 * y * m * s + m * m * q; x += K[K.push(Math.sqrt((e = k - w) * e + (e = m - u) * e)) - 1]; w = k; u = m } f._segments.push(x); f._segments.push(K); f._length += x } e = f.orient; f.orient = !0; b = {}; return c.calc(f, f.start, b), a.__rotPathS = Number(b.rotation.toFixed(5)), c.calc(f, f.end, b), a.__rotPathE = Number(b.rotation.toFixed(5)), f.orient = !1, c.calc(f, f.end, d), f.orient = e, f.orient ? (a.__guideData = f, c.testRotData(a, d), f) : f }; c.testRotData = function (a, b) { if (void 0 === a.__rotGlobalS || void 0 === a.__rotGlobalE) { if (a.__needsRot) return; a.__rotGlobalS = a.__rotGlobalE = void 0 !== a._curQueueProps.rotation ? a._curQueueProps.rotation : b.rotation = a.target.rotation || 0 } if (void 0 !== a.__guideData) { var c = a.__guideData, f = a.__rotGlobalE - a.__rotGlobalS, d = a.__rotPathE - a.__rotPathS, e = f - d; if ("auto" == c.orient) 180 < e ? e -= 360 : -180 > e && (e += 360); else if ("cw" == c.orient) { for (; 0 > e;) e += 360; 0 == e && 0 < f && 180 != f && (e += 360) } else if ("ccw" == c.orient) { for (e = f - (180 < d ? 360 - d : d); 0 < e;) e -= 360; 0 == e && 0 > f && -180 != f && (e -= 360) } c.rotDelta = e; c.rotOffS = a.__rotGlobalS - a.__rotPathS; a.__rotGlobalS = a.__rotGlobalE = a.__guideData = a.__needsRot = void 0 } }; c.tween = function (a, b, g, f, d, e, h) { d = d.guide; if (void 0 == d || d === f.guide) return g; if (d.lastRatio != e) { switch (c.calc(d, (d.end - d.start) * (h ? d.end : e) + d.start, a.target), d.orient) { case "cw": case "ccw": case "auto": a.target.rotation += d.rotOffS + d.rotDelta * e; break; default: a.target.rotation += d.rotOffS } d.lastRatio = e } return "rotation" != b || d.orient && "false" != d.orient ? a.target[b] : g }; c.calc = function (a, b, g) { void 0 == a._segments && c.validate(a); void 0 == g && (g = { x: 0, y: 0, rotation: 0 }); var f = a._segments, d = a.path, e = a._length * b, h = f.length - 2; for (b = 0; e > f[b] && h > b;) e -= f[b], b += 2; for (var f = f[b + 1], k = 0, h = f.length - 1; e > f[k] && h > k;) e -= f[k], k++; e = k / ++h + e / (h * f[k]); b = 2 * b + 2; h = 1 - e; return g.x = h * h * d[b - 2] + 2 * h * e * d[b + 0] + e * e * d[b + 2], g.y = h * h * d[b - 1] + 2 * h * e * d[b + 1] + e * e * d[b + 3], a.orient && (g.rotation = 57.2957795 * Math.atan2((d[b + 1] - d[b - 1]) * h + (d[b + 3] - d[b + 1]) * e, (d[b + 0] - d[b - 2]) * h + (d[b + 2] - d[b + 0]) * e)), g }; createjs.MotionGuidePlugin = c })(); this.createjs = this.createjs || {}; (function () { var c = createjs.TweenJS = createjs.TweenJS || {}; c.version = "0.5.0"; c.buildDate = "Wed, 25 Sep 2013 17:09:35 GMT" })(); this.createjs = this.createjs || {}; (function () { var c = createjs.SoundJS = createjs.SoundJS || {}; c.version = "0.5.0"; c.buildDate = "Wed, 25 Sep 2013 17:09:35 GMT" })(); this.createjs = this.createjs || {}; (function () { var c = function () {}, a = c.prototype; c.initialize = function (b) { b.addEventListener = a.addEventListener; b.on = a.on; b.removeEventListener = b.off = a.removeEventListener; b.removeAllEventListeners = a.removeAllEventListeners; b.hasEventListener = a.hasEventListener; b.dispatchEvent = a.dispatchEvent; b._dispatchEvent = a._dispatchEvent }; a._listeners = null; a._captureListeners = null; a.initialize = function () {}; a.addEventListener = function (a, c, f) { var d; d = f ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {}; var e = d[a]; return e && this.removeEventListener(a, c, f), e = d[a], e ? e.push(c) : d[a] = [c], c }; a.on = function (a, c, f, d, e, h) { return c.handleEvent && (f = f || c, c = c.handleEvent), f = f || this, this.addEventListener(a, function (a) { c.call(f, a, e); d && a.remove() }, h) }; a.removeEventListener = function (a, c, f) { if (f = f ? this._captureListeners : this._listeners) { var d = f[a]; if (d) for (var e = 0, h = d.length; h > e; e++) if (d[e] == c) { 1 == h ? delete f[a] : d.splice(e, 1); break } } }; a.off = a.removeEventListener; a.removeAllEventListeners = function (a) { a ? (this._listeners && delete this._listeners[a], this._captureListeners && delete this._captureListeners[a]) : this._listeners = this._captureListeners = null }; a.dispatchEvent = function (a, c) { if ("string" == typeof a) { var f = this._listeners; if (!f || !f[a]) return !1; a = new createjs.Event(a) } if (a.target = c || this, a.bubbles && this.parent) { for (var d = this, f = [d]; d.parent;) f.push(d = d.parent); for (var e = f.length, d = e - 1; 0 <= d && !a.propagationStopped; d--) f[d]._dispatchEvent(a, 1 + (0 == d)); for (d = 1; e > d && !a.propagationStopped; d++) f[d]._dispatchEvent(a, 3) } else this._dispatchEvent(a, 2); return a.defaultPrevented }; a.hasEventListener = function (a) { var c = this._listeners, f = this._captureListeners; return !!(c && c[a] || f && f[a]) }; a.toString = function () { return "[EventDispatcher]" }; a._dispatchEvent = function (a, c) { var f, d = 1 == c ? this._captureListeners : this._listeners; if (a && d && (d = d[a.type]) && (f = d.length)) { a.currentTarget = this; a.eventPhase = c; a.removed = !1; for (var d = d.slice(), e = 0; f > e && !a.immediatePropagationStopped; e++) { var h = d[e]; h.handleEvent ? h.handleEvent(a) : h(a); a.removed && (this.off(a.type, h, 1 == c), a.removed = !1) } } }; createjs.EventDispatcher = c })(); this.createjs = this.createjs || {}; (function () { var c = function (a, c, f) { this.initialize(a, c, f) }, a = c.prototype; a.type = null; a.target = null; a.currentTarget = null; a.eventPhase = 0; a.bubbles = !1; a.cancelable = !1; a.timeStamp = 0; a.defaultPrevented = !1; a.propagationStopped = !1; a.immediatePropagationStopped = !1; a.removed = !1; a.initialize = function (a, c, f) { this.type = a; this.bubbles = c; this.cancelable = f; this.timeStamp = (new Date) .getTime() }; a.preventDefault = function () { this.defaultPrevented = !0 }; a.stopPropagation = function () { this.propagationStopped = !0 }; a.stopImmediatePropagation = function () { this.immediatePropagationStopped = this.propagationStopped = !0 }; a.remove = function () { this.removed = !0 }; a.clone = function () { return new c(this.type, this.bubbles, this.cancelable) }; a.toString = function () { return "[Event (type=" + this.type + ")]" }; createjs.Event = c })(); this.createjs = this.createjs || {}; (function () { createjs.indexOf = function (c, a) { for (var b = 0, g = c.length; g > b; b++) if (a === c[b]) return b; return -1 } })(); this.createjs = this.createjs || {}; (function () { createjs.proxy = function (c, a) { var b = Array.prototype.slice.call(arguments, 2); return function () { return c.apply(a, Array.prototype.slice.call(arguments, 0) .concat(b)) } } })(); this.createjs = this.createjs || {}; (function () { function c() { throw "Sound cannot be instantiated"; } function a(a, b) { this.init(a, b) } function b() {} c.DELIMITER = "|"; c.AUDIO_TIMEOUT = 8E3; c.INTERRUPT_ANY = "any"; c.INTERRUPT_EARLY = "early"; c.INTERRUPT_LATE = "late"; c.INTERRUPT_NONE = "none"; c.PLAY_INITED = "playInited"; c.PLAY_SUCCEEDED = "playSucceeded"; c.PLAY_INTERRUPTED = "playInterrupted"; c.PLAY_FINISHED = "playFinished"; c.PLAY_FAILED = "playFailed"; c.SUPPORTED_EXTENSIONS = "mp3 ogg mpeg wav m4a mp4 aiff wma mid".split(" "); c.EXTENSION_MAP = { m4a: "mp4" }; c.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/; c.defaultInterruptBehavior = c.INTERRUPT_NONE; c.lastId = 0; c.activePlugin = null; c.pluginsRegistered = !1; c.masterVolume = 1; c.masterMute = !1; c.instances = []; c.idHash = {}; c.preloadHash = {}; c.defaultSoundInstance = null; c.addEventListener = null; c.removeEventListener = null; c.removeAllEventListeners = null; c.dispatchEvent = null; c.hasEventListener = null; c._listeners = null; createjs.EventDispatcher.initialize(c); c.sendFileLoadEvent = function (a) { if (c.preloadHash[a]) for (var b = 0, e = c.preloadHash[a].length; e > b; b++) { var g = c.preloadHash[a][b]; if (c.preloadHash[a][b] = !0, c.hasEventListener("fileload")) { var k = new createjs.Event("fileload"); k.src = g.src; k.id = g.id; k.data = g.data; c.dispatchEvent(k) } } }; c.getPreloadHandlers = function () { return { callback: createjs.proxy(c.initLoad, c), types: ["sound"], extensions: c.SUPPORTED_EXTENSIONS } }; c.registerPlugin = function (a) { return c.pluginsRegistered = !0, null == a ? !1 : a.isSupported() ? (c.activePlugin = new a, !0) : !1 }; c.registerPlugins = function (a) { for (var b = 0, e = a.length; e > b; b++) if (c.registerPlugin(a[b])) return !0; return !1 }; c.initializeDefaultPlugins = function () { return null != c.activePlugin ? !0 : c.pluginsRegistered ? !1 : c.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin]) ? !0 : !1 }; c.isReady = function () { return null != c.activePlugin }; c.getCapabilities = function () { return null == c.activePlugin ? null : c.activePlugin.capabilities }; c.getCapability = function (a) { return null == c.activePlugin ? null : c.activePlugin.capabilities[a] }; c.initLoad = function (a, b, e, g, k) { a = c.registerSound(a, e, g, !1, k); return null == a ? !1 : a }; c.registerSound = function (b, d, e, g, k) { if (!c.initializeDefaultPlugins()) return !1; b instanceof Object && (k = d, d = b.id, e = b.data, b = b.src); var m = c.parsePath(b, "sound", d, e); if (null == m) return !1; null != d && (c.idHash[d] = m.src); var n = null; null != e && (isNaN(e.channels) ? isNaN(e) || (n = parseInt(e)) : n = parseInt(e.channels)); var p = c.activePlugin.register(m.src, n); if (null != p && (null != p.numChannels && (n = p.numChannels), a.create(m.src, n), null != e && isNaN(e) ? e.channels = m.data.channels = n || a.maxPerChannel() : e = m.data = n || a.maxPerChannel(), null != p.tag ? m.tag = p.tag : p.src && (m.src = p.src), null != p.completeHandler && (m.completeHandler = p.completeHandler), p.type && (m.type = p.type)), 0 != g) if (c.preloadHash[m.src] || (c.preloadHash[m.src] = []), c.preloadHash[m.src].push({ src: b, id: d, data: e }), 1 == c.preloadHash[m.src].length) null == k && (k = ""), c.activePlugin.preload(m.src, p, k); else if (1 == c.preloadHash[m.src][0]) return !0; return m }; c.registerManifest = function (a, b) { for (var c = [], g = 0, k = a.length; k > g; g++) c[g] = createjs.Sound.registerSound(a[g].src, a[g].id, a[g].data, a[g].preload, b); return c }; c.removeSound = function (b) { if (null == c.activePlugin) return !1; b instanceof Object && (b = b.src); b = c.getSrcById(b); b = c.parsePath(b); if (null == b) return !1; b = b.src; for (var d in c.idHash) c.idHash[d] == b && delete c.idHash[d]; return a.removeSrc(b), delete c.preloadHash[b], c.activePlugin.removeSound(b), !0 }; c.removeManifest = function (a) { for (var b = [], c = 0, g = a.length; g > c; c++) b[c] = createjs.Sound.removeSound(a[c].src); return b }; c.removeAllSounds = function () { c.idHash = {}; c.preloadHash = {}; a.removeAll(); c.activePlugin.removeAllSounds() }; c.loadComplete = function (a) { var b = c.parsePath(a, "sound"); return a = b ? c.getSrcById(b.src) : c.getSrcById(a), 1 == c.preloadHash[a][0] }; c.parsePath = function (a, b, e, g) { "string" != typeof a && (a = a.toString()); a = a.split(c.DELIMITER); b = { type: b || "sound", id: e, data: g }; e = c.getCapabilities(); g = 0; for (var k = a.length; k > g; g++) { var m = a[g], n = m.match(c.FILE_PATTERN); if (null == n) return !1; var p = n[4], n = n[5]; if (e[n] && -1 < createjs.indexOf(c.SUPPORTED_EXTENSIONS, n)) return b.name = p, b.src = m, b.extension = n, b } return null }; c.play = function (a, b, e, g, k, m, n) { a = c.createInstance(a); return c.playInstance(a, b, e, g, k, m, n) || a.playFailed(), a }; c.createInstance = function (b) { if (!c.initializeDefaultPlugins()) return c.defaultSoundInstance; b = c.getSrcById(b); b = c.parsePath(b, "sound"); var d = null; return null != b && null != b.src ? (a.create(b.src), d = c.activePlugin.create(b.src)) : d = c.defaultSoundInstance, d.uniqueId = c.lastId++, d }; c.setVolume = function (a) { if (null == Number(a)) return !1; if (a = Math.max(0, Math.min(1, a)), c.masterVolume = a, !this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(a)) for (var b = this.instances, e = 0, g = b.length; g > e; e++) b[e].setMasterVolume(a) }; c.getVolume = function () { return c.masterVolume }; c.setMute = function (a) { if (null == a || void 0 == a) return !1; if (this.masterMute = a, !this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(a)) for (var b = this.instances, c = 0, g = b.length; g > c; c++) b[c].setMasterMute(a); return !0 }; c.getMute = function () { return this.masterMute }; c.stop = function () { for (var a = this.instances, b = a.length; b--;) a[b].stop() }; c.playInstance = function (a, b, e, g, k, m, n) { if (b instanceof Object && (e = b.delay, g = b.offset, k = b.loop, m = b.volume, n = b.pan), b = b || c.defaultInterruptBehavior, null == e && (e = 0), null == g && (g = a.getPosition()), null == k && (k = 0), null == m && (m = a.volume), null == n && (n = a.pan), 0 == e) { if (!c.beginPlaying(a, b, g, k, m, n)) return !1 } else e = setTimeout(function () { c.beginPlaying(a, b, g, k, m, n) }, e), a.delayTimeoutId = e; return this.instances.push(a), !0 }; c.beginPlaying = function (b, c, e, g, k, m) { return a.add(b, c) ? b.beginPlaying(e, g, k, m) ? !0 : (b = createjs.indexOf(this.instances, b), -1 < b && this.instances.splice(b, 1), !1) : !1 }; c.getSrcById = function (a) { return null == c.idHash || null == c.idHash[a] ? a : c.idHash[a] }; c.playFinished = function (b) { a.remove(b); b = createjs.indexOf(this.instances, b); - 1 < b && this.instances.splice(b, 1) }; createjs.Sound = c; a.channels = {}; a.create = function (b, c) { return null == a.get(b) ? (a.channels[b] = new a(b, c), !0) : !1 }; a.removeSrc = function (b) { var c = a.get(b); return null == c ? !1 : (c.removeAll(), delete a.channels[b], !0) }; a.removeAll = function () { for (var b in a.channels) a.channels[b].removeAll(); a.channels = {} }; a.add = function (b, c) { var e = a.get(b.src); return null == e ? !1 : e.add(b, c) }; a.remove = function (b) { var c = a.get(b.src); return null == c ? !1 : (c.remove(b), !0) }; a.maxPerChannel = function () { return g.maxDefault }; a.get = function (b) { return a.channels[b] }; var g = a.prototype; g.src = null; g.max = null; g.maxDefault = 100; g.length = 0; g.init = function (a, b) { this.src = a; this.max = b || this.maxDefault; - 1 == this.max && this.max == this.maxDefault; this.instances = [] }; g.get = function (a) { return this.instances[a] }; g.add = function (a, b) { return this.getSlot(b, a) ? (this.instances.push(a), this.length++, !0) : !1 }; g.remove = function (a) { a = createjs.indexOf(this.instances, a); return -1 == a ? !1 : (this.instances.splice(a, 1), this.length--, !0) }; g.removeAll = function () { for (var a = this.length - 1; 0 <= a; a--) this.instances[a].stop() }; g.getSlot = function (a) { for (var b, e, g = 0, k = this.max; k > g; g++) { if (b = this.get(g), null == b) return !0; (a != c.INTERRUPT_NONE || b.playState == c.PLAY_FINISHED) && (0 != g ? b.playState == c.PLAY_FINISHED || b.playState == c.PLAY_INTERRUPTED || b.playState == c.PLAY_FAILED ? e = b : (a == c.INTERRUPT_EARLY && b.getPosition() < e.getPosition() || a == c.INTERRUPT_LATE && b.getPosition() > e.getPosition()) && (e = b) : e = b) } return null != e ? (e.interrupt(), this.remove(e), !0) : !1 }; g.toString = function () { return "[Sound SoundChannel]" }; c.defaultSoundInstance = new function () { this.isDefault = !0; this.addEventListener = this.removeEventListener = this.removeAllEventListener = this.dispatchEvent = this.hasEventListener = this._listeners = this.interrupt = this.playFailed = this.pause = this.resume = this.play = this.beginPlaying = this.cleanUp = this.stop = this.setMasterVolume = this.setVolume = this.mute = this.setMute = this.getMute = this.setPan = this.getPosition = this.setPosition = function () { return !1 }; this.getVolume = this.getPan = this.getDuration = function () { return 0 }; this.playState = c.PLAY_FAILED; this.toString = function () { return "[Sound Default Sound Instance]" } }; null == createjs.proxy && (createjs.proxy = function () { throw "Proxy has been moved to an external file, and must be included separately."; }); b.init = function () { var a = window.navigator.userAgent; b.isFirefox = -1 < a.indexOf("Firefox"); b.isOpera = null != window.opera; b.isChrome = -1 < a.indexOf("Chrome"); b.isIOS = -1 < a.indexOf("iPod") || -1 < a.indexOf("iPhone") || -1 < a.indexOf("iPad"); b.isAndroid = -1 < a.indexOf("Android"); b.isBlackberry = -1 < a.indexOf("Blackberry") }; b.init(); createjs.Sound.BrowserDetect = b })(); this.createjs = this.createjs || {}; (function () { function c() { this.init() } c.capabilities = null; c.isSupported = function () { var a = createjs.Sound.BrowserDetect.isIOS || createjs.Sound.BrowserDetect.isAndroid || createjs.Sound.BrowserDetect.isBlackberry; return "file:" != location.protocol || a || this.isFileXHRSupported() ? (c.generateCapabilities(), null == c.context ? !1 : !0) : !1 }; c.isFileXHRSupported = function () { var a = !0, c = new XMLHttpRequest; try { c.open("GET", "fail.fail", !1) } catch (f) { return a = !1 } c.onerror = function () { a = !1 }; c.onload = function () { a = 404 == this.status || 200 == this.status || 0 == this.status && "" != this.response }; try { c.send() } catch (d) { a = !1 } return a }; c.generateCapabilities = function () { if (null == c.capabilities) { var a = document.createElement("audio"); if (null == a.canPlayType) return null; if (window.webkitAudioContext) c.context = new webkitAudioContext; else { if (!window.AudioContext) return null; c.context = new AudioContext } c.compatibilitySetUp(); c.playEmptySound(); c.capabilities = { panning: !0, volume: !0, tracks: -1 }; for (var g = createjs.Sound.SUPPORTED_EXTENSIONS, f = createjs.Sound.EXTENSION_MAP, d = 0, e = g.length; e > d; d++) { var h = g[d], k = f[h] || h; c.capabilities[h] = "no" != a.canPlayType("audio/" + h) && "" != a.canPlayType("audio/" + h) || "no" != a.canPlayType("audio/" + k) && "" != a.canPlayType("audio/" + k) } 2 > c.context.destination.numberOfChannels && (c.capabilities.panning = !1); c.dynamicsCompressorNode = c.context.createDynamicsCompressor(); c.dynamicsCompressorNode.connect(c.context.destination); c.gainNode = c.context.createGain(); c.gainNode.connect(c.dynamicsCompressorNode) } }; c.compatibilitySetUp = function () { if (!c.context.createGain) { c.context.createGain = c.context.createGainNode; var a = c.context.createBufferSource(); a.__proto__.start = a.__proto__.noteGrainOn; a.__proto__.stop = a.__proto__.noteOff; this.panningModel = 0 } }; c.playEmptySound = function () { var a = this.context.createBuffer(1, 1, 22050), c = this.context.createBufferSource(); c.buffer = a; c.connect(this.context.destination); c.start(0, 0, 0) }; var a = c.prototype; a.capabilities = null; a.volume = 1; a.context = null; a.panningModel = "equalpower"; a.dynamicsCompressorNode = null; a.gainNode = null; a.arrayBuffers = null; a.init = function () { this.capabilities = c.capabilities; this.arrayBuffers = {}; this.context = c.context; this.gainNode = c.gainNode; this.dynamicsCompressorNode = c.dynamicsCompressorNode }; a.register = function (a) { this.arrayBuffers[a] = !0; return { tag: new createjs.WebAudioPlugin.Loader(a, this) } }; a.isPreloadStarted = function (a) { return null != this.arrayBuffers[a] }; a.isPreloadComplete = function (a) { return !(null == this.arrayBuffers[a] || 1 == this.arrayBuffers[a]) }; a.removeFromPreload = function (a) { delete this.arrayBuffers[a] }; a.removeSound = function (a) { delete this.arrayBuffers[a] }; a.removeAllSounds = function () { this.arrayBuffers = {} }; a.addPreloadResults = function (a, c) { this.arrayBuffers[a] = c }; a.handlePreloadComplete = function () { createjs.Sound.sendFileLoadEvent(this.src) }; a.preload = function (a, c, f) { this.arrayBuffers[a] = !0; a = new createjs.WebAudioPlugin.Loader(a, this); a.onload = this.handlePreloadComplete; null != f && (a.src = f + a.src); a.load() }; a.create = function (a) { return this.isPreloadStarted(a) || this.preload(a), new createjs.WebAudioPlugin.SoundInstance(a, this) }; a.setVolume = function (a) { return this.volume = a, this.updateVolume(), !0 }; a.updateVolume = function () { var a = createjs.Sound.masterMute ? 0 : this.volume; a != this.gainNode.gain.value && (this.gainNode.gain.value = a) }; a.getVolume = function () { return this.volume }; a.setMute = function () { return this.updateVolume(), !0 }; a.toString = function () { return "[WebAudioPlugin]" }; createjs.WebAudioPlugin = c })(); (function () { function c(a, c) { this.init(a, c) } var a = c.prototype; a.src = null; a.uniqueId = -1; a.playState = null; a.owner = null; a.offset = 0; a.delay = 0; a._volume = 1; Object.defineProperty(a, "volume", { get: function () { return this._volume }, set: function (a) { return null == Number(a) ? !1 : (a = Math.max(0, Math.min(1, a)), this._volume = a, this.updateVolume(), void 0) } }); a._pan = 0; Object.defineProperty(a, "pan", { get: function () { return this._pan }, set: function (a) { return this.owner.capabilities.panning && null != Number(a) ? (a = Math.max(-1, Math.min(1, a)), this._pan = a, this.panNode.setPosition(a, 0, -0.5), void 0) : !1 } }); a.duration = 0; a.remainingLoops = 0; a.delayTimeoutId = null; a.soundCompleteTimeout = null; a.panNode = null; a.gainNode = null; a.sourceNode = null; a.sourceNodeNext = null; a.muted = !1; a.paused = !1; a.startTime = 0; a.addEventListener = null; a.removeEventListener = null; a.removeAllEventListeners = null; a.dispatchEvent = null; a.hasEventListener = null; a._listeners = null; a.endedHandler = null; a.readyHandler = null; a.stalledHandler = null; a.sendEvent = function (a) { a = new createjs.Event(a); this.dispatchEvent(a) }; a.init = function (a, c) { this.owner = c; this.src = a; this.panNode = this.owner.context.createPanner(); this.panNode.panningModel = this.owner.panningModel; this.gainNode = this.owner.context.createGain(); this.gainNode.connect(this.panNode); this.owner.isPreloadComplete(this.src) && (this.duration = 1E3 * this.owner.arrayBuffers[this.src].duration); this.endedHandler = createjs.proxy(this.handleSoundComplete, this); this.readyHandler = createjs.proxy(this.handleSoundReady, this); this.stalledHandler = createjs.proxy(this.handleSoundStalled, this) }; a.cleanUp = function () { this.sourceNode && this.sourceNode.playbackState != this.sourceNode.UNSCHEDULED_STATE && (this.sourceNode = this.cleanUpAudioNode(this.sourceNode), this.sourceNodeNext = this.cleanUpAudioNode(this.sourceNodeNext)); 0 != this.panNode.numberOfOutputs && this.panNode.disconnect(0); clearTimeout(this.delayTimeoutId); clearTimeout(this.soundCompleteTimeout); this.startTime = 0; null != window.createjs && createjs.Sound.playFinished(this) }; a.cleanUpAudioNode = function (a) { return a && (a.stop(0), a.disconnect(this.gainNode), a = null), a }; a.interrupt = function () { this.playState = createjs.Sound.PLAY_INTERRUPTED; this.cleanUp(); this.paused = !1; this.sendEvent("interrupted") }; a.handleSoundStalled = function () { this.sendEvent("failed") }; a.handleSoundReady = function () { if (null != window.createjs) { if (1E3 * this.offset > this.getDuration()) return this.playFailed(), void 0; 0 > this.offset && (this.offset = 0); this.playState = createjs.Sound.PLAY_SUCCEEDED; this.paused = !1; this.panNode.connect(this.owner.gainNode); var a = this.owner.arrayBuffers[this.src].duration; this.sourceNode = this.createAndPlayAudioNode(this.owner.context.currentTime - a, this.offset); this.duration = 1E3 * a; this.startTime = this.sourceNode.startTime - this.offset; this.soundCompleteTimeout = setTimeout(this.endedHandler, 1E3 * (a - this.offset)); 0 != this.remainingLoops && (this.sourceNodeNext = this.createAndPlayAudioNode(this.startTime, 0)) } }; a.createAndPlayAudioNode = function (a, c) { var f = this.owner.context.createBufferSource(); return f.buffer = this.owner.arrayBuffers[this.src], f.connect(this.gainNode), this.owner.context.currentTime, f.startTime = a + f.buffer.duration, f.start(f.startTime, c, f.buffer.duration - c), f }; a.play = function (a, c, f, d, e, h) { this.cleanUp(); createjs.Sound.playInstance(this, a, c, f, d, e, h) }; a.beginPlaying = function (a, c, f, d) { return null != window.createjs && this.src ? (this.offset = a / 1E3, this.remainingLoops = c, this.volume = f, this.pan = d, this.owner.isPreloadComplete(this.src) ? (this.handleSoundReady(null), this.sendEvent("succeeded"), 1) : (this.playFailed(), void 0)) : void 0 }; a.pause = function () { return this.paused || this.playState != createjs.Sound.PLAY_SUCCEEDED ? !1 : (this.paused = !0, this.offset = this.owner.context.currentTime - this.startTime, this.cleanUpAudioNode(this.sourceNode), this.cleanUpAudioNode(this.sourceNodeNext), 0 != this.panNode.numberOfOutputs && this.panNode.disconnect(), clearTimeout(this.delayTimeoutId), clearTimeout(this.soundCompleteTimeout), !0) }; a.resume = function () { return this.paused ? (this.handleSoundReady(null), !0) : !1 }; a.stop = function () { return this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), this.offset = 0, !0 }; a.setVolume = function (a) { return this.volume = a, !0 }; a.updateVolume = function () { var a = this.muted ? 0 : this._volume; return a != this.gainNode.gain.value ? (this.gainNode.gain.value = a, !0) : !1 }; a.getVolume = function () { return this.volume }; a.setMute = function (a) { return null == a || void 0 == a ? !1 : (this.muted = a, this.updateVolume(), !0) }; a.getMute = function () { return this.muted }; a.setPan = function (a) { return this.pan = a, this.pan != a ? !1 : void 0 }; a.getPan = function () { return this.pan }; a.getPosition = function () { return 1E3 * (this.paused || null == this.sourceNode ? this.offset : this.owner.context.currentTime - this.startTime) }; a.setPosition = function (a) { return this.offset = a / 1E3, this.sourceNode && this.sourceNode.playbackState != this.sourceNode.UNSCHEDULED_STATE && (this.cleanUpAudioNode(this.sourceNode), this.cleanUpAudioNode(this.sourceNodeNext), clearTimeout(this.soundCompleteTimeout)), this.paused || this.playState != createjs.Sound.PLAY_SUCCEEDED || this.handleSoundReady(null), !0 }; a.getDuration = function () { return this.duration }; a.handleSoundComplete = function () { return this.offset = 0, 0 != this.remainingLoops ? (this.remainingLoops--, this.sourceNodeNext ? (this.cleanUpAudioNode(this.sourceNode), this.sourceNode = this.sourceNodeNext, this.startTime = this.sourceNode.startTime, this.sourceNodeNext = this.createAndPlayAudioNode(this.startTime, 0), this.soundCompleteTimeout = setTimeout(this.endedHandler, this.duration)) : this.handleSoundReady(null), this.sendEvent("loop"), void 0) : (null != window.createjs && (this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), this.sendEvent("complete")), void 0) }; a.playFailed = function () { null != window.createjs && (this.playState = createjs.Sound.PLAY_FAILED, this.cleanUp(), this.sendEvent("failed")) }; a.toString = function () { return "[WebAudioPlugin SoundInstance]" }; createjs.EventDispatcher.initialize(c.prototype); createjs.WebAudioPlugin.SoundInstance = c })(); (function () { function c(a, c) { this.init(a, c) } var a = c.prototype; a.request = null; a.owner = null; a.progress = -1; a.src = null; a.originalSrc = null; a.result = null; a.onload = null; a.onprogress = null; a.onError = null; a.init = function (a, c) { this.originalSrc = this.src = a; this.owner = c }; a.load = function (a) { null != a && (this.src = a); this.request = new XMLHttpRequest; this.request.open("GET", this.src, !0); this.request.responseType = "arraybuffer"; this.request.onload = createjs.proxy(this.handleLoad, this); this.request.onError = createjs.proxy(this.handleError, this); this.request.onprogress = createjs.proxy(this.handleProgress, this); this.request.send() }; a.handleProgress = function (a, c) { this.progress = a / c; null != this.onprogress && this.onprogress({ loaded: a, total: c, progress: this.progress }) }; a.handleLoad = function () { this.owner.context.decodeAudioData(this.request.response, createjs.proxy(this.handleAudioDecoded, this), createjs.proxy(this.handleError, this)) }; a.handleAudioDecoded = function (a) { this.progress = 1; this.result = a; this.src = this.originalSrc; this.owner.addPreloadResults(this.src, this.result); this.onload && this.onload() }; a.handleError = function (a) { this.owner.removeSound(this.src); this.onerror && this.onerror(a) }; a.toString = function () { return "[WebAudioPlugin Loader]" }; createjs.WebAudioPlugin.Loader = c })(); this.createjs = this.createjs || {}; (function () { function c() { this.init() } c.MAX_INSTANCES = 30; c.capabilities = null; c.AUDIO_READY = "canplaythrough"; c.AUDIO_ENDED = "ended"; c.AUDIO_SEEKED = "seeked"; c.AUDIO_ERROR = "error"; c.AUDIO_STALLED = "stalled"; c.enableIOS = !1; c.isSupported = function () { if (createjs.Sound.BrowserDetect.isIOS && !c.enableIOS) return !1; c.generateCapabilities(); return null == c.tag || null == c.capabilities ? !1 : !0 }; c.generateCapabilities = function () { if (null == c.capabilities) { var a = c.tag = document.createElement("audio"); if (null == a.canPlayType) return null; c.capabilities = { panning: !0, volume: !0, tracks: -1 }; for (var g = createjs.Sound.SUPPORTED_EXTENSIONS, f = createjs.Sound.EXTENSION_MAP, d = 0, e = g.length; e > d; d++) { var h = g[d], k = f[h] || h; c.capabilities[h] = "no" != a.canPlayType("audio/" + h) && "" != a.canPlayType("audio/" + h) || "no" != a.canPlayType("audio/" + k) && "" != a.canPlayType("audio/" + k) } } }; var a = c.prototype; a.capabilities = null; a.audioSources = null; a.defaultNumChannels = 2; a.loadedHandler = null; a.init = function () { this.capabilities = c.capabilities; this.audioSources = {} }; a.register = function (a, c) { this.audioSources[a] = !0; for (var f = createjs.HTMLAudioPlugin.TagPool.get(a), d = null, e = c || this.defaultNumChannels, h = 0; e > h; h++) d = this.createTag(a), f.add(d); if (d.id = a, this.loadedHandler = createjs.proxy(this.handleTagLoad, this), d.addEventListener && d.addEventListener("canplaythrough", this.loadedHandler), null == d.onreadystatechange) d.onreadystatechange = this.loadedHandler; else { var k = d.onreadystatechange; d.onreadystatechange = function () { k(); this.loadedHandler() } } return { tag: d, numChannels: e } }; a.handleTagLoad = function (a) { a.target.removeEventListener && a.target.removeEventListener("canplaythrough", this.loadedHandler); a.target.onreadystatechange = null; a.target.src != a.target.id && createjs.HTMLAudioPlugin.TagPool.checkSrc(a.target.id) }; a.createTag = function (a) { var c = document.createElement("audio"); return c.autoplay = !1, c.preload = "none", c.src = a, c }; a.removeSound = function (a) { delete this.audioSources[a]; createjs.HTMLAudioPlugin.TagPool.remove(a) }; a.removeAllSounds = function () { this.audioSources = {}; createjs.HTMLAudioPlugin.TagPool.removeAll() }; a.create = function (a) { if (!this.isPreloadStarted(a)) { var c = createjs.HTMLAudioPlugin.TagPool.get(a), f = this.createTag(a); f.id = a; c.add(f); this.preload(a, { tag: f }) } return new createjs.HTMLAudioPlugin.SoundInstance(a, this) }; a.isPreloadStarted = function (a) { return null != this.audioSources[a] }; a.preload = function (a, c, f) { this.audioSources[a] = !0; null != f && (c.tag.src = f + a); new createjs.HTMLAudioPlugin.Loader(a, c.tag) }; a.toString = function () { return "[HTMLAudioPlugin]" }; createjs.HTMLAudioPlugin = c })(); (function () { function c(a, c) { this.init(a, c) } var a = c.prototype; a.src = null; a.uniqueId = -1; a.playState = null; a.owner = null; a.loaded = !1; a.offset = 0; a.delay = 0; a._volume = 1; Object.defineProperty(a, "volume", { get: function () { return this._volume }, set: function (a) { null != Number(a) && (a = Math.max(0, Math.min(1, a)), this._volume = a, this.updateVolume()) } }); a.pan = 0; a.duration = 0; a.remainingLoops = 0; a.delayTimeoutId = null; a.tag = null; a.muted = !1; a.paused = !1; a.addEventListener = null; a.removeEventListener = null; a.removeAllEventListeners = null; a.dispatchEvent = null; a.hasEventListener = null; a._listeners = null; a.endedHandler = null; a.readyHandler = null; a.stalledHandler = null; a.loopHandler = null; a.init = function (a, c) { this.src = a; this.owner = c; this.endedHandler = createjs.proxy(this.handleSoundComplete, this); this.readyHandler = createjs.proxy(this.handleSoundReady, this); this.stalledHandler = createjs.proxy(this.handleSoundStalled, this); this.loopHandler = createjs.proxy(this.handleSoundLoop, this) }; a.sendEvent = function (a) { a = new createjs.Event(a); this.dispatchEvent(a) }; a.cleanUp = function () { var a = this.tag; if (null != a) { a.pause(); a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, !1); a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, !1); a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1); try { a.currentTime = 0 } catch (c) {} createjs.HTMLAudioPlugin.TagPool.setInstance(this.src, a); this.tag = null } clearTimeout(this.delayTimeoutId); null != window.createjs && createjs.Sound.playFinished(this) }; a.interrupt = function () { null != this.tag && (this.playState = createjs.Sound.PLAY_INTERRUPTED, this.cleanUp(), this.paused = !1, this.sendEvent("interrupted")) }; a.play = function (a, c, f, d, e, h) { this.cleanUp(); createjs.Sound.playInstance(this, a, c, f, d, e, h) }; a.beginPlaying = function (a, c, f, d) { if (null == window.createjs) return -1; var e = this.tag = createjs.HTMLAudioPlugin.TagPool.getInstance(this.src); return null == e ? (this.playFailed(), -1) : (e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, !1), this.offset = a, this.volume = f, this.pan = d, this.updateVolume(), this.remainingLoops = c, 4 !== e.readyState ? (e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, !1), e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_STALLED, this.stalledHandler, !1), e.preload = "auto", e.load()) : this.handleSoundReady(null), this.sendEvent("succeeded"), 1) }; a.handleSoundStalled = function () { this.cleanUp(); this.sendEvent("failed") }; a.handleSoundReady = function () { if (null != window.createjs) { if (this.duration = 1E3 * this.tag.duration, this.playState = createjs.Sound.PLAY_SUCCEEDED, this.paused = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, !1), this.offset >= this.getDuration()) return this.playFailed(), void 0; 0 < this.offset && (this.tag.currentTime = 0.0010 * this.offset); - 1 == this.remainingLoops && (this.tag.loop = !0); 0 != this.remainingLoops && (this.tag.addEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1), this.tag.loop = !0); this.tag.play() } }; a.pause = function () { return this.paused || this.playState != createjs.Sound.PLAY_SUCCEEDED || null == this.tag ? !1 : (this.paused = !0, this.tag.pause(), clearTimeout(this.delayTimeoutId), !0) }; a.resume = function () { return this.paused && null != this.tag ? (this.paused = !1, this.tag.play(), !0) : !1 }; a.stop = function () { return this.offset = 0, this.pause(), this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), !0 }; a.setMasterVolume = function () { return this.updateVolume(), !0 }; a.setVolume = function (a) { return this.volume = a, !0 }; a.updateVolume = function () { if (null != this.tag) { var a = this.muted || createjs.Sound.masterMute ? 0 : this._volume * createjs.Sound.masterVolume; return a != this.tag.volume && (this.tag.volume = a), !0 } return !1 }; a.getVolume = function () { return this.volume }; a.setMasterMute = function () { return this.updateVolume(), !0 }; a.setMute = function (a) { return null == a || void 0 == a ? !1 : (this.muted = a, this.updateVolume(), !0) }; a.getMute = function () { return this.muted }; a.setPan = function () { return !1 }; a.getPan = function () { return 0 }; a.getPosition = function () { return null == this.tag ? this.offset : 1E3 * this.tag.currentTime }; a.setPosition = function (a) { if (null == this.tag) this.offset = a; else { this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1); try { this.tag.currentTime = 0.0010 * a } catch (c) { return !1 } this.tag.addEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1) } return !0 }; a.getDuration = function () { return this.duration }; a.handleSoundComplete = function () { this.offset = 0; null != window.createjs && (this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), this.sendEvent("complete")) }; a.handleSoundLoop = function () { this.offset = 0; this.remainingLoops--; 0 == this.remainingLoops && (this.tag.loop = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1)); this.sendEvent("loop") }; a.playFailed = function () { null != window.createjs && (this.playState = createjs.Sound.PLAY_FAILED, this.cleanUp(), this.sendEvent("failed")) }; a.toString = function () { return "[HTMLAudioPlugin SoundInstance]" }; createjs.EventDispatcher.initialize(c.prototype); createjs.HTMLAudioPlugin.SoundInstance = c })(); (function () { function c(a, c) { this.init(a, c) } var a = c.prototype; a.src = null; a.tag = null; a.preloadTimer = null; a.loadedHandler = null; a.init = function (a, c) { if (this.src = a, this.tag = c, this.preloadTimer = setInterval(createjs.proxy(this.preloadTick, this), 200), this.loadedHandler = createjs.proxy(this.sendLoadedEvent, this), this.tag.addEventListener && this.tag.addEventListener("canplaythrough", this.loadedHandler), null == this.tag.onreadystatechange) this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this); else { var f = this.tag.onreadystatechange; this.tag.onreadystatechange = function () { f(); this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this) } } this.tag.preload = "auto"; this.tag.load() }; a.preloadTick = function () { var a = this.tag.buffered, c = this.tag.duration; 0 < a.length && a.end(0) >= c - 1 && this.handleTagLoaded() }; a.handleTagLoaded = function () { clearInterval(this.preloadTimer) }; a.sendLoadedEvent = function () { this.tag.removeEventListener && this.tag.removeEventListener("canplaythrough", this.loadedHandler); this.tag.onreadystatechange = null; createjs.Sound.sendFileLoadEvent(this.src) }; a.toString = function () { return "[HTMLAudioPlugin Loader]" }; createjs.HTMLAudioPlugin.Loader = c })(); (function () { function c(a) { this.init(a) } c.tags = {}; c.get = function (a) { var g = c.tags[a]; return null == g && (g = c.tags[a] = new c(a)), g }; c.remove = function (a) { var g = c.tags[a]; return null == g ? !1 : (g.removeAll(), delete c.tags[a], !0) }; c.removeAll = function () { for (var a in c.tags) c.tags[a].removeAll(); c.tags = {} }; c.getInstance = function (a) { a = c.tags[a]; return null == a ? null : a.get() }; c.setInstance = function (a, g) { var f = c.tags[a]; return null == f ? null : f.set(g) }; c.checkSrc = function (a) { a = c.tags[a]; return null == a ? null : (a.checkSrcChange(), void 0) }; var a = c.prototype; a.src = null; a.length = 0; a.available = 0; a.tags = null; a.init = function (a) { this.src = a; this.tags = [] }; a.add = function (a) { this.tags.push(a); this.length++; this.available++ }; a.removeAll = function () { for (; this.length--;) delete this.tags[this.length]; this.src = null; this.tags.length = 0 }; a.get = function () { if (0 == this.tags.length) return null; this.available = this.tags.length; var a = this.tags.pop(); return null == a.parentNode && document.body.appendChild(a), a }; a.set = function (a) { -1 == createjs.indexOf(this.tags, a) && this.tags.push(a); this.available = this.tags.length }; a.checkSrcChange = function () { for (var a = this.tags.length - 1, c = this.tags[a].src; a--;) this.tags[a].src = c }; a.toString = function () { return "[HTMLAudioPlugin TagPool]" }; createjs.HTMLAudioPlugin.TagPool = c })(); (function (c) { c.hideAddressbar = function (a) { a = "string" === typeof a ? document.querySelector(a) : a; var b = navigator.userAgent, g = ~b.indexOf("iPhone") || ~b.indexOf("iPod"), f = ~b.indexOf("iPad"), d = g || f, e = ~b.indexOf("Android"), h = c.navigator.standalone, k = 0; (d || e) && a && (e && c.addEventListener("scroll", function () { a.style.height = c.innerHeight + "px" }, !1), function n() { var b = a.offsetWidth; k !== b && (k = b, b = 0, d ? (b = document.documentElement.clientHeight, g && !h && (b += 60)) : e && (b = c.innerHeight + 56), a.style.height = b + "px", setTimeout(scrollTo, 0, 0, 1), c.addEventListener("resize", n, !1), console.log("resizefunt")) }()) } })(this); function isArrayContains(c, a) { return -1 < c.indexOf(a) } function addToArray(c, a) { isArrayContains(c, a) || c.push(a) } function removeFromArray(c, a) { isArrayContains(c, a) && c.splice(c.indexOf(a, 0), 1) } function setCacheFromOther(c, a) { c.cacheCanvas = a.cacheCanvas; c.cacheID = a.cacheID; c._cacheWidth = a._cacheWidth; c._cacheHeight = a._cacheHeight; c._cacheOffsetX = a._cacheOffsetX; c._cacheOffsetY = a._cacheOffsetY; c._cacheScale = a._cacheScale } function deleteCache(c) { c.cacheCanvas = null; c.cacheID = 0 } function trace(c) { isLevelEditor && console.log(c) } function onHoverScale(c) { c.scaleX = c.scaleY = 1.2 * spriteScale * (c.defaultScale ? c.defaultScale : 1) } function onOutScale(c) { c.scaleX = c.scaleY = spriteScale * (c.defaultScale ? c.defaultScale : 1) } function removeFromParent(c) { c.parent && c.parent.removeChild(c) } function addToParent(c, a) { removeFromParent(c); a && a.addChild(c) } function setSpriteScale(c, a) { c.scaleX = c.scaleY = a } function setTextAndCenter(c, a, b, g) { g.text != b && (g.text = b, b = g.getBounds(), g.x = c - (b.width >> 1) * g.scaleX, a && (g.y = a - (b.height >> 1) * g.scaleY)) } function setAnimationSpeed(c, a) { c._animation.speed = a } function setNextAnimation(c, a) { c._animation.next = a } function randomizeAnimFrame(c) { c.currentAnimationFrame = Math.floor(30 * Math.random()) } var spilLogo, logoDefaultY = 0, logoDefaultX = 0, currentLogoHorizPos = 0, currentLogoVertPos = 0, LOGO_TOP_POS = 0, LOGO_BOTTOM_POS = 1, LOGO_VERTICAL_ANY_POS = 2, LOGO_LEFT_POS = 3, LOGO_RIGHT_POS = 4, LOGO_HORIZ_ANY_POS = 5, logoPosDivisor = 1, sponsorLogoFrame = "splashlogo"; function createSponsorLogo() { spilLogo = createButton(160, 322, 0.8, sponsorLogoFrame, sponsorClick, null, null) } function showSponsorLogo(c, a, b, g, f, d, e, h) { spilLogo || createSponsorLogo(); isSponsorLogoError || (addToParent(spilLogo, g), logoDefaultY = a, logoDefaultX = c, currentLogoHorizPos = d, currentLogoVertPos = e, spilLogo.scaleX = spilLogo.scaleY = b, spilLogo.alpha = f ? f : 1, logoPosDivisor = h, updateLogoPos(), (c = zoeSS.getAnimation(sponsorLogoFrame)) && c.frames && 0 < c.frames.length && (c = zoeSS.getFrameBounds(c.frames[0]), spilLogo.setBoundingBox(c.x * b, c.y * b, c.width * b, c.height * b))) } function updateLogoPos() { spilLogo && !isSponsorLogoError && (spilLogo.x = logoDefaultX, spilLogo.y = logoDefaultY, currentLogoHorizPos === LOGO_LEFT_POS ? spilLogo.x += deltaForHLeft() : currentLogoHorizPos === LOGO_RIGHT_POS && (spilLogo.x -= deltaForHLeft()), currentLogoVertPos === LOGO_TOP_POS ? spilLogo.y += deltaForVTop() / logoPosDivisor : currentLogoVertPos === LOGO_BOTTOM_POS && (spilLogo.y -= deltaForVTop() / logoPosDivisor)) } var isAdPauseSoundMuted = !1; function startSponsorAds() { sponsorApi && (isAdPauseSoundMuted = isMute, sponsorApi.GameBreak.request(onAdBeginPause, onAdEndUnpause)) } function onAdBeginPause() { trace("ad pause, , sound is muted: " + isMute); isAdPauseSoundMuted = isMute; isMute = !0; stopBgMusic(); stopWindSound() } function onAdEndUnpause() { trace("ad unpause, sound was muted: " + isAdPauseSoundMuted); (isMute = isAdPauseSoundMuted) || playBgMusic() } function showTopLogo(c) { showSponsorLogo(160, 26, 0.7 * c, container, 1, LOGO_HORIZ_ANY_POS, LOGO_TOP_POS, 2) } function initSpilApi() { try { trace(GameAPI), GameAPI.loadAPI(function (a) { sponsorApi = a; logoConfig = sponsorApi.Branding.getLogo(); showPreloaderLogo(); isLogoReady = !0; trace(GameAPI.Branding.getLinks("more_games")); trace("list"); trace(sponsorApi.Branding.getLogo()) }) } catch (c) { trace("init api fail!"), isSponsorLogoError = !0, isAllFilesLoaded && startGame() } } function handleFileLoadError(c) { trace("Logo loading error!"); isSponsorLogoError = !0 } var isSponsorLogoError = !1; function handleSponsorLogoComplete(c) { if (!isSponsorLogoError) try { spilLogo || createSponsorLogo(); trace("logo loaded!"); var a = files.sponsorLogoImg, b = sponsorLogoDefWidth = a.width, g = sponsorLogoDefHeight = a.height, f = sponsorLogoBitmap = (new createjs.Bitmap(a)) .set({ scaleX: 1, scaleY: 1, regX: 0, regY: 0, cursor: "pointer", x: 0, y: 0 }); f.isOnlyBoundsCheck = !0; f.setBoundingBox(0, 0, 1 * b, 1 * g); f.addEventListener("mousedown", sponsorClick); spilLogo.addChild(f); loaderBar && showSponsorLogo(160, 80, 1, loaderBar, 1, LOGO_HORIZ_ANY_POS, LOGO_VERTICAL_ANY_POS, 2); isLogoReady = !0 } catch (d) { isSponsorLogoError = !0, trace("logo error!") } isAllFilesLoaded && startGame() } var logoConfig, sponsorLogoBitmap, sponsorPreload, sponsorLogoDefWidth = 1, sponsorLogoDefHeight = 1, sponsorApi, isLogoReady = !1, isGameInited = !1; (function (c, a) { function b() { function b() { var c; c = a("amd"); c.fork = b; return c } return b() } function g() { function b() { var d, e = [], g = {}; d = a("global"); d.fork = b; d.noConflict = function () { var a, b; b = Array.prototype.slice.apply(arguments); for (a = 0; a < e.length; a += 1) "undefined" === typeof g[e[a]] ? delete c[e[a]] : c[e[a]] = g[e[a]]; g = {}; for (a = 0; a < b.length; a += 1) { if ("string" !== typeof b[a]) throw Error("Cannot replace namespaces. All new namespaces must be strings."); g[b[a]] = c[b[a]]; c[b[a]] = d } return e = b }; return d } b() .noConflict("KeyboardJS", "k") }[].indexOf || (Array.prototype.indexOf = function (a, b, c) { c = this.length; for (b = (c + ~~b) % c; b < c && (!(b in this) || this[b] !== a); b++); return b ^ c ? b : -1 }); "function" === typeof define && define.amd ? define(b) : g() })(this, function (c) { function a() { window.addEventListener ? (document.addEventListener("keydown", g, !1), document.addEventListener("keyup", f, !1), window.addEventListener("blur", b, !1), window.addEventListener("webkitfullscreenchange", b, !1), window.addEventListener("mozfullscreenchange", b, !1)) : window.attachEvent && (document.attachEvent("onkeydown", g), document.attachEvent("onkeyup", f), window.attachEvent("onblur", b)) } function b(a) { z = []; h(); k(a) } function g(a) { var b, c; b = d(a.keyCode); if (!(1 > b.length)) { for (c = 0; c < b.length; c += 1) q(b[c]); for (b = 0; b < C.length; b += 1) if (c = r(C[b][0]), -1 === P.indexOf(C[b]) && n(c)) for (P.push(C[b]), c = 0; c < C[b][1].length; c += 1) q(C[b][1][c]); var e, f, g, h, k, m, s = []; c = [].concat(z); for (b = 0; b < F.length; b += 1) e = p(F[b].keyCombo) .length, s[e] || (s[e] = []), s[e].push(F[b]); for (e = s.length - 1; 0 <= e; e -= 1) if (s[e]) for (b = 0; b < s[e].length; b += 1) { f = s[e][b]; g = p(f.keyCombo); m = !0; for (k = 0; k < g.length; k += 1) if (-1 === c.indexOf(g[k])) { m = !1; break } if (m && n(f.keyCombo)) { J.push(f); for (k = 0; k < g.length; k += 1) m = c.indexOf(g[k]), -1 < m && (c.splice(m, 1), k -= 1); for (g = 0; g < f.keyDownCallback.length; g += 1)!1 === f.keyDownCallback[g](a, t(), f.keyCombo) && (h = !0); !0 === h && (a.preventDefault(), a.stopPropagation()) } } } } function f(a) { var b, c; b = d(a.keyCode); if (!(1 > b.length)) { for (c = 0; c < b.length; c += 1) w(b[c]); h(); k(a) } } function d(a) { return y[a] || [] } function e(a) { for (var b in y) if (y.hasOwnProperty(b) && -1 < y[b].indexOf(a)) return b; return !1 } function h() { var a, b; for (a = 0; a < P.length; a += 1) if (b = r(P[a][0]), !1 === n(b)) { for (b = 0; b < P[a][1].length; b += 1) w(P[a][1][b]); P.splice(a, 1); a -= 1 } } function k(a) { var b, c, d, e; for (b = 0; b < J.length; b += 1) if (d = J[b], !1 === n(d.keyCombo)) { for (c = 0; c < d.keyUpCallback.length; c += 1)!1 === d.keyUpCallback[c](a, t(), d.keyCombo) && (e = !0); !0 === e && (a.preventDefault(), a.stopPropagation()); J.splice(b, 1); b -= 1 } } function m(a, b) { var c, d, e; a = r(a); b = r(b); if (a.length !== b.length) return !1; for (c = 0; c < a.length; c += 1) { if (a[c].length !== b[c].length) return !1; for (d = 0; d < a[c].length; d += 1) { if (a[c][d].length !== b[c][d].length) return !1; for (e = 0; e < a[c][d].length; e += 1) if (-1 === b[c][d].indexOf(a[c][d][e])) return !1 } } return !0 } function n(a) { var b, c, d, e, f = 0, g, h; a = r(a); for (b = 0; b < a.length; b += 1) { h = !0; for (c = f = 0; c < a[b].length; c += 1) { d = [].concat(a[b][c]); for (e = f; e < z.length; e += 1) g = d.indexOf(z[e]), -1 < g && (d.splice(g, 1), f = e); if (0 !== d.length) { h = !1; break } } if (h) return !0 } return !1 } function p(a) { var b, c, d = []; a = r(a); for (b = 0; b < a.length; b += 1) for (c = 0; c < a[b].length; c += 1) d = d.concat(a[b][c]); return d } function r(a) { var b = 0, c = 0, d = !1, e = !1, f = [], g = [], h = [], k = ""; if ("object" === typeof a && "function" === typeof a.push) return a; if ("string" !== typeof a) throw Error('Cannot parse "keyCombo" because its type is "' + typeof a + '". It must be a "string".'); for (; " " === a.charAt(b);) b += 1; for (;;) { if (" " === a.charAt(b)) { for (; " " === a.charAt(b);) b += 1; d = !0 } else if ("," === a.charAt(b)) { if (c || e) throw Error("Failed to parse key combo. Unexpected , at character index " + b + "."); e = !0; b += 1 } else if ("+" === a.charAt(b)) { k.length && (h.push(k), k = ""); if (c || e) throw Error("Failed to parse key combo. Unexpected + at character index " + b + "."); c = !0; b += 1 } else if (">" === a.charAt(b)) { k.length && (h.push(k), k = ""); h.length && (g.push(h), h = []); if (c || e) throw Error("Failed to parse key combo. Unexpected > at character index " + b + "."); c = !0; b += 1 } else if (b < a.length - 1 && "!" === a.charAt(b) && (">" === a.charAt(b + 1) || "," === a.charAt(b + 1) || "+" === a.charAt(b + 1))) k += a.charAt(b + 1), e = d = c = !1, b += 2; else if (b < a.length && "+" !== a.charAt(b) && ">" !== a.charAt(b) && "," !== a.charAt(b) && " " !== a.charAt(b)) { if (!1 === c && !0 === d || !0 === e) k.length && (h.push(k), k = ""), h.length && (g.push(h), h = []), g.length && (f.push(g), g = []); for (e = d = c = !1; b < a.length && "+" !== a.charAt(b) && ">" !== a.charAt(b) && "," !== a.charAt(b) && " " !== a.charAt(b);) k += a.charAt(b), b += 1 } else { b += 1; continue } if (b >= a.length) { k.length && h.push(k); h.length && g.push(h); g.length && f.push(g); break } } return f } function s(a) { var b, c, d = []; if ("string" === typeof a) return a; if ("object" !== typeof a || "function" !== typeof a.push) throw Error("Cannot stringify key combo."); for (b = 0; b < a.length; b += 1) { d[b] = []; for (c = 0; c < a[b].length; c += 1) d[b][c] = a[b][c].join(" + "); d[b] = d[b].join(" > ") } return d.join(" ") } function t(a) { return [].concat(z) } function q(a) { if (a.match(/\s/)) throw Error("Cannot add key name " + a + " to active keys because it contains whitespace."); - 1 < z.indexOf(a) || z.push(a) } function w(a) { var b = e(a); "91" === b || "92" === b ? z = [] : z.splice(z.indexOf(a), 1) } function u(a, b) { if ("string" !== typeof a) throw Error("Cannot register new locale. The locale name must be a string."); if ("object" !== typeof b) throw Error("Cannot register " + a + " locale. The locale map must be an object."); if ("object" !== typeof b.map) throw Error("Cannot register " + a + " locale. The locale map is invalid."); b.macros || (b.macros = []); K[a] = b } function x(a) { if (a) { if ("string" !== typeof a) throw Error("Cannot set locale. The locale name must be a string."); if (!K[a]) throw Error("Cannot set locale to " + a + " because it does not exist. If you would like to submit a " + a + " locale map for KeyboardJS please submit it at https://github.com/RobertWHurst/KeyboardJS/issues."); y = K[a].map; C = K[a].macros; A = a } return A } c = {}; var K = {}, A, y, C, z = [], F = [], J = [], P = [], E, S; S = { map: { 3: ["cancel"], 8: ["backspace"], 9: ["tab"], 12: ["clear"], 13: ["enter"], 16: ["shift"], 17: ["ctrl"], 18: ["alt", "menu"], 19: ["pause", "break"], 20: ["capslock"], 27: ["escape", "esc"], 32: ["space", "spacebar"], 33: ["pageup"], 34: ["pagedown"], 35: ["end"], 36: ["home"], 37: ["left"], 38: ["up"], 39: ["right"], 40: ["down"], 41: ["select"], 42: ["printscreen"], 43: ["execute"], 44: ["snapshot"], 45: ["insert", "ins"], 46: ["delete", "del"], 47: ["help"], 91: "command windows win super leftcommand leftwindows leftwin leftsuper".split(" "), 92: "command windows win super rightcommand rightwindows rightwin rightsuper".split(" "), 145: ["scrolllock", "scroll"], 186: ["semicolon", ";"], 187: ["equal", "equalsign", "="], 188: ["comma", ","], 189: ["dash", "-"], 190: ["period", "."], 191: ["slash", "forwardslash", "/"], 192: ["graveaccent", "`"], 219: ["openbracket", "["], 220: ["backslash", "\\"], 221: ["closebracket", "]"], 222: ["apostrophe", "'"], 48: ["zero", "0"], 49: ["one", "1"], 50: ["two", "2"], 51: ["three", "3"], 52: ["four", "4"], 53: ["five", "5"], 54: ["six", "6"], 55: ["seven", "7"], 56: ["eight", "8"], 57: ["nine", "9"], 96: ["numzero", "num0"], 97: ["numone", "num1"], 98: ["numtwo", "num2"], 99: ["numthree", "num3"], 100: ["numfour", "num4"], 101: ["numfive", "num5"], 102: ["numsix", "num6"], 103: ["numseven", "num7"], 104: ["numeight", "num8"], 105: ["numnine", "num9"], 106: ["nummultiply", "num*"], 107: ["numadd", "num+"], 108: ["numenter"], 109: ["numsubtract", "num-"], 110: ["numdecimal", "num."], 111: ["numdevide", "num/"], 144: ["numlock", "num"], 112: ["f1"], 113: ["f2"], 114: ["f3"], 115: ["f4"], 116: ["f5"], 117: ["f6"], 118: ["f7"], 119: ["f8"], 120: ["f9"], 121: ["f10"], 122: ["f11"], 123: ["f12"] }, macros: [ ["shift + `", ["tilde", "~"]], ["shift + 1", ["exclamation", "exclamationpoint", "!"]], ["shift + 2", ["at", "@"]], ["shift + 3", ["number", "#"]], ["shift + 4", ["dollar", "dollars", "dollarsign", "$"]], ["shift + 5", ["percent", "%"]], ["shift + 6", ["caret", "^"]], ["shift + 7", ["ampersand", "and", "&"]], ["shift + 8", ["asterisk", "*"]], ["shift + 9", ["openparen", "("]], ["shift + 0", ["closeparen", ")"]], ["shift + -", ["underscore", "_"]], ["shift + =", ["plus", "+"]], ["shift + (", ["opencurlybrace", "opencurlybracket", "{"]], ["shift + )", ["closecurlybrace", "closecurlybracket", "}"]], ["shift + \\", ["verticalbar", "|"]], ["shift + ;", ["colon", ":"]], ["shift + '", ["quotationmark", '"']], ["shift + !,", ["openanglebracket", "<"]], ["shift + .", ["closeanglebracket", ">"]], ["shift + /", ["questionmark", "?"]] ] }; for (E = 65; 90 >= E; E += 1) S.map[E] = String.fromCharCode(E + 32), S.macros.push(["shift + " + String.fromCharCode(E + 32) + ", capslock + " + String.fromCharCode(E + 32), [String.fromCharCode(E)]]); u("us", S); x("us"); a(); c.enable = a; c.disable = function () { b(); window.removeEventListener ? (document.removeEventListener("keydown", g, !1), document.removeEventListener("keyup", f, !1), window.removeEventListener("blur", b, !1), window.removeEventListener("webkitfullscreenchange", b, !1), window.removeEventListener("mozfullscreenchange", b, !1)) : window.detachEvent && (document.detachEvent("onkeydown", g), document.detachEvent("onkeyup", f), window.detachEvent("onblur", b)) }; c.activeKeys = t; c.isPressed = function (a) { return -1 < z.indexOf(a) }; c.on = function (a, b, c) { var d = {}, e, f = [], g, h; "string" === typeof a && (a = r(a)); for (g = 0; g < a.length; g += 1) { e = {}; h = s([a[g]]); if ("string" !== typeof h) throw Error("Failed to bind key combo. The key combo must be string."); e.keyCombo = h; e.keyDownCallback = []; e.keyUpCallback = []; b && e.keyDownCallback.push(b); c && e.keyUpCallback.push(c); F.push(e); f.push(e) } d.clear = function () { var a; for (a = 0; a < f.length; a += 1) F.splice(F.indexOf(f[a]), 1) }; d.on = function (a) { var b = {}, c, d, e; if ("string" !== typeof a) throw Error("Cannot bind callback. The event name must be a string."); if ("keyup" !== a && "keydown" !== a) throw Error('Cannot bind callback. The event name must be a "keyup" or "keydown".'); c = Array.prototype.slice.apply(arguments, [1]); for (d = 0; d < c.length; d += 1) if ("function" === typeof c[d]) if ("keyup" === a) for (e = 0; e < f.length; e += 1) f[e].keyUpCallback.push(c[d]); else if ("keydown" === a) for (e = 0; e < f.length; e += 1) f[e].keyDownCallback.push(c[d]); b.clear = function () { var b, d; for (b = 0; b < c.length; b += 1) if ("function" === typeof c[b]) if ("keyup" === a) for (d = 0; d < f.length; d += 1) f[d].keyUpCallback.splice(f[d].keyUpCallback.indexOf(c[b]), 1); else for (d = 0; d < f.length; d += 1) f[d].keyDownCallback.splice(f[d].keyDownCallback.indexOf(c[b]), 1) }; return b }; return d }; c.clear = function (a) { var b, c; for (b = 0; b < F.length; b += 1) c = F[b], m(a, c.keyCombo) && (F.splice(b, 1), b -= 1) }; c.clear.key = function (a) { var b, c, d; if (a) for (b = 0; b < F.length; b += 1) for (d = F[b], c = 0; c < d.keyCombo.length; c += 1) { if (-1 < d.keyCombo[c].indexOf(a)) { F.splice(b, 1); b -= 1; break } } else F = [] }; c.locale = x; c.locale.register = u; c.macro = function (a, b) { if ("string" !== typeof a && ("object" !== typeof a || "function" !== typeof a.push)) throw Error("Cannot create macro. The combo must be a string or array."); if ("object" !== typeof b || "function" !== typeof b.push) throw Error("Cannot create macro. The injectedKeys must be an array."); C.push([a, b]) }; c.macro.remove = function (a) { var b; if ("string" !== typeof a && ("object" !== typeof a || "function" !== typeof a.push)) throw Error("Cannot remove macro. The combo must be a string or array."); for (mI = 0; mI < C.length; mI += 1) if (b = C[mI], m(a, b[0])) { w(b[1]); C.splice(mI, 1); break } }; c.key = {}; c.key.name = d; c.key.code = e; c.combo = {}; c.combo.active = n; c.combo.parse = r; c.combo.stringify = s; return c }); var allLevels = [ [ ["DECOR_HELP_1_TYPE", 182, 216.25, 0.6, 0.6, 0, [""]], ["LAND_TYPE", 94.5, 270.95, 0.84, 0.84, 8, [""]], ["LAND_TYPE", 229.5, 314.25, 0.84, 0.84, 0, ["4"]], ["HERO_TYPE", 92.35, 224.75, 0.68, 0.68, 0, [""]], ["DYNAMIC_BOX_TYPE", 123.6, 240, 0.423, 0.423, 7, [""]], ["AIM_TYPE", 257.9, 265.4, 0.74, 0.74, 0, ["REV"]] ], [ ["LAND_TYPE", 63.7, 249, 0.84, 0.84, 0, ["2"]], ["LAND_TYPE", 227.05, 277.7, 0.84, 0.84, 0, [""]], ["HERO_TYPE", 226.8, 126.4, 0.68, 0.68, 0, [""]], ["DYNAMIC_BOX_TYPE", 200.3, 244.75, 0.423, 0.423, 0, [""]], ["DYNAMIC_BOX_TYPE", 251.15, 244.75, 0.423, 0.423, 0, [""] ], ["DYNAMIC_RECT_TYPE", 225.85, 188.05, 0.7, 0.7, 0, [""]], ["DYNAMIC_RECT_TYPE", 225.75, 225.45, 0.7, 0.7, 0, ["2"]], ["DYNAMIC_BOX_TYPE", 251.25, 207, 0.42, 0.42, 0, ["2"]], ["DYNAMIC_BOX_TYPE", 199.55, 207, 0.42, 0.42, 0, ["3"]], ["DYNAMIC_TRIANGLE_TYPE", 243.55, 165, 0.7, 0.7, 180, [""]], ["DYNAMIC_TRIANGLE_TYPE", 225.3, 163, 0.68, 0.68, 0, [""]], ["DYNAMIC_TRIANGLE_TYPE", 207.85, 165, 0.69, 0.69, 180, [""]], ["STATIC_BALK_1_TYPE", 149.7, 207.5, 0.6, 0.6, -25, [""]], ["AIM_TYPE", 42.05, 199.7, 0.74, 0.74, 0, ["DEF"]] ], [ ["LAND_TYPE", 116.95, 287.15, 0.84, 0.84, 0, ["2"] ], ["LAND_TYPE", 40.05, 192.4, 0.84, 0.84, 0, [""]], ["HERO_TYPE", 47.8, 107, 0.68, 0.68, 0, [""]], ["DYNAMIC_BOX_TYPE", 21.3, 157, 0.43, 0.43, 0, [""]], ["DYNAMIC_RECT_TYPE", 46.75, 136.15, 0.7, 0.7, 0, ["2"]], ["DYNAMIC_RECT_TYPE", 127.2, 146.75, 0.7, 0.7, 90, [""]], ["DYNAMIC_RECT_TYPE", 127.2, 223.8, 0.7, 0.7, 90, [""]], ["DYNAMIC_BOX_TYPE", 73.55, 157, 0.43, 0.43, 0, [""]], ["BONUS_STAR_TYPE", 185.3, 210.2, 0.798, 0.798, 0, [""]], ["AIM_TYPE", 272.2, 287.95, 0.74, 0.74, 0, ["REV_MOVED_R_0_4"]] ], [ ["LAND_TYPE", 274, 233.45, 0.84, 0.84, -8, ["5"] ], ["LAND_TYPE", 158.75, 240.9, 0.84, 0.84, 0, ["2"]], ["LAND_TYPE", 46.15, 240.9, 0.84, 0.84, 0, ["2"]], ["STATIC_BOX_TYPE", 327.7, 166.45, 0.5, 1.06, -23, ["INVIS"]], ["DECOR_HELP_2_TYPE", 91.45, 114.4, 0.7, 0.7, 0, [""]], ["BOMB_TYPE", 45.55, 195.25, 0.9, 0.9, 0, ["180_700"]], ["HERO_TYPE", 128.2, 192.1, 0.68, 0.68, 0, [""]], ["DYNAMIC_BOX_TYPE", 11.8, 204.8, 0.43, 0.43, 0, [""]], ["BONUS_STAR_TYPE", 211.2, 192.05, 0.798, 0.798, 0, [""]], ["AIM_TYPE", 298.65, 182.25, 0.74, 0.74, -8, ["REV"]] ], [ ["LAND_TYPE", 161.7, 361.4, 0.84, 0.84, 0, ["5"]], ["LAND_TYPE", 263.85, 237.95, 0.84, 0.84, 0, [""] ], ["DYNAMIC_BOX_TYPE", 237.1, 205, 0.423, 0.423, 0, [""]], ["DYNAMIC_BOX_TYPE", 287.95, 205, 0.423, 0.423, 0, [""]], ["DYNAMIC_RECT_TYPE", 262.65, 148.3, 0.7, 0.7, 0, [""]], ["DYNAMIC_RECT_TYPE", 262.55, 185.7, 0.7, 0.7, 0, ["2"]], ["DYNAMIC_BOX_TYPE", 288.05, 167.25, 0.42, 0.42, 0, ["2"]], ["DYNAMIC_BOX_TYPE", 236.35, 167.25, 0.42, 0.42, 0, ["3"]], ["STATIC_BALK_1_TYPE", 157.5, 139.5, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 164.5, 221.05, 0.7, 0.7, 0, [""]], ["MOVABLE_BALK_TYPE", 64, 281.45, 1.03, 0.699, 35, ["R_1030_5"]], ["HERO_TYPE", 261.65, 115.4, 0.68, 0.68, 0, [""] ], ["BONUS_STAR_TYPE", 163.6, 184, 0.798, 0.798, 0, [""]], ["BONUS_STAR_TYPE", 89.95, 253.4, 0.798, 0.798, 0, [""]], ["AIM_TYPE", 193.1, 314, 0.74, 0.74, 0, ["REV"]] ], [ ["TELEPORT_TYPE", 241.7, 69.45, 1, 1, 0, ["A"]], ["TELEPORT_TYPE", 121.55, 367.3, 1, 1, 0, ["A"]], ["LAND_TYPE", 219.85, 392.45, 0.84, 0.84, -6, ["2"]], ["LAND_TYPE", 68.25, 150.95, 0.84, 0.84, 0, ["3"]], ["LAND_TYPE", 62.05, 295.65, 0.84, 0.84, 0, [""]], ["HERO_TYPE", 61.8, 218.15, 0.68, 0.68, 0, [""]], ["DYNAMIC_TRIANGLE_TYPE", 78.55, 256.75, 0.7, 0.7, 180, [""]], ["DYNAMIC_TRIANGLE_TYPE", 60.3, 254.75, 0.68, 0.68, 0, [""] ], ["DYNAMIC_TRIANGLE_TYPE", 42.85, 256.75, 0.69, 0.69, 180, [""]], ["STATIC_BALK_1_TYPE", 157.05, 290.2, 0.7, 0.7, 12, [""]], ["STATIC_BALK_1_TYPE", 294.05, 261.85, 0.7, 0.7, 68, [""]], ["STATIC_BALK_1_TYPE", 290.7, 333.7, 0.7, 0.7, 118, [""]], ["BONUS_STAR_TYPE", 158.25, 250.7, 0.798, 0.798, 0, [""]], ["BONUS_STAR_TYPE", 238.25, 337.7, 0.798, 0.798, 0, [""]], ["BONUS_STAR_TYPE", 158.25, 91.2, 0.798, 0.798, 0, [""]], ["STATIC_BALK_1_TYPE", 164.1, 125.8, 0.7, 0.7, 171, [""]], ["STATIC_BALK_1_TYPE", 244.15, 112.65, 0.7, 0.7, 171, [""]], ["AIM_TYPE", 43.45, 103.6, 0.73, 0.73, 0, ["DEF"]] ], [ ["LAND_TYPE", 71, 387.8, 0.84, 0.84, 0, [""]], ["DECOR_HELP_3_TYPE", 163.85, 193.45, 0.67, 0.67, 0, [""]], ["STATIC_BALK_1_TYPE", 61.35, 153.35, 0.791, 0.814, 0, [""]], ["DYNAMIC_RECT_TYPE", 161.15, 130.25, 1.31, 1.278, 0, [""]], ["HARD_RECT_TYPE", 162.35, 107.6, 0.92, 1, 0, [""]], ["STATIC_BALK_1_TYPE", 262.85, 153.35, 0.791, 0.814, 0, [""]], ["STATIC_BALK_1_TYPE", 236.85, 369.7, 0.791, 0.814, 0, [""]], ["STATIC_BALK_1_TYPE", 272.5, 262.7, 0.791, 0.814, -11, [""]], ["DYNAMIC_TRIANGLE_TYPE", 243.3, 243.65, 0.68, 0.68, 170, [""] ], ["BONUS_STAR_TYPE", 130.05, 325.55, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 188.65, 273, 0.68, 0.68, 0, [""]], ["HERO_TYPE", 271.95, 230.1, 0.68, 0.68, 0, [""]], ["AIM_TYPE", 46.2, 339.5, 0.73, 0.73, 0, ["DEF"]] ], [ ["TELEPORT_TYPE", 211.9, 186.85, 1, 1, 0, ["A"]], ["TELEPORT_TYPE", 53.9, 377.5, 1, 1, 0, ["A"]], ["LAND_TYPE", 185, 266.4, 0.989, 0.84, 0, ["5"]], ["HARD_RECT_TYPE", 76.45, 230.35, 1, 1, 0, [""]], ["STATIC_BOX_TYPE", 33.85, 252.85, 0.75, 0.75, 0, [""]], ["STATIC_BOX_TYPE", 72.85, 298.95, 0.75, 0.75, 0, [""]], ["BOMB_TYPE", 73.9, 270.2, 0.8, 0.8, 0, ["140_600"] ], ["STATIC_BOX_TYPE", 46.85, 119.3, 0.75, 0.75, 0, [""]], ["STATIC_BOX_TYPE", 133.35, 119.8, 0.75, 0.75, 0, [""]], ["HARD_RECT_TYPE", 89.85, 97.3, 1, 1, 0, [""]], ["HARD_RECT_TYPE", 72.5, 163.25, 1, 1, 90, [""]], ["STATIC_BALK_1_TYPE", 182.95, 128.9, 0.7, 0.7, 15, [""]], ["STATIC_BALK_1_TYPE", 128.45, 405.8, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 204.45, 405.8, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 277.45, 386.8, 0.7, 0.7, -30, [""]], ["DYNAMIC_TRIANGLE_TYPE", 235.45, 233.1, 0.68, 0.68, -60, [""]], ["STATIC_BALK_1_TYPE", 312.3, 151.15, 0.7, 0.7, -90, [""] ], ["HERO_TYPE", 118.95, 64.4, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 267.85, 119, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 203.85, 358.05, 0.68, 0.68, 0, [""]], ["AIM_TYPE", 156.15, 217.55, 0.73, 0.73, 0, ["DEF"]] ], [ ["LAND_TYPE", 238.5, 404.05, 0.84, 0.84, 0, ["2"]], ["LAND_TYPE", 131.15, 140.05, 0.84, 0.84, 0, ["4"]], ["LAND_TYPE", 46.5, 249.6, 0.84, 0.84, 8, [""]], ["HERO_TYPE", 44.35, 203.4, 0.68, 0.68, 0, [""]], ["DYNAMIC_BOX_TYPE", 75.6, 218.65, 0.423, 0.423, 7, [""]], ["TELEGA_TYPE", 199.05, 302.45, 1.68, 0.85, 0, ["1_R_50_8"]], ["BOMB_TYPE", 240.2, 358.8, 0.9, 0.9, 0, ["180_1400"] ], ["BONUS_STAR_TYPE", 248.2, 195.3, 0.798, 0.798, 0, [""]], ["BONUS_STAR_TYPE", 240.3, 117.65, 0.798, 0.798, 0, [""]], ["STATIC_BALK_1_TYPE", 276.2, 127.65, 0.7, 0.7, 68, [""]], ["STATIC_BALK_1_TYPE", 229.65, 67.3, 0.7, 0.7, 36, [""]], ["STATIC_BALK_1_TYPE", 168, 52.1, 0.48, 0.48, -15, [""]], ["BONUS_STAR_TYPE", 150.4, 240, 0.798, 0.798, 0, [""]], ["AIM_TYPE", 107.8, 90, 0.73, 0.73, 0, ["DEF"]] ], [ ["LAND_TYPE", 259.95, 376.75, 0.84, 0.84, 0, [""]], ["LAND_TYPE", 76, 144.8, 0.84, 0.84, 0, [""]], ["DECOR_HELP_4_TYPE", 168.25, 78.95, 0.59, 0.59, 0, [""] ], ["STATIC_BALK_1_TYPE", 168.25, 138.6, 0.7, 0.7, 15, [""]], ["STATIC_BALK_1_TYPE", 93.4, 327.3, 0.7, 0.7, 15, [""]], ["STATIC_BALK_1_TYPE", 167.35, 348.3, 0.7, 0.7, 15, [""]], ["HERO_TYPE", 95, 95.3, 0.68, 0.68, 0, [""]], ["FAN_TYPE", 44, 93.85, 0.8, 0.8, 0, ["DEF_60_40"]], ["BONUS_STAR_TYPE", 263.4, 188.55, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 98.9, 277.7, 0.68, 0.68, 0, [""]], ["STATIC_BALK_1_TYPE", 270.95, 228.2, 0.7, 0.7, -15, [""]], ["STATIC_BALK_1_TYPE", 197.95, 247.6, 0.7, 0.7, -15, [""]], ["STATIC_BALK_1_TYPE", 20.4, 306.3, 0.7, 0.7, 15, [""] ], ["STATIC_BALK_1_TYPE", 342.95, 208.2, 0.7, 0.7, -15, [""]], ["BONUS_STAR_TYPE", 175.4, 218.95, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 176.4, 307.15, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 234.35, 124.45, 0.68, 0.68, 0, [""]], ["AIM_TYPE", 278.35, 327.55, 0.74, 0.74, 0, ["REV"]] ], [ ["LAND_TYPE", 52, 194.5, 0.84, 0.84, 0, ["2"]], ["LAND_TYPE", 51.9, 367.85, 0.84, 0.84, 0, ["5"]], ["DYNAMIC_RECT_TYPE", 149.9, 350.05, 0.751, 0.819, 0, [""]], ["DYNAMIC_TRIANGLE_TYPE", 214.2, 132, 0.822, 0.76, 180, [""]], ["DYNAMIC_TRIANGLE_TYPE", 192.5, 130.1, 0.81, 0.749, 0, [""] ], ["DYNAMIC_TRIANGLE_TYPE", 171.7, 131.75, 0.822, 0.76, 180, [""]], ["STATIC_BALK_1_TYPE", 232, 333.65, 0.749, 0.767, -22, [""]], ["BONUS_STAR_TYPE", 105.4, 119.65, 0.68, 0.68, 0, [""]], ["STATIC_BALK_1_TYPE", 193.85, 156.85, 0.875, 0.825, 0, [""]], ["FAN_TYPE", 27.4, 147.1, 0.8, 0.8, 0, ["DEF_130_40"]], ["STATIC_BALK_1_TYPE", 297, 287.2, 0.749, 0.767, -52, [""]], ["STATIC_BALK_1_TYPE", 302, 119.1, 0.921, 0.877, -105, [""]], ["BONUS_STAR_TYPE", 282, 215.35, 0.68, 0.68, 0, [""]], ["STATIC_BOX_TYPE", 194.8, 368.1, 0.616, 0.615, 0, [""]], ["STATIC_BALK_1_TYPE", 129.8, 394.3, 0.743, 0.787, 53, [""] ], ["STATIC_BOX_TYPE", 174.05, 440, 0.75, 0.75, 0, [""]], ["FAN_TYPE", 189.95, 416.55, 0.8, 0.8, 45, ["REV_630_10"]], ["BONUS_STAR_TYPE", 158.35, 383.05, 0.68, 0.68, 0, [""]], ["STATIC_BOX_TYPE", 120.2, 168, 0.616, 0.615, -22, [""]], ["STATIC_BOX_TYPE", 136.85, 161.1, 0.616, 0.615, -22, [""]], ["STATIC_BOX_TYPE", -1.3, 308.05, 0.5, 1.06, 14, ["INVIS"]], ["HERO_TYPE", 192.65, 91.05, 0.68, 0.68, 0, [""]], ["AIM_TYPE", 29.2, 319.75, 0.73, 0.73, 0, ["DEF"]] ], [ ["LAND_TYPE", 289.4, 407.6, 0.84, 0.84, 6, ["3"]], ["LAND_TYPE", 249.5, 144.1, 0.84, 0.84, 0, ["3"] ], ["LAND_TYPE", 180.4, 395.45, 0.84, 0.84, 6, ["3"]], ["HERO_TYPE", 248.5, 60.05, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 294.85, 201.95, 0.65, 0.65, 0, [""]], ["BONUS_STAR_TYPE", 53.65, 173.65, 0.65, 0.65, 0, [""]], ["BONUS_STAR_TYPE", 180.55, 345.15, 0.65, 0.65, 0, [""]], ["DYNAMIC_RECT_TYPE", 248.2, 91.15, 0.7, 0.7, 0, [""]], ["DYNAMIC_BOX_TYPE", 273.6, 110.1, 0.42, 0.42, 0, ["2"]], ["DYNAMIC_BOX_TYPE", 221.9, 110.1, 0.42, 0.42, 0, ["3"]], ["TELEGA_TYPE", 158.65, 242.3, 2.2, 0.85, 0, ["2_R_0_10"]], ["AIM_TYPE", 303.1, 360.05, 0.74, 0.74, 6, ["REV"]] ], [ ["LAND_TYPE", 236, 242.95, 0.99, 0.84, 0, ["4"]], ["LAND_TYPE", 59.9, 405.7, 0.84, 0.84, 0, ["5"]], ["TELEPORT_TYPE", 199.85, 141.9, 1, 1, 0, ["A"]], ["TELEPORT_TYPE", 274.3, 384.95, 1, 1, 0, ["A"]], ["STATIC_BOX_TYPE", 233.9, 205.65, 0.75, 0.75, 0, [""]], ["STATIC_BALK_1_TYPE", 41.95, 99.95, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 116.9, 99.95, 0.7, 0.7, 0, [""]], ["DYNAMIC_BOX_TYPE", 22.95, 368.7, 0.42, 0.42, 0, [""]], ["DYNAMIC_BOX_TYPE", 93.95, 368.7, 0.42, 0.42, 0, [""]], ["DYNAMIC_BOX_TYPE", 93.95, 346.7, 0.42, 0.42, 0, [""]], ["DYNAMIC_BOX_TYPE", 22.95, 347.7, 0.42, 0.42, 0, [""] ], ["DYNAMIC_RECT_TYPE", 58.9, 326, 0.924, 0.79, 0, [""]], ["STATIC_BALK_1_TYPE", 220.95, 430.95, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 295.9, 430.95, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 149.55, 412.95, 0.7, 0.7, 30, [""]], ["STATIC_BALK_1_TYPE", 292.85, 101.15, 0.7, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 292.85, 177.15, 0.7, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 190.85, 99.95, 0.7, 0.7, 0, [""]], ["BOMB_TYPE", 60.4, 73.15, 0.8, 0.8, 0, ["140_700"]], ["BOMB_TYPE", 178.35, 73.15, 0.8, 0.8, 0, ["140_700"]], ["HERO_TYPE", 57.2, 293.45, 0.68, 0.68, 0, [""] ], ["BONUS_STAR_TYPE", 173.95, 380.55, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 161.85, 188.35, 0.68, 0.68, 0, [""]], ["AIM_TYPE", 48.25, 189.95, 0.832, 0.888, 0, ["DEF_MOVED_R_0_10"]] ], [ ["LAND_TYPE", 69.8, 135.2, 0.84, 0.84, 0, ["5"]], ["STATIC_BALK_1_TYPE", 164.85, 128.85, 0.7, 0.7, 15, [""]], ["STATIC_BALK_1_TYPE", 206.8, 238.9, 0.7, 0.7, -15, [""]], ["STATIC_BALK_1_TYPE", 279.25, 219.45, 0.7, 0.7, -15, [""]], ["STATIC_BALK_1_TYPE", 133.8, 257.9, 0.7, 0.7, -15, [""]], ["STATIC_BALK_1_TYPE", 38.8, 345.85, 0.7, 0.7, 15, [""]], ["STATIC_BALK_1_TYPE", 110.8, 365.8, 0.7, 0.7, 15, [""] ], ["BONUS_STAR_TYPE", 53.75, 291.15, 0.68, 0.68, 0, [""]], ["STATIC_BALK_1_TYPE", 310.35, 162.35, 0.7, 0.7, -90, [""]], ["BONUS_STAR_TYPE", 262.8, 167.15, 0.68, 0.68, 0, [""]], ["STATIC_BALK_1_TYPE", 10.4, 289.05, 0.7, 0.7, -90, [""]], ["FAN_TYPE", 37.75, 85.6, 0.8, 0.8, 0, ["DEF_100_40"]], ["HERO_TYPE", 115, 87.9, 0.68, 0.68, 0, [""]], ["AIM_TYPE", 266.25, 362, 1.185, 0.74, 0, ["REV_MOVED_R_0_10"]] ], [ ["LAND_TYPE", 53, 391.05, 0.84, 0.84, 0, [""]], ["STATIC_BOX_TYPE", 280.4, 58.75, 0.592, 0.516, 20, [""]], ["STATIC_BALK_1_TYPE", 310.6, 143.15, 0.7, 0.7, -90, [""] ], ["FAN_TYPE", 302.45, 86.1, 0.8, 0.8, -15, ["REV_530_10"]], ["STATIC_BOX_TYPE", 264.9, 52.75, 0.592, 0.516, 20, [""]], ["STATIC_BALK_1_TYPE", 141.75, 374.65, 0.599, 0.631, 0, [""]], ["STATIC_BALK_1_TYPE", 206.95, 383.65, 0.603, 0.627, 16, [""]], ["STATIC_BALK_1_TYPE", 270, 402.65, 0.603, 0.627, 16, [""]], ["STATIC_BALK_1_TYPE", 56.65, 49.75, 0.734, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 136.5, 49.75, 0.734, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 216.4, 49.75, 0.734, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 9.2, 82.75, 0.742, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 9.2, 163.35, 0.742, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 310.6, 219.15, 0.7, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 310.6, 294.15, 0.7, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 310.6, 370.15, 0.7, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 9.2, 242.75, 0.742, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 9.2, 323.25, 0.742, 0.7, -90, [""]], ["BOMB_TYPE", 284.7, 380.25, 0.8, 0.8, 0, ["140_300"]], ["STATIC_BALK_1_TYPE", 247.15, 199.7, 0.725, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 220.65, 170.15, 0.599, 0.631, -15, [""]], ["STATIC_BOX_TYPE", 185.25, 180.45, 0.75, 0.75, -10, [""] ], ["STATIC_BOX_TYPE", 169.35, 92.4, 0.75, 0.75, -10, [""]], ["DYNAMIC_RECT_TYPE", 196.55, 125.55, 0.79, 0.79, -100, [""]], ["STATIC_BALK_1_TYPE", 247.15, 278.7, 0.725, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 270.5, 324.95, 0.599, 0.631, 0, [""]], ["BOMB_TYPE", 279.25, 297.65, 0.8, 0.8, 0, ["140_1300"]], ["STATIC_BALK_1_TYPE", 48.9, 282.55, 0.603, 0.627, 8, [""]], ["STATIC_BALK_1_TYPE", 114.1, 291.8, 0.603, 0.627, 8, [""]], ["BONUS_STAR_TYPE", 257.25, 115.5, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 66.3, 249.75, 0.68, 0.68, 0, [""]], ["STATIC_BOX_TYPE", 26.8, 212.95, 0.682, 0.662, 5, [""]], ["STATIC_BOX_TYPE", 110.15, 219.3, 0.682, 0.662, 5, [""]], ["DYNAMIC_RECT_TYPE", 70.6, 198.25, 0.936, 0.79, 5, [""]], ["BONUS_STAR_TYPE", 116.35, 343.65, 0.68, 0.68, 0, [""]], ["HERO_TYPE", 279.55, 251.3, 0.68, 0.68, 0, [""]], ["AIM_TYPE", 43.2, 342.5, 0.73, 0.73, 0, ["DEF"]] ], [ ["LAND_TYPE", 208, 292.45, 0.84, 0.84, 0, ["4"]], ["LAND_TYPE", 74.5, 166.4, 0.84, 0.84, 0, ["5"]], ["HARD_BOX_TYPE", 169.75, 253, 1, 1, 0, ["5"]], ["STATIC_BALK_1_TYPE", 113.75, 276.75, 0.7, 0.7, 0, [""]], ["DYNAMIC_RECT_TYPE", 72.5, 86.85, 0.79, 0.79, 0, [""] ], ["DYNAMIC_BOX_TYPE", 43.65, 130, 0.42, 0.42, 0, [""]], ["DYNAMIC_BOX_TYPE", 103.65, 130, 0.42, 0.42, 0, [""]], ["DYNAMIC_BOX_TYPE", 43.65, 107, 0.42, 0.42, 0, [""]], ["DYNAMIC_BOX_TYPE", 103.65, 107, 0.42, 0.42, 0, [""]], ["STATIC_BALK_1_TYPE", 253.25, 227.65, 0.7, 0.7, -90, [""]], ["STATIC_BOX_TYPE", 252.6, 180.5, 0.75, 0.75, 0, [""]], ["BOMB_TYPE", 77.75, 61.25, 0.8, 0.8, 0, ["140_600"]], ["STATIC_BALK_1_TYPE", 38.1, 329.75, 0.7, 0.7, 30, [""]], ["BONUS_STAR_TYPE", 47.8, 296.2, 0.68, 0.68, 0, [""]], ["HERO_TYPE", 94.6, 246.6, 0.68, 0.68, 0, [""] ], ["BONUS_STAR_TYPE", 109.6, 344.6, 0.68, 0.68, 0, [""]], ["STATIC_BALK_1_TYPE", 39.75, 380.5, 0.7, 0.7, -35, [""]], ["AIM_TYPE", 220.6, 378.45, 1.42, 0.74, 0, ["REV_MOVED_R_0_10"]] ], [ ["LAND_TYPE", 56, 423.95, 0.84, 0.84, 0, [""]], ["STATIC_BALK_1_TYPE", 1, 99.85, 0.7, 0.7, 0, [""]], ["FAN_TYPE", 23, 68.6, 0.8, 0.8, 0, ["DEF_100_40"]], ["STATIC_BALK_1_TYPE", 76, 99.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 151, 99.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 151, 195.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 226, 195.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 301, 195.85, 0.7, 0.7, 0, [""] ], ["STATIC_BALK_1_TYPE", 17, 294.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 92, 294.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 167, 294.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 311.95, 99.85, 0.7, 0.7, 0, [""]], ["FAN_TYPE", 299.75, 163.85, 0.8, 0.8, 0, ["REV_130_10"]], ["FAN_TYPE", 23, 262.6, 0.8, 0.8, 0, ["DEF_200_10"]], ["STATIC_BALK_1_TYPE", 151, 404.8, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 226, 404.8, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 301, 404.8, 0.7, 0.7, 0, [""]], ["FAN_TYPE", 299.75, 372.8, 0.8, 0.8, 0, ["REV_150_10"]], ["HERO_TYPE", 76.95, 67.95, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 83.85, 159.3, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 270.8, 299.1, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 239.8, 62.85, 0.68, 0.68, 0, [""]], ["AIM_TYPE", 32.2, 378, 0.73, 0.73, 0, ["DEF"]] ], [ ["LAND_TYPE", 175.85, 424.35, 0.746, 0.643, 0, [""]], ["TELEPORT_TYPE", 263.7, 350.9, 1, 1, 0, ["A"]], ["TELEPORT_TYPE", 31.85, 181.85, 1, 1, 0, ["A"]], ["TELEGA_TYPE", 160, 102.3, 2.171, 0.85, 0, ["2_L_0_10"]], ["STATIC_BALK_1_TYPE", 94, 391.4, 0.7, 0.7, 30, [""]], ["STATIC_BALK_1_TYPE", 29, 353.25, 0.7, 0.7, 30, [""] ], ["HERO_TYPE", 161.2, 72.2, 0.68, 0.68, 0, [""]], ["STATIC_BALK_1_TYPE", 37.8, 130.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 112.8, 130.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 187.8, 130.85, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 341.75, 130.1, 0.7, 0.7, 0, [""]], ["STATIC_BOX_TYPE", 225.85, 297.45, 0.75, 0.75, 0, [""]], ["STATIC_BOX_TYPE", 301.85, 297.45, 0.75, 0.75, 0, [""]], ["DYNAMIC_RECT_TYPE", 102, 207.1, 0.79, 0.79, 0, [""]], ["LAND_TYPE", 101.6, 266.6, 0.746, 0.643, 0, [""]], ["DYNAMIC_TRIANGLE_TYPE", 80.9, 237.55, 0.68, 0.68, -60, [""] ], ["DYNAMIC_TRIANGLE_TYPE", 130.9, 237.55, 0.68, 0.68, -60, [""]], ["STATIC_BALK_1_TYPE", 203.55, 314.25, 0.61, 0.61, 0, [""]], ["STATIC_BOX_TYPE", 159.95, 309.7, 0.75, 0.75, 0, [""]], ["BONUS_STAR_TYPE", 266.85, 205.7, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 76.1, 338, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 30.9, 61.1, 0.68, 0.68, 0, [""]], ["HARD_RECT_TYPE", 263.7, 276.25, 0.856, 0.857, 0, [""]], ["BOMB_TYPE", 101.7, 181.4, 0.8, 0.8, 0, ["90_1000"]], ["AIM_TYPE", 185.35, 381.1, 0.74, 0.74, 0, ["REV"]] ], [ ["STATIC_BOX_TYPE", 286.55, 344.25, 0.5, 1.06, -12, ["INVIS"] ], ["LAND_TYPE", 246.85, 399.45, 0.84, 0.84, 0, ["5"]], ["LAND_TYPE", 265.5, 247.55, 0.765, 0.807, 0, [""]], ["STATIC_BALK_1_TYPE", 47, 55.45, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 123.2, 55.45, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 199.4, 55.45, 0.7, 0.7, 0, [""]], ["STATIC_BALK_1_TYPE", 267.35, 82.8, 0.7, 0.7, 45, [""]], ["BOMB_TYPE", 265.7, 205.4, 0.8, 0.8, 0, ["140_1000"]], ["TELEGA_TYPE", 173, 165.55, 2.037, 0.85, 0, ["1_L_0_10"]], ["STATIC_BALK_1_TYPE", 17.4, 101.25, 0.7, 0.7, -90, [""]], ["STATIC_BALK_1_TYPE", 17.4, 175.25, 0.7, 0.7, -90, [""] ], ["STATIC_BOX_TYPE", 21.1, 258.8, 0.75, 0.75, 0, [""]], ["STATIC_BOX_TYPE", 112.2, 258.8, 0.75, 0.75, 0, [""]], ["DYNAMIC_RECT_TYPE", 68, 221.75, 0.954, 0.79, 0, [""]], ["STATIC_BALK_1_TYPE", 130.4, 236, 0.64, 0.64, -90, [""]], ["STATIC_BALK_1_TYPE", 48.2, 395.85, 0.7, 0.7, -7, [""]], ["STATIC_BALK_1_TYPE", 123.9, 387.1, 0.7, 0.7, -7, [""]], ["FAN_TYPE", 28.05, 364.9, 0.8, 0.8, -8, ["DEF_130_40"]], ["GLASS_BLOCK_TYPE", 68.35, 238.75, 0.973, 0.79, 0, [""]], ["HERO_TYPE", 175.85, 135.2, 0.68, 0.68, 0, [""]], ["BONUS_STAR_TYPE", 62.85, 114.25, 0.65, 0.65, 0, [""] ], ["BONUS_STAR_TYPE", 67.3, 287.7, 0.65, 0.65, 0, [""]], ["BONUS_STAR_TYPE", 169.4, 340.2, 0.65, 0.65, 0, [""]], ["AIM_TYPE", 258.35, 351.15, 0.74, 0.74, 0, ["REV"]] ], [ ["STATIC_BOX_TYPE", 84.05, 70.2, 0.5, 1.06, 15, ["INVIS"]], ["STATIC_BOX_TYPE", 258.4, 331.3, 0.75, 0.75, 0, [""]], ["BONUS_STAR_TYPE", 187.85, 321.9, 0.65, 0.65, 0, [""]], ["BONUS_STAR_TYPE", 61.55, 219.75, 0.65, 0.65, 0, [""]], ["BONUS_STAR_TYPE", 221.45, 110.25, 0.65, 0.65, 0, [""]], ["DYNAMIC_RECT_TYPE", 52.2, 161.75, 0.918, 0.989, 0, [""]], ["DYNAMIC_BOX_TYPE", 25.1, 142.95, 0.42, 0.42, 0, [""] ], ["DYNAMIC_BOX_TYPE", 76.05, 142.95, 0.42, 0.42, 0, [""]], ["LAND_TYPE", 128.15, 124.6, 0.702, 0.643, -9, [""]], ["DYNAMIC_BOX_TYPE", 19.4, 322.25, 0.42, 0.42, 0, ["3"]], ["DYNAMIC_BOX_TYPE", 95.7, 321.75, 0.42, 0.42, 0, ["3"]], ["DYNAMIC_BOX_TYPE", 95.85, 300.6, 0.42, 0.42, 0, [""]], ["DYNAMIC_BOX_TYPE", 19.85, 300.1, 0.42, 0.42, 0, [""]], ["DYNAMIC_RECT_TYPE", 58.15, 279.25, 0.918, 0.989, 0, [""]], ["HARD_BOX_TYPE", 12.85, 183.9, 0.877, 0.852, 0, ["5"]], ["HARD_BOX_TYPE", 89, 183.9, 0.877, 0.852, 0, ["5"]], ["STATIC_BALK_1_TYPE", 59.35, 342.15, 0.903, 0.886, 0, [""] ], ["STATIC_BALK_1_TYPE", 183.5, 424.75, 0.801, 0.817, -53, [""]], ["STATIC_BALK_1_TYPE", 233.4, 356.8, 0.747, 0.919, -55, [""]], ["STATIC_BALK_1_TYPE", 218.6, 211.85, 0.64, 0.92, -113, [""]], ["STATIC_BOX_TYPE", 13.5, 208.2, 0.75, 0.75, 0, [""]], ["STATIC_BALK_1_TYPE", 313.85, 266.15, 0.779, 0.919, -110, [""]], ["STATIC_BOX_TYPE", 89, 208.2, 0.75, 0.75, 0, [""]], ["FAN_TYPE", 286.65, 320.25, 0.8, 0.8, 75, ["REV_780_15"]], ["FAN_TYPE", 154.25, 405.65, 0.8, 0.8, -52, ["DEF_230_40"]], ["HERO_TYPE", 50.35, 113.35, 0.68, 0.68, 0, [""]], ["STATIC_BALK_1_TYPE", 186.9, 147.1, 0.64, 0.92, -120, [""] ], ["AIM_TYPE", 114.35, 81.25, 0.73, 0.73, -9, ["DEF"]] ] ], allBgIndexes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], isEditorDebug = !1, editorLevelToLoad = 3, manifest = [{ src: PRELOADER_LOGO, id: "preloaderlogo" }, { src: "soccerassets.png", id: "zoespritesheet" }], zoeCFG = { framerate: 24, images: ["assets/soccerassets.png"], frames: [ [946, 1742, 37, 33, 0, 17, 15], [1051, 1742, 37, 33, 0, 17, 15], [909, 1742, 37, 33, 0, 17, 15], [1252, 2, 312, 244, 0, 159, 148], [131, 692, 128, 127, 0, 63, 59], [846, 1694, 230, 45, 0, 104, 17], [448, 1555, 74, 73, 0, 35, 31 ], [355, 936, 87, 86, 0, 41, 41], [529, 936, 87, 86, 0, 41, 41], [473, 1628, 168, 62, 0, 81, 30], [1242, 1105, 77, 76, 0, 37, 34], [700, 1028, 77, 77, 0, 37, 34], [855, 1028, 77, 77, 0, 37, 34], [546, 1105, 78, 77, 0, 37, 35], [442, 936, 87, 86, 0, 41, 39], [1920, 1555, 67, 66, 0, 31, 29], [1987, 1555, 62, 61, 0, 29, 27], [276, 1742, 36, 40, 0, 0, 0], [281, 362, 201, 182, 0, 95, 30], [1751, 820, 87, 93, 0, 41, 48], [1664, 820, 87, 93, 0, 41, 48], [1838, 820, 87, 93, 0, 41, 48], [482, 362, 298, 166, 0, 146, 141], [1578, 936, 80, 79, 0, 39, 36], [853, 936, 93, 82, 0, 46, 43], [1409, 1628, 161, 50, 0, 80, 23], [2, 1694, 261, 48, 0, 125, 17 ], [1076, 1694, 141, 45, 0, 71, 21], [2, 1785, 174, 30, 0, 84, 12], [1274, 1742, 228, 32, 0, 113, 14], [1649, 1742, 149, 31, 0, 73, 14], [1088, 1742, 186, 32, 0, 93, 14], [1798, 1742, 206, 30, 0, 102, 12], [176, 1785, 150, 30, 0, 74, 12], [2, 820, 168, 116, 0, 86, 57], [1019, 1628, 276, 52, 0, 136, 24], [2, 544, 160, 148, 0, 73, 68], [540, 1694, 306, 47, 0, 150, 20], [981, 2, 271, 275, 0, 128, 148], [270, 544, 139, 147, 0, 71, 81], [1564, 2, 221, 221, 0, 109, 108], [2044, 2, 4, 4, 0, 200, 200], [1741, 1628, 159, 49, 0, 78, 18], [170, 820, 314, 113, 0, 154, 34], [1900, 1628, 138, 49, 0, 96, 23], [843, 1785, 157, 26, 0, 75, 11 ], [1740, 936, 233, 78, 0, 99, 44], [2, 1628, 204, 66, 0, 100, 32], [2017, 820, 28, 45, 0, -4, 0], [1374, 1694, 35, 44, 0, 0, 0], [1462, 1694, 33, 44, 0, -1, 0], [1495, 1694, 35, 44, 0, 0, 0], [1614, 1694, 33, 44, 0, -1, 0], [1682, 1694, 35, 44, 0, 0, 0], [1647, 1694, 35, 44, 0, 0, 0], [1581, 1694, 33, 44, 0, -1, 0], [1340, 1694, 34, 44, 0, -1, 0], [2013, 1105, 35, 45, 0, 0, 1], [1113, 1785, 114, 26, 0, 55, 11], [1388, 820, 94, 94, 0, 0, 0], [271, 1628, 138, 66, 0, 67, 32], [817, 1555, 138, 72, 0, 67, 33], [1438, 1555, 138, 68, 0, 67, 32], [1576, 1555, 138, 68, 0, 67, 32], [1714, 1555, 138, 67, 0, 67, 32], [598, 820, 114, 113, 0, 55, 54 ], [1508, 692, 120, 119, 0, 57, 58], [382, 692, 124, 123, 0, 60, 59], [1031, 692, 120, 121, 0, 58, 59], [1E3, 1785, 113, 26, 0, 54, 10], [499, 1785, 113, 26, 0, 54, 10], [1627, 1628, 57, 50, 0, 27, 24], [874, 1742, 35, 34, 0, 15, 15], [612, 1785, 116, 26, 0, 55, 10], [517, 1742, 35, 36, 0, 15, 16], [481, 1742, 36, 36, 0, 15, 16], [717, 1742, 35, 35, 0, 15, 16], [587, 1742, 35, 35, 0, 15, 16], [752, 1742, 35, 35, 0, 15, 15], [552, 1742, 35, 36, 0, 15, 16], [1684, 1628, 57, 50, 0, 27, 24], [522, 1555, 73, 73, 0, 35, 34], [701, 1628, 58, 58, 0, 27, 27], [759, 1628, 59, 58, 0, 27, 27], [818, 1628, 58, 56, 0, 27, 26], [1570, 1628, 57, 50, 0, 27, 24 ], [641, 1628, 60, 60, 0, 28, 29], [263, 1694, 50, 48, 0, 24, 22], [202, 936, 72, 88, 0, 35, 44], [274, 936, 81, 87, 0, 30, 44], [1693, 544, 150, 132, 0, 40, 44], [1284, 1694, 56, 44, 0, 27, 22], [1502, 1742, 68, 32, 0, 34, 14], [787, 1742, 87, 35, 0, 46, 14], [1570, 1742, 79, 32, 0, 45, 14], [622, 1742, 95, 35, 0, 55, 15], [1993, 1258, 56, 65, 0, 26, 36], [409, 1628, 64, 65, 0, 28, 38], [1295, 1628, 55, 51, 0, 25, 27], [206, 1628, 65, 66, 0, 29, 33], [1436, 936, 82, 79, 0, 37, 43], [1022, 936, 89, 81, 0, 39, 44], [107, 936, 95, 88, 0, 43, 46], [1180, 820, 102, 95, 0, 44, 49], [2, 936, 105, 92, 0, 45, 47], [1282, 820, 106, 94, 0, 47, 48 ], [1559, 820, 105, 93, 0, 44, 49], [350, 1742, 131, 37, 0, 64, 17], [876, 1628, 90, 55, 0, 45, 26], [1981, 1182, 68, 69, 0, 32, 33], [1852, 1555, 68, 67, 0, 31, 33], [385, 1785, 114, 27, 0, 55, 11], [326, 1785, 30, 30, 0, 14, 15], [2004, 1742, 33, 30, 0, 15, 14], [356, 1785, 29, 28, 0, 13, 12], [983, 1742, 35, 33, 0, 16, 16], [1227, 1785, 35, 25, 0, 16, 8], [1262, 1785, 127, 23, 0, 65, 10], [1516, 1785, 127, 23, 0, 65, 10], [1389, 1785, 127, 23, 0, 65, 10], [1350, 1628, 59, 50, 0, 27, 22], [728, 1785, 115, 26, 0, 54, 10], [312, 1742, 38, 38, 0, 17, 17], [427, 1694, 113, 48, 0, 54, 22], [313, 1694, 114, 48, 0, 55, 22 ], [1104, 1555, 334, 72, 0, 1, -2], [1418, 1482, 334, 73, 0, 1, -1], [232, 1408, 334, 74, 0, 1, 0], [566, 1408, 334, 74, 0, 1, 0], [1414, 1182, 334, 75, 0, 1, 1], [1080, 1182, 334, 75, 0, 1, 1], [1198, 1408, 334, 74, 0, 1, 0], [1680, 1408, 334, 74, 0, 1, 0], [634, 1482, 334, 73, 0, 1, -1], [300, 1482, 334, 73, 0, 1, -1], [2, 2, 554, 360, 0, 0, 0], [556, 2, 425, 314, 0, 0, 0], [2022, 692, 25, 46, 0, -23, -13], [1251, 1694, 33, 44, 0, -20, -14], [2017, 1028, 32, 45, 0, -21, -15], [2014, 1408, 34, 45, 0, -18, -14], [1217, 1694, 34, 45, 0, -21, -15], [1907, 1694, 34, 43, 0, -20, -16], [245, 1742, 31, 42, 0, -22, -17], [215, 1742, 30, 43, 0, -22, -17 ], [1875, 1694, 32, 43, 0, -21, -16], [108, 1742, 53, 43, 0, -11, -16], [1994, 1694, 45, 43, 0, -14, -17], [1941, 1694, 53, 43, 0, -10, -16], [1409, 1694, 53, 44, 0, -10, -15], [161, 1742, 54, 43, 0, -11, -15], [2, 1742, 52, 43, 0, -11, -16], [54, 1742, 54, 43, 0, -11, -16], [1824, 1694, 51, 43, 0, -11, -16], [1530, 1694, 51, 44, 0, -11, -16], [1717, 1694, 51, 43, 0, -11, -16], [1768, 1694, 56, 43, 0, -10, -16], [310, 1182, 76, 76, 0, 36, 36], [1165, 1028, 76, 77, 0, 36, 37], [540, 1258, 76, 75, 0, 36, 36], [1004, 1258, 75, 75, 0, 36, 36], [1290, 1333, 74, 74, 0, 35, 36], [2, 1482, 74, 73, 0, 35, 36], [1142, 1333, 74, 74, 0, 35, 37 ], [1068, 1333, 74, 74, 0, 35, 38], [995, 1333, 73, 74, 0, 35, 38], [1762, 1258, 75, 75, 0, 36, 39], [1154, 1258, 75, 75, 0, 36, 39], [1533, 1258, 75, 75, 0, 36, 39], [386, 1182, 76, 76, 0, 36, 40], [78, 1182, 76, 76, 0, 36, 40], [1241, 1028, 76, 77, 0, 36, 40], [1317, 1028, 78, 77, 0, 37, 40], [1395, 1028, 78, 77, 0, 37, 40], [1706, 1028, 78, 77, 0, 37, 40], [1549, 1028, 79, 77, 0, 37, 40], [1628, 1028, 78, 77, 0, 36, 40], [154, 1182, 78, 76, 0, 36, 39], [616, 1182, 78, 76, 0, 36, 39], [462, 1182, 78, 76, 0, 36, 39], [2, 1258, 78, 75, 0, 36, 38], [306, 1258, 78, 75, 0, 36, 38], [1686, 1258, 76, 75, 0, 35, 38], [232, 1333, 76, 74, 0, 35, 38], [539, 1333, 76, 74, 0, 35, 38], [1343, 1482, 75, 73, 0, 35, 37], [373, 1555, 75, 73, 0, 35, 37], [1030, 1555, 74, 72, 0, 35, 36], [955, 1555, 75, 72, 0, 36, 36], [308, 1333, 76, 74, 0, 36, 37], [768, 1333, 76, 74, 0, 36, 37], [844, 1333, 77, 74, 0, 37, 37], [926, 1258, 78, 75, 0, 37, 37], [848, 1258, 78, 75, 0, 37, 37], [770, 1258, 78, 75, 0, 37, 37], [232, 1182, 78, 76, 0, 37, 38], [624, 1105, 78, 77, 0, 37, 38], [702, 1105, 78, 77, 0, 37, 38], [780, 1105, 77, 77, 0, 37, 38], [1863, 1028, 77, 77, 0, 37, 38], [1940, 1028, 77, 77, 0, 37, 38], [314, 1105, 76, 77, 0, 37, 38], [155, 1258, 76, 75, 0, 37, 37], [80, 1258, 75, 75, 0, 37, 37], [1512, 1333, 75, 74, 0, 37, 36], [1664, 1333, 74, 74, 0, 37, 36], [2, 1555, 74, 73, 0, 37, 35], [158, 1333, 74, 74, 0, 37, 35], [1738, 1333, 74, 74, 0, 37, 34], [1364, 1333, 74, 74, 0, 37, 34], [1004, 1182, 76, 75, 0, 38, 35], [1089, 1105, 76, 77, 0, 38, 36], [540, 1182, 76, 76, 0, 38, 36], [857, 1105, 78, 77, 0, 39, 37], [158, 1105, 78, 77, 0, 39, 37], [236, 1105, 78, 77, 0, 39, 37], [544, 1028, 78, 77, 0, 39, 37], [694, 1182, 78, 75, 0, 39, 36], [850, 1182, 78, 75, 0, 39, 36], [1587, 1333, 77, 74, 0, 38, 36], [1119, 1482, 75, 73, 0, 37, 35], [1194, 1482, 74, 73, 0, 36, 35], [223, 1555, 75, 73, 0, 36, 35 ], [298, 1555, 75, 73, 0, 35, 36], [692, 1333, 76, 74, 0, 35, 36], [615, 1333, 77, 74, 0, 36, 36], [1748, 1182, 78, 75, 0, 37, 36], [772, 1182, 78, 75, 0, 37, 36], [935, 1105, 78, 77, 0, 37, 37], [390, 1105, 78, 77, 0, 37, 37], [468, 1105, 78, 77, 0, 37, 37], [1165, 1105, 77, 77, 0, 36, 37], [1319, 1105, 76, 76, 0, 36, 36], [1472, 1105, 76, 76, 0, 36, 36], [1013, 1105, 76, 77, 0, 36, 37], [928, 1182, 76, 75, 0, 36, 36], [231, 1258, 75, 75, 0, 36, 36], [1438, 1333, 74, 74, 0, 35, 36], [149, 1555, 74, 73, 0, 35, 36], [1216, 1333, 74, 74, 0, 35, 37], [921, 1333, 74, 74, 0, 35, 38], [76, 1555, 73, 73, 0, 35, 38], [1812, 1333, 75, 74, 0, 36, 39 ], [1307, 1258, 75, 75, 0, 36, 39], [1382, 1258, 75, 75, 0, 36, 39], [2, 1182, 76, 76, 0, 36, 40], [1702, 1105, 76, 76, 0, 36, 40], [1548, 1105, 76, 76, 0, 36, 40], [80, 1105, 78, 77, 0, 37, 40], [2, 1105, 78, 77, 0, 37, 40], [1856, 1105, 78, 76, 0, 37, 40], [1934, 1105, 79, 76, 0, 37, 40], [1784, 1028, 79, 77, 0, 37, 40], [1778, 1105, 78, 76, 0, 36, 39], [80, 1333, 78, 75, 0, 36, 39], [1915, 1258, 78, 75, 0, 36, 39], [1837, 1258, 78, 75, 0, 36, 39], [384, 1333, 78, 74, 0, 36, 38], [462, 1333, 77, 74, 0, 35, 38], [1887, 1333, 76, 74, 0, 35, 38], [968, 1482, 76, 73, 0, 35, 37], [1268, 1482, 75, 73, 0, 34, 37], [1044, 1482, 75, 73, 0, 35, 37 ], [225, 1482, 75, 73, 0, 35, 37], [595, 1555, 75, 72, 0, 36, 36], [150, 1482, 75, 73, 0, 36, 36], [1963, 1333, 76, 74, 0, 36, 37], [2, 1408, 76, 74, 0, 36, 37], [78, 1408, 77, 74, 0, 37, 37], [1903, 1182, 78, 75, 0, 37, 37], [1229, 1258, 78, 75, 0, 37, 37], [462, 1258, 78, 75, 0, 37, 37], [1624, 1105, 78, 76, 0, 37, 38], [155, 1028, 78, 77, 0, 37, 38], [1087, 1028, 78, 77, 0, 37, 38], [1010, 1028, 77, 77, 0, 37, 38], [1973, 936, 77, 77, 0, 37, 38], [78, 1028, 77, 77, 0, 37, 38], [2, 1028, 76, 77, 0, 37, 38], [694, 1258, 76, 75, 0, 37, 37], [1079, 1258, 75, 75, 0, 37, 37], [1049, 1408, 75, 74, 0, 37, 36], [1124, 1408, 74, 74, 0, 37, 36 ], [76, 1482, 74, 73, 0, 37, 35], [1532, 1408, 74, 74, 0, 37, 35], [1606, 1408, 74, 74, 0, 37, 34], [975, 1408, 74, 74, 0, 37, 34], [1457, 1258, 76, 75, 0, 38, 35], [1473, 1028, 76, 77, 0, 38, 36], [1395, 1105, 77, 76, 0, 38, 36], [233, 1028, 78, 77, 0, 39, 37], [777, 1028, 78, 77, 0, 39, 37], [622, 1028, 78, 77, 0, 39, 37], [616, 1258, 78, 75, 0, 39, 36], [384, 1258, 78, 75, 0, 39, 36], [1826, 1182, 77, 75, 0, 38, 36], [1752, 1482, 77, 73, 0, 38, 35], [1829, 1482, 75, 73, 0, 37, 35], [1904, 1482, 75, 73, 0, 36, 35], [670, 1555, 75, 72, 0, 35, 35], [900, 1408, 75, 74, 0, 35, 36], [155, 1408, 77, 74, 0, 36, 36], [2, 1333, 78, 75, 0, 37, 36 ], [1608, 1258, 78, 75, 0, 37, 36], [311, 1028, 78, 77, 0, 37, 37], [932, 1028, 78, 77, 0, 37, 37], [389, 1028, 78, 77, 0, 37, 37], [467, 1028, 77, 77, 0, 36, 37], [1306, 936, 65, 80, 0, 30, 38], [1371, 936, 65, 80, 0, 30, 38], [1241, 936, 65, 80, 0, 30, 38], [1176, 936, 65, 80, 0, 30, 38], [1111, 936, 65, 80, 0, 30, 38], [2, 362, 279, 182, 0, 0, 0], [1785, 2, 215, 160, 0, 0, 1], [2E3, 2, 44, 93, 0, 19, 73], [1973, 544, 57, 107, 0, 27, 77], [830, 692, 80, 122, 0, 39, 81], [1948, 362, 101, 135, 0, 50, 84], [1050, 544, 103, 139, 0, 51, 87], [662, 544, 104, 144, 0, 51, 91], [556, 544, 106, 145, 0, 52, 91], [162, 544, 108, 147, 0, 53, 92 ], [1689, 362, 110, 150, 0, 54, 93], [750, 692, 80, 122, 0, 40, 93], [1862, 692, 80, 116, 0, 40, 94], [1942, 692, 80, 112, 0, 40, 95], [712, 820, 79, 110, 0, 39, 97], [900, 820, 78, 106, 0, 39, 98], [1482, 820, 77, 93, 0, 38, 100], [700, 936, 77, 83, 0, 38, 92], [777, 936, 76, 82, 0, 37, 93], [946, 936, 76, 81, 0, 37, 94], [1518, 936, 60, 79, 0, 22, 94], [1658, 936, 42, 78, 0, 21, 95], [1700, 936, 40, 78, 0, 20, 96], [2030, 544, 13, 13, 0, 0, 83], [1979, 1482, 68, 67, 0, 32, 32], [616, 936, 84, 83, 0, 40, 40], [791, 820, 109, 109, 0, 53, 53], [1843, 544, 130, 129, 0, 63, 63], [1291, 544, 135, 135, 0, 66, 66], [909, 544, 141, 141, 0, 69, 69 ], [933, 362, 152, 152, 0, 75, 74], [780, 362, 153, 152, 0, 75, 74], [1085, 362, 152, 151, 0, 75, 74], [1388, 362, 151, 151, 0, 74, 74], [1237, 362, 151, 151, 0, 74, 74], [1539, 362, 150, 150, 0, 74, 73], [1799, 362, 149, 148, 0, 73, 72], [409, 544, 147, 146, 0, 72, 71], [766, 544, 143, 143, 0, 70, 70], [1153, 544, 138, 137, 0, 68, 67], [1426, 544, 135, 134, 0, 66, 65], [1561, 544, 132, 132, 0, 65, 64], [2, 692, 129, 128, 0, 63, 62], [1018, 1742, 33, 33, 0, 15, 15], [966, 1628, 53, 52, 0, 25, 25], [745, 1555, 72, 72, 0, 35, 35], [1925, 820, 92, 92, 0, 45, 45], [1084, 820, 96, 95, 0, 46, 46], [978, 820, 106, 106, 0, 51, 51 ], [484, 820, 114, 113, 0, 55, 55], [1746, 692, 116, 117, 0, 56, 57], [1151, 692, 118, 119, 0, 57, 58], [1628, 692, 118, 118, 0, 57, 57], [1269, 692, 119, 119, 0, 58, 58], [1388, 692, 120, 119, 0, 58, 58], [910, 692, 121, 121, 0, 59, 59], [628, 692, 122, 122, 0, 59, 59], [506, 692, 122, 123, 0, 59, 60], [259, 692, 123, 123, 0, 60, 60] ], animations: { 0: { frames: [56], speed: 1 }, 1: { frames: [48], speed: 1 }, 2: { frames: [49], speed: 1 }, 3: { frames: [50], speed: 1 }, 4: { frames: [51], speed: 1 }, 5: { frames: [52, 52], speed: 1 }, 6: { frames: [57], speed: 1 }, 7: { frames: [53], speed: 1 }, 8: { frames: [54], speed: 1 }, 9: { frames: [55], speed: 1 }, lvlnum4: { frames: [140], speed: 1 }, BONUS_STAR_TYPE: { frames: [91], speed: 1 }, lvlnum20: { frames: [156], speed: 1 }, particle3v: { frames: [2], speed: 1 }, AIM_TYPE: { frames: [88], speed: 1 }, logov: { frames: [3], speed: 1 }, lvlnum6: { frames: [142], speed: 1 }, biglimetxt: { frames: [43], speed: 1 }, parteffectv3: { frames: [356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 41, 41, 41], speed: 1 }, particleglass2: { frames: [113], speed: 1 }, lvlnum9: { frames: [145], speed: 1 }, lvlnum5: { frames: [141], speed: 1 }, musiconbtn: { frames: [11], speed: 1 }, TELEPORT_TYPE: { frames: [157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307 ], speed: 1 }, HARD_RECT_TYPE_2: { frames: [70], speed: 1 }, particleglass1: { frames: [112], speed: 1 }, GLASS_BLOCK_TYPE: { frames: [111], speed: 1 }, achievdesc2: { frames: [30], speed: 1 }, achievdesc1: { frames: [29], speed: 1 }, lvlnum3: { frames: [139], speed: 1 }, tint2: { frames: [59], speed: 1 }, DECOR_HELP_3_TYPE: { frames: [67], speed: 1 }, backbtn: { frames: [6], speed: 1 }, creditstitle: { frames: [42], speed: 1 }, achievdesc4: { frames: [32], speed: 1 }, lvlnum19: { frames: [155], speed: 1 }, lvlnum16: { frames: [152], speed: 1 }, creditselk: { frames: [34], speed: 1 }, lvlnum2: { frames: [138], speed: 1 }, radugav: { frames: [40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41], speed: 1 }, STATIC_BALK_1_TYPE_2: { frames: [73, 73], speed: 1 }, bgwinv: { frames: [136], speed: 1 }, MONSTER_TYPE: { frames: [109, 110, 109], speed: 1 }, tintbg: { frames: [17], speed: 1 }, DECOR_HELP_2_TYPE: { frames: [66], speed: 1 }, achievback: { frames: [35], speed: 1 }, STATIC_BOX_TYPE: { frames: [72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72 ], speed: 1 }, lvlnum17: { frames: [153], speed: 1 }, lvlnum18: { frames: [154], speed: 1 }, HARD_RECT_TYPE: { frames: [69], speed: 1 }, nextlevelwin: { frames: [23], speed: 1 }, lvlnum1: { frames: [137], speed: 1 }, deathanimv: { frames: [108], speed: 1 }, TELEGA_TYPE: { frames: [123], speed: 1 }, fansv: { frames: [125, 126, 127, 128, 129, 130, 131, 132, 133, 134], speed: 1 }, playbtnup: { frames: [4], speed: 1 }, PART_50: { frames: [92], speed: 1 }, lvlnum15: { frames: [151], speed: 1 }, achievdesc0: { frames: [28], speed: 1 }, BOMB_TYPE: { frames: [96], speed: 1 }, achievdesc5: { frames: [33], speed: 1 }, DANGER_TYPE: { frames: [107], speed: 1 }, achievdesc3: { frames: [31], speed: 1 }, DYNAMIC_CIRCLE_TYPE: { frames: [122], speed: 1 }, TELEGA_TYPE_2: { frames: [124, 124], speed: 1 }, STATIC_BALK_1_TYPE: { frames: [58], speed: 1 }, LAND_TYPE_2: { frames: [61], speed: 1 }, bombexplosionv: { frames: [97, 98, 99, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106], speed: 1 }, restartbtn: { frames: [13], speed: 1 }, DECOR_HELP_1_TYPE: { frames: [65], speed: 1 }, AIM_TYPE_MOVABLE: { frames: [90], speed: 1 }, DYNAMIC_RECT_TYPE_2: { frames: [121], speed: 1 }, spelelogo: { frames: [47], speed: 1 }, tryagaintitle: { frames: [18], speed: 1 }, splashlogo: { frames: [46], speed: 1 }, particleglass3: { frames: [114], speed: 1 }, lvlnum14: { frames: [150], speed: 1 }, BONUS_GHOST_TYPE: { frames: [120], speed: 1 }, LAND_TYPE: { frames: [60], speed: 1 }, totalscoreslabel: { frames: [45], speed: 1 }, levelreadylabel: { frames: [44], speed: 1 }, DECOR_HELP_4_TYPE: { frames: [68, 68, 68, 68], speed: 1 }, LAND_TYPE_5: { frames: [64], speed: 1 }, particle2v: { frames: [1], speed: 1 }, moregames2v: { frames: [25], speed: 1 }, lvlnum12: { frames: [148], speed: 1 }, ACTIVATOR_TYPE: { frames: [115, 116, 116 ], speed: 1 }, levelselecttitle: { frames: [5], speed: 1 }, LAND_TYPE_3: { frames: [62], speed: 1 }, DOOR_TYPE: { frames: [117, 118, 119], speed: 1 }, particle1v: { frames: [0], speed: 1 }, lvlnum13: { frames: [149], speed: 1 }, pausetitle: { frames: [9], speed: 1 }, parteffectv2: { frames: [337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 41], speed: 1 }, BONUS_DIAMOND_TYPE: { frames: [86], speed: 1 }, btnbaseup: { frames: [15], speed: 1 }, DYNAMIC_BOX_TYPE_3: { frames: [84], speed: 1 }, lvlLabelStar0: { frames: [7], speed: 1 }, DYNAMIC_BOX_TYPE_2: { frames: [83], speed: 1 }, lvlLabelStar3: { frames: [21], speed: 1 }, lvlLabelStar2: { frames: [20], speed: 1 }, newachievtitle: { frames: [37], speed: 1 }, lvlLabelStar1: { frames: [19], speed: 1 }, lvlcompletebgnew: { frames: [22], speed: 1 }, PART_200: { frames: [95, 95], speed: 1 }, HARD_BOX_TYPE_5: { frames: [78], speed: 1 }, GLASS_BOX_TYPE: { frames: [79], speed: 1 }, DYNAMIC_RECT_TYPE: { frames: [73], speed: 1 }, DYNAMIC_TRIANGLE_TYPE: { frames: [85, 85, 85, 85, 85], speed: 1 }, PART_150: { frames: [94], speed: 1 }, HERO_TYPE: { frames: [81], speed: 1 }, HARD_BOX_TYPE_4: { frames: [77], speed: 1 }, achievmenutitle: { frames: [26], speed: 1 }, bigbg: { frames: [135], speed: 1 }, parteffectv1: { frames: [315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336], speed: 1 }, quitbtn: { frames: [10], speed: 1 }, achievclosed: { frames: [27], speed: 1 }, musicoffbtn: { frames: [12], speed: 1 }, achievbtn: { frames: [14], speed: 1 }, smallwinv: { frames: [314], speed: 1 }, completeelk: { frames: [39], speed: 1 }, lvlnum10: { frames: [146], speed: 1 }, levelbuttonlocked: { frames: [8], speed: 1 }, lvlnum11: { frames: [147], speed: 1 }, pausebtn: { frames: [16], speed: 1 }, HARD_BOX_TYPE_3: { frames: [76], speed: 1 }, HARD_BOX_TYPE_2: { frames: [75], speed: 1 }, PART_100: { frames: [93], speed: 1 }, HARD_BOX_TYPE: { frames: [74], speed: 1 }, FAN_TYPE_ON: { frames: [309, 310, 311, 312, 309, 310, 311, 312, 309, 309], speed: 1 }, AIM_BACK: { frames: [89], speed: 1 }, newachievbgv: { frames: [38], speed: 1 }, achievelk: { frames: [36], speed: 1 }, DYNAMIC_BOX_TYPE: { frames: [82], speed: 1 }, HARD_TRIANGLE_TYPE: { frames: [71], speed: 1 }, smallbg: { frames: [313], speed: 1 }, LAND_TYPE_4: { frames: [63], speed: 1 }, lvlnum7: { frames: [143], speed: 1 }, FAN_TYPE: { frames: [308], speed: 1 }, GLASS_TRIANGLE_TYPE: { frames: [80], speed: 1 }, BONUS_MONEY_TYPE: { frames: [87], speed: 1 }, completestar: { frames: [24, 24], speed: 1 }, lvlnum8: { frames: [144], speed: 1 } } }, interfaceCFG = {}, bgCFG = { framerate: 24, images: ["assets/cheapbg.jpg"], frames: [ [0, 270, 401, 270, 0, 0, 0], [401, 270, 401, 270, 0, 0, 0], [0, 540, 401, 270, 0, 0, 0], [401, 0, 401, 270, 0, 0, 0], [0, 0, 401, 270, 0, 0, 0] ], animations: { bigbg: { speed: 1, frames: [0, 1, 2, 3, 4] } } }, PART_STAR_TYPE = 1, PART_CLOUD_TYPE = 2, PART_NUM_TYPE = 3, PART_INSTRUCTION_TYPE = 4, PART_GLASS_TYPE = 5, PART_ACHIEV_TYPE = 6, MAX_PARTICLES_ON_SCREEN = 12; (function (c) { function a(a, b, c) { this.initialize(a, b, c) } var b = a.prototype; b.initialize = function (a, b, c) { var e = new createjs.Sprite(zoeSS); e.snapToPixel = !0; e.baseBlock = this; this.vis = e; this.reset(a, b, c) }; b.reset = function (a, b, c) { this.type = a; this.vis.parent != b && removeFromParent(this.vis); createjs.Tween.removeTweens(this.vis); this.parent = b; this.vis.alpha = 1; this.vis.mouseEnabled = !1; this.speedY = this.speedX = 0; this.moveTarget = null; this.speedA = 0; this.speedScale = 0.05; this.maxScale = 1.2; this.isPrerendered = !1; this.speedAlpha = 0.08; this.gravity = 0.6; this.isNum = !1; this.beforeHideTimer = 0.1; this.isNeedDispose = this.isInstruction = !1; this.vis.spriteSheet = zoeSS; deleteCache(this.vis); var e = "numb0"; a == PART_STAR_TYPE ? e = 0.7 < Math.random() ? "particle1v" : 0.5 < Math.random() ? "particle3v" : "particle2v" : a == PART_NUM_TYPE || a == PART_ACHIEV_TYPE ? this.isNum = !0 : a == PART_CLOUD_TYPE ? (this.gravity = 0, e = 0.5 < Math.random() ? "cloud1v" : "cloud2v") : a == PART_INSTRUCTION_TYPE ? this.isInstruction = !0 : a === PART_GLASS_TYPE && (e = 0.7 < Math.random() ? "particleglass1" : 0.5 < Math.random() ? "particleglass2" : "particleglass3"); this.vis.gotoAndStop(e); this.scale = c; this.updateVisionScale(); b.addChild(this.vis) }; b.setPos = function (a, b) { this.vis.x = a; this.vis.y = b }; b.setNum = function (a) { this.beforeHideTimer = 10; this.speedAlpha = 0.03; this.gravity = 0; this.vis.rotation = 0; this.vis.gotoAndStop("PART_" + a) }; b.setFrame = function (a, b) { this.gravity = 0; this.vis.rotation = 0; b ? this.vis.gotoAndPlay(a) : this.vis.gotoAndStop(a) }; b.tick = function () { if (!(this.isNeedDispose || (this.moveTarget ? (this.vis.x = this.moveTarget.x, this.vis.y = this.moveTarget.y) : (this.vis.x += this.speedX * dtScale, this.vis.y += this.speedY * dtScale, this.speedY += this.gravity * dtScale, this.vis.rotation += this.speedA * dtScale), this.beforeHideTimer -= dtScale, 0 < this.beforeHideTimer))) if (this.isPrerendered) this.isNeedDispose = !0; else { if (this.isNum) this.vis.alpha -= this.speedAlpha * dtScale; else { if (this.isInstruction) return; this.vis.visible = !0; this.vis.scaleX += this.speedScale * dtScale; this.vis.scaleX > this.maxScale && (this.vis.alpha -= this.speedAlpha * dtScale); this.vis.scaleY = this.vis.scaleX } 0.01 > this.vis.alpha && (this.isNeedDispose = !0) } }; b.updateVisionScale = function () { this.vis.scaleX = this.vis.scaleY = this.scale }; b.dispose = function () { isArrayContains(allParts, this) && allParts.splice(allParts.indexOf(this, 0), 1); addToDisposedParts(this); this.vis.removeAllEventListeners(); this.vis.stop(); removeFromParent(this.vis) }; c.ParticleBase = a })(window); var allParts = [], disposedParts = []; function initParticleManager() { container.addChild(particleContainer) } var partSin, partCos, partScale; function createPartExplode(c, a, b, g, f, d) { for (var e, h = 0; h < b; h++) { e = h * (2 * Math.PI / b); partSin = Math.cos(e); partCos = Math.sin(e); e = createPart(g, c, a, 1, f ? f : particleContainer); if (!e) break; setParticleParamsByIndex(e, d ? d : 0) } } function setParticleParamsByIndex(c, a) { var b = 1.3; c.gravity = 0; c.speedA = 20 * Math.random(); 0 === a ? (c.maxScale = 0.7, c.beforeHideTimer = 0.2 * FPS, partScale = 0.2 + 0.2 * Math.random()) : 1 === a ? (b = 4, c.maxScale = 1.3, c.beforeHideTimer = 0.3 * FPS, c.gravity = 0, c.speedAlpha = 0.05, c.speedA = 20 * Math.random(), partScale = 0.4 + 0.6 * Math.random()) : 2 === a ? (b = 2, c.maxScale = 1.3, c.vis.alpha = 1, c.beforeHideTimer = 0.3 * FPS, c.speedA = 20 * Math.random(), partScale = 0.4 + 0.6 * Math.random()) : 3 === a && (b = 1.3, c.gravity = 0, c.speedA = 20 * Math.random(), c.maxScale = 0.7, c.beforeHideTimer = 0.1 * FPS, c.gravity = 0, c.speedAlpha = 0.05, partScale = 0.6, c.vis.alpha = 1); c.vis.scaleX = c.vis.scaleY = partScale; c.speedX = (b + Math.random() * b) * partCos; c.speedY = (b + Math.random() * b) * partSin } function createDiePart(c, a) { var b = createPart(PART_NUM_TYPE, c, a, 1, particleContainer); b && (b.setNum(11), b.setFrame("deathanimv", !0), b.speedAlpha = 0.05, b.beforeHideTimer = 1.5 * FPS, b.speedX = 0, b.speedY = -1, b.speedA = 0) } function createGoodPlayExplode(c, a) { for (var b, g = 0 == a ? 90 : -120, f = 0; 8 > f; f++) { var d = f * (Math.PI / 2 / 8) - Math.PI / 4; 0 < a && (d += Math.PI); var e = Math.cos(d), d = Math.sin(d); b = 0.2 + 0.2 * Math.random(); b = createPart(PART_STAR_TYPE, g, 0, b, monsterCont); if (!b) break; b.setFrame("particle1v"); b.speedAlpha = 0.1; b.speedScale = 0.02; b.vis.visible = !1; b.beforeHideTimer = 0.5 * FPS; b.maxScale = 0.6; b.speedX = (1.5 + 1.5 * Math.random()) * e; b.speedY = (1.5 + 1.5 * Math.random()) * d; b.speedA = 20 * Math.random() } } function createNumPart(c, a, b) { if (c = createPart(PART_NUM_TYPE, c, a, 0.8, particleContainer)) c.setNum(b), c.beforeHideTimer = 0.2 * FPS, c.speedX = 0, c.speedY = -0.8, c.speedA = 0 } function createPrerenderedPart(c, a, b, g, f, d, e) { if (c = createPart(PART_NUM_TYPE, c, a, b, particleContainer)) c.setFrame(g, !0), setNextAnimation(c.vis, ""), e && setAnimationSpeed(c.vis, e), c.isPrerendered = !0, d && (c.moveTarget = d), c.beforeHideTimer = f * GAME_FPS, c.speedX = 0, c.speedY = 0, c.speedA = 0, c.gravity = 0, c.vis.rotation = 0 } function createGlassRectExplode(c, a, b, g) { for (var f, d = 0; 5 > d; d++) { var e = g * Math.PI / 180; f = Math.cos(e); var e = Math.sin(e), h = (24.4 * d - 60) * b; f = createPart(PART_GLASS_TYPE, c + h * f, a + h * e, 1, particleContainer); if (!f) break; f.gravity = 0; f.speedA = 20 * Math.random(); f.maxScale = 0.7; f.beforeHideTimer = 0.1 * FPS; f.gravity = 0; f.speedAlpha = 0.05; partScale = 0.6; f.vis.scaleX = f.vis.scaleY = partScale; f.speedX = 1.3 - 2.6 * Math.random(); f.speedY = 1.3 - 2.6 * Math.random() } } function createAwesomePart() { var c = createPart(PART_NUM_TYPE, 160, topVisionLine + viewportH / 2, 1, particleContainer); c && (c.setNum(11), c.speedAlpha = 1, c.beforeHideTimer = 1.5 * FPS, c.speedX = 0, c.speedY = 0, c.speedA = 0, c.vis.rotation = -360, c.vis.scaleX = c.vis.scaleY = 0.1, createjs.Tween.get(c.vis, { override: !0 }) .to({ rotation: 0, scaleX: 1, scaleY: 1 }, 600) .wait(600) .to({ alpha: 0 }, 200)) } function createAchievPart(c) { for (var a = 210, b = 10, g = 0, f, d = 0; d < allParts.length; d++) f = allParts[d], f.type === PART_ACHIEV_TYPE && (a = f.vis.y - 50, b += 200, g++); if (f = createPart(PART_ACHIEV_TYPE, -130, a, 0.8, container)) f.setFrame("achievdesc" + c), f.speedAlpha = 1, f.beforeHideTimer = 3.2 * FPS + 0.2 * g, f.speedX = 0, f.speedY = 0, f.speedA = 0, f.vis.rotation = 0, f.vis.scaleX = f.vis.scaleY = 0.7, f.vis.alpha = 1, createjs.Tween.get(f.vis, { override: !0 }) .wait(b) .to({ x: 5 }, 600, menuEase) .wait(2E3) .to({ x: -130 }, 400, createjs.Ease.sineIn) } var allPartsLenght = 0; function createPart(c, a, b, g, f) { var d; allPartsLenght = allParts.length; if (allPartsLenght > MAX_PARTICLES_ON_SCREEN) { for (var e = 0; e < allPartsLenght; e++) if (allParts[e].type === PART_STAR_TYPE) { d = allParts[e]; break } d || (d = allParts[0]); d.reset(c, f, g) } else d = gePartFromPool(c, f, g); d.setPos(a, b); isArrayContains(allParts, d) || allParts.push(d); return d } function addToDisposedParts(c) { isArrayContains(disposedParts, c) || disposedParts.push(c) } function gePartFromPool(c, a, b) { if (0 < disposedParts.length) { var g = disposedParts.pop(); g.reset(c, a, b); return g } return new ParticleBase(c, a, b) } var partLength = 0, currPart = null, disposeNeededParts = []; function updatePartManager() { partLength = allParts.length; for (var c = 0; c < partLength; c++) currPart = allParts[c], currPart.tick(), currPart.isNeedDispose && disposeNeededParts.push(currPart); for (; 0 < disposeNeededParts.length;) disposeNeededParts.pop() .dispose() } (function () { Object.create = Object.create || function (a) { function b() {} return b.prototype = a, new b }; var c; "undefined" == typeof exports ? (c = {}, "object" == typeof window && (window.cp = c)) : c = exports; var a, b, g = function (a, b) { if (!a) throw Error("Assertion failed: " + b); }, f = function (a, b) { !a && console && console.warn && (console.warn("ASSERTION FAILED: " + b), console.trace && console.trace()) }, d = function (a, b) { return b > a ? a : b }, e = function (a, b) { return a > b ? a : b }; "object" == typeof window && -1 < window.navigator.userAgent.indexOf("Firefox") ? (a = Math.min, b = Math.max) : (a = d, b = e); var h = function (a, b) { return b > a ? a + " " + b : b + " " + a }, k = function (a, b) { for (var c = 0; a.length > c; c++) if (a[c] === b) return a[c] = a[a.length - 1], a.length--, void 0 }; c.momentForCircle = function (a, b, c, d) { return a * (0.5 * (b * b + c * c) + N(d)) }; c.areaForCircle = function (a, b) { return Math.PI * Math.abs(a * a - b * b) }; c.momentForSegment = function (a, b, c) { var d = z(A(b, c), 0.5); return a * (Ka(c, b) / 12 + N(d)) }; c.areaForSegment = function (a, b, c) { return c * (Math.PI * c + 2 * sa(a, b)) }; c.momentForPoly = function (a, b, c) { for (var d = 0, e = 0, f = b.length, g = 0; f > g; g += 2) var h = b[g] + c.x, k = b[g + 1] + c.y, m = b[(g + 2) % f] + c.x, n = b[(g + 3) % f] + c.y, q = m * k - n * h, d = d + q * (h * h + k * k + (h * m + k * n) + (m * m + n * n)), e = e + q; return a * d / (6 * e) }; c.areaForPoly = function (a) { for (var b = 0, c = 0, d = a.length; d > c; c += 2) b += F(new q(a[c], a[c + 1]), new q(a[(c + 2) % d], a[(c + 3) % d])); return -b / 2 }; c.centroidForPoly = function (a) { for (var b = 0, c = new q(0, 0), d = 0, e = a.length; e > d; d += 2) var f = new q(a[d], a[d + 1]), g = new q(a[(d + 2) % e], a[(d + 3) % e]), h = F(f, g), b = b + h, c = A(c, z(A(f, g), h)); return z(c, 1 / (3 * b)) }; c.recenterPoly = function (a) { for (var b = c.centroidForPoly(a), d = 0; a.length > d; d += 2) a[d] -= b.x, a[d + 1] -= b.y }; c.momentForBox = function (a, b, c) { return a * (b * b + c * c) / 12 }; c.momentForBox2 = function (a, b) { var d = b.r - b.l, e = b.t - b.b, f = z([b.l + b.r, b.b + b.t], 0.5); return c.momentForBox(a, d, e) + a * N(f) }; var m = c.loopIndexes = function (a) { var b, c, d, e, f = 0, g = 0; b = d = a[0]; c = e = a[1]; for (var h = a.length >> 1, k = 1; h > k; k++) { var m = a[2 * k], n = a[2 * k + 1]; b > m || m == b && c > n ? (b = m, c = n, f = k) : (m > d || m == d && n > e) && (d = m, e = n, g = k) } return [f, g] }, n = function (a, b, c) { var d = a[2 * b]; a[2 * b] = a[2 * c]; a[2 * c] = d; d = a[2 * b + 1]; a[2 * b + 1] = a[2 * c + 1]; a[2 * c + 1] = d }, p = function (a, b, c, d, e, f) { if (0 === c) return 0; var g = 0, h = b; e = y(e, d); f *= x(e); var k = b; for (c = b + c - 1; c >= k;) { var m = new q(a[2 * k], a[2 * k + 1]), m = F(e, y(m, d)); m > f ? (m > g && (g = m, h = k), k++) : (n(a, k, c), c--) } return h != b && n(a, b, h), k - b }, r = function (a, b, c, d, e, f, g, h) { if (0 > d) return 0; if (0 == d) return b[2 * h] = f.x, b[2 * h + 1] = f.y, 1; var k = p(b, c, d, e, f, a), m = new q(b[2 * c], b[2 * c + 1]); e = r(a, b, c + 1, k - 1, e, m, f, h); m = h + e++; b[2 * m] = f.x; b[2 * m + 1] = f.y; d = p(b, c + k, d - k, f, g, a); m = new q(b[2 * (c + k)], b[2 * (c + k) + 1]); return e + r(a, b, c + k + 1, d - 1, f, m, g, h + e) }; c.convexHull = function (a, b, c) { if (b) for (var d = 0; a.length > d; d++) b[d] = a[d]; else b = a; var e = m(a), d = e[0], e = e[1]; if (d == e) return b.length = 2, b; n(b, 0, d); n(b, 1, 0 == e ? d : e); d = new q(b[0], b[1]); e = new q(b[2], b[3]); a = r(c, b, 2, (a.length >> 1) - 2, d, e, d, 1) + 1; return b.length = 2 * a, f(Ma(b), "Internal error: cpConvexHull() and cpPolyValidate() did not agree.Please report this error with as much info as you can."), b }; var s = function (c, d, e) { return a(b(c, d), e) }, t = function (c) { return b(0, a(c, 1)) }, q = c.Vect = function (a, b) { this.x = a; this.y = b }; c.v = function (a, b) { return new q(a, b) }; var w = c.vzero = new q(0, 0), u = c.v.dot = function (a, b) { return a.x * b.x + a.y * b.y }, x = c.v.len = function (a) { return Math.sqrt(u(a, a)) }, K = c.v.len2 = function (a, b) { return Math.sqrt(a * a + b * b) }; c.v.eql = function (a, b) { return a.x === b.x && a.y === b.y }; var A = c.v.add = function (a, b) { return new q(a.x + b.x, a.y + b.y) }; q.prototype.add = function (a) { return this.x += a.x, this.y += a.y, this }; var y = c.v.sub = function (a, b) { return new q(a.x - b.x, a.y - b.y) }; q.prototype.sub = function (a) { return this.x -= a.x, this.y -= a.y, this }; var C = c.v.neg = function (a) { return new q(-a.x, -a.y) }; q.prototype.neg = function () { return this.x = -this.x, this.y = -this.y, this }; var z = c.v.mult = function (a, b) { return new q(a.x * b, a.y * b) }; q.prototype.mult = function (a) { return this.x *= a, this.y *= a, this }; var F = c.v.cross = function (a, b) { return a.x * b.y - a.y * b.x }, J = c.v.perp = function (a) { return new q(-a.y, a.x) }; c.v.pvrperp = function (a) { return new q(a.y, -a.x) }; var P = c.v.project = function (a, b) { return z(b, u(a, b) / N(b)) }; q.prototype.project = function (a) { return this.mult(u(this, a) / N(a)), this }; var E = c.v.rotate = function (a, b) { return new q(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x) }; q.prototype.rotate = function (a) { return this.x = this.x * a.x - this.y * a.y, this.y = this.x * a.y + this.y * a.x, this }; var S = c.v.unrotate = function (a, b) { return new q(a.x * b.x + a.y * b.y, a.y * b.x - a.x * b.y) }, N = c.v.lengthsq = function (a) { return u(a, a) }, Z = c.v.lengthsq2 = function (a, b) { return a * a + b * b }, T = c.v.lerp = function (a, b, c) { return A(z(a, 1 - c), z(b, c)) }, Q = c.v.normalize = function (a) { return z(a, 1 / x(a)) }, G = c.v.normalize_safe = function (a) { return 0 === a.x && 0 === a.y ? w : Q(a) }, M = c.v.clamp = function (a, b) { return u(a, a) > b * b ? z(Q(a), b) : a }; c.v.lerpconst = function (a, b, c) { return A(a, M(y(b, a), c)) }; var sa = c.v.dist = function (a, b) { return x(y(a, b)) }, Ka = c.v.distsq = function (a, b) { return N(y(a, b)) }; c.v.near = function (a, b, c) { return c * c > Ka(a, b) }; var eb = c.v.slerp = function (a, b, c) { var d = Math.acos(u(a, b)); if (d) { var e = 1 / Math.sin(d); return A(z(a, Math.sin((1 - c) * d) * e), z(b, Math.sin(c * d) * e)) } return a }; c.v.slerpconst = function (b, c, d) { var e = Math.acos(u(b, c)); return eb(b, c, a(d, e) / e) }; c.v.forangle = function (a) { return new q(Math.cos(a), Math.sin(a)) }; c.v.toangle = function (a) { return Math.atan2(a.y, a.x) }; c.v.str = function (a) { return "(" + a.x.toFixed(3) + ", " + a.y.toFixed(3) + ")" }; var fb = 0, $ = c.BB = function (a, b, c, d) { this.l = a; this.b = b; this.r = c; this.t = d; fb++ }; c.bb = function (a, b, c, d) { return new $(a, b, c, d) }; var La = 0; c.NO_GROUP = 0; var gb = c.ALL_LAYERS = -1; c.resetShapeIdCounter = function () { La = 0 }; var O = c.Shape = function (a) { this.body = a; this.bb_l = this.bb_b = this.bb_r = this.bb_t = 0; this.hashid = La++; this.sensor = !1; this.u = this.e = 0; this.surface_v = w; this.group = this.collision_type = 0; this.layers = gb; this.space = null; this.collisionCode = this.collisionCode }; O.prototype.setElasticity = function (a) { this.e = a }; O.prototype.setFriction = function (a) { this.body.activate(); this.u = a }; O.prototype.setLayers = function (a) { this.body.activate(); this.layers = a }; O.prototype.setSensor = function (a) { this.body.activate(); this.sensor = a }; O.prototype.setCollisionType = function (a) { this.body.activate(); this.collision_type = a }; O.prototype.getBody = function () { return this.body }; O.prototype.active = function () { return this.body && -1 !== this.body.shapeList.indexOf(this) }; O.prototype.setBody = function (a) { g(!this.active(), "You cannot change the body on an active shape. You must remove the shape from the space before changing the body."); this.body = a }; O.prototype.cacheBB = function () { return this.update(this.body.p, this.body.rot) }; O.prototype.update = function (a, b) { g(!isNaN(b.x), "Rotation is NaN"); g(!isNaN(a.x), "Position is NaN"); this.cacheData(a, b) }; O.prototype.pointQuery = function (a) { a = this.nearestPointQuery(a); return 0 > a.d ? a : void 0 }; O.prototype.getBB = function () { return new $(this.bb_l, this.bb_b, this.bb_r, this.bb_t) }; var ta = function (a, b, c) { this.shape = a; this.p = b; this.d = c }, ha = function (a, b, c) { this.shape = a; this.t = b; this.n = c }; ha.prototype.hitPoint = function (a, b) { return T(a, b, this.t) }; ha.prototype.hitDist = function (a, b) { return sa(a, b) * this.t }; var fa = c.CircleShape = function (a, b, c) { this.c = this.tc = c; this.r = b; this.type = "circle"; O.call(this, a) }; fa.prototype = Object.create(O.prototype); fa.prototype.cacheData = function (a, b) { var c = this.tc = E(this.c, b) .add(a), d = this.r; this.bb_l = c.x - d; this.bb_b = c.y - d; this.bb_r = c.x + d; this.bb_t = c.y + d }; fa.prototype.nearestPointQuery = function (a) { var b = a.x - this.tc.x, c = a.y - this.tc.y; a = K(b, c); var d = this.r, b = new q(this.tc.x + b * d / a, this.tc.y + c * d / a); return new ta(this, b, a - d) }; var ua = function (a, b, c, d, e) { d = y(d, b); e = y(e, b); b = u(d, d) - 2 * u(d, e) + u(e, e); var f = -2 * u(d, d) + 2 * u(d, e); c = u(d, d) - c * c; c = f * f - 4 * b * c; if (0 <= c && (b = (-f - Math.sqrt(c)) / (2 * b), 0 <= b && 1 >= b)) return new ha(a, b, Q(T(d, e, b))) }; fa.prototype.segmentQuery = function (a, b) { return ua(this, this.tc, this.r, a, b) }; var ba = c.SegmentShape = function (a, b, c, d) { this.a = b; this.b = c; this.n = J(Q(y(c, b))); this.ta = this.tb = this.tn = null; this.r = d; this.b_tangent = this.a_tangent = w; this.type = "segment"; O.call(this, a) }; ba.prototype = Object.create(O.prototype); ba.prototype.cacheData = function (a, b) { this.ta = A(a, E(this.a, b)); this.tb = A(a, E(this.b, b)); this.tn = E(this.n, b); var c, d, e, f; this.ta.x < this.tb.x ? (c = this.ta.x, d = this.tb.x) : (c = this.tb.x, d = this.ta.x); this.ta.y < this.tb.y ? (e = this.ta.y, f = this.tb.y) : (e = this.tb.y, f = this.ta.y); var g = this.r; this.bb_l = c - g; this.bb_b = e - g; this.bb_r = d + g; this.bb_t = f + g }; ba.prototype.nearestPointQuery = function (a) { var b; b = this.tb; var c = y(this.ta, b), d = t(u(c, y(a, b)) / N(c)); b = A(b, z(c, d)); var c = a.x - b.x, e = a.y - b.y; a = K(c, e); d = this.r; b = a ? A(b, z(new q(c, e), d / a)) : b; return new ta(this, b, a - d) }; ba.prototype.segmentQuery = function (a, b) { var c = this.tn, d = u(y(this.ta, a), c), e = this.r, f = 0 < d ? C(c) : c, g = y(z(f, e), a), h = A(this.ta, g), k = A(this.tb, g), g = y(b, a); if (0 >= F(g, h) * F(g, k)) { if (e = d + (0 < d ? -e : e), d = -e, c = u(g, c) - e, 0 > d * c) return new ha(this, d / (d - c), f) } else if (0 !== e) return f = ua(this, this.ta, this.r, a, b), c = ua(this, this.tb, this.r, a, b), f ? c && c.t < f.t ? c : f : c }; ba.prototype.setNeighbors = function (a, b) { this.a_tangent = y(a, this.a); this.b_tangent = y(b, this.b) }; ba.prototype.setEndpoints = function (a, b) { this.a = a; this.b = b; this.n = J(Q(y(b, a))) }; var Ma = function (a) { for (var b = a.length, c = 0; b > c; c += 2) { var d = a[(c + 2) % b], e = a[(c + 3) % b]; if (0 < (d - a[c]) * (a[(c + 5) % b] - e) - (e - a[c + 1]) * (a[(c + 4) % b] - d)) return !1 } return !0 }, R = c.PolyShape = function (a, b, c) { this.setVerts(b, c); this.type = "poly"; O.call(this, a) }; R.prototype = Object.create(O.prototype); var va = function (a, b) { this.n = a; this.d = b }; va.prototype.compare = function (a) { return u(this.n, a) - this.d }; R.prototype.setVerts = function (a, b) { g(4 <= a.length, "Polygons require some verts"); g("number" == typeof a[0], "Polygon verticies should be specified in a flattened list (eg [x1,y1,x2,y2,x3,y3,...])"); g(Ma(a), "Polygon is concave or has a reversed winding. Consider using cpConvexHull()"); var c = a.length, d = c >> 1; this.verts = Array(c); this.tVerts = Array(c); this.planes = Array(d); this.tPlanes = Array(d); for (d = 0; c > d; d += 2) { var e = a[d] + b.x, f = a[d + 1] + b.y, h = Q(J(new q(a[(d + 2) % c] + b.x - e, a[(d + 3) % c] + b.y - f))); this.verts[d] = e; this.verts[d + 1] = f; this.planes[d >> 1] = new va(h, h.x * e + h.y * f); this.tPlanes[d >> 1] = new va(new q(0, 0), 0) } }; c.BoxShape = function (a, b, c) { b /= 2; c /= 2; return hb(a, new $(-b, -c, b, c)) }; var hb = c.BoxShape2 = function (a, b) { return new R(a, [b.l, b.b, b.l, b.t, b.r, b.t, b.r, b.b], w) }; R.prototype.transformVerts = function (c, d) { for (var e = this.verts, f = this.tVerts, g = 1 / 0, h = -1 / 0, k = 1 / 0, m = -1 / 0, n = 0; e.length > n; n += 2) { var q = e[n], p = e[n + 1], r = c.x + q * d.x - p * d.y, q = c.y + q * d.y + p * d.x; f[n] = r; f[n + 1] = q; g = a(g, r); h = b(h, r); k = a(k, q); m = b(m, q) } this.bb_l = g; this.bb_b = k; this.bb_r = h; this.bb_t = m }; R.prototype.transformAxes = function (a, b) { for (var c = this.planes, d = this.tPlanes, e = 0; c.length > e; e++) { var f = E(c[e].n, b); d[e].n = f; d[e].d = u(a, f) + c[e].d } }; R.prototype.cacheData = function (a, b) { this.transformAxes(a, b); this.transformVerts(a, b) }; R.prototype.nearestPointQuery = function (a) { for (var b = this.tPlanes, c = this.tVerts, d = c[c.length - 2], e = c[c.length - 1], f = 1 / 0, g = w, h = !1, k = 0; b.length > k; k++) { 0 < b[k].compare(a) && (h = !0); var m = c[2 * k], n = c[2 * k + 1], p; p = m; var r = n, d = d - p, e = e - r, s = t((d * (a.x - p) + e * (a.y - r)) / Z(d, e)); p = new q(p + d * s, r + e * s); r = sa(a, p); f > r && (f = r, g = p); d = m; e = n } return new ta(this, g, h ? f : -f) }; R.prototype.segmentQuery = function (a, b) { for (var c = this.tPlanes, d = this.tVerts, e = c.length, f = 2 * e, g = 0; e > g; g++) { var h = c[g].n, k = u(a, h); if (!(c[g].d > k)) { var m = u(b, h), k = (c[g].d - k) / (m - k); if (!(0 > k || 1 < k)) { var m = T(a, b, k), m = -F(h, m), n = -(h.x * d[(2 * g + 3) % f] - h.y * d[(2 * g + 2) % f]); if (m >= -(h.x * d[2 * g + 1] - h.y * d[2 * g]) && n >= m) return new ha(this, k, h) } } } }; R.prototype.valueOnAxis = function (b, c) { for (var d = this.tVerts, e = b.x * d[0] + b.y * d[1], f = 2; d.length > f; f += 2) e = a(e, b.x * d[f] + b.y * d[f + 1]); return e - c }; R.prototype.containsVert = function (a, b) { for (var c = this.tPlanes, d = 0; c.length > d; d++) { var e = c[d].n; if (0 < e.x * a + e.y * b - c[d].d) return !1 } return !0 }; R.prototype.containsVertPartial = function (a, b, c) { for (var d = this.tPlanes, e = 0; d.length > e; e++) { var f = d[e].n; if (!(0 > u(f, c)) && 0 < f.x * a + f.y * b - d[e].d) return !1 } return !0 }; R.prototype.getNumVerts = function () { return this.verts.length / 2 }; R.prototype.getVert = function (a) { return new q(this.verts[2 * a], this.verts[2 * a + 1]) }; var D = c.Body = function (a, b) { this.p = new q(0, 0); this.vx = this.vy = 0; this.f = new q(0, 0); this.t = this.w = 0; this.v_limit = 1 / 0; this.w_limit = 1 / 0; this.w_bias = this.v_biasx = this.v_biasy = 0; this.space = null; this.shapeList = []; this.nodeNext = this.nodeRoot = this.constraintList = this.arbiterList = null; this.nodeIdleTime = 0; this.setMass(a); this.setMoment(b); this.rot = new q(0, 0); this.setAngle(0) }; if ("undefined" != typeof DEBUG && DEBUG) { var wa = function (a, b) { g(a.x == a.x && a.y == a.y, b) }, xa = function (a, b) { g(1 / 0 !== Math.abs(a.x) && 1 / 0 !== Math.abs(a.y), b) }; D.prototype.sanityCheck = function () { g(this.m === this.m && this.m_inv === this.m_inv, "Body's mass is invalid."); g(this.i === this.i && this.i_inv === this.i_inv, "Body's moment is invalid."); var a = this.p; wa(a, "Body's position is invalid."); xa(a, "Body's position is invalid."); a = this.f; wa(a, "Body's force is invalid."); xa(a, "Body's force is invalid."); g(this.vx === this.vx && 1 / 0 !== Math.abs(this.vx), "Body's velocity is invalid."); g(this.vy === this.vy && 1 / 0 !== Math.abs(this.vy), "Body's velocity is invalid."); g(this.a === this.a && 1 / 0 !== Math.abs(this.a), "Body's angle is invalid."); g(this.w === this.w && 1 / 0 !== Math.abs(this.w), "Body's angular velocity is invalid."); g(this.t === this.t && 1 / 0 !== Math.abs(this.t), "Body's torque is invalid."); a = this.rot; wa(a, "Body's rotation vector is invalid."); xa(a, "Body's rotation vector is invalid."); g(this.v_limit === this.v_limit, "Body's velocity limit is invalid."); g(this.w_limit === this.w_limit, "Body's angular velocity limit is invalid.") } } else D.prototype.sanityCheck = function () {}; D.prototype.getPos = function () { return this.p }; D.prototype.getVel = function () { return new q(this.vx, this.vy) }; D.prototype.getAngVel = function () { return this.w }; D.prototype.isSleeping = function () { return null !== this.nodeRoot }; D.prototype.isStatic = function () { return 1 / 0 === this.nodeIdleTime }; D.prototype.isRogue = function () { return null === this.space }; D.prototype.setMass = function (a) { g(0 < a, "Mass must be positive and non-zero."); this.activate(); this.m = a; this.m_inv = 1 / a }; D.prototype.setMoment = function (a) { g(0 < a, "Moment of Inertia must be positive and non-zero."); this.activate(); this.i = a; this.i_inv = 1 / a }; D.prototype.addShape = function (a) { this.shapeList.push(a) }; D.prototype.removeShape = function (a) { k(this.shapeList, a) }; var ya = function (a, b, c) { return a === c ? a.next(b) : (a.a === b ? a.next_a = ya(a.next_a, b, c) : a.next_b = ya(a.next_b, b, c), a) }; D.prototype.removeConstraint = function (a) { this.constraintList = ya(this.constraintList, this, a) }; D.prototype.setPos = function (a) { this.activate(); this.sanityCheck(); a === w && (a = c.v(0, 0)); this.p = a }; D.prototype.setVel = function (a) { this.activate(); this.vx = a.x; this.vy = a.y }; D.prototype.setAngVel = function (a) { this.activate(); this.w = a }; D.prototype.setAngleInternal = function (a) { g(!isNaN(a), "Internal Error: Attempting to set body's angle to NaN"); this.a = a; this.rot.x = Math.cos(a); this.rot.y = Math.sin(a) }; D.prototype.setAngle = function (a) { this.activate(); this.sanityCheck(); this.setAngleInternal(a) }; D.prototype.velocity_func = function (a, b, c) { var d = this.vx * b + (a.x + this.f.x * this.m_inv) * c; a = this.vy * b + (a.y + this.f.y * this.m_inv) * c; var e = this.v_limit, f = d * d + a * a, e = f > e * e ? e / Math.sqrt(f) : 1; this.vx = d * e; this.vy = a * e; d = this.w_limit; this.w = s(this.w * b + this.t * this.i_inv * c, -d, d); this.sanityCheck() }; D.prototype.position_func = function (a) { this.p.x += (this.vx + this.v_biasx) * a; this.p.y += (this.vy + this.v_biasy) * a; this.setAngleInternal(this.a + (this.w + this.w_bias) * a); this.w_bias = this.v_biasx = this.v_biasy = 0; this.sanityCheck() }; D.prototype.resetForces = function () { this.activate(); this.f = new q(0, 0); this.t = 0 }; D.prototype.applyForce = function (a, b) { this.activate(); this.f = A(this.f, a); this.t += F(b, a) }; D.prototype.applyImpulse = function (a, b) { this.activate(); za(this, a.x, a.y, b) }; D.prototype.getVelAtPoint = function (a) { return A(new q(this.vx, this.vy), z(J(a), this.w)) }; D.prototype.getVelAtWorldPoint = function (a) { return this.getVelAtPoint(y(a, this.p)) }; D.prototype.getVelAtLocalPoint = function (a) { return this.getVelAtPoint(E(a, this.rot)) }; D.prototype.eachShape = function (a) { for (var b = 0, c = this.shapeList.length; c > b; b++) a(this.shapeList[b]) }; D.prototype.eachConstraint = function (a) { for (var b = this.constraintList; b;) { var c = b.next(this); a(b); b = c } }; D.prototype.eachArbiter = function (a) { for (var b = this.arbiterList; b;) { var c = b.next(this); b.swappedColl = this === b.body_b; a(b); b = c } }; D.prototype.local2World = function (a) { return A(this.p, E(a, this.rot)) }; D.prototype.world2Local = function (a) { return S(y(a, this.p), this.rot) }; D.prototype.kineticEnergy = function () { var a = this.vx * this.vx + this.vy * this.vy, b = this.w * this.w; return (a ? a * this.m : 0) + (b ? b * this.i : 0) }; var Aa = c.SpatialIndex = function (a) { if (this.staticIndex = a, a) { if (a.dynamicIndex) throw Error("This static index is already associated with a dynamic index."); a.dynamicIndex = this } }; Aa.prototype.collideStatic = function (a, b) { if (0 < a.count) { var c = a.query; this.each(function (a) { c(a, new $(a.bb_l, a.bb_b, a.bb_r, a.bb_t), b) }) } }; var I = c.BBTree = function (a) { Aa.call(this, a); this.velocityFunc = null; this.leaves = {}; this.count = 0; this.pooledPairs = this.pooledNodes = this.root = null; this.stamp = 0 }; I.prototype = Object.create(Aa.prototype); var ib = 0, W = function (c, d, e) { this.obj = null; this.bb_l = a(d.bb_l, e.bb_l); this.bb_b = a(d.bb_b, e.bb_b); this.bb_r = b(d.bb_r, e.bb_r); this.bb_t = b(d.bb_t, e.bb_t); this.parent = null; this.setA(d); this.setB(e) }; I.prototype.makeNode = function (a, b) { var c = this.pooledNodes; return c ? (this.pooledNodes = c.parent, c.constructor(this, a, b), c) : (ib++, new W(this, a, b)) }; var jb = 0, X = function (a, b) { this.obj = b; a.getBB(b, this); this.parent = null; this.stamp = 1; this.pairs = null; jb++ }; I.prototype.getBB = function (c, d) { var e = this.velocityFunc; if (e) { var f = 0.1 * (c.bb_r - c.bb_l), g = 0.1 * (c.bb_t - c.bb_b), e = z(e(c), 0.1); d.bb_l = c.bb_l + a(-f, e.x); d.bb_b = c.bb_b + a(-g, e.y); d.bb_r = c.bb_r + b(f, e.x); d.bb_t = c.bb_t + b(g, e.y) } else d.bb_l = c.bb_l, d.bb_b = c.bb_b, d.bb_r = c.bb_r, d.bb_t = c.bb_t }; I.prototype.getStamp = function () { var a = this.dynamicIndex; return a && a.stamp ? a.stamp : this.stamp }; I.prototype.incrementStamp = function () { this.dynamicIndex && this.dynamicIndex.stamp ? this.dynamicIndex.stamp++ : this.stamp++ }; var kb = 0, Na = function (a, b, c, d) { this.prevA = null; this.leafA = a; this.nextA = b; this.prevB = null; this.leafB = c; this.nextB = d }; I.prototype.makePair = function (a, b, c, d) { var e = this.pooledPairs; return e ? (this.pooledPairs = e.prevA, e.prevA = null, e.leafA = a, e.nextA = b, e.prevB = null, e.leafB = c, e.nextB = d, e) : (kb++, new Na(a, b, c, d)) }; Na.prototype.recycle = function (a) { this.prevA = a.pooledPairs; a.pooledPairs = this }; var Oa = function (a, b, c) { c && (c.leafA === b ? c.prevA = a : c.prevB = a); a ? a.leafA === b ? a.nextA = c : a.nextB = c : b.pairs = c }; X.prototype.clearPairs = function (a) { var b, c = this.pairs; for (this.pairs = null; c;) c.leafA === this ? (b = c.nextA, Oa(c.prevB, c.leafB, c.nextB)) : (b = c.nextB, Oa(c.prevA, c.leafA, c.nextA)), c.recycle(a), c = b }; var Pa = function (a, b, c) { var d = a.pairs, e = b.pairs; c = c.makePair(a, d, b, e); a.pairs = b.pairs = c; d && (d.leafA === a ? d.prevA = c : d.prevB = c); e && (e.leafA === b ? e.prevA = c : e.prevB = c) }; W.prototype.recycle = function (a) { this.parent = a.pooledNodes; a.pooledNodes = this }; X.prototype.recycle = function () {}; W.prototype.setA = function (a) { this.A = a; a.parent = this }; W.prototype.setB = function (a) { this.B = a; a.parent = this }; X.prototype.isLeaf = !0; W.prototype.isLeaf = !1; W.prototype.otherChild = function (a) { return this.A == a ? this.B : this.A }; W.prototype.replaceChild = function (c, d, e) { f(c == this.A || c == this.B, "Node is not a child of parent."); this.A == c ? (this.A.recycle(e), this.setA(d)) : (this.B.recycle(e), this.setB(d)); for (c = this; c; c = c.parent) d = c.A, e = c.B, c.bb_l = a(d.bb_l, e.bb_l), c.bb_b = a(d.bb_b, e.bb_b), c.bb_r = b(d.bb_r, e.bb_r), c.bb_t = b(d.bb_t, e.bb_t) }; W.prototype.bbArea = X.prototype.bbArea = function () { return (this.bb_r - this.bb_l) * (this.bb_t - this.bb_b) }; var Qa = function (c, d) { return (b(c.bb_r, d.bb_r) - a(c.bb_l, d.bb_l)) * (b(c.bb_t, d.bb_t) - a(c.bb_b, d.bb_b)) }, Ra = function (a, b) { return Math.abs(a.bb_l + a.bb_r - b.bb_l - b.bb_r) + Math.abs(a.bb_b + a.bb_t - b.bb_b - b.bb_t) }, ia = function (c, d, e) { if (null == c) return d; if (c.isLeaf) return e.makeNode(d, c); var f = c.B.bbArea() + Qa(c.A, d), g = c.A.bbArea() + Qa(c.B, d); return f === g && (f = Ra(c.A, d), g = Ra(c.B, d)), f > g ? c.setB(ia(c.B, d, e)) : c.setA(ia(c.A, d, e)), c.bb_l = a(c.bb_l, d.bb_l), c.bb_b = a(c.bb_b, d.bb_b), c.bb_r = b(c.bb_r, d.bb_r), c.bb_t = b(c.bb_t, d.bb_t), c }; W.prototype.intersectsBB = X.prototype.intersectsBB = function (a) { return this.bb_l <= a.r && a.l <= this.bb_r && this.bb_b <= a.t && a.b <= this.bb_t }; var Ba = function (a, b, c) { a.intersectsBB(b) && (a.isLeaf ? c(a.obj) : (Ba(a.A, b, c), Ba(a.B, b, c))) }, Sa = function (c, d, e) { var f = 1 / (e.x - d.x), g = c.bb_l == d.x ? -1 / 0 : (c.bb_l - d.x) * f, h = c.bb_r == d.x ? 1 / 0 : (c.bb_r - d.x) * f, f = a(g, h), g = b(g, h), h = 1 / (e.y - d.y); e = c.bb_b == d.y ? -1 / 0 : (c.bb_b - d.y) * h; d = c.bb_t == d.y ? 1 / 0 : (c.bb_t - d.y) * h; c = a(e, d); d = b(e, d); return g >= c && d >= f && (f = b(f, c), 0 <= a(g, d) && 1 >= f) ? b(f, 0) : 1 / 0 }, ja = function (b, c, d, e, f) { if (b.isLeaf) return f(b.obj); var g = Sa(b.A, c, d), h = Sa(b.B, c, d); return h > g ? (e > g && (e = a(e, ja(b.A, c, d, e, f))), e > h && (e = a(e, ja(b.B, c, d, e, f)))) : (e > h && (e = a(e, ja(b.B, c, d, e, f))), e > g && (e = a(e, ja(b.A, c, d, e, f)))), e }; I.prototype.subtreeRecycle = function (a) { a.isLeaf && (this.subtreeRecycle(a.A), this.subtreeRecycle(a.B), a.recycle(this)) }; var Ta = function (a, b, c) { if (b == a) return null; var d = b.parent; return d == a ? (b = a.otherChild(b), b.parent = a.parent, a.recycle(c), b) : (d.parent.replaceChild(d, d.otherChild(b), c), a) }, Ua = function (a, b) { return a.bb_l <= b.bb_r && b.bb_l <= a.bb_r && a.bb_b <= b.bb_t && b.bb_b <= a.bb_t }; X.prototype.markLeafQuery = function (a, b, c, d) { Ua(a, this) && (b ? Pa(a, this, c) : (this.stamp < a.stamp && Pa(this, a, c), d && d(a.obj, this.obj))) }; W.prototype.markLeafQuery = function (a, b, c, d) { Ua(a, this) && (this.A.markLeafQuery(a, b, c, d), this.B.markLeafQuery(a, b, c, d)) }; X.prototype.markSubtree = function (a, b, c) { if (this.stamp == a.getStamp()) for (b && b.markLeafQuery(this, !1, a, c), b = this; b.parent; b = b.parent) b == b.parent.A ? b.parent.B.markLeafQuery(this, !0, a, c) : b.parent.A.markLeafQuery(this, !1, a, c); else for (a = this.pairs; a;) this === a.leafB ? (c && c(a.leafA.obj, this.obj), a = a.nextB) : a = a.nextA }; W.prototype.markSubtree = function (a, b, c) { this.A.markSubtree(a, b, c); this.B.markSubtree(a, b, c) }; X.prototype.containsObj = function (a) { return this.bb_l <= a.bb_l && this.bb_r >= a.bb_r && this.bb_b <= a.bb_b && this.bb_t >= a.bb_t }; X.prototype.update = function (a) { var b = a.root; return this.containsObj(this.obj) ? !1 : (a.getBB(this.obj, this), b = Ta(b, this, a), a.root = ia(b, this, a), this.clearPairs(a), this.stamp = a.getStamp(), !0) }; X.prototype.addPairs = function (a) { var b = a.dynamicIndex; b ? (a = b.root) && a.markLeafQuery(this, !0, b, null) : this.markSubtree(a, a.staticIndex.root, null) }; I.prototype.insert = function (a, b) { var c = new X(this, a); this.leaves[b] = c; this.root = ia(this.root, c, this); this.count++; c.stamp = this.getStamp(); c.addPairs(this); this.incrementStamp() }; I.prototype.remove = function (a, b) { var c = this.leaves[b]; delete this.leaves[b]; this.root = Ta(this.root, c, this); this.count--; c.clearPairs(this); c.recycle(this) }; I.prototype.contains = function (a, b) { return null != this.leaves[b] }; var lb = function () {}; I.prototype.reindexQuery = function (a) { if (this.root) { var b, c = this.leaves; for (b in c) c[b].update(this); c = (b = this.staticIndex) && b.root; this.root.markSubtree(this, c, a); b && !c && this.collideStatic(this, b, a); this.incrementStamp() } }; I.prototype.reindex = function () { this.reindexQuery(lb) }; I.prototype.reindexObject = function (a, b) { var c = this.leaves[b]; c && (c.update(this) && c.addPairs(this), this.incrementStamp()) }; I.prototype.pointQuery = function (a, b) { this.query(new $(a.x, a.y, a.x, a.y), b) }; I.prototype.segmentQuery = function (a, b, c, d) { this.root && ja(this.root, a, b, c, d) }; I.prototype.query = function (a, b) { this.root && Ba(this.root, a, b) }; I.prototype.count = function () { return this.count }; I.prototype.each = function (a) { for (var b in this.leaves) a(this.leaves[b].obj) }; var Ca = function (c, d, e, f) { if (1 == f) return d[e]; if (2 == f) return c.makeNode(d[e], d[e + 1]); for (var g = d[e], h = g.bb_l, k = g.bb_b, m = g.bb_r, n = g.bb_t, q = e + f, p = e + 1; q > p; p++) g = d[p], h = a(h, g.bb_l), k = a(k, g.bb_b), m = b(m, g.bb_r), n = b(n, g.bb_t); var g = m - h > n - k, r = Array(2 * f); if (g) for (p = e; q > p; p++) r[2 * p + 0] = d[p].bb_l, r[2 * p + 1] = d[p].bb_r; else for (p = e; q > p; p++) r[2 * p + 0] = d[p].bb_b, r[2 * p + 1] = d[p].bb_t; r.sort(function (a, b) { return a - b }); var s = 0.5 * (r[f - 1] + r[f]), p = h, r = k, t = m, w = n; g ? t = h = s : w = k = s; for (var s = q, u = e; s > u;) g = d[u], (b(g.bb_r, m) - a(g.bb_l, h)) * (b(g.bb_t, n) - a(g.bb_b, k)) < (b(g.bb_r, t) - a(g.bb_l, p)) * (b(g.bb_t, w) - a(g.bb_b, r)) ? (s--, d[u] = d[s], d[s] = g) : u++; if (s == f) { g = null; for (p = e; q > p; p++) g = ia(g, d[p], c); return g } return NodeNew(c, Ca(c, d, e, s - e), Ca(c, d, s, q - s)) }; I.prototype.optimize = function () { var a = Array(this.count), b = 0, c; for (c in this.leaves) a[b++] = this.nodes[c]; tree.subtreeRecycle(root); this.root = Ca(tree, a, a.length) }; var Da = function (a, b) { !a.isLeaf && 10 >= b && (Da(a.A, b + 1), Da(a.B, b + 1)); for (var c = "", d = 0; b > d; d++) c += " "; console.log(c + a.bb_b + " " + a.bb_t) }; I.prototype.log = function () { this.root && Da(this.root, 0) }; var ea = c.CollisionHandler = function () { this.a = this.b = 0 }; ea.prototype.begin = function () { return !0 }; ea.prototype.preSolve = function () { return !0 }; ea.prototype.postSolve = function () {}; ea.prototype.separate = function () {}; var L = function (a, b) { this.u = this.e = 0; this.surface_vr = w; this.a = a; this.body_a = a.body; this.b = b; this.body_b = b.body; this.contacts = this.thread_b_next = this.thread_b_prev = this.thread_a_next = this.thread_a_prev = null; this.stamp = 0; this.handler = null; this.swappedColl = !1; this.state = "first coll" }; L.prototype.getShapes = function () { return this.swappedColl ? [this.b, this.a] : [this.a, this.b] }; L.prototype.totalImpulse = function () { for (var a = this.contacts, b = new q(0, 0), c = 0, d = a.length; d > c; c++) { var e = a[c]; b.add(z(e.n, e.jnAcc)) } return this.swappedColl ? b : b.neg() }; L.prototype.totalImpulseWithFriction = function () { for (var a = this.contacts, b = new q(0, 0), c = 0, d = a.length; d > c; c++) { var e = a[c]; b.add((new q(e.jnAcc, e.jtAcc)) .rotate(e.n)) } return this.swappedColl ? b : b.neg() }; L.prototype.totalKE = function () { for (var a = (1 - this.e) / (1 + this.e), b = 0, c = this.contacts, d = 0, e = c.length; e > d; d++) var f = c[d], g = f.jnAcc, h = f.jtAcc, b = b + (a * g * g / f.nMass + h * h / f.tMass); return b }; L.prototype.ignore = function () { this.state = "ignore" }; L.prototype.getA = function () { return this.swappedColl ? this.b : this.a }; L.prototype.getB = function () { return this.swappedColl ? this.a : this.b }; L.prototype.isFirstContact = function () { return "first coll" === this.state }; var Va = function (a, b, c) { this.point = a; this.normal = b; this.dist = c }; L.prototype.getContactPointSet = function () { var a, b = Array(this.contacts.length); for (a = 0; b.length > a; a++) b[a] = new Va(this.contacts[a].p, this.contacts[a].n, this.contacts[a].dist); return b }; L.prototype.getNormal = function (a) { a = this.contacts[a].n; return this.swappedColl ? C(a) : a }; L.prototype.getPoint = function (a) { return this.contacts[a].p }; L.prototype.getDepth = function (a) { return this.contacts[a].dist }; var Wa = function (a, b, c, d) { c ? c.body_a === b ? c.thread_a_next = d : c.thread_b_next = d : b.arbiterList = d; d && (d.body_a === b ? d.thread_a_prev = c : d.thread_b_prev = c) }; L.prototype.unthread = function () { Wa(this, this.body_a, this.thread_a_prev, this.thread_a_next); Wa(this, this.body_b, this.thread_b_prev, this.thread_b_next); this.thread_b_prev = this.thread_b_next = this.thread_a_prev = this.thread_a_next = null }; L.prototype.update = function (a, b, c, d) { if (this.contacts) for (var e = 0; this.contacts.length > e; e++) for (var f = this.contacts[e], g = 0; a.length > g; g++) { var h = a[g]; h.hash === f.hash && (h.jnAcc = f.jnAcc, h.jtAcc = f.jtAcc) } this.contacts = a; this.handler = b; this.swappedColl = c.collision_type !== b.a; this.e = c.e * d.e; this.u = c.u * d.u; this.surface_vr = y(c.surface_v, d.surface_v); this.a = c; this.body_a = c.body; this.b = d; this.body_b = d.body; "cached" == this.state && (this.state = "first coll") }; L.prototype.preStep = function (b, c, d) { for (var e = this.body_a, f = this.body_b, g = 0; this.contacts.length > g; g++) { var h = this.contacts[g]; h.r1 = y(h.p, e.p); h.r2 = y(h.p, f.p); h.nMass = 1 / ka(e, f, h.r1, h.r2, h.n); h.tMass = 1 / ka(e, f, h.r1, h.r2, J(h.n)); h.bias = -d * a(0, h.dist + c) / b; h.jBias = 0; h.bounce = Ea(e, f, h.r1, h.r2, h.n) * this.e } }; L.prototype.applyCachedImpulse = function (a) { if (!this.isFirstContact()) for (var b = this.body_a, c = this.body_b, d = 0; this.contacts.length > d; d++) { var e = this.contacts[d], f = e.n.x, g = e.n.y; U(b, c, e.r1, e.r2, (f * e.jnAcc - g * e.jtAcc) * a, (f * e.jtAcc + g * e.jnAcc) * a) } }; var mb = 0, nb = 0; L.prototype.applyImpulse = function () { mb++; for (var a = this.body_a, c = this.body_b, d = this.surface_vr, e = this.u, f = 0; this.contacts.length > f; f++) { nb++; var g = this.contacts[f], h = g.nMass, k = g.n, m = g.r1, n = g.r2, q = c.vx - n.y * c.w - (a.vx - m.y * a.w), p = c.vy + n.x * c.w - (a.vy + m.x * a.w), r = q * k.x + p * k.y, t = (q + d.x) * -k.y + (p + d.y) * k.x, p = g.jBias; g.jBias = b(p + (g.bias - (k.x * (c.v_biasx - n.y * c.w_bias - a.v_biasx + m.y * a.w_bias) + k.y * (n.x * c.w_bias + c.v_biasy - m.x * a.w_bias - a.v_biasy))) * h, 0); q = g.jnAcc; g.jnAcc = b(q + -(g.bounce + r) * h, 0); r = e * g.jnAcc; h = g.jtAcc; g.jtAcc = s(h + -t * g.tMass, -r, r); r = k.x * (g.jBias - p); p = k.y * (g.jBias - p); Xa(a, -r, -p, m); Xa(c, r, p, n); q = g.jnAcc - q; g = g.jtAcc - h; U(a, c, m, n, k.x * q - k.y * g, k.x * g + k.y * q) } }; L.prototype.callSeparate = function (a) { a.lookupHandler(this.a.collision_type, this.b.collision_type) .separate(this, a) }; L.prototype.next = function (a) { return this.body_a == a ? this.thread_a_next : this.thread_b_next }; var ob = 0, aa = function (a, b, c, d) { this.p = a; this.n = b; this.dist = c; this.r1 = this.r2 = w; this.jnAcc = this.jtAcc = this.jBias = this.nMass = this.tMass = this.bounce = this.bias = 0; this.hash = d; ob++ }, V = [], ca = function (a, b, c, d) { d = c + d; b = y(b, a); var e = N(b); if (!(e >= d * d)) return e = Math.sqrt(e), new aa(A(a, z(b, 0.5 + (c - 0.5 * d) / (e ? e : 1 / 0))), e ? z(b, 1 / e) : new q(1, 0), e - d, 0) }, Fa = 0, Ya = function (a, b) { var c = 0, d = a.valueOnAxis(b[0].n, b[0].d); if (0 < d) return -1; for (var e = 1; b.length > e; e++) { var f = a.valueOnAxis(b[e].n, b[e].d); if (0 < f) return -1; f > d && (d = f, c = e) } return Fa = d, c }, Za = function (a, b, c, d) { for (var e = [], f = a.tVerts, g = 0; f.length > g; g += 2) { var k = f[g], m = f[g + 1]; b.containsVert(k, m) && e.push(new aa(new q(k, m), c, d, h(a.hashid, g >> 1))) } f = b.tVerts; for (g = 0; f.length > g; g += 2) k = f[g], m = f[g + 1], a.containsVert(k, m) && e.push(new aa(new q(k, m), c, d, h(b.hashid, g >> 1))); if (!e.length) { e = []; f = a.tVerts; for (g = 0; f.length > g; g += 2) k = f[g], m = f[g + 1], b.containsVertPartial(k, m, C(c)) && e.push(new aa(new q(k, m), c, d, h(a.hashid, g))); f = b.tVerts; for (g = 0; f.length > g; g += 2) k = f[g], m = f[g + 1], a.containsVertPartial(k, m, c) && e.push(new aa(new q(k, m), c, d, h(b.hashid, g))) } return a = e }, $a = function (b, c, d) { var e = u(c, b.ta) - b.r; b = u(c, b.tb) - b.r; return a(e, b) - d }, ab = function (a, b, c, d, e) { for (var f = F(b.tn, b.ta), g = F(b.tn, b.tb), k = z(b.tn, e), m = c.tVerts, n = 0; m.length > n; n += 2) { var p = m[n], r = m[n + 1]; if (p * k.x + r * k.y < u(b.tn, b.ta) * e + b.r) { var s = b.tn.x * r - b.tn.y * p; f >= s && s >= g && a.push(new aa(new q(p, r), k, d, h(c.hashid, n))) } } }; fa.prototype.collisionCode = 0; ba.prototype.collisionCode = 1; R.prototype.collisionCode = 2; fa.prototype.collisionTable = [ function (a, b) { var c = ca(a.tc, b.tc, a.r, b.r); return c ? [c] : V }, function (a, b) { var c = b.ta, d = a.tc, e = y(b.tb, c), f = t(u(e, y(d, c)) / N(e)), c = A(c, z(e, f)); return (d = ca(d, c, a.r, b.r)) ? (c = d.n, 0 === f && 0 > u(c, b.a_tangent) || 1 === f && 0 > u(c, b.b_tangent) ? V : [d]) : V }, function (a, b) { for (var c = b.tPlanes, d = 0, e = u(c[0].n, a.tc) - c[0].d - a.r, f = 0; c.length > f; f++) { var g = u(c[f].n, a.tc) - c[f].d - a.r; if (0 < g) return V; g > e && (e = g, d = f) } var c = c[d].n, h = b.tVerts, k = h.length, m = d << 1, d = h[m], f = h[m + 1], g = h[(m + 2) % k], h = h[(m + 3) % k], k = c.x * f - c.y * d, m = c.x * h - c.y * g, n = F(c, a.tc); if (m > n) { var p = ca(a.tc, new q(g, h), a.r, 0, p); return p ? [p] : V } return k > n ? [new aa(y(a.tc, z(c, a.r + e / 2)), C(c), e, 0)] : (p = ca(a.tc, new q(d, f), a.r, 0, p)) ? [p] : V } ]; ba.prototype.collisionTable = [null, function () { return V }, function (a, b) { var c = [], d = b.tPlanes, e = d.length, f = u(a.tn, a.ta), g = b.valueOnAxis(a.tn, f) - a.r, f = b.valueOnAxis(C(a.tn), -f) - a.r; if (0 < f || 0 < g) return V; var k = 0, m = $a(a, d[0].n, d[0].d); if (0 < m) return V; for (var n = 0; e > n; n++) { var p = $a(a, d[n].n, d[n].d); if (0 < p) return V; p > m && (m = p, k = n) } d = C(d[k].n); n = A(a.ta, z(d, a.r)); p = A(a.tb, z(d, a.r)); if (b.containsVert(n.x, n.y) && c.push(new aa(n, d, m, h(a.hashid, 0))), b.containsVert(p.x, p.y) && c.push(new aa(p, d, m, h(a.hashid, 1))), (g >= m || f >= m) && (g > f ? ab(c, a, b, g, 1) : ab(c, a, b, f, -1)), 0 === c.length) { f = 2 * k; k = b.tVerts; m = new q(k[f], k[f + 1]); if ((g = ca(a.ta, m, a.r, 0, c)) || (g = ca(a.tb, m, a.r, 0, c))) return [g]; e *= 2; e = new q(k[(f + 2) % e], k[(f + 3) % e]); if ((g = ca(a.ta, e, a.r, 0, c)) || (g = ca(a.tb, e, a.r, 0, c))) return [g] } return c } ]; R.prototype.collisionTable = [null, null, function (a, b) { var c = Ya(b, a.tPlanes); if (-1 == c) return V; var d = Fa, e = Ya(a, b.tPlanes); if (-1 == e) return V; var f = Fa; return d > f ? Za(a, b, a.tPlanes[c].n, d) : Za(a, b, C(b.tPlanes[e].n), f) } ]; var Ga = c.collideShapes = function (a, b) { return g(a.collisionCode <= b.collisionCode, "Collided shapes must be sorted by type"), a.collisionTable[b.collisionCode](a, b) }, bb = new ea, B = c.Space = function () { this.curr_dt = this.stamp = 0; this.bodies = []; this.rousedBodies = []; this.sleepingComponents = []; this.staticShapes = new I(null); this.activeShapes = new I(this.staticShapes); this.arbiters = []; this.contactBuffersHead = null; this.cachedArbiters = {}; this.constraints = []; this.locked = 0; this.collisionHandlers = {}; this.defaultHandler = bb; this.postStepCallbacks = []; this.iterations = 10; this.gravity = w; this.damping = 1; this.idleSpeedThreshold = 0; this.sleepTimeThreshold = 1 / 0; this.collisionSlop = 0.1; this.collisionBias = Math.pow(0.9, 60); this.collisionPersistence = 3; this.enableContactGraph = !1; this.staticBody = new D(1 / 0, 1 / 0); this.staticBody.nodeIdleTime = 1 / 0; this.collideShapes = this.makeCollideShapes() }; B.prototype.getCurrentTimeStep = function () { return this.curr_dt }; B.prototype.setIterations = function (a) { this.iterations = a }; B.prototype.isLocked = function () { return this.locked }; var Y = function (a) { g(!a.locked, "This addition/removal cannot be done safely during a call to cpSpaceStep() or during a query. Put these calls into a post-step callback.") }; B.prototype.addCollisionHandler = function (a, b, c, d, e, f) { Y(this); this.removeCollisionHandler(a, b); var g = new ea; g.a = a; g.b = b; c && (g.begin = c); d && (g.preSolve = d); e && (g.postSolve = e); f && (g.separate = f); this.collisionHandlers[h(a, b)] = g }; B.prototype.removeCollisionHandler = function (a, b) { Y(this); delete this.collisionHandlers[h(a, b)] }; B.prototype.setDefaultCollisionHandler = function (a, b, c, d) { Y(this); var e = new ea; a && (e.begin = a); b && (e.preSolve = b); c && (e.postSolve = c); d && (e.separate = d); this.defaultHandler = e }; B.prototype.lookupHandler = function (a, b) { return this.collisionHandlers[h(a, b)] || this.defaultHandler }; B.prototype.addShape = function (a) { var b = a.body; return b.isStatic() ? this.addStaticShape(a) : (g(!a.space, "This shape is already added to a space and cannot be added to another."), Y(this), b.activate(), b.addShape(a), a.update(b.p, b.rot), this.activeShapes.insert(a, a.hashid), a.space = this, a) }; B.prototype.addStaticShape = function (a) { g(!a.space, "This shape is already added to a space and cannot be added to another."); Y(this); var b = a.body; return b.addShape(a), a.update(b.p, b.rot), this.staticShapes.insert(a, a.hashid), a.space = this, a }; B.prototype.addBody = function (a) { return g(!a.isStatic(), "Static bodies cannot be added to a space as they are not meant to be simulated."), g(!a.space, "This body is already added to a space and cannot be added to another."), Y(this), this.bodies.push(a), a.space = this, a }; B.prototype.addConstraint = function (a) { g(!a.space, "This shape is already added to a space and cannot be added to another."); Y(this); var b = a.a, c = a.b; return b.activate(), c.activate(), this.constraints.push(a), a.next_a = b.constraintList, b.constraintList = a, a.next_b = c.constraintList, c.constraintList = a, a.space = this, a }; B.prototype.filterArbiters = function (a, b) { for (var c in this.cachedArbiters) { var d = this.cachedArbiters[c]; (a !== d.body_a || b !== d.a && null !== b) && (a !== d.body_b || b !== d.b && null !== b) || (b && "cached" !== d.state && d.callSeparate(this), d.unthread(), k(this.arbiters, d), delete this.cachedArbiters[c]) } }; B.prototype.removeShape = function (a) { var b = a.body; b.isStatic() ? this.removeStaticShape(a) : (g(this.containsShape(a), "Cannot remove a shape that was not added to the space. (Removed twice maybe?)"), Y(this), b.activate(), b.removeShape(a), this.filterArbiters(b, a), this.activeShapes.remove(a, a.hashid), a.space = null) }; B.prototype.removeStaticShape = function (a) { g(this.containsShape(a), "Cannot remove a static or sleeping shape that was not added to the space. (Removed twice maybe?)"); Y(this); var b = a.body; b.isStatic() && b.activateStatic(a); b.removeShape(a); this.filterArbiters(b, a); this.staticShapes.remove(a, a.hashid); a.space = null }; B.prototype.removeBody = function (a) { g(this.containsBody(a), "Cannot remove a body that was not added to the space. (Removed twice maybe?)"); Y(this); a.activate(); k(this.bodies, a); a.space = null }; B.prototype.removeConstraint = function (a) { g(this.containsConstraint(a), "Cannot remove a constraint that was not added to the space. (Removed twice maybe?)"); Y(this); a.a.activate(); a.b.activate(); k(this.constraints, a); a.a.removeConstraint(a); a.b.removeConstraint(a); a.space = null }; B.prototype.containsShape = function (a) { return a.space === this }; B.prototype.containsBody = function (a) { return a.space == this }; B.prototype.containsConstraint = function (a) { return a.space == this }; B.prototype.uncacheArbiter = function (a) { delete this.cachedArbiters[h(a.a.hashid, a.b.hashid)]; k(this.arbiters, a) }; B.prototype.eachBody = function (a) { this.lock(); for (var b = this.bodies, c = 0; b.length > c; c++) a(b[c]); b = this.sleepingComponents; for (c = 0; b.length > c; c++) for (var d = b[c]; d;) { var e = d.nodeNext; a(d); d = e } this.unlock(!0) }; B.prototype.eachShape = function (a) { this.lock(); this.activeShapes.each(a); this.staticShapes.each(a); this.unlock(!0) }; B.prototype.eachConstraint = function (a) { this.lock(); for (var b = this.constraints, c = 0; b.length > c; c++) a(b[c]); this.unlock(!0) }; B.prototype.reindexStatic = function () { g(!this.locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete."); this.staticShapes.each(function (a) { var b = a.body; a.update(b.p, b.rot) }); this.staticShapes.reindex() }; B.prototype.reindexShape = function (a) { g(!this.locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete."); var b = a.body; a.update(b.p, b.rot); this.activeShapes.reindexObject(a, a.hashid); this.staticShapes.reindexObject(a, a.hashid) }; B.prototype.reindexShapesForBody = function (a) { for (a = a.shapeList; a; a = a.next) this.reindexShape(a) }; B.prototype.useSpatialHash = function (a, b) { throw Error("Spatial Hash not implemented."); }; B.prototype.activateBody = function (a) { if (g(!a.isRogue(), "Internal error: Attempting to activate a rogue body."), this.locked) - 1 === this.rousedBodies.indexOf(a) && this.rousedBodies.push(a); else { this.bodies.push(a); for (var b = 0; a.shapeList.length > b; b++) { var c = a.shapeList[b]; this.staticShapes.remove(c, c.hashid); this.activeShapes.insert(c, c.hashid) } for (b = a.arbiterList; b; b = b.next(a)) if (c = b.body_a, a === c || c.isStatic()) { var c = b.a, d = b.b; this.cachedArbiters[h(c.hashid, d.hashid)] = b; b.stamp = this.stamp; b.handler = this.lookupHandler(c.collision_type, d.collision_type); this.arbiters.push(b) } for (b = a.constraintList; b; b = b.nodeNext) c = b.a, (a === c || c.isStatic()) && this.constraints.push(b) } }; B.prototype.deactivateBody = function (a) { g(!a.isRogue(), "Internal error: Attempting to deactivate a rogue body."); k(this.bodies, a); for (var b = 0; a.shapeList.length > b; b++) { var c = a.shapeList[b]; this.activeShapes.remove(c, c.hashid); this.staticShapes.insert(c, c.hashid) } for (c = a.arbiterList; c; c = c.next(a)) b = c.body_a, (a === b || b.isStatic()) && this.uncacheArbiter(c); for (c = a.constraintList; c; c = c.nodeNext) b = c.a, (a === b || b.isStatic()) && k(this.constraints, c) }; D.prototype.activate = function () { if (!this.isRogue()) { this.nodeIdleTime = 0; var a = this ? this.nodeRoot : null; if (a && a.isSleeping(a)) { g(!a.isRogue(), "Internal Error: componentActivate() called on a rogue body."); for (var b = a.space, c = a; c;) { var d = c.nodeNext; c.nodeIdleTime = 0; c.nodeRoot = null; c.nodeNext = null; b.activateBody(c); c = d } k(b.sleepingComponents, a) } } }; D.prototype.activateStatic = function (a) { g(this.isStatic(), "Body.activateStatic() called on a non-static body."); for (var b = this.arbiterList; b; b = b.next(this)) a && a != b.a && a != b.b || (b.body_a == this ? b.body_b : b.body_a) .activate() }; D.prototype.pushArbiter = function (a) { f(null === (a.body_a === this ? a.thread_a_next : a.thread_b_next), "Internal Error: Dangling contact graph pointers detected. (A)"); f(null === (a.body_a === this ? a.thread_a_prev : a.thread_b_prev), "Internal Error: Dangling contact graph pointers detected. (B)"); var b = this.arbiterList; f(null === b || null === (b.body_a === this ? b.thread_a_prev : b.thread_b_prev), "Internal Error: Dangling contact graph pointers detected. (C)"); a.body_a === this ? a.thread_a_next = b : a.thread_b_next = b; b && (b.body_a === this ? b.thread_a_prev = a : b.thread_b_prev = a); this.arbiterList = a }; var Ha = function (a, b) { if (!b.isRogue()) { var c = b ? b.nodeRoot : null; if (null == c) { b.nodeRoot = a; b !== a && (b.nodeNext = a.nodeNext, a.nodeNext = b); for (c = b.arbiterList; c; c = c.next(b)) Ha(a, b == c.body_a ? c.body_b : c.body_a); for (c = b.constraintList; c; c = c.next(b)) Ha(a, b == c.a ? c.b : c.a) } else f(c === a, "Internal Error: Inconsistency detected in the contact graph.") } }; B.prototype.processComponents = function (a) { for (var b = 1 / 0 !== this.sleepTimeThreshold, c = this.bodies, d = 0; c.length > d; d++) { var e = c[d]; f(null === e.nodeNext, "Internal Error: Dangling next pointer detected in contact graph."); f(null === e.nodeRoot, "Internal Error: Dangling root pointer detected in contact graph.") } if (b) for (var g = (d = this.idleSpeedThreshold) ? d * d : N(this.gravity) * a * a, d = 0; c.length > d; d++) { var e = c[d], h = g ? e.m * g : 0; e.nodeIdleTime = e.kineticEnergy() > h ? 0 : e.nodeIdleTime + a } g = this.arbiters; d = 0; for (h = g.length; h > d; d++) { var k = g[d], e = k.body_a; a = k.body_b; b && ((a.isRogue() && !a.isStatic() || e.isSleeping()) && e.activate(), (e.isRogue() && !e.isStatic() || a.isSleeping()) && a.activate()); e.pushArbiter(k); a.pushArbiter(k) } if (b) { b = this.constraints; for (d = 0; b.length > d; d++) a = b[d], e = a.a, a = a.b, a.isRogue() && !a.isStatic() && e.activate(), e.isRogue() && !e.isStatic() && a.activate(); for (d = 0; c.length > d;) { e = c[d]; if (!(b = null !== (e ? e.nodeRoot : null))) a: { for (Ha(e, e), b = e; b; b = b.nodeNext) if (this.sleepTimeThreshold > b.nodeIdleTime) { b = !0; break a } b = !1 } if (b) d++, e.nodeRoot = null, e.nodeNext = null; else for (this.sleepingComponents.push(e), b = e; b; b = b.nodeNext) this.deactivateBody(b) } } }; D.prototype.sleep = function () { this.sleepWithGroup(null) }; D.prototype.sleepWithGroup = function (a) { g(!this.isStatic() && !this.isRogue(), "Rogue and static bodies cannot be put to sleep."); var b = this.space; if (g(b, "Cannot put a rogue body to sleep."), g(!b.locked, "Bodies cannot be put to sleep during a query or a call to cpSpaceStep(). Put these calls into a post-step callback."), g(null === a || a.isSleeping(), "Cannot use a non-sleeping body as a group identifier."), this.isSleeping()) return g((this ? this.nodeRoot : null) === (a ? a.nodeRoot : null), "The body is already sleeping and it's group cannot be reassigned."), void 0; for (var c = 0; this.shapeList.length > c; c++) this.shapeList[c].update(this.p, this.rot); (b.deactivateBody(this), a) ? (this.nodeRoot = a = a ? a.nodeRoot : null, this.nodeNext = a.nodeNext, this.nodeIdleTime = 0, a.nodeNext = this) : (this.nodeRoot = this, this.nodeNext = null, this.nodeIdleTime = 0, b.sleepingComponents.push(this)); k(b.bodies, this) }; B.prototype.activateShapesTouchingShape = function (a) { 1 / 0 !== this.sleepTimeThreshold && this.shapeQuery(a, function (a) { a.body.activate() }) }; B.prototype.pointQuery = function (a, b, c, d) { var e = function (e) { (!e.group || c !== e.group) && b & e.layers && e.pointQuery(a) && d(e) }, f = new $(a.x, a.y, a.x, a.y); this.lock(); this.activeShapes.query(f, e); this.staticShapes.query(f, e); this.unlock(!0) }; B.prototype.pointQueryFirst = function (a, b, c) { var d = null; return this.pointQuery(a, b, c, function (a) { a.sensor || (d = a) }), d }; B.prototype.nearestPointQuery = function (a, b, c, d, e) { var f = function (f) { if ((!f.group || d !== f.group) && c & f.layers) { var g = f.nearestPointQuery(a); b > g.d && e(f, g.d, g.p) } }, g = new $(a.x - b, a.y - b, a.x + b, a.y + b); this.lock(); this.activeShapes.query(g, f); this.staticShapes.query(g, f); this.unlock(!0) }; B.prototype.nearestPointQueryNearest = function (a, b, c, d) { var e, f = function (f) { f.group && d === f.group || !(c & f.layers) || f.sensor || (f = f.nearestPointQuery(a), b > f.d && (!e || f.d < e.d) && (e = f)) }, g = new $(a.x - b, a.y - b, a.x + b, a.y + b); return this.activeShapes.query(g, f), this.staticShapes.query(g, f), e }; B.prototype.segmentQuery = function (a, b, c, d, e) { var f = function (f) { var g; return (!f.group || d !== f.group) && c & f.layers && (g = f.segmentQuery(a, b)) && e(f, g.t, g.n), 1 }; this.lock(); this.staticShapes.segmentQuery(a, b, 1, f); this.activeShapes.segmentQuery(a, b, 1, f); this.unlock(!0) }; B.prototype.segmentQueryFirst = function (a, b, c, d) { var e = null, f = function (f) { var g; return (!f.group || d !== f.group) && c & f.layers && !f.sensor && (g = f.segmentQuery(a, b)) && (null === e || g.t < e.t) && (e = g), e ? e.t : 1 }; return this.staticShapes.segmentQuery(a, b, 1, f), this.activeShapes.segmentQuery(a, b, e ? e.t : 1, f), e }; B.prototype.bbQuery = function (a, b, c, d) { var e = function (e) { (!e.group || c !== e.group) && b & e.layers && e.bb_r >= a.l && a.r >= e.bb_l && e.bb_t >= a.b && a.t >= e.bb_b && d(e) }; this.lock(); this.activeShapes.query(a, e); this.staticShapes.query(a, e); this.unlock(!0) }; B.prototype.shapeQuery = function (a, b) { var c = a.body; c && a.update(c.p, c.rot); var c = new $(a.bb_l, a.bb_b, a.bb_r, a.bb_t), d = !1, e = function (c) { if ((!a.group || a.group !== c.group) && a.layers & c.layers && a !== c) { var e; if (a.collisionCode <= c.collisionCode) e = Ga(a, c); else { e = Ga(c, a); for (var f = 0; e.length > f; f++) e[f].n = C(e[f].n) } if (e.length && (d = !(a.sensor || c.sensor), b)) { for (var g = Array(e.length), f = 0; e.length > f; f++) g[f] = new Va(e[f].p, e[f].n, e[f].dist); b(c, g) } } }; return this.lock(), this.activeShapes.query(c, e), this.staticShapes.query(c, e), this.unlock(!0), d }; B.prototype.addPostStepCallback = function (a) { f(this.locked, "Adding a post-step callback when the space is not locked is unnecessary. Post-step callbacks will not called until the end of the next call to cpSpaceStep() or the next query."); this.postStepCallbacks.push(a) }; B.prototype.runPostStepCallbacks = function () { for (var a = 0; this.postStepCallbacks.length > a; a++) this.postStepCallbacks[a](); this.postStepCallbacks = [] }; B.prototype.lock = function () { this.locked++ }; B.prototype.unlock = function (a) { if (this.locked--, g(0 <= this.locked, "Internal Error: Space lock underflow."), 0 === this.locked && a) { a = this.rousedBodies; for (var b = 0; a.length > b; b++) this.activateBody(a[b]); a.length = 0; this.runPostStepCallbacks() } }; B.prototype.makeCollideShapes = function () { var a = this; return function (b, c) { if (b.bb_l <= c.bb_r && c.bb_l <= b.bb_r && b.bb_b <= c.bb_t && c.bb_b <= b.bb_t && b.body !== c.body && (!b.group || b.group !== c.group) && b.layers & c.layers) { var d = a.lookupHandler(b.collision_type, c.collision_type), e = b.sensor || c.sensor; if (!e || d !== bb) { if (b.collisionCode > c.collisionCode) { var f = b; b = c; c = f } f = Ga(b, c); if (0 !== f.length) { var g = h(b.hashid, c.hashid), k = a.cachedArbiters[g]; k || (k = a.cachedArbiters[g] = new L(b, c)); k.update(f, d, b, c); "first coll" != k.state || d.begin(k, a) || k.ignore(); "ignore" !== k.state && d.preSolve(k, a) && !e ? a.arbiters.push(k) : (k.contacts = null, "ignore" !== k.state && (k.state = "normal")); k.stamp = a.stamp } } } } }; B.prototype.arbiterSetFilter = function (a) { var b = this.stamp - a.stamp, c = a.body_a, d = a.body_b; return (c.isStatic() || c.isSleeping()) && (d.isStatic() || d.isSleeping()) ? !0 : (1 <= b && "cached" != a.state && (a.callSeparate(this), a.state = "cached"), b >= this.collisionPersistence ? (a.contacts = null, !1) : !0) }; var pb = function (a) { var b = a.body; a.update(b.p, b.rot) }; B.prototype.step = function (a) { if (0 !== a) { g(0 === w.x && 0 === w.y, "vzero is invalid"); this.stamp++; var b = this.curr_dt; this.curr_dt = a; var c, d, e = this.bodies, f = this.constraints, h = this.arbiters; for (c = 0; h.length > c; c++) { var k = h[c]; k.state = "normal"; k.body_a.isSleeping() || k.body_b.isSleeping() || k.unthread() } h.length = 0; this.lock(); for (c = 0; e.length > c; c++) e[c].position_func(a); this.activeShapes.each(pb); this.activeShapes.reindexQuery(this.collideShapes); this.unlock(!1); this.processComponents(a); this.lock(); for (d in this.cachedArbiters) this.arbiterSetFilter(this.cachedArbiters[d]) || delete this.cachedArbiters[d]; d = this.collisionSlop; k = 1 - Math.pow(this.collisionBias, a); for (c = 0; h.length > c; c++) h[c].preStep(a, d, k); for (c = 0; f.length > c; c++) d = f[c], d.preSolve(this), d.preStep(a); d = Math.pow(this.damping, a); k = this.gravity; for (c = 0; e.length > c; c++) e[c].velocity_func(k, d, a); a = 0 === b ? 0 : a / b; for (c = 0; h.length > c; c++) h[c].applyCachedImpulse(a); for (c = 0; f.length > c; c++) f[c].applyCachedImpulse(a); for (c = 0; this.iterations > c; c++) { for (a = 0; h.length > a; a++) h[a].applyImpulse(); for (a = 0; f.length > a; a++) f[a].applyImpulse() } for (c = 0; f.length > c; c++) f[c].postSolve(this); for (c = 0; h.length > c; c++) h[c].handler.postSolve(h[c], this); this.unlock(!0) } }; var Ia = function (a, b, c, d) { return new q(b.vx + -d.y * b.w - (a.vx + -c.y * a.w), b.vy + d.x * b.w - (a.vy + c.x * a.w)) }, Ea = function (a, b, c, d, e) { return (b.vx + -d.y * b.w - (a.vx + -c.y * a.w)) * e.x + (b.vy + d.x * b.w - (a.vy + c.x * a.w)) * e.y }, za = function (a, b, c, d) { a.vx += b * a.m_inv; a.vy += c * a.m_inv; a.w += a.i_inv * (d.x * c - d.y * b) }, U = function (a, b, c, d, e, f) { za(a, -e, -f, c); za(b, e, f, d) }, Xa = function (a, b, c, d) { a.v_biasx += b * a.m_inv; a.v_biasy += c * a.m_inv; a.w_bias += a.i_inv * (d.x * c - d.y * b) }, cb = function (a, b, c) { b = F(b, c); return a.m_inv + a.i_inv * b * b }, ka = function (a, b, c, d, e) { a = cb(a, c, e) + cb(b, d, e); return f(0 !== a, "Unsolvable collision or constraint."), a }, db = function (a, b, c, d, e, g) { var h; h = a.m_inv + b.m_inv; var k = a.i_inv, m = c.x * c.x * k; a = -c.x * c.y * k; c = h + c.y * c.y * k; h += m; k = b.i_inv; b = d.x * d.x * k; m = -d.x * d.y * k; c += d.y * d.y * k; d = 0 + a + m; a = 0 + a + m; h += b; b = c * h - d * a; f(0 !== b, "Unsolvable constraint."); b = 1 / b; e.x = h * b; e.y = -d * b; g.x = -a * b; g.y = c * b }, H = c.Constraint = function (a, b) { this.a = a; this.b = b; this.next_b = this.next_a = this.space = null; this.maxForce = 1 / 0; this.errorBias = Math.pow(0.9, 60); this.maxBias = 1 / 0 }; H.prototype.activateBodies = function () { this.a && this.a.activate(); this.b && this.b.activate() }; H.prototype.preStep = function () {}; H.prototype.applyCachedImpulse = function () {}; H.prototype.applyImpulse = function () {}; H.prototype.getImpulse = function () { return 0 }; H.prototype.preSolve = function () {}; H.prototype.postSolve = function () {}; H.prototype.next = function (a) { return this.a === a ? this.next_a : this.next_b }; var la = c.PinJoint = function (a, b, c, d) { H.call(this, a, b); this.anchr1 = c; this.anchr2 = d; a = a ? A(a.p, E(c, a.rot)) : c; b = b ? A(b.p, E(d, b.rot)) : d; this.dist = x(y(b, a)); f(0 < this.dist, "You created a 0 length pin joint. A pivot joint will be much more stable."); this.n = this.r1 = this.r2 = null; this.bias = this.jnAcc = this.jnMax = this.nMass = 0 }; la.prototype = Object.create(H.prototype); la.prototype.preStep = function (a) { var b = this.a, c = this.b; this.r1 = E(this.anchr1, b.rot); this.r2 = E(this.anchr2, c.rot); var d = y(A(c.p, this.r2), A(b.p, this.r1)), e = x(d); this.n = z(d, 1 / (e ? e : 1 / 0)); this.nMass = 1 / ka(b, c, this.r1, this.r2, this.n); b = this.maxBias; this.bias = s(-(1 - Math.pow(this.errorBias, a)) * (e - this.dist) / a, -b, b); this.jnMax = this.maxForce * a }; la.prototype.applyCachedImpulse = function (a) { a = z(this.n, this.jnAcc * a); U(this.a, this.b, this.r1, this.r2, a.x, a.y) }; la.prototype.applyImpulse = function () { var a = this.a, b = this.b, c = this.n, d = Ea(a, b, this.r1, this.r2, c), d = (this.bias - d) * this.nMass, e = this.jnAcc; this.jnAcc = s(e + d, -this.jnMax, this.jnMax); d = this.jnAcc - e; U(a, b, this.r1, this.r2, c.x * d, c.y * d) }; la.prototype.getImpulse = function () { return Math.abs(this.jnAcc) }; var ma = c.SlideJoint = function (a, b, c, d, e, f) { H.call(this, a, b); this.anchr1 = c; this.anchr2 = d; this.min = e; this.max = f; this.r1 = this.r2 = this.n = null; this.bias = this.jnAcc = this.jnMax = this.nMass = 0 }; ma.prototype = Object.create(H.prototype); ma.prototype.preStep = function (a) { var b = this.a, c = this.b; this.r1 = E(this.anchr1, b.rot); this.r2 = E(this.anchr2, c.rot); var d = y(A(c.p, this.r2), A(b.p, this.r1)), e = x(d), f = 0; e > this.max ? (f = e - this.max, this.n = G(d)) : this.min > e ? (f = this.min - e, this.n = C(G(d))) : (this.n = w, this.jnAcc = 0); this.nMass = 1 / ka(b, c, this.r1, this.r2, this.n); b = this.maxBias; this.bias = s(-(1 - Math.pow(this.errorBias, a)) * f / a, -b, b); this.jnMax = this.maxForce * a }; ma.prototype.applyCachedImpulse = function (a) { a *= this.jnAcc; U(this.a, this.b, this.r1, this.r2, this.n.x * a, this.n.y * a) }; ma.prototype.applyImpulse = function () { if (0 !== this.n.x || 0 !== this.n.y) { var a = this.a, b = this.b, c = this.n, d = Ia(a, b, this.r1, this.r2), d = u(d, c), d = (this.bias - d) * this.nMass, e = this.jnAcc; this.jnAcc = s(e + d, -this.jnMax, 0); d = this.jnAcc - e; U(a, b, this.r1, this.r2, c.x * d, c.y * d) } }; ma.prototype.getImpulse = function () { return Math.abs(this.jnAcc) }; var na = c.PivotJoint = function (a, b, c, d) { if (H.call(this, a, b), void 0 === d) d = c, c = a ? a.world2Local(d) : d, d = b ? b.world2Local(d) : d; this.anchr1 = c; this.anchr2 = d; this.r1 = this.r2 = w; this.k1 = new q(0, 0); this.k2 = new q(0, 0); this.jAcc = w; this.jMaxLen = 0; this.bias = w }; na.prototype = Object.create(H.prototype); na.prototype.preStep = function (a) { var b = this.a, c = this.b; this.r1 = E(this.anchr1, b.rot); this.r2 = E(this.anchr2, c.rot); db(b, c, this.r1, this.r2, this.k1, this.k2); this.jMaxLen = this.maxForce * a; b = y(A(c.p, this.r2), A(b.p, this.r1)); this.bias = M(z(b, -(1 - Math.pow(this.errorBias, a)) / a), this.maxBias) }; na.prototype.applyCachedImpulse = function (a) { U(this.a, this.b, this.r1, this.r2, this.jAcc.x * a, this.jAcc.y * a) }; na.prototype.applyImpulse = function () { var a = this.a, b = this.b, c = Ia(a, b, this.r1, this.r2), c = y(this.bias, c), d = this.k2, c = new q(u(c, this.k1), u(c, d)), d = this.jAcc; this.jAcc = M(A(this.jAcc, c), this.jMaxLen); U(a, b, this.r1, this.r2, this.jAcc.x - d.x, this.jAcc.y - d.y) }; na.prototype.getImpulse = function () { return x(this.jAcc) }; var da = c.GrooveJoint = function (a, b, c, d, e) { H.call(this, a, b); this.grv_a = c; this.grv_b = d; this.grv_n = J(Q(y(d, c))); this.anchr2 = e; this.grv_tn = null; this.clamp = 0; this.r1 = this.r2 = null; this.k1 = new q(0, 0); this.k2 = new q(0, 0); this.jAcc = w; this.jMaxLen = 0; this.bias = null }; da.prototype = Object.create(H.prototype); da.prototype.preStep = function (a) { var b = this.a, c = this.b, d = b.local2World(this.grv_a), e = b.local2World(this.grv_b), f = E(this.grv_n, b.rot), g = u(d, f); this.grv_tn = f; this.r2 = E(this.anchr2, c.rot); var h = F(A(c.p, this.r2), f); F(d, f) >= h ? (this.clamp = 1, this.r1 = y(d, b.p)) : h >= F(e, f) ? (this.clamp = -1, this.r1 = y(e, b.p)) : (this.clamp = 0, this.r1 = y(A(z(J(f), -h), z(f, g)), b.p)); db(b, c, this.r1, this.r2, this.k1, this.k2); this.jMaxLen = this.maxForce * a; b = y(A(c.p, this.r2), A(b.p, this.r1)); this.bias = M(z(b, -(1 - Math.pow(this.errorBias, a)) / a), this.maxBias) }; da.prototype.applyCachedImpulse = function (a) { U(this.a, this.b, this.r1, this.r2, this.jAcc.x * a, this.jAcc.y * a) }; da.prototype.grooveConstrain = function (a) { var b = this.grv_tn; a = 0 < this.clamp * F(a, b) ? a : P(a, b); return M(a, this.jMaxLen) }; da.prototype.applyImpulse = function () { var a = this.a, b = this.b, c = Ia(a, b, this.r1, this.r2), c = y(this.bias, c), d = this.k2, c = new q(u(c, this.k1), u(c, d)), d = this.jAcc; this.jAcc = this.grooveConstrain(A(d, c)); U(a, b, this.r1, this.r2, this.jAcc.x - d.x, this.jAcc.y - d.y) }; da.prototype.getImpulse = function () { return x(this.jAcc) }; da.prototype.setGrooveA = function (a) { this.grv_a = a; this.grv_n = J(Q(y(this.grv_b, a))); this.activateBodies() }; da.prototype.setGrooveB = function (a) { this.grv_b = a; this.grv_n = J(Q(y(a, this.grv_a))); this.activateBodies() }; var qb = function (a, b) { return (a.restLength - b) * a.stiffness }, oa = c.DampedSpring = function (a, b, c, d, e, f, g) { H.call(this, a, b); this.anchr1 = c; this.anchr2 = d; this.restLength = e; this.stiffness = f; this.damping = g; this.springForceFunc = qb; this.target_vrn = this.v_coef = 0; this.r1 = this.r2 = null; this.nMass = 0; this.n = null }; oa.prototype = Object.create(H.prototype); oa.prototype.preStep = function (a) { var b = this.a, c = this.b; this.r1 = E(this.anchr1, b.rot); this.r2 = E(this.anchr2, c.rot); var d = y(A(c.p, this.r2), A(b.p, this.r1)), e = x(d); this.n = z(d, 1 / (e ? e : 1 / 0)); d = ka(b, c, this.r1, this.r2, this.n); f(0 !== d, "Unsolvable this."); this.nMass = 1 / d; this.target_vrn = 0; this.v_coef = 1 - Math.exp(-this.damping * a * d); e = this.springForceFunc(this, e); U(b, c, this.r1, this.r2, this.n.x * e * a, this.n.y * e * a) }; oa.prototype.applyCachedImpulse = function () {}; oa.prototype.applyImpulse = function () { var a = this.a, b = this.b, c = Ea(a, b, this.r1, this.r2, this.n), d = (this.target_vrn - c) * this.v_coef; this.target_vrn = c + d; d *= this.nMass; U(a, b, this.r1, this.r2, this.n.x * d, this.n.y * d) }; oa.prototype.getImpulse = function () { return 0 }; var rb = function (a, b) { return (b - a.restAngle) * a.stiffness }, Ja = c.DampedRotarySpring = function (a, b, c, d, e) { H.call(this, a, b); this.restAngle = c; this.stiffness = d; this.damping = e; this.springTorqueFunc = rb; this.iSum = this.w_coef = this.target_wrn = 0 }; Ja.prototype = Object.create(H.prototype); Ja.prototype.preStep = function (a) { var b = this.a, c = this.b, d = b.i_inv + c.i_inv; f(0 !== d, "Unsolvable spring."); this.iSum = 1 / d; this.w_coef = 1 - Math.exp(-this.damping * a * d); this.target_wrn = 0; a *= this.springTorqueFunc(this, b.a - c.a); b.w -= a * b.i_inv; c.w += a * c.i_inv }; Ja.prototype.applyImpulse = function () { var a = this.a, b = this.b, c = a.w - b.w, d = (this.target_wrn - c) * this.w_coef; this.target_wrn = c + d; c = d * this.iSum; a.w += c * a.i_inv; b.w -= c * b.i_inv }; var pa = c.RotaryLimitJoint = function (a, b, c, d) { H.call(this, a, b); this.min = c; this.max = d; this.iSum = this.bias = this.jMax = this.jAcc = 0 }; pa.prototype = Object.create(H.prototype); pa.prototype.preStep = function (a) { var b = this.a, c = this.b, d = c.a - b.a, e = 0; d > this.max ? e = this.max - d : this.min > d && (e = this.min - d); this.iSum = 1 / (1 / b.i + 1 / c.i); b = this.maxBias; this.bias = s(-(1 - Math.pow(this.errorBias, a)) * e / a, -b, b); this.jMax = this.maxForce * a; this.bias || (this.jAcc = 0) }; pa.prototype.applyCachedImpulse = function (a) { var b = this.a, c = this.b; a *= this.jAcc; b.w -= a * b.i_inv; c.w += a * c.i_inv }; pa.prototype.applyImpulse = function () { if (this.bias) { var a = this.a, b = this.b, c = -(this.bias + (b.w - a.w)) * this.iSum, d = this.jAcc; this.jAcc = 0 > this.bias ? s(d + c, 0, this.jMax) : s(d + c, -this.jMax, 0); c = this.jAcc - d; a.w -= c * a.i_inv; b.w += c * b.i_inv } }; pa.prototype.getImpulse = function () { return Math.abs(joint.jAcc) }; var qa = c.RatchetJoint = function (a, b, c, d) { H.call(this, a, b); this.angle = 0; this.phase = c; this.ratchet = d; this.angle = (b ? b.a : 0) - (a ? a.a : 0); this.iSum = this.bias = this.jAcc = this.jMax = 0 }; qa.prototype = Object.create(H.prototype); qa.prototype.preStep = function (a) { var b = this.a, c = this.b, d = this.phase, e = this.ratchet, f = c.a - b.a, g = this.angle - f, h = 0; 0 < g * e ? h = g : this.angle = Math.floor((f - d) / e) * e + d; this.iSum = 1 / (b.i_inv + c.i_inv); b = this.maxBias; this.bias = s(-(1 - Math.pow(this.errorBias, a)) * h / a, -b, b); this.jMax = this.maxForce * a; this.bias || (this.jAcc = 0) }; qa.prototype.applyCachedImpulse = function (a) { var b = this.a, c = this.b; a *= this.jAcc; b.w -= a * b.i_inv; c.w += a * c.i_inv }; qa.prototype.applyImpulse = function () { if (this.bias) { var a = this.a, b = this.b, c = this.ratchet, d = -(this.bias + (b.w - a.w)) * this.iSum, e = this.jAcc; this.jAcc = s((e + d) * c, 0, this.jMax * Math.abs(c)) / c; d = this.jAcc - e; a.w -= d * a.i_inv; b.w += d * b.i_inv } }; qa.prototype.getImpulse = function (a) { return Math.abs(a.jAcc) }; var ga = c.GearJoint = function (a, b, c, d) { H.call(this, a, b); this.phase = c; this.ratio = d; this.ratio_inv = 1 / d; this.iSum = this.bias = this.jMax = this.jAcc = 0 }; ga.prototype = Object.create(H.prototype); ga.prototype.preStep = function (a) { var b = this.a, c = this.b; this.iSum = 1 / (b.i_inv * this.ratio_inv + this.ratio * c.i_inv); var d = this.maxBias; this.bias = s(-(1 - Math.pow(this.errorBias, a)) * (c.a * this.ratio - b.a - this.phase) / a, -d, d); this.jMax = this.maxForce * a }; ga.prototype.applyCachedImpulse = function (a) { var b = this.a, c = this.b; a *= this.jAcc; b.w -= a * b.i_inv * this.ratio_inv; c.w += a * c.i_inv }; ga.prototype.applyImpulse = function () { var a = this.a, b = this.b, c = (this.bias - (b.w * this.ratio - a.w)) * this.iSum, d = this.jAcc; this.jAcc = s(d + c, -this.jMax, this.jMax); c = this.jAcc - d; a.w -= c * a.i_inv * this.ratio_inv; b.w += c * b.i_inv }; ga.prototype.getImpulse = function () { return Math.abs(this.jAcc) }; ga.prototype.setRatio = function (a) { this.ratio = a; this.ratio_inv = 1 / a; this.activateBodies() }; var ra = c.SimpleMotor = function (a, b, c) { H.call(this, a, b); this.rate = c; this.iSum = this.jMax = this.jAcc = 0 }; ra.prototype = Object.create(H.prototype); ra.prototype.preStep = function (a) { this.iSum = 1 / (this.a.i_inv + this.b.i_inv); this.jMax = this.maxForce * a }; ra.prototype.applyCachedImpulse = function (a) { var b = this.a, c = this.b; a *= this.jAcc; b.w -= a * b.i_inv; c.w += a * c.i_inv }; ra.prototype.applyImpulse = function () { var a = this.a, b = this.b, c = -(b.w - a.w + this.rate) * this.iSum, d = this.jAcc; this.jAcc = s(d + c, -this.jMax, this.jMax); c = this.jAcc - d; a.w -= c * a.i_inv; b.w += c * b.i_inv }; ra.prototype.getImpulse = function () { return Math.abs(this.jAcc) } })(); var world, PHYS_SCALE = 1, RAD_TO_DEGREES = 180 / Math.PI, DEGREES_TO_RAD = Math.PI / 180, objA, objB, debugCanvas, debugDraw, space, v = cp.v, GRABABLE_MASK_BIT = -2147483648, NOT_GRABABLE_MASK = ~GRABABLE_MASK_BIT; function initPhysics(c) { isLevelEditor && isEditorDebug && (isPhysicsDebugDraw = !0); isPhysicsDebugDraw && !c && (debugCanvas = document.createElement("canvas"), debugCanvas.id = "debugCanvas", debugCanvas.width = 320, debugCanvas.height = 356, debugCanvas.style.position = "absolute", debugCanvas.style.left = "50%", debugCanvas.style.top = "10%", debugCanvas.style.zIndex = "1", debugCanvas.style.pointerEvents = "none", document.body.appendChild(debugCanvas), ChipMunkDebugDrawer.prototype.canvas = debugCanvas, ChipMunkDebugDrawer.prototype.ctx = debugCanvas.getContext("2d"), onWindowResize(null)); debugDraw = new ChipMunkDebugDrawer; space = debugDraw.space; space.iterations = 10; space.gravity = v(0, 500); space.sleepTimeThreshold = 1; space.collisionSlop = 1; space.addCollisionHandler(1, 0, null, onSensorContactPreSolve, null, null); space.addCollisionHandler(2, 0, onGlassContactBegin, null, null, null); space.addCollisionHandler(2, 2, onGlassContactBegin, null, null, null); trace("reinit") } function onGlassContactBegin(c, a) { objA = c.body_a.userdata; objB = c.body_b.userdata; collidedGlass = collidedAim = null; if (objA && objB && (objA.isGlass ? (collidedGlass = objA, collidedAim = objB) : objB.isGlass && (collidedGlass = objB, collidedAim = objA), collidedGlass)) { (collidedBody = collidedAim.physBody) && collidedAim.physBody.isStatic() && (collidedBody = collidedGlass.physBody); if (!collidedBody) return !0; var b = collidedBody.vx, g = collidedBody.vy; Math.sqrt(b * b + g * g) > GLASS_BREAK_VELOCITY && (addToArray(clickedChars, collidedGlass), collidedAim.isGlass && addToArray(clickedChars, collidedAim)) } return !0 } function onSensorContactPreSolve(c, a, b) { objA = c.body_a.userdata; objB = c.body_b.userdata; collidedSensor = collidedAim = null; objA && objB && (c.a.sensor ? (collidedSensor = objA, collidedAim = objB) : c.b.sensor && (collidedSensor = objB, collidedAim = objA), collidedSensor && collidedSensor.isActivated && collidedAim.physBody && (dx = collidedAim.vis.x - collidedSensor.vis.x, dy = collidedAim.vis.y - collidedSensor.vis.y, dist = Math.sqrt(dx * dx + dy * dy), force = Math.max(0, 1 - dist / collidedSensor.activDistance), force = force * collidedSensor.activForce * collidedAim.physBody.m, angle = collidedSensor.vis.rotation * DEGREES_TO_RAD, collidedSensor.isReversed && (angle += Math.PI), collidedAim.physBody.applyImpulse(v(force * Math.cos(angle), force * Math.sin(angle)), cp.vzero))); return !0 } var worldManifold, isCollideParticlesNeed = !0, collidedChar, collidedAim, collidedSensor, collidedBody, collidedGlass, force, angle, fixDef, bodyDef; function createCircleShape(c, a, b, g, f, d) { var e = !1, h = 0.5, k = 0.3; g === HERO_TYPE || g === HERO_DOC_TYPE ? k = 0.8 : g === FAN_TYPE && (e = !0, h = 0.8, k = 0); e ? (e = new cp.Body(Infinity, Infinity), e.nodeIdleTime = Infinity) : e = space.addBody(new cp.Body(1, cp.momentForCircle(1, 0, b, v(0, 0)))); e.setPos(v(c, a)); e.setAngle(f); c = space.addShape(new cp.CircleShape(e, b, v(0, 0))); c.setElasticity(k); c.setFriction(h); g === FAN_TYPE && (g = d.isReversed ? space.addShape(new cp.BoxShape2(e, new cp.BB(-d.activDistance, -15, 0, 15))) : space.addShape(new cp.BoxShape2(e, new cp.BB(0, -15, d.activDistance, 15))), g.setSensor(!0), g.setCollisionType(1)); return e } var DEFAULT_RECT_SIZE = 90 / PHYS_SCALE, DEFAULT_BOX_SIZE = 52 / PHYS_SCALE; function createRectPhysics(c, a, b, g, f, d) { var e = DEFAULT_RECT_SIZE, h = DEFAULT_RECT_SIZE, k = !1, m = 0.6, n = 0, p = 0.0010; f === PHYSICS_RECT_TYPE ? k = !0 : f === DYNAMIC_BOX_TYPE ? (h = e = DEFAULT_BOX_SIZE, m = 0.8) : f === HARD_BOX_TYPE ? (e = 30 / PHYS_SCALE, h = 30 / PHYS_SCALE, m = 0.8) : f === STATIC_BOX_TYPE ? (e = 30 / PHYS_SCALE, h = 30 / PHYS_SCALE, m = 0.8, k = !0) : f === DANGER_TYPE ? (e = 100 / PHYS_SCALE, h = 18 / PHYS_SCALE) : f === PHYSICS_MAN_BLOCK_TYPE ? (e = 194 / PHYS_SCALE, h = 23 / PHYS_SCALE) : f === GLASS_BLOCK_TYPE ? (e = 103 / PHYS_SCALE, h = 20 / PHYS_SCALE, n = 2) : f === GLASS_BOX_TYPE ? (e = 30 / PHYS_SCALE, h = 30 / PHYS_SCALE, n = 2) : f === DOOR_TYPE ? (e = 122 / PHYS_SCALE, h = 18 / PHYS_SCALE) : f === DYNAMIC_RECT_TYPE ? (e = 109 / PHYS_SCALE, h = 20 / PHYS_SCALE, m = 0.8) : f === HARD_RECT_TYPE ? (e = 109 / PHYS_SCALE, h = 20 / PHYS_SCALE, m = 0.8, p = 1 / 1500) : f === STATIC_BALK_1_TYPE && (e = 109 / PHYS_SCALE, h = 20 / PHYS_SCALE, m = 0.8, k = !0); b *= e; g *= h; k ? (k = new cp.Body(Infinity, Infinity), k.nodeIdleTime = Infinity) : (k = b * g * p, k = space.addBody(new cp.Body(k, cp.momentForBox(k, b, g)))); k.setPos(v(c, a)); k.setAngle(d); c = space.addShape(new cp.BoxShape(k, b, g)); c.setCollisionType(n); c.setFriction(m); c.setElasticity(0); return k } function createKinematicPhysics(c, a, b, g, f, d, e) { b = 0.8; var h = 0, k = 0, m; m = new cp.Body(Infinity, Infinity); m.setPos(v(c, a)); m.setAngle(d); f === TELEGA_TYPE ? (h = 105 / PHYS_SCALE * g, k = 20 / PHYS_SCALE * g, e = 0, c = space.addShape(new cp.BoxShape2(m, new cp.BB(-h / 2, e * g, h / 2, k + e))), c.setFriction(b), c.setElasticity(0), e = 20, c = space.addShape(new cp.BoxShape2(m, new cp.BB(-h / 2, -20 * g, -h / 2 + e, k))), c.setFriction(1), c.setElasticity(0), c = space.addShape(new cp.BoxShape2(m, new cp.BB(h / 2 - e, -20 * g, h / 2, k))), c.setFriction(0), c.setElasticity(0)) : f === AIM_TYPE ? (h = 50 / PHYS_SCALE * g, k = 40 / PHYS_SCALE * g, b = 0.2, c = (a = e.isReversed) ? space.addShape(new cp.SegmentShape(m, v(h / 2, k / 2), v(h / 2 - 3 * g, -16 * g), 3)) : space.addShape(new cp.SegmentShape(m, v(-h / 2, k / 2), v(-h / 2 + 3 * g, -16 * g), 3)), c.setFriction(b), c.setElasticity(0), c = a ? space.addShape(new cp.SegmentShape(m, v(h / 2 - 8 * g, -19 * g), v(-10 * g, -40 * g), 3)) : space.addShape(new cp.SegmentShape(m, v(-h / 2 + 8 * g, -19 * g), v(10 * g, -40 * g), 3)), c.setFriction(b), c.setElasticity(0), c = a ? space.addShape(new cp.SegmentShape(m, v(-10 * g, -40 * g), v(-35 * g, -40 * g), 3)) : space.addShape(new cp.SegmentShape(m, v(10 * g, -40 * g), v(35 * g, -40 * g), 3)), c.setFriction(b), c.setElasticity(0.7), e.isMovable && (c = a ? space.addShape(new cp.SegmentShape(m, v(-97 * g, 37 * g), v(25 * g, 37 * g), 4)) : space.addShape(new cp.SegmentShape(m, v(-25 * g, 37 * g), v(97 * g, 37 * g), 4)), c.setFriction(b), c.setElasticity(0))) : f === MOVABLE_BALK_TYPE && (h = 105 / PHYS_SCALE * g, k = 20 / PHYS_SCALE * g, c = space.addShape(new cp.BoxShape2(m, new cp.BB(-h / 2, -k / 2, h / 2, k / 2))), c.setFriction(b), c.setElasticity(0)); return m } function createSegmentPhysics(c, a, b, g, f, d, e) { e = new cp.Body(Infinity, Infinity); e.nodeIdleTime = Infinity; e.setPos(v(c, a)); e.setAngle(d); f === LAND_TYPE && (c = space.addShape(new cp.SegmentShape(e, v(-60 * b, -22 * g), v(60 * b, -22 * g), 5)), c.setFriction(0.8), c.setElasticity(0)); return e } function createTrianglePhysics(c, a, b, g, f, d) { var e = 0; b *= 51; var h = 45 * g; g = [-b / 2, -h / 2, 0, h / 2, b / 2, -h / 2]; b = 0.0010 * b * h; b = space.addBody(new cp.Body(b, cp.momentForPoly(b, g, cp.vzero))); g = space.addShape(new cp.PolyShape(b, g, cp.vzero)); g.setFriction(0.6); g.setElasticity(0); f === GLASS_TRIANGLE_TYPE && (e = 2); g.setCollisionType(e); b.setPos(v(c, a)); b.setAngle(d); return b } var querySelectedBody, queryV = new v(0, 0); function getBodyAtMouse(c, a) { querySelectedBody = null; queryV.x = c; queryV.y = a; var b = this.space.nearestPointQueryNearest(queryV, 100, cp.ALL_LAYERS, cp.NO_GROUP); b && 0 > b.d && b.shape && b.shape.body && (querySelectedBody = b.shape.body); return querySelectedBody } function destroyBody(c) { var a; if (c.isStatic()) for (; 0 < c.shapeList.length;) a = c.shapeList[0], space.removeStaticShape(a); else { for (; 0 < c.shapeList.length;) a = c.shapeList[0], a.space && space.removeShape(a); c.space && space.removeBody(c) } } function awakeAllBodies() { for (var c, a = allChars.length - 1; 0 <= a; --a) c = allChars[a], c.physBody && c.physBody.activate() } var ChipMunkDebugDrawer = function () { this.space = new cp.Space; this.fps = this.remainder = 0; this.mouse = v(0, 0); this.drawTime = this.simulationTime = 0; this.scale = 1; this.width = minW; this.height = minH; var c = this; this.canvas2point = function (a, b) { return v(a / c.scale, 480 - b / c.scale) }; this.point2canvas = function (a) { return v(a.x * c.scale, a.y * c.scale) } }; ChipMunkDebugDrawer.prototype.drawInfo = function () { var c = this.space, a = this.width - 20; this.ctx.textAlign = "start"; this.ctx.textBaseline = "alphabetic"; this.ctx.fillStyle = "black"; var b = Math.floor(10 * this.fps) / 10; 0 === c.activeShapes.count && (b = "--"); this.ctx.fillText("FPS: " + b, 10, 50, a); this.ctx.fillText("Step: " + c.stamp, 10, 80, a); b = c.arbiters.length; this.maxArbiters = this.maxArbiters ? Math.max(this.maxArbiters, b) : b; this.ctx.fillText("Arbiters: " + b + " (Max: " + this.maxArbiters + ")", 10, 110, a); for (var g = 0, f = 0; f < b; f++) g += c.arbiters[f].contacts.length; this.maxContacts = this.maxContacts ? Math.max(this.maxContacts, g) : g; this.ctx.fillText("Contact points: " + g + " (Max: " + this.maxContacts + ")", 10, 140, a); this.ctx.fillText("Simulation time: " + this.simulationTime + " ms", 10, 170, a); this.ctx.fillText("Draw time: " + this.drawTime + " ms", 10, 200, a); this.message && this.ctx.fillText(this.message, 10, this.height - 50, a) }; ChipMunkDebugDrawer.prototype.draw = function () { var c = this.ctx, a = this; a.scale = scaleFactor; c.strokeStyle = "black"; c.clearRect(0, 0, debugCanvas.width, debugCanvas.height); this.ctx.font = "16px sans-serif"; this.ctx.lineCap = "round"; this.space.eachShape(function (b) { c.fillStyle = b.style(); b.draw(c, a.scale, a.point2canvas) }); this.space.eachConstraint(function (b) { b.draw && b.draw(c, a.scale, a.point2canvas) }) }; var drawSegment = function (c, a, b) { var g = this.ctx; g.beginPath(); c = this.point2canvas(c); a = this.point2canvas(a); g.moveTo(c.x, c.y); g.lineTo(a.x, a.y); g.lineWidth = 1; g.strokeStyle = b; g.stroke() }, drawBB = function (c, a, b) { var g = this.ctx, f = this.point2canvas(v(c.l, c.t)), d = this.scale * (c.r - c.l); c = this.scale * (c.t - c.b); a && (g.fillStyle = a, g.fillRect(f.x, f.y, d, c)); b && (g.strokeStyle = b, g.strokeRect(f.x, f.y, d, c)) }, drawCircle = function (c, a, b, g, f) { g = b(g); c.beginPath(); c.arc(g.x, g.y, a * f, 0, 2 * Math.PI, !1); c.fill(); c.stroke() }, drawLine = function (c, a, b, g) { b = a(b); g = a(g); c.beginPath(); c.moveTo(b.x, b.y); c.lineTo(g.x, g.y); c.stroke() }, drawRect = function (c, a, b, g) { var f = a(b); a = cp.v.sub(a(cp.v.add(b, g)), f); c.fillRect(f.x, f.y, a.x, a.y) }, springPoints = [v(0, 0), v(0.2, 0), v(0.25, 3), v(0.3, -6), v(0.35, 6), v(0.4, -6), v(0.45, 6), v(0.5, -6), v(0.55, 6), v(0.6, -6), v(0.65, 6), v(0.7, -3), v(0.75, 6), v(0.8, 0), v(1, 0)], drawSpring = function (c, a, b, g, f) { g = b(g); f = b(f); c.beginPath(); c.moveTo(g.x, g.y); f = v.sub(f, g); b = v.len(f); f = v.mult(f, 1 / b); for (var d = 1; d < springPoints.length; d++) { var e = v.add(g, v.rotate(v(springPoints[d].x * b, springPoints[d].y * a), f)); c.lineTo(e.x, e.y) } c.stroke() }; cp.PolyShape.prototype.draw = function (c, a, b) { c.beginPath(); a = this.tVerts; var g = a.length, f = b(new cp.Vect(a[g - 2], a[g - 1])); c.moveTo(f.x, f.y); for (f = 0; f < g; f += 2) { var d = b(new cp.Vect(a[f], a[f + 1])); c.lineTo(d.x, d.y) } c.fill(); c.stroke() }; cp.SegmentShape.prototype.draw = function (c, a, b) { var g = c.lineWidth; c.lineWidth = Math.max(1, 2 * this.r * a); drawLine(c, b, this.ta, this.tb); c.lineWidth = g }; cp.CircleShape.prototype.draw = function (c, a, b) { drawCircle(c, a, b, this.tc, this.r); drawLine(c, b, this.tc, cp.v.mult(this.body.rot, this.r) .add(this.tc)) }; cp.PinJoint.prototype.draw = function (c, a, b) { a = this.a.local2World(this.anchr1); var g = this.b.local2World(this.anchr2); c.lineWidth = 2; c.strokeStyle = "grey"; drawLine(c, b, a, g) }; cp.SlideJoint.prototype.draw = function (c, a, b) { a = this.a.local2World(this.anchr1); var g = this.b.local2World(this.anchr2), f = v.add(a, v.clamp(v.sub(g, a), this.min)); c.lineWidth = 2; c.strokeStyle = "grey"; drawLine(c, b, a, g); c.strokeStyle = "red"; drawLine(c, b, a, f) }; cp.PivotJoint.prototype.draw = function (c, a, b) { var g = this.a.local2World(this.anchr1), f = this.b.local2World(this.anchr2); c.strokeStyle = "grey"; c.fillStyle = "grey"; drawCircle(c, a, b, g, 2); drawCircle(c, a, b, f, 2) }; cp.GrooveJoint.prototype.draw = function (c, a, b) { var g = this.a.local2World(this.grv_a), f = this.a.local2World(this.grv_b), d = this.b.local2World(this.anchr2); c.strokeStyle = "grey"; drawLine(c, b, g, f); drawCircle(c, a, b, d, 3) }; cp.DampedSpring.prototype.draw = function (c, a, b) { var g = this.a.local2World(this.anchr1), f = this.b.local2World(this.anchr2); c.strokeStyle = "grey"; drawSpring(c, a, b, g, f) }; for (var randColor = function () { return Math.floor(256 * Math.random()) }, debugAlpha = 0.7, styles = [], i = 0; 100 > i; i++) styles.push("rgba(" + randColor() + ", " + randColor() + ", " + randColor() + "," + debugAlpha + ")"); cp.Shape.prototype.style = function () { var c; if (this.sensor) return "rgba(255,255,255,0)"; c = this.body; return c.isSleeping() ? "rgba(50,50,50," + debugAlpha + ")" : c.nodeIdleTime > this.space.sleepTimeThreshold ? "rgba(170,170,170," + debugAlpha + ")" : styles[this.hashid % styles.length] }; var MINIMUM_SPEED = 3, MAX_SPEED = 6, IS_NITRO = !1, DEFAULT_STATE = 0, COLLIDED_STATE = 1, ACTIVATOR_RADIUS = 25, MORE_EASY_MULT = 1, dx, dy, dist, isNeedActivate = !1; (function (c) { function a(a, b, c, e, h) { var k = new createjs.Sprite(zoeSS); k.baseBlock = this; this.vis = k; k = new createjs.Sprite(zoeSS); k.baseBlock = this; this.additVision = k; this.reset(a, b, c, e, h) } var b = a.prototype; b.reset = function (a, b, d, e, h) { this.typeId = a; this.type = c[a]; createjs.Tween.removeTweens(this.vis); removeFromParent(this.additVision); this.parent = b; this.vis.isOnTop = !1; this.vis.isOnBottom = !0; this.isMovable = this.isFly = !1; this.teleportPartner = null; this.isReversed = !1; this.dir = 1; this.activForce = FAN_MAX_FORCE; this.activDistance = FAN_ACTIV_DISTANCE; this.distanceStartX = this.distanceEndX = 0; this.isRemovable = this.isClicked = !1; this.doorDistanceEnd = 0; this.isMechanic = this.isActivated = this.isGlass = !1; this.labelId = ""; this.isMonster = !1; this.isRectMonster = !0; this.isNeedDispose = !1; this.teleportationStatus = -1; this.vis.alpha = 1; this.vis.mouseEnabled = !1; this.physBody = null; this.scale = d; this.scaleY = e; this.isEnemy = !1; this.additParams = h; this.aimTeleport = this.startTeleport = null; this.isFirstCollided = this.isTeleport = this.isDanger = this.isAim = !1; this.shape = null; this.defaultRotation = 0; this.animMargin = 30 * Math.random(); this.isNeutralEnemy = !1; this.startMarginX = this.startMoveX = this.visionWidth = this.currSpeed = 0; this.state = DEFAULT_STATE; this.collideTimer = this.charRadius = 0; this.isExploded = !1; this.lastColliderType = -1; this.raduis = this.vis.rotation = 0; this.isDied = !1; this.forceToFly = this.vel = null; this.isByPhysPosUpdate = !0; this.vis.cursor = null; this.isLand = this.isHero = !1; this.lastAngularVelocity = this.lastVelocity = 0; this.isHelp = -1 < a.indexOf("HELP"); this.isDynamicDecor = (this.isDecor = -1 < a.indexOf("DECOR")) ? this.isDynDecor() : !0; this.isPhysStatic = -1 < a.indexOf("PHYSICS"); this.vis.visible = !this.isPhysStatic; this.type === LAND_TYPE && (this.isLand = !0); this.setVisionByType(); this.updateVisionScale(); !this.isDynamicDecor && isWithCache && (this.parent = allBgContainer); this.parent.addChild(this.vis) }; b.isDynDecor = function () { return this.isHelp || this.type === DECOR_ARROW_TYPE }; b.setupMouseEventListeners = function () { this.vis.cursor = "pointer" }; b.setVisionByType = function () { this.vis.gotoAndStop(this.typeId); var a = !1; if (this.type === DYNAMIC_BOX_TYPE || this.type === DYNAMIC_RECT_TYPE || this.type === DYNAMIC_TRIANGLE_TYPE) a = this.isRemovable = !0; if (this.type === HARD_BOX_TYPE || this.type === HARD_RECT_TYPE || this.type === LAND_TYPE || this.type === STATIC_BALK_1_TYPE) a = !0; this.type === STATIC_BOX_TYPE && "INVIS" == this.getAdditParams(0) && (this.vis.visible = !1); this.type === HERO_TYPE ? (this.isHero = !0, this.vis.play(), this.isByPhysPosUpdate = !0, addToArray(allHeroes, this)) : this.type === BOMB_TYPE ? (this.vis.cursor = "pointer", this.vis.mouseEnabled = !0, this.activDistance = parseInt(this.getAdditParams(0)), this.activForce = parseInt(this.getAdditParams(1)), addToArray(allBombs, this)) : this.type === GLASS_BLOCK_TYPE || this.type === GLASS_BOX_TYPE || this.type === GLASS_TRIANGLE_TYPE ? this.isGlass = !0 : this.type === TELEGA_TYPE ? (this.readMovableConfig(1), this.isMovable = !0, this.visionWidth = 106, "1" !== this.getAdditParams(0) && (this.isRemovable = a = !0)) : this.type === MOVABLE_BALK_TYPE ? (this.readMovableConfig(0), this.isMovable = !0, this.visionWidth = 106, this.vis.gotoAndStop("STATIC_BALK_1_TYPE")) : this.type === STATIC_BALK_1_TYPE ? 0 < this.getAdditParams(0) .length && (this.isRemovable = !0) : this.type === FAN_TYPE && (this.vis.cursor = "pointer", this.vis.mouseEnabled = !0, addToArray(allFans, this), this.isByPhysPosUpdate = !1); this.isRemovable && (this.vis.cursor = "pointer", this.vis.mouseEnabled = !0, currentRemovablesNum++); this.type === AIM_TYPE && (this.isAim = !0, this.visionWidth = 65, this.additVision.gotoAndStop("AIM_BACK"), this.parent.addChildAt(this.additVision, 0), "REV" == this.getAdditParams(0) && (this.isReversed = !0), this.getAdditParams(1) && (this.readMovableConfig(2), this.isMovable = !0, this.vis.gotoAndStop("AIM_TYPE_MOVABLE"))); this.type === DANGER_TYPE && (this.isDanger = !0, this.isDynamicDecor = !1); if (this.type === TELEPORT_TYPE) { this.vis.play(); this.isByPhysPosUpdate = !1; this.isTeleport = !0; this.labelId = this.getAdditParams(0); addToArray(allTeleports, this); for (var b = allTeleports.length - 1; 0 <= b; --b) { var c = allTeleports[b]; c.labelId === this.labelId && (c.teleportPartner = this, this.teleportPartner = c) } } this.type === FAN_TYPE && ("REV" == this.getAdditParams(0) && (this.isReversed = !0, this.dir = -1), this.getAdditParams(1) && (this.activDistance = parseInt(this.getAdditParams(1))), this.getAdditParams(2) && (this.activForce = parseInt(this.getAdditParams(2)))); a && 0 < this.getAdditParams(0) .length && this.vis.gotoAndStop(this.typeId + "_" + this.getAdditParams(0)); this.vis.paused || (this.vis.currentAnimationFrame = Math.floor(20 * Math.random())) }; b.readMovableConfig = function (a) { this.dir = "R" === this.getAdditParams(0) ? 1 : -1; var b = parseInt(this.getAdditParams(1 + a)); this.startMarginX = 1E3 <= b ? 1E3 - b : b; this.currSpeed = parseInt(this.getAdditParams(2 + a)) / 10 }; b.getAdditParams = function (a) { return this.additParams[0].split("_") .length > a ? this.additParams[0].split("_")[a] : null }; b.setupActivLabel = function () { this.labelId = this.getAdditParams(0) }; b.bombClick = function (a) { isLevelCompleted || isLevelFailed || isGamePaused || this.isExploded || (createExplosion(this), this.vis.removeAllEventListeners(), this.vis.mouseEnabled = !1, this.vis.scaleX = this.vis.scaleY = this.scale = 2, this.vis.gotoAndPlay("bombexplosionv"), addToParent(this.vis, this.parent), this.isByPhysPosUpdate = !1, this.disposePhysBody(), this.isExploded = !0, playSound("explodeSound")) }; b.calculateBoundingBox = function () { var a = 1; this.isEnemy && (a = 0.7); var b = this.vis._animation; b && b.frames && 0 < b.frames.length && (this.bounds = charSS.getFrameBounds(b.frames[0]), this.bounds.width = this.bounds.width * this.scale * a, this.bounds.height = this.bounds.height * this.scale * a, this.bounds.x = this.bounds.x * this.scale * a, this.bounds.y = this.bounds.y * this.scale * a, this.charRadius = this.bounds.width / 2) }; b.setPosition = function (a, b, c) { var e = a; this.isMovable && (this.distanceEndX = 140 * this.scale - this.scaleY * this.visionWidth, this.distanceStartX = a - this.distanceEndX / 2, this.distanceEndX = a + this.distanceEndX / 2, e = Math.min(this.distanceEndX, Math.max(this.distanceStartX, a + this.startMarginX))); this.vis.x = this.additVision.x = e; this.vis.y = this.additVision.y = b; this.defaultRotation = this.vis.rotation = this.additVision.rotation = c }; b.initPhysics = function () { if (!this.isDecor && this.type !== ACTIVATOR_TYPE && this.type !== TELEPORT_TYPE) { var a; a = this.vis.x / PHYS_SCALE; var b = this.vis.y / PHYS_SCALE, c = this.vis.rotation * DEGREES_TO_RAD; if (a = this.isPhysStatic || this.type === DYNAMIC_BOX_TYPE || this.type === DANGER_TYPE || this.type === MONSTER_TYPE && this.isRectMonster || this.type === GLASS_BLOCK_TYPE || this.type === GLASS_BOX_TYPE || this.type === DOOR_TYPE || this.type === DYNAMIC_RECT_TYPE || this.type === HARD_RECT_TYPE || this.type === HARD_BOX_TYPE || this.type === STATIC_BALK_1_TYPE || this.type === STATIC_BOX_TYPE ? createRectPhysics(a, b, this.scale, this.scaleY, this.type, c) : this.type === DYNAMIC_TRIANGLE_TYPE || this.type === GLASS_TRIANGLE_TYPE || this.type === HARD_TRIANGLE_TYPE ? createTrianglePhysics(a, b, this.scale, this.scaleY, this.type, c) : this.type === TELEGA_TYPE || this.type === AIM_TYPE || this.type === MOVABLE_BALK_TYPE ? createKinematicPhysics(a, b, this.scale, this.scaleY, this.type, c, this) : this.type === LAND_TYPE ? createSegmentPhysics(a, b, this.scale, this.scaleY, this.type, c, this) : createCircleShape(a, b, this.scale * this.getRadiusByType() / PHYS_SCALE, this.type, c, this)) a.userdata = this, this.physBody = a } }; b.getRadiusByType = function () { switch (this.type) { case HERO_TYPE: return 32; case AIM_TYPE: return 19; case HERO_DOC_TYPE: return 31; case HERO_WOMAN_TYPE: return 31; case TELEPORT_TYPE: return 25; case BOMB_TYPE: return 20; case MONSTER_TYPE: return 31; case DYNAMIC_CIRCLE_TYPE: return 16; case FAN_TYPE: return 25 } return 0 }; b.setFrame = function (a, b) { b ? this.vis.gotoAndPlay(a) : this.vis.gotoAndStop(a) }; b.setVisionState = function (a) {}; b.onInflateEnd = function () { this.isFly = !1 }; b.tick = function () { if (this.isNeedDispose) addToArray(toDisposeChars, this); else if (!isGamePaused && (!this.isDecor || this.isDynamicDecor)) if (this.physBody && !this.isPhysStatic && this.isByPhysPosUpdate && (this.isMovable && (this.vis.x > this.distanceEndX ? this.dir = -1 : this.vis.x < this.distanceStartX && (this.dir = 1), this.physBody.setVel(v(15 * this.currSpeed * this.dir * dtScale, 0)), this.physBody.p.x += this.currSpeed * this.dir * dtScale), this.vis.x = this.additVision.x = this.physBody.p.x, this.vis.y = this.additVision.y = this.physBody.p.y, this.vis.rotation = this.additVision.rotation = Math.atan2(this.physBody.rot.y, this.physBody.rot.x) * RAD_TO_DEGREES), this.type === BOMB_TYPE ? (this.vis.scaleX = this.scale + Math.cos((counter + this.animMargin) / 5) / 60, this.vis.scaleY = this.scale - Math.cos((counter + this.animMargin) / 5) / 60, this.isExploded && 13 <= this.vis.currentAnimationFrame && (this.isNeedDispose = !0)) : this.isHelp && (this.vis.scaleX = this.vis.scaleY = this.scale + Math.cos((counter + this.animMargin) / 12) / 20), this.isHero && (this.updateTeleportation(), (-50 > this.vis.x || 410 < this.vis.x || this.vis.y > viewportH + 40 || -140 > this.vis.y) && this.dieByWorldOut()), this.type === AIM_TYPE) for (var a = 0; a < allHeroesLen; a++) { var b = allHeroes[a]; if (25 > Math.abs(b.vis.x - this.vis.x) && 10 > Math.abs(b.vis.y - this.vis.y)) { if (isLevelCompleted && !isLevelFailed) break; trace("level complete!"); this.aimCollected(); updateShare(currentLevel + 1); showLevelCompleteWin(); // updateShare(currentLevel + 1);Play68.setRankingScoreDesc(currentLevel + 1,Play68.rankingShowType.RANKING_SHOW_NO); } } else if (this.type === TELEPORT_TYPE) for (a = 0; a < allHeroesLen; a++) b = allHeroes[a], 40 > Math.abs(b.vis.x - this.vis.x) && 40 > Math.abs(b.vis.y - this.vis.y) ? b.teleportTo(this) : 0 > b.teleportationStatus && b.teleportContactEnd(this) }; b.updateTeleportation = function () { if (this.physBody) if (0 === this.teleportationStatus) { this.isByPhysPosUpdate = !1; this.teleportationStatus = 1; this.physBody.p.x = -1E3; this.physBody.p.y = 0; var a = this; playSound("portalAppearSound"); createjs.Tween.get(this.vis, { override: !0 }) .to({ rotation: 900, scaleX: 0.05, scaleY: 0.05, x: this.startTeleport.vis.x, y: this.startTeleport.vis.y }, 700) .to({ x: this.aimTeleport.vis.x, y: this.aimTeleport.vis.y }, 0) .call(function () {}) .to({ rotation: 0, scaleX: this.scale, scaleY: this.scale }, 700) .call(function () { a.teleportationStatus = 2 }) } else 2 == this.teleportationStatus && (this.physBody.p.x = this.aimTeleport.vis.x / PHYS_SCALE, this.physBody.p.y = this.aimTeleport.vis.y / PHYS_SCALE, this.physBody.w = 0, this.physBody.setAngle(0), this.physBody.setVel(v(0, 0)), this.teleportationStatus = -1, this.isByPhysPosUpdate = !0) }; b.updateVisionScale = function () { this.vis.scaleX = this.scale; this.vis.scaleY = this.scaleY; this.isMovable && (this.vis.scaleX = this.vis.scaleY = this.scaleY); this.isReversed && (this.vis.scaleX *= -1); this.additVision.scaleX = this.vis.scaleX; this.additVision.scaleY = this.vis.scaleY }; b.dispose = function () { removeFromArray(allChars, this); this.isHero && removeFromArray(allHeroes, this); this.lastColliderType = -1; addToDisposed(this); this.vis.removeAllEventListeners(); this.disposePhysBody(); this.shape = null; this.vis.stop(); removeFromParent(this.vis); removeFromParent(this.additVision) }; b.collideWithOtherDynamic = function () { -1 < this.teleportationStatus || (this.isByPhysPosUpdate = !0) }; b.toggleFly = function () {}; b.heroRejoicing = function () { this.vis.gotoAndPlay(this.typeId) }; b.aimCollected = function () { createPrerenderedPart(this.vis.x, this.vis.y, 1.4, "parteffectv3", 0.71, this.vis, 0.8); addAchiev(GREAT_START_ACHIEV) }; b.teleportTo = function (a) { this.aimTeleport || (this.startTeleport = a, this.aimTeleport = a.teleportPartner, this.teleportationStatus = 0) }; b.teleportContactEnd = function (a) { this.aimTeleport === a && (this.aimTeleport = this.startTeleport = null) }; b.die = function () { isLevelCompleted || isLevelFailed || (this.isDied = isLevelFailed = !0, this.isByPhysPosUpdate = this.isFly = !1, hideGameInterface(), createjs.Tween.get(this.vis, { override: !0 }) .to({ alpha: 0, scaleX: 0, scaleY: 0, rotation: 900 }, 1200) .wait(400) .call(showRestartWin), createDiePart(this.vis.x, this.vis.y), this.physBody && (this.physBody.p.x = -1E3), playSound("restartSound")) }; b.dieByWorldOut = function () { isLevelCompleted || isLevelFailed || (1 >= allHeroes.length ? (this.isDied = isLevelFailed = !0, this.isByPhysPosUpdate = this.isFly = !1, hideGameInterface(), createjs.Tween.get(this.vis) .wait(400) .call(showRestartWin), this.physBody && (this.physBody.p.x = -1E3), playSound("restartSound")) : this.isNeedDispose = !0) }; b.collideWithDyn = function (a) { this.isFirstCollided || (this.isByPhysPosUpdate = this.isFirstCollided = !0) }; b.breakGlass = function () { !this.vis.visible || 15 > levelStartTimer || !this.physBody || (this.disposePhysBody(), this.vis.visible = !1, this.type === GLASS_BLOCK_TYPE ? createGlassRectExplode(this.vis.x, this.vis.y, this.scale, this.vis.rotation) : createPartExplode(this.vis.x, this.vis.y, 3, PART_GLASS_TYPE, null, 3), playSound("glassBrakeSound")) }; b.activateBtn = function () { if (!this.isActivated) { this.isActivated = !0; this.vis.currentAnimationFrame = 1; for (var a, b = 0; b < allChars.length; b++) a = allChars[b], a.isMechanic && !a.isActivated && a.labelId === this.labelId && a.activateMechanic(); playSound("clickSound") } }; b.deActivateBtn = function () { if (this.isActivated) { this.isActivated = !1; this.vis.currentAnimationFrame = 0; for (var a, b = 0; b < allChars.length; b++) a = allChars[b], a.isMechanic && a.isActivated && a.labelId === this.labelId && a.deActivateMechanic(); playSound("clickSound") } }; b.activateMechanic = function () { this.isActivated = !0 }; b.deActivateMechanic = function () { this.isActivated = !1 }; b.toggleFan = function () { if (this.isActivated = !this.isActivated) this.vis.gotoAndPlay("FAN_TYPE_ON"), awakeAllBodies(), playWindSound(); else { this.vis.gotoAndStop("FAN_TYPE"); for (var a = 0, b = allFans.length - 1; 0 <= b; --b) allFans[b].isActivated && a++; 1 > a && stopWindSound() } }; b.removeFromField = function () { this.disposePhysBody(); this.isByPhysPosUpdate = !1; currentRemovablesNum--; var a = this; createjs.Tween.get(this.vis) .to({ alpha: 0, scaleX: 0, scaleY: 0 }, 250) .call(function () { a.isNeedDispose = !0 }); playRemoveObjectSound() }; b.disposePhysBody = function () { this.physBody && toDisposePhysicsBodies.push(this.physBody); this.physBody = null }; c.CharBase = a })(window); var allChars = [], allHeroes = [], disposedChars = [], allBombs = [], allMonsters = [], allActivators = [], allTeleports = [], allFans = [], blockContainer, currentLevel = 0, isLevelCompleted = !1, isLevelFailed = !1, isInflateReason = !1, currentChar, totalFriends = 0, totalBonuses = 0, collectedBonuses = 0, totalScore = 0, currentLevelScore = 0, scoreToAdd = 0; function initLevelManager() { container.addChild(blockContainer); initPhysics(); stage.addEventListener("stagemousedown", onCharContainerMouseDown); stage.addEventListener("stagemouseup", onCharContainerMouseUp) } function createChar(c, a, b, g, f, d, e) { c = geCharFromPool(c, blockContainer, g, f, e); c.setPosition(a, b, d); c.initPhysics(); isArrayContains(allChars, c) || allChars.push(c); return c } var levelRestartsCounter = 0, levelsWithoutRestartsCounter = 0, diamondsCounter = 0; function loadLevel(c) { currentLevel != c && (levelRestartsCounter = 0, MORE_EASY_MULT = 1); currentLevel = c; currentLevel >= LEVELS_NUM && (currentLevel %= LEVELS_NUM); showBgByLevelNum(currentLevel); setCurrentLevelLabel(currentLevel); loadLevelByCode(allLevels[currentLevel]); isLevelRestarted = isGamePaused = !1; isNeedCacheSizeUpdate = !0; playSound("levelStart") } var totalEnemies = 0; function loadLevelByCode(c) { isGamePaused = !0; disposeLevel(); addInstructions(); if (c) { totalEnemies = 0; resetSoundOnNewLevel(); for (var a = 0; a < c.length; a++) { var b = c[a]; isBonus(b[0]) ? createBonus(b[0], b[1], b[2], b[3], b[4], b[5], b[6]) : createChar(b[0], b[1], b[2], b[3], b[4], b[5], b[6]) } } } function isBonus(c) { return -1 < c.indexOf("BONUS") } var isLevelRestarted = !1; function restartLevel() { isLevelRestarted = !0; levelRestartsCounter += 1; levelsWithoutRestartsCounter = 0; loadLevel(currentLevel) } function loadNextLevel() { loadLevel(currentLevel + 1) } var levelStartTimer = 0; function disposeLevel() { disposeInstructions(); isLevelFailed = isLevelCompleted = isInflateReason = !1; levelStartTimer = 0; currentChar = null; currentRemovablesNum = collectedBonuses = totalBonuses = currentLevelScore = scoreToAdd = 0; var c = allChars.length, a; for (a = 0; a < c; a++) allChars.pop() .dispose(); toDisposeChars = []; clickedChars = []; disposeBonuses(); allBombs = []; allMonsters = []; allActivators = []; allTeleports = []; for (allFans = []; 0 < toDisposePhysicsBodies.length;) c = toDisposePhysicsBodies.pop(), destroyBody(c); space.step(0.01); window.gc && window.gc() } function disposeLevelPhysics() { var c = allChars.length, a; for (a = 0; a < c; a++) allChars[a].disposePhysBody(); for (; 0 < toDisposePhysicsBodies.length;) c = toDisposePhysicsBodies.pop(), destroyBody(c) } function addScore(c) { currentLevelScore += c } function addToDisposed(c) { isArrayContains(disposedChars, c) || disposedChars.push(c) } function geCharFromPool(c, a, b, g, f) { if (0 < disposedChars.length) { var d = disposedChars.pop(); d.reset(c, a, b, g, f); return d } return new CharBase(c, a, b, g, f) } var BIG_DISTANCE = 1E8; function onCharContainerMouseDown(c) { splashContainer && splashContainer.parent && sponsorClick(c); if (!(isGamePaused || isLevelCompleted || isLevelFailed)) { var a = (c.stageX - container.x) / scaleFactor; c = (c.stageY - container.y) / scaleFactor; for (var b, g = 0, f = g = 0, d = 0, d = 0; d < allBombs.length; d++) if (b = allBombs[d], !b.isExploded && (g = b.vis.x - a, f = b.vis.y - c, g = g * g + f * f, 484 > g)) { addToArray(clickedChars, b); return } for (d = allFans.length - 1; 0 <= d; --d) if (b = allFans[d], g = b.vis.x - a, f = b.vis.y - c, g = g * g + f * f, 784 > g) { addToArray(clickedChars, b); return }(a = getBodyAtMouse(a / PHYS_SCALE, c / PHYS_SCALE)) && (c = a.userdata) && c.isRemovable && addToArray(clickedChars, a.userdata) } } function onCharContainerMouseUp(c) {} var lastopenedlvl = 0, levelstates = [], LEVELS_NUM = 20, ZERO_STAR = 0, ONE_STAR = 1, TWO_STAR = 2, THREE_STAR = 3, ACHIEVS_NUM = 6, NOT_ACHIEVED = 0, ACHIEVED = 1, allachievs = [], GREAT_START_ACHIEV = 0, SUPER_COLLECTOR_ACHIEV = 1, DESTROYER_ACHIEV = 2, AMAZING_GAME_ACHIEV = 3, SOCCER_MASTER_ACHIEV = 4, MEGA_STAR_ACHIEV = 5, isStorageSupported = !1; function loadSaves() { lastopenedlvl = 0; if (isStorageSupported = isSupportshtml5storage()) if (localStorage[STORAGE_PREFIX + "lastopenedlvl"]) { lastopenedlvl = parseInt(localStorage[STORAGE_PREFIX + "lastopenedlvl"]); for (a = 0; a < LEVELS_NUM; a++) levelstates.push(parseInt(localStorage[STORAGE_PREFIX + "levelstate" + a])); for (a = 0; a < ACHIEVS_NUM; a++) { var c = localStorage[STORAGE_PREFIX + "achiev" + a]; c ? allachievs.push(parseInt(c)) : allachievs.push(NOT_ACHIEVED) } isMute = "1" == localStorage[STORAGE_PREFIX + "ismute"]; totalFriends = localStorage[STORAGE_PREFIX + "totalfriends"] ? parseInt(localStorage[STORAGE_PREFIX + "totalFriends"]) : 0; totalScore = localStorage[STORAGE_PREFIX + "totalScore"] ? parseInt(localStorage[STORAGE_PREFIX + "totalScore"]) : 0; diamondsCounter = localStorage[STORAGE_PREFIX + "diamondsCounter"] ? parseInt(localStorage[STORAGE_PREFIX + "diamondsCounter"]) : 0 } else { trace("saves not found!"); for (a = 0; a < LEVELS_NUM; a++) levelstates.push(ZERO_STAR); for (a = 0; a < ACHIEVS_NUM; a++) allachievs.push(NOT_ACHIEVED); updateSaves() } else { trace("storage not supported"); for (var a = 0; a < LEVELS_NUM; a++) levelstates.push(ZERO_STAR); for (a = 0; a < ACHIEVS_NUM; a++) allachievs.push(NOT_ACHIEVED) } } function getStarsForLevel(c) { return levelstates[c] } function saveGame(c) { lastopenedlvl <= currentLevel && (lastopenedlvl = currentLevel + 1); levelstates[currentLevel] < c && (levelstates[currentLevel] = c); updateSaves() } function updateSaves() { if (isStorageSupported) { localStorage[STORAGE_PREFIX + "lastopenedlvl"] = lastopenedlvl; for (var c = 0; c < LEVELS_NUM; c++) localStorage[STORAGE_PREFIX + "levelstate" + c] = levelstates[c]; for (c = 0; c < ACHIEVS_NUM; c++) localStorage[STORAGE_PREFIX + "achiev" + c] = allachievs[c]; saveMuteState(); localStorage[STORAGE_PREFIX + "totalfriends"] = "" + totalFriends; localStorage[STORAGE_PREFIX + "totalScore"] = "" + totalScore; localStorage[STORAGE_PREFIX + "diamondsCounter"] = "" + diamondsCounter } } function saveMuteState() { isStorageSupported && (localStorage[STORAGE_PREFIX + "ismute"] = isMute ? "1" : "0") } function isSupportshtml5storage() { try { var c = "localStorage" in window && null !== window.localStorage; c && (localStorage.setItem("storage", ""), localStorage.removeItem("storage")); return c } catch (a) { return !1 } } var allInstructions = []; function createInstruction(c, a, b, g) { c = createPart(PART_INSTRUCTION_TYPE, c, a, 1, g ? blockContainer : allBgContainer); c.setFrame(b); allInstructions.push(c); return c } function addInstructions() { isLevelRestarted || updateBgCache() } function disposeInstructions() { for (; 0 < allInstructions.length;) allInstructions.pop() .dispose() } function getCollectedStarsNum() { for (var c = 0, a = 0; a < LEVELS_NUM; a++) c += levelstates[a]; return c } function createExplosion(c) { for (var a, b = allChars.length - 1; 0 <= b; --b) a = allChars[b], a !== c && a.physBody && (a.physBody.isStatic() || a.isPhysStatic && a.type !== GLASS_BLOCK_TYPE || -1 < a.teleportationStatus || a.isDied || a.isMovable || a.isAim || a.isLand || CreateExplode(c, a)) } function CreateExplode(c, a) { var b = a.physBody, g = a.vis.x - c.vis.x, f = a.vis.y - c.vis.y, d = Math.sqrt(g * g + f * f); d > c.activDistance || (a.type === GLASS_BLOCK_TYPE ? d < 0.6 * c.activDistance && a.breakGlass() : (g /= d, f /= d, d = Math.max(0, 1 - d / c.activDistance), d = d * c.activForce * b.m, d = v(g * d, f * d), b.applyImpulse(d, v(10 * Math.random() - 5, 0)), a.isByPhysPosUpdate = !0)) } var allBonuses = [], disposedBonuses = [], currentBon; function initBonusManager() {} function createBonus(c, a, b, g, f, d, e) { c = getBonusFromPool(c, blockContainer, g, f, e); c.setPos(a, b, d); addToArray(allBonuses, c) } function disposeBonuses() { var c = allBonuses.length, a; for (a = 0; a < c; a++) allBonuses.pop() .dispose() } function addToDisposedBonuses(c) { isArrayContains(disposedBonuses, c) || disposedBonuses.push(c) } function getBonusFromPool(c, a, b, g, f) { if (0 < disposedBonuses.length) { var d = disposedBonuses.pop(); d.reset(c, a, b, g, f); return d } return new BonusBase(c, a, b, g, f) } var toDisposeBonuses = []; function updateBonusManager() { for (var c = 0; c < allBonuses.length; c++) allBonuses[c].tick(), allBonuses[c].isCollected && addToArray(toDisposeBonuses, allBonuses[c]); for (; 0 < toDisposeBonuses.length;) toDisposeBonuses.pop() .dispose() } (function (c) { function a(a, b, c, e, h) { var k = new createjs.Sprite(zoeSS); k.mouseEnabled = !1; k.baseBlock = this; this.vis = k; this.reset(a, b, c, e, h) } var b = a.prototype; b.reset = function (a, b, d, e, h) { this.typeId = a; this.type = c[a]; createjs.Tween.removeTweens(this.vis); this.tweenMaxSteps = 0; this.isNeedCollect = !1; this.additParams = h; this.parent = b; this.vis.isOnTop = !1; this.vis.isOnBottom = !0; this.vis.alpha = 1; this.isCollected = this.isGhost = !1; this.animMargin = 30 * Math.random(); this.scaleX = d; this.scaleY = e; this.moveTarget = null; this.distanceSq = this.speed = this.dy = this.dx = 0; this.hero = null; this.dir = 1; this.distanceStartX = this.distanceEndX = 0; this.sensorRadiusSq = 3600; this.collectRadiusSq = 100; this.setVisionByType(); this.updateVisionScale(); b.addChild(this.vis); this.isGhost || totalBonuses++ }; b.setPos = function (a, b, c) { this.vis.x = a; this.vis.y = b; this.isGhost && 0 === this.distanceStartX && (this.distanceEndX = 140 * this.scaleX - 52 * this.scaleY, this.distanceStartX = a - this.distanceEndX / 2, this.distanceEndX = a + this.distanceEndX / 2); c && (this.vis.rotation = c) }; b.updateVisionScale = function () { this.vis.scaleX = this.scaleX; this.vis.scaleY = this.scaleY; this.isGhost && (this.vis.scaleX = this.scaleY) }; b.getAdditParams = function (a) { return this.additParams[0].split("_")[a] }; b.setVisionByType = function () { this.vis.gotoAndStop(this.typeId); this.type === BONUS_DIAMOND_TYPE && (this.vis.play(), this.vis._animation.speed = 1.5); this.vis.paused || (this.vis.currentAnimationFrame = Math.floor(20 * Math.random())); this.type === BONUS_GHOST_TYPE && (this.isGhost = !0, this.vis.play(), this.speed = parseInt(this.getAdditParams(0)) / 10, this.vis._animation.speed = 0.7, this.sensorRadiusSq = 625) }; b.tick = function () { if (!this.isCollected && !isGamePaused) if (this.isGhost) this.updateGhost(); else if (this.vis.scaleX = this.scaleX + Math.cos((counter + this.animMargin) / 10) / 12, this.vis.scaleY = this.vis.scaleX, this.moveTarget) this.speed += 0.2, this.dx = this.moveTarget.vis.x - this.vis.x, this.dy = this.moveTarget.vis.y - this.vis.y, this.distanceSq = this.dx * this.dx + this.dy * this.dy, this.vis.x += this.dx / 3 * this.speed, this.vis.y += this.dy / 3 * this.speed, this.distanceSq < this.collectRadiusSq && (this.isCollected = !0, createPrerenderedPart(this.moveTarget.vis.x, this.moveTarget.vis.y, 1, "parteffectv1", 0.9, this.moveTarget.vis), addScore(this.getScoreByType()), this.checkBonusAchievByType(), this.moveTarget = null, collectedBonuses++, playBonusPickSound()); else for (var a = 0; a < allHeroesLen; a++) this.hero = allHeroes[a], this.dx = this.hero.vis.x - this.vis.x, this.dy = this.hero.vis.y - this.vis.y, this.distanceSq = this.dx * this.dx + this.dy * this.dy, this.distanceSq < this.sensorRadiusSq && (this.moveTarget = this.hero) }; b.updateGhost = function () { this.vis.x += this.speed * this.dir * dtScale; this.vis.x > this.distanceEndX && (this.dir = -1); this.vis.x < this.distanceStartX && (this.dir = 1); for (var a = 0; a < allHeroesLen; a++) this.hero = allHeroes[a], this.dx = this.hero.vis.x - this.vis.x, this.dy = this.hero.vis.y - this.vis.y, this.distanceSq = this.dx * this.dx + this.dy * this.dy, this.distanceSq < this.sensorRadiusSq && this.hero.die() }; b.checkBonusAchievByType = function () { for (var a = 0; a < allBonuses.length; a++); }; b.getScoreByType = function () { switch (this.type) { case BONUS_STAR_TYPE: return 50; case BONUS_DIAMOND_TYPE: return 150; case BONUS_MONEY_TYPE: return 100; default: return 50 } }; b.dispose = function () { removeFromArray(allBonuses, this); addToDisposedBonuses(this); this.vis.removeAllEventListeners(); this.vis.stop(); this.parent.removeChild(this.vis) }; b.startCollectAnim = function (a) {}; c.BonusBase = a })(window); var isAudioSupported = !1, isMute = !1; function initSoundManager() { isDesktop() || createjs.Sound.registerPlugins([createjs.WebAudioPlugin]); (isAudioSupported = isSamsungDefaultBrowser() ? !1 : createjs.Sound.initializeDefaultPlugins()) && manifest.push({ src: "click.ogg|click.mp3", id: "clickSound", data: 1 }, { src: "win.ogg|win.mp3", id: "winSound", data: 1 }, { src: "sm_main_music.ogg|sm_main_music.mp3", id: "bgMusic", data: 1 }, { src: "fail.ogg|fail.mp3", id: "restartSound", data: 1 }, { src: "explosion.ogg|explosion.mp3", id: "explodeSound", data: 1 }, { src: "elk_achievement_voice2.ogg|elk_achievement_voice2.mp3", id: "achievSound0", data: 1 }, { src: "elk_achievement_voice1.ogg|elk_achievement_voice1.mp3", id: "achievSound1", data: 1 }, { src: "star1.ogg|star1.mp3", id: "star1", data: 1 }, { src: "star2.ogg|star2.mp3", id: "star2", data: 1 }, { src: "star3.ogg|star3.mp3", id: "star3", data: 1 }, { src: "whistles_got1.ogg|whistles_got1.mp3", id: "bonus0", data: 1 }, { src: "whistles_got2.ogg|whistles_got2.mp3", id: "bonus1", data: 1 }, { src: "whistles_got3.ogg|whistles_got3.mp3", id: "bonus2", data: 1 }, { src: "start_game.ogg|start_game.mp3", id: "levelStart", data: 1 }, { src: "remove_object1.ogg|remove_object1.mp3", id: "remove_object0", data: 1 }, { src: "remove_object2.ogg|remove_object2.mp3", id: "remove_object1", data: 1 }, { src: "remove_object3.ogg|remove_object3.mp3", id: "remove_object2", data: 1 }, { src: "teleport.ogg|teleport.mp3", id: "portalAppearSound", data: 2 }, { src: "glass.ogg|glass.mp3", id: "glassBrakeSound", data: 1 }, { src: "wind_release.ogg|wind_release.mp3", id: "windRelease", data: 1 }) } function isSamsungDefaultBrowser() { var c = navigator.userAgent; return -1 < c.toLowerCase() .indexOf("samsung") && -1 < c.indexOf("Android ") } function playSound(c, a) { if (!isMute && isAudioSupported) return createjs.Sound.play(c, { interrupt: createjs.Sound.INTERRUPT_EARLY, loop: a ? -1 : 0 }) } function toggleMute() { (isMute = !isMute) ? (stopBgMusic(), stopWindSound()) : playBgMusic(); saveMuteState() } var scoresSound; function playScoresSound() { !isMute && isAudioSupported && (scoresSound ? scoresSound.play() : scoresSound = playSound("countScoreSound", !1)) } function stopScoresSound() { isAudioSupported && scoresSound && (scoresSound.stop(), scoresSound = null) } var windSound; function playWindSound() { !isMute && isAudioSupported && (windSound = playSound("windRelease", !1)) } function stopWindSound() { isAudioSupported && windSound && (windSound.stop(), windSound = null) } function playRemoveObjectSound() { playSound("remove_object" + Math.floor(3 * Math.random())) } function resetSoundOnNewLevel() { isAudioSupported && (bonusSoundNum = 0) } var bonusSoundNum = 0; function playBonusPickSound() { playSound("bonus" + bonusSoundNum); bonusSoundNum++; 2 < bonusSoundNum && (bonusSoundNum = 0) } var achievSoundNum = 0; function playAchievSound() { playSound("achievSound" + achievSoundNum); achievSoundNum++; 1 < achievSoundNum && (achievSoundNum = 0) } function startBgMusic() { bgMusic || playBgMusic() } var bgMusic; function playBgMusic() { !isMute && isAudioSupported && (bgMusic ? bgMusic.resume() : bgMusic = playSound("bgMusic", !0)) } function stopBgMusic() { isAudioSupported && bgMusic && bgMusic.pause() } var pauseBtnV, playMenuBtn, creditsBtn, logoImg, levelSelectContainer, interfaceRestartBtn, isGamePaused, levelLabel, menuEase; function initInterface() { pauseBtnV = createButton(18, 18, 0.8, "pausebtn", onPausePress, null, onPauseUp); interfaceRestartBtn = createButton(18, 18, 0.6, "restartbtn", onPressStandartHandler, null, onInterfaceRestartUp); levelLabel = new createjs.BitmapText("0", zoeSS); levelLabel.scaleX = levelLabel.scaleY = 0.25; levelLabel.mouseEnabled = !1; levelLabel.y = 253; levelLabel.score = 0; levelLabel.spaceWidth = 10; levelLabel.postfix = "ll"; menuEase = createjs.Ease.getElasticOut(1, 0.35); createMainMenu(); createLevelSelectMenu(); createLevelCompleteWin(); createPauseWin(); createAchievWin(); createAchievGalleryMenu(); createCreditsWin(); creategameCompleteWin(); createBlinkWin(); isGamePaused = !0; isSkipMenus ? showGameInterface() : isLevelSelectShow ? showLevelsMenu() : showMainMenu(!1) } var blinkWin; function createBlinkWin() { blinkWin = createButton(-40, -60, 6.5, "tint2"); blinkWin.scaleX = 4.5 } function startBlink(c, a) { addToParent(blinkWin, container); blinkWin.alpha = 1; blinkWin.gotoAndStop(a); createjs.Tween.get(blinkWin, { override: !0 }) .to({ alpha: 0 }, c) .call(removeChildOnTweenComplete) } function showFPSMeter() { isNeedFpsMeter && addToParent(fpsText, container); isNeedHelperLabel && addToParent(helperLabel, container) } function showGameInterface() { addToParent(pauseBtnV, container); addToParent(interfaceRestartBtn, container); addToParent(levelLabel, container); showFPSMeter() } function hideGameInterface() { pauseBtnV.parent && container.removeChild(pauseBtnV); removeFromParent(interfaceRestartBtn); removeFromParent(levelLabel) } function setCurrentLevelLabel(c) { levelLabel.text = "l " + (c + 1) } function onPausePress(c) { isGamePaused || isLevelFailed || isLevelCompleted || onHoverScale(c.target) } function onPauseUp(c) { onOutScale(c.target); isGamePaused || isLevelFailed || isLevelCompleted || levelPauseContainer.parent || isCursorOutMoved(c) || (playSound("clickSound"), showPauseWin()) } var menuContainer, mainMenuMuteBtn, mainMenuMoreGames, mainMenuAchievBtn; function createMainMenu() { menuContainer = new createjs.Container; playMenuBtn = createButton(ow / 2, 220, 0.7, "playbtnup", onPlayPress, menuContainer, onPlayUp); creditsBtn = createButton(300, 200, 0.8, "btnbaseup", onCreditsPress, menuContainer, onCreditsUp); logoImg = createButton(ow / 2 + 5, 175, 1, "logov", null, menuContainer); mainMenuAchievBtn = createButton(37, 170, 0.8, "achievbtn", onAchievGalleryPress, menuContainer, onAchievGalleryUp); mainMenuMuteBtn = createButton(382, 17, 0.65, "musiconbtn", onMainMenuMutePress, menuContainer, onMainMenuMuteUp); mainMenuMoreGames = createButton(100, 190, 0.7, "moregames2v", sponsorClick, menuContainer, null); isAudioSupported || (mainMenuMuteBtn.visible = !1); createMainMenuTweens() } var MUTED_FRAME = "musicoffbtn", UNMUTED_FRAME = "musiconbtn"; function onMainMenuMutePress(c) { onHoverScale(c.target) } function onMainMenuMuteUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (toggleMute(), updateMusicIconFrame(c.target), playSound("clickSound")) } function updateMusicIconFrame(c) { c.gotoAndStop(isMute ? MUTED_FRAME : UNMUTED_FRAME) } function showMainMenu(c) { container.addChild(menuContainer); updateMusicIconFrame(mainMenuMuteBtn); showBgByLevelNum(0, 2); showFPSMeter(); showTopLogo(0.8); c && (startBlink(700, "tint2"), isNeedCacheSizeUpdate = !0) } function showMainMenuTweenComplete(c) {} function hideMainMenu() { removeFromParent(menuContainer) } function hideMainMenuTweenComplete(c) { c = c.target; c.alpha = 1; c.parent && container.removeChild(c) } function createBigWinBg(c, a, b, g) { c = createButton(c, a, isLowQuality ? 2 : 1, isLowQuality ? "smallwinv" : "bgwinv", null, g); c.rotation = -90; c.scaleX = isLowQuality ? 2 * b : b } function createMainMenuTweens() { var c = createjs.Ease.bounceOut; createjs.Tween.removeTweens(playMenuBtn); playMenuBtn.scaleX = playMenuBtn.scaleY = 0.75; createjs.Tween.get(playMenuBtn, { override: !0, loop: !0 }) .to({ scaleX: 0.95, scaleY: 0.95 }, 3E3, c) .wait(1E3) .to({ scaleX: 0.75, scaleY: 0.75 }, 3E3, c) } function disposeMainMenuTweens() { createjs.Tween.removeTweens(playMenuBtn) } function onPlayPress(c) { onHoverScale(c.target) } function onPlayUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), hideMainMenu(), showLevelsMenu(), startBgMusic()) } function onAchievGalleryPress(c) { onHoverScale(c.target) } function onAchievGalleryUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), hideMainMenu(), showAchievGallery()) } function onCreditsPress(c) { c.target.scaleX = c.target.scaleY = 0.9; trace("play credits!") } function onCreditsUp(c) { c.target.scaleX = c.target.scaleY = 0.8; isCursorOutMoved(c) || (playSound("clickSound"), hideMainMenu(), showCreditsWin()) } function createButton(c, a, b, g, f, d, e) { var h = new createjs.Sprite(interfaceSS); h.snapToPixel = !0; h.x = c; h.y = a; h.scaleX = h.scaleY = b; h.gotoAndStop(g); h.defaultScale = b; e && h.addEventListener("pressup", e, !1); f ? (h.addEventListener("mousedown", f, !1), h.cursor = "pointer") : h.mouseEnabled = !1; (f || e) && (c = interfaceSS.getAnimation(g)) && c.frames && 0 < c.frames.length && (c = interfaceSS.getFrameBounds(c.frames[0]), h.setBoundingBox(c.x * b, c.y * b, c.width * b, c.height * b)); d && d.addChild(h); return h } var selectMenuBackBtn, selectMenuNextBtn, selectMenuPreviousBtn, allLevelBtns = [], levelsScreen1, levelsScreen2; function createLevelSelectMenu() { var c = levelSelectContainer = new createjs.Container; levelSelectContainer.name = "levelselcont"; createBigWinBg(5, 438, 0.95, c); levelsScreen1 = new createjs.Container; levelsScreen1.name = "levelsScreen1"; levelsScreen2 = new createjs.Container; createButton(156, 73, 1, "levelselecttitle", null, levelSelectContainer); selectMenuBackBtn = createButton(28, 411, 0.8, "backbtn", onBackToMenuPress, levelsScreen1, onBackToMenuUp); createLevelsButtons(); levelSelectContainer.addChild(levelsScreen1) } function cacheWin(c) { c.cache(-10, -10, ow + 20, oh + 20) } function uncacheWin(c) { c.uncache() } function createLevelsButtons() { for (var c = 0; 20 > c; c++) { var a = createButton(62 + 65 * (c % 4), 129 + 60 * Math.floor(c / 4), 0.72, "lvlLabelStar0", onLevelBtnPress, levelsScreen1, onLevelBtnUp); a.levelNum = c; allLevelBtns.push(a); var b = createButton(a.x - 24, a.y - 26, 0.7, "lvlnum" + (c + 1), null, levelsScreen1); a.txtNum = b } } function updateLevelsButtons() { for (var c = 0; 20 > c; c++) { var a = c <= lastopenedlvl; isOpenAllLevels && (a = c < openedLevels); var b; b = a ? "lvlLabelStar" + getStarsForLevel(c) : "levelbuttonlocked"; var g = allLevelBtns[c]; g.gotoAndStop(b); (g.isOpened = a) ? g.txtNum.parent || g.parent.addChild(g.txtNum) : g.txtNum.parent && g.parent.removeChild(g.txtNum) } } function onLevelBtnPress(c) { c = c.target; onHoverScale(c); trace("level " + c.levelNum + " load"); updateCacheByBtnNum(c.levelNum) } function onLevelBtnUp(c) { var a = c.target; onOutScale(a); isCursorOutMoved(c) ? updateCacheByBtnNum(a.levelNum) : a.isOpened ? (levelsWithoutRestartsCounter = levelRestartsCounter = 0, showGameInterface(), loadLevel(a.levelNum), startBlink(400, "tint2"), showGameField(), hideLevelsMenu()) : (updateCacheByBtnNum(a.levelNum), playSound("clickSound")) } function updateCacheByBtnNum(c) {} function onBackToMenuPress(c) { onHoverScale(c.target) } function onBackToMenuUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (hideLevelsMenu(), showMainMenu(!0), playSound("clickSound")) } function showLevelsMenu() { container.addChild(levelSelectContainer); updateLevelsButtons(); levelsScreen2.parent && levelSelectContainer.removeChild(levelsScreen2); levelsScreen1.parent || levelSelectContainer.addChild(levelsScreen1); levelsScreen1.x = 0; levelsScreen1.alpha = 1; showBgByLevelNum(0, 1, 1.2); startBlink(700, "tint2"); isNeedCacheSizeUpdate = !0; showTopLogo(0.8) } function hideLevelsMenu() { createjs.Tween.removeTweens(levelSelectContainer); removeFromParent(levelSelectContainer) } function showGameField() { createjs.Tween.removeTweens(blockContainer); blockContainer.parent || container.addChild(blockContainer); blockContainer.alpha = 0; blockContainer.visible = !0; createjs.Tween.get(blockContainer, { override: !0 }) .to({ alpha: 1 }, 400) } function hideGameField(c, a) { isGamePaused = !0; createjs.Tween.removeTweens(blockContainer); var b = createjs.Tween.get(blockContainer) .to({ alpha: 0, visible: !1 }, a ? a : 200) .call(removeFromParent); c && b.call(disposeLevelPhysics) } function showRestartWin() { isLevelFailed && (levelPauseContainer.parent || showPauseWin(!0)) } var levelCompleteContainer, completeWinNextBtn, star1, star2, star3, completeLevelLabel, completeTotalScore; function createLevelCompleteWin() { var c = levelCompleteContainer = new createjs.Container; createBigWinBg(5, 400, 0.83, c); var a = createButton(ow / 2, 220, 0.9, "lvlcompletebgnew", null, c); completeWinNextBtn = createButton(270, 390, 0.85, "nextlevelwin", onPressStandartHandler, c, onNextLevelUp); createButton(70, 330, 1, "completeelk", null, c, null); createButton(50, 390, 0.9, "restartbtn", onPressStandartHandler, c, onCompleteRestartUp); createButton(210, 310, 0.8, "levelreadylabel", null, c); star1 = createButton(a.x - 82, a.y - 20, 1, "completestar", null, null, null); star1.rotation = -15; star2 = createButton(a.x + 1, a.y - 27, 1, "completestar", null, null, null); star3 = createButton(a.x + 86, a.y - 16, 1, "completestar", null, null, null); star3.rotation = 12; completeLevelLabel = new createjs.BitmapText("0", zoeSS); completeLevelLabel.scaleX = completeLevelLabel.scaleY = 0.65; completeLevelLabel.mouseEnabled = !1; completeLevelLabel.y = 297; completeLevelLabel.x = 240; completeLevelLabel.score = 0; addToParent(completeLevelLabel, c); createButton(160, 390, 0.85, "moregames2v", sponsorClick, c, null) } function onCompleteQuitUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (hideGameField(!1), disposeLevel(), hideLevelCompleteWin(), showMainMenu(!0), playSound("clickSound"), stopScoresSound()) } function onCompleteRestartUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), restartLevel(), showGameField(), hideLevelCompleteWin(), stopScoresSound()) } function onPressStandartHandler(c) { onHoverScale(c.target) } function onNextLevelUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), hideLevelCompleteWin(), handleNextLevelClick(), stopScoresSound()) } function handleNextLevelClick() { var c = getNewAchievedId(); - 1 < c ? showAchievWin(c) : currentLevel >= LEVELS_NUM - 1 ? (hideGameInterface(), disposeLevel(), showMainMenu(!0)) : (showGameInterface(), loadNextLevel(), showGameField()) } var currentLevelStarsNum = 0; function showLevelCompleteWin() { isLevelCompleted || isLevelFailed || (isLevelCompleted = !0, hideGameInterface(), createjs.Tween.removeTweens(levelCompleteContainer), removeFromParent(star1), removeFromParent(star2), removeFromParent(star3), container.addChild(levelCompleteContainer), addToParent(particleContainer, container), levelCompleteContainer.x = 400, levelCompleteContainer.alpha = 0, createjs.Tween.get(blockContainer) .wait(800) .call(hideGameField), createjs.Tween.get(levelCompleteContainer, { override: !0 }) .wait(900) .to({ alpha: 1, x: 0 }, 1300, menuEase) .call(showStars), currentLevelStarsNum = ZERO_STAR, totalBonuses <= collectedBonuses ? currentLevelStarsNum = THREE_STAR : collectedBonuses >= totalBonuses / 2 ? currentLevelStarsNum = TWO_STAR : 0 < collectedBonuses && (currentLevelStarsNum = ONE_STAR), totalScore += currentLevelScore + scoreToAdd, scoreToAdd = 0, totalFriends += totalEnemies, saveGame(currentLevelStarsNum), completeLevelLabel.text = "" + (currentLevel + 1), checkCompleteAchievs(), stopWindSound(), playSound("winSound")) } function checkCompleteAchievs() { 9 <= getStarsForLevel(0) + getStarsForLevel(1) + getStarsForLevel(2) && addAchiev(SUPER_COLLECTOR_ACHIEV); currentLevel >= LEVELS_NUM - 1 && addAchiev(SOCCER_MASTER_ACHIEV); 60 <= getCollectedStarsNum() && addAchiev(MEGA_STAR_ACHIEV); levelsWithoutRestartsCounter++; 5 <= levelsWithoutRestartsCounter && addAchiev(AMAZING_GAME_ACHIEV); 0 >= currentRemovablesNum && addAchiev(DESTROYER_ACHIEV) } var scoreTweenLength = 0; function showStars(c) { startSponsorAds(); animateStar(star1, 20 + scoreTweenLength, 1, "star1"); currentLevelStarsNum >= TWO_STAR && animateStar(star2, 800 + scoreTweenLength, 1, "star2"); currentLevelStarsNum >= THREE_STAR && animateStar(star3, 1600 + scoreTweenLength, 1, "star3") } function animateStar(c, a, b, g) { levelCompleteContainer.addChild(c); c.alpha = 0; c.scaleX = c.scaleY = 2; createjs.Tween.get(c, { override: !0 }) .wait(a) .to({ alpha: 1, scaleX: b, scaleY: b }, 700, createjs.Ease.bounceOut) .call(function () {}); createjs.Tween.get({ x: 100 }) .wait(a + 200) .call(function () { isLevelCompleted && (playSound(g), createPrerenderedPart(c.x, c.y, 1.2, "parteffectv2", 0.85, c, 0.8)) }) } function removeFromParent(c) { c.parent && c.parent.removeChild(c) } function hideLevelCompleteWin() { createjs.Tween.removeTweens(star1); createjs.Tween.removeTweens(star2); createjs.Tween.removeTweens(star3); createjs.Tween.removeTweens(levelCompleteContainer); createjs.Tween.get(levelCompleteContainer) .to({ alpha: 0, x: -400 }, 200) .call(removeChildOnTweenComplete); showGameInterface() } var levelPauseContainer, pauseContinueBtn, pauseMuteBtn, pauseTitle; function createPauseWin() { var c = levelPauseContainer = new createjs.Container; createBigWinBg(5, 420, 0.83, c); pauseTitle = createButton(ow / 2 - 2, oh / 2 - 70, 0.92, "pausetitle", null, levelPauseContainer); createButton(ow / 2 - 90, 345, 0.9, "quitbtn", onPauseQuitPress, levelPauseContainer, onPauseQuitUp); createButton(ow / 2 + 90, 345, 0.9, "restartbtn", onPauseRestartPress, levelPauseContainer, onPauseRestartUp); pauseMuteBtn = createButton(ow / 2, 345, 0.9, "musiconbtn", onPauseMutePress, levelPauseContainer, onPauseMuteUp); isAudioSupported || (pauseMuteBtn.visible = !1); pauseContinueBtn = createButton(160, 250, 0.8, "playbtnup", onPauseContinuePress, levelPauseContainer, onPauseContinueUp); createButton(160, 410, 0.9, "moregames2v", sponsorClick, levelPauseContainer, null) } function onPauseMutePress(c) { onHoverScale(c.target) } function onPauseMuteUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (toggleMute(), updateMusicIconFrame(c.target), isMute || playSound("clickSound")) } function onPauseRestartPress(c) { onHoverScale(c.target) } function onPauseRestartUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), hidePauseWin(!1, !1), showGameField(), restartLevel()) } function onInterfaceRestartUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), showGameField(), restartLevel()) } function onPauseQuitPress(c) { onHoverScale(c.target) } function onPauseQuitUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), isGamePaused = !0, disposeLevel(), hidePauseWin(!1, !0), updateBgCache(), hideGameField(!1, 100), showMainMenu(!0)) } function onPauseContinuePress(c) { onHoverScale(c.target) } function onPauseContinueUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), hidePauseWin(!1, !1)) } function showPauseWin(c) { isGamePaused = !0; hideGameInterface(); updateMusicIconFrame(pauseMuteBtn); container.addChild(levelPauseContainer); pauseContinueBtn.visible = !c; c ? (pauseTitle.gotoAndStop("tryagaintitle"), setSpriteScale(pauseTitle, 1), hideGameField(!0, 400), stopWindSound()) : (pauseTitle.gotoAndStop("pausetitle"), setSpriteScale(pauseTitle, 0.92)); levelPauseContainer.x = -400; levelPauseContainer.y = -20; levelPauseContainer.alpha = 0; createjs.Tween.get(levelPauseContainer) .to({ alpha: 1, x: 0 }, 1300, menuEase) } function hidePauseWin(c, a) { isGamePaused = !1; createjs.Tween.removeTweens(levelPauseContainer); createjs.Tween.get(levelPauseContainer) .to({ alpha: 0, x: 400 }, 300) .call(removeChildOnTweenComplete); a || showGameInterface() } var achievContainer, raduga, achievDesc; function createAchievWin() { achievContainer = new createjs.Container; createButton(160, 84, 1, "newachievtitle", null, achievContainer); raduga = createButton(160, 222, 1.1, "radugav", null, achievContainer); createButton(160, 262, 1.1, "newachievbgv", null, achievContainer); achievDesc = createButton(160, 343, 0.9, "achievdesc1", null, achievContainer); createButton(160, 399, 1, "nextlevelwin", onAchievContinuePress, achievContainer) } function onAchievContinuePress(c) { hideAchievWin(); handleNextLevelClick() } function showAchievWin(c) { achievContainer.parent || container.addChild(achievContainer); disposeLevel(); updateBgCache(); hideGameInterface(); achievDesc.gotoAndStop("achievdesc" + Math.round(c)); allachievs[c] = ACHIEVED; updateSaves(); createjs.Tween.removeTweens(achievContainer); achievContainer.alpha = 0; createjs.Tween.get(achievContainer, { override: !0 }) .to({ alpha: 1 }, 300) .call(function () { playAchievSound() }) } function hideAchievWin() { removeFromParent(achievContainer) } function getNewAchievedId() { return 0 < achievsReadyToShow.length ? achievsReadyToShow.pop() : -1 } var achievsReadyToShow = []; function addAchiev(c) { isAlreadyAchieved(c) || addToArray(achievsReadyToShow, c) } function isAlreadyAchieved(c) { return allachievs[c] == ACHIEVED } var achGalleryMenuBackBtn, achGalleryContainer, achievGalleryTotalScore, allAchievsLabels = []; function createAchievGalleryMenu() { var c = achGalleryContainer = new createjs.Container; createBigWinBg(5, 438, 0.95, c); createButton(ow / 2, 76, 0.9, "achievmenutitle", null, c); createAchievLabels(); achGalleryMenuBackBtn = createButton(32, 410, 0.8, "backbtn", onPressStandartHandler, c, onAchievGalleryBackUp); createButton(250, 390, 0.9, "achievelk", null, c) } function createAchievLabels() { for (var c = 0; c < ACHIEVS_NUM; c++) { var a = c, b = createButton(160, 130 + 45 * a, 0.9, "achievback", null, achGalleryContainer, null), a = createButton(160, 130 + 45 * a, 0.8 * 0.8, "achievclosed", null, achGalleryContainer, null); allAchievsLabels.push(a); a.bg = b } } function updateAchievLabels() { for (var c = 0; c < ACHIEVS_NUM; c++) allAchievsLabels[c].gotoAndStop(allachievs[c] == ACHIEVED ? "achievdesc" + c.toString() : "achievclosed") } function onAchievGalleryBackUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), hideAchievGallery(), showMainMenu(!0)) } function showAchievGallery() { container.addChild(achGalleryContainer); updateAchievLabels(); achGalleryContainer.x = 0; achGalleryContainer.alpha = 1; showBgByLevelNum(0, 4, 1.2); startBlink(700, "tint2"); showTopLogo(0.8) } function hideAchievGallery() { createjs.Tween.removeTweens(achGalleryContainer); createjs.Tween.get(achGalleryContainer, { override: !0 }) .to({ alpha: 0, x: 400 }, 200) .call(uncacheAndRemove) } var creditsContainer; function createCreditsWin() { var c = creditsContainer = new createjs.Container; createBigWinBg(5, 400, 0.8, c); createButton(33, 370, 0.9, "backbtn", onCreditsQuitPress, c, onCreditsQuitUp); createButton(160, 210, 0.85, "biglimetxt", null, c); createButton(155, 120, 0.9, "creditstitle", null, c); createButton(230, 337, 1, "creditselk", null, c) } function onSiteLinkPress(c) { window.open("http://porubov.com", "_blank") } function onCreditsLinkPress(c) { window.location = "mailto:seddas@gmail.com?subject=BattleFish" } function onCreditsQuitPress(c) { onHoverScale(c.target) } function onCreditsQuitUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), hideCreditsWin(), showMainMenu(!0)) } function showCreditsWin() { container.addChild(creditsContainer); creditsContainer.x = 0; creditsContainer.alpha = 1; showBgByLevelNum(0, 4, 1.2); startBlink(700, "tint2") } function hideCreditsWin() { removeFromParent(creditsContainer) } var gameCompleteContainer, collectedStarsTxt; function creategameCompleteWin() { gameCompleteContainer = new createjs.Container; createButton(ow / 2, 310, 1, "nextlevelwin", ongameCompleteQuitPress, gameCompleteContainer, ongameCompleteQuitUp); createButton(ow / 2, 237, 1, "levelinstruction8", null, gameCompleteContainer); createButton(ow / 2, 105, 1, "allcollectedstars", null, gameCompleteContainer); createButton(ow / 2, 30, 1, "gamecompletedTitle", null, gameCompleteContainer); collectedStarsTxt = new createjs.BitmapText(getCollectedStarsNum() .toString(), interfaceSS); collectedStarsTxt.letterSpacing = -7; collectedStarsTxt.x = 80; collectedStarsTxt.y = 121; collectedStarsTxt.mouseEnabled = !1; gameCompleteContainer.addChild(collectedStarsTxt); createButton(260, 335, 0.7, "moregamesbtn", sponsorClick, gameCompleteContainer, null) } function ongameCompleteQuitPress(c) { c = c.target; c.scaleX = c.scaleY = 1.2 } function ongameCompleteQuitUp(c) { onOutScale(c.target); isCursorOutMoved(c) || (playSound("clickSound"), hidegameCompleteWin(), showMainMenu(!0)) } var isGameCompleteScreenShow = !1; function showGameCompleteWin() { isGameCompleteScreenShow = !0; container.addChild(gameCompleteContainer); collectedStarsTxt.text = getCollectedStarsNum() .toString(); gameCompleteContainer.x = 400; gameCompleteContainer.alpha = 0; createjs.Tween.get(gameCompleteContainer, { override: !0 }) .to({ alpha: 1, x: 0 }, 1300, createjs.Ease.elasticOut) } function hidegameCompleteWin() { isGameCompleteScreenShow = !1; updateMobileBrowserParams(); createjs.Tween.removeTweens(gameCompleteContainer); createjs.Tween.get(gameCompleteContainer, { override: !0 }) .to({ alpha: 0, x: 400 }, 200) .call(removeChildOnTweenComplete) } function uncacheAndRemove(c) { c = c.target; c.parent && c.parent.removeChild(c) } function removeChildOnTweenComplete(c) { c = c.target; c.parent && c.parent.removeChild(c) } function isTweened(c) { return createjs.Tween.hasActiveTweens(c) } var hitPoint; function isCursorOutMoved(c) { if (!isDesktop()) return !1; hitPoint = c.target.globalToLocal(c.stageX, c.stageY); return !c.target.hitTest(hitPoint.x, hitPoint.y) } function updateScoreLabel(c) {} var rotatedDecors = []; function interfaceTick() { for (var c = 0; c < rotatedDecors.length; c++) rotatedDecors[c].rotation += 3 * dtScale; raduga && (raduga.rotation += dtScale, raduga.rotation %= 360) } function updateInterfacePositions() { pauseBtnV.x = 24 + deltaForHLeft(); pauseBtnV.y = 416 - deltaForVTop() / 2; interfaceRestartBtn.x = 70 + deltaForHLeft(); interfaceRestartBtn.y = 416 - deltaForVTop() / 2; creditsBtn.x = 290 - deltaForHLeft(); creditsBtn.y = 410 - deltaForVTop() / 2; mainMenuMuteBtn.x = 292 - deltaForHLeft(); mainMenuMuteBtn.y = 360 - deltaForVTop() / 2; mainMenuMoreGames.x = 160; mainMenuMoreGames.y = 420 - deltaForVTop() / 2; playMenuBtn.y = 330 - 0.2 * deltaForVTop(); mainMenuAchievBtn.x = 40 + deltaForHLeft(); mainMenuAchievBtn.y = 400 - deltaForVTop() / 2; isNeedFpsMeter && (fpsText.x = ow - 32 - deltaForHLeft(), fpsText.y = deltaForVTop() / 2); updateLogoPos() } var stage, exportRoot, canvas, rect, container, preload, rotationContainer, particleContainer, winWidth, winHeight, scaleFactor = 1, minW = 320, minH = 440, ow = minW, oh = minH, maxW = 356, maxH = 550, desctopMaxW = maxW, desctopMaxH = maxH, viewportW = minW, viewportH = minH, pixelDensity = 1; function initResizeManager() { window.addEventListener("resize", onWindowResize); document.addEventListener("touchstart", PreventScrollTouch); window.onorientationchange = orientChange; onGameResize(); setTimeout(hideAdressBar, 100); hideAddressbar(document.getElementById("gamediv")) } var isWasPaused = null, topVisionLine, zoomFactor; function onGameResize() { hideAdressBar(); var c = window.innerWidth, a = window.innerHeight; zoomFactor = 1; if (isLowQuality) { var b = Math.min(c / minW, a / minH); zoomFactor = Math.max(1, Math.min(2, b * b)); c /= zoomFactor; a /= zoomFactor } b = "scale(" + zoomFactor + "," + zoomFactor + ")"; canvas.style.transform = b; canvas.style.msTransform = b; canvas.style.MozTransform = b; canvas.style.WebkitTransform = b; canvas.style.OTransform = b; scaleFactor = Math.min(c / minW, a / minH); stage.scaleX = 1; stage.scaleY = 1; stage.canvas.width = Math.min(c, maxW * scaleFactor); stage.canvas.height = Math.min(a, maxH * scaleFactor); if (isDesktop() && !isMobileOnlyResize) { var b = 10, g = getURLParameter("scale"); g && (b = parseFloat(g)); scaleFactor = Math.min(c / desctopMaxW, a / desctopMaxH); scaleFactor = Math.min(scaleFactor, b / zoomFactor); stage.canvas.width = Math.min(c, desctopMaxW * scaleFactor); stage.canvas.height = Math.min(a, desctopMaxH * scaleFactor) } stage.canvas.style.marginTop = "0px"; stage.canvas.style.marginLeft = "0px"; stage.canvas.style.left = Math.floor((c * zoomFactor - stage.canvas.width) / 2) + "px"; stage.canvas.style.top = Math.floor((a * zoomFactor - stage.canvas.height) / 2) + "px"; viewportH = stage.canvas.height / scaleFactor; viewportW = stage.canvas.width / scaleFactor; topVisionLine = -(viewportH - oh); stage.autoClear = !1; container.scaleX = scaleFactor; container.scaleY = scaleFactor; container.x = Math.round((stage.canvas.width - ow * scaleFactor) / 2); container.y = Math.round((stage.canvas.height - oh * scaleFactor) / 2); splashContainer && (splashContainer.scaleX = container.scaleX, splashContainer.scaleY = container.scaleY, splashContainer.x = container.x, splashContainer.y = container.y); winWidth = c; winHeight = a; timer = null; loaderBar && (loaderBar.y = (oh - barHeight) / 2 + deltaForVCenter()); isAllFilesLoaded && isGameInited && updateInterfacePositions(); isNeedCacheSizeUpdate = !0; isPhysicsDebugDraw && debugDraw && (debugCanvas.width = stage.canvas.width, debugCanvas.height = stage.canvas.height, debugCanvas.style.left = stage.canvas.style.left, debugCanvas.style.top = stage.canvas.style.top, debugCanvas.style.marginLeft = container.x + "px", debugCanvas.style.marginTop = container.y + "px"); stage.update() } function isNeedCanvasZoom(c, a) { if (isDesktop()) return !1; var b = Math.min(c / minW, a / minH); return isDefaultAndroid() && 2 <= b } function sizeHandler() {} function deltaForVCenter() { return -(viewportH - oh) / 2 } function deltaForVTop() { return -(viewportH - oh) } function deltaForHLeft() { return -(viewportW - ow) / 2 } function getMaxLeft() { return -(maxW - ow) / 2 } function getMaxRight() { return maxW + getMaxLeft() } function getMaxTop() { return -(maxH - oh) } function orientChange(c) { setTimeout(hideAdressBar, 50); onWindowResize(null) } function hideAdressBar() { window.scrollTo(0, 1) } function PreventScrollTouch(c) { window.scrollTo(0, 1); window.innerHeight != winHeight && onWindowResize(null); c.preventDefault(); c.stopPropagation(); c.cancelBubble = !0; return c.returnValue = !1 } var timer; function onWindowResize(c) { setTimeout(hideAdressBar, 1); clearTimeout(timer); setTimeout(onGameResize, 1) } function setPixelRatio() { if (isHiDPI()) { var c = document.createElement("meta"); c.name = "viewport"; c.content = "target-densitydpi=device-dpi, user-scalable=0, initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5"; document.getElementsByTagName("head")[0].appendChild(c) } } function isHiDPI() { return !window.hasOwnProperty("devicePixelRatio") || -1 == navigator.userAgent.indexOf("iPhone") && -1 == navigator.userAgent.indexOf("iPad") || 2 != window.devicePixelRatio ? !1 : !0 } function getURLParameter(c) { return decodeURIComponent((RegExp("[?|&]" + c + "=([^&;]+?)(&|#|;|$)") .exec(location.search) || [, ""])[1].replace(/\+/g, "%20")) || null } function isMobileDetected(c) { return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|android|ipad|playbook|silk|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(c) || /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|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(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|yas\-|your|zeto|zte\-/i.test(c.substr(0, 4)) } var MyGame = {}, images, files; MyGame.init = function () { try { canvas = document.getElementById("canvas"); images = images || {}; files = files || {}; stage = new createjs.Stage("canvas"); container = new createjs.Container; container.isRoot = !0; container.width = ow; container.height = oh; stage.addChild(container); detectBrowser(); blockContainer = new createjs.Container; splashContainer = new createjs.Container; splashContainer.width = ow; splashContainer.height = oh; particleContainer = new createjs.Container; rotationContainer = new createjs.Container; rotationContainer.width = ow; rotationContainer.height = oh; initResizeManager(); createjs.Touch.enable(stage, !0); isDesktop() && stage.enableMouseOver(20); stage.mouseMoveOutside = !0; initLoaders(); stage.update(); var c = document.getElementById("loader"); c && c.parentNode && c.parentNode.removeChild(c); onGameResize(); initSpilApi() } catch (a) { trace(a.name + ":" + a.message) } }; function isDesktop() { return isDesktopBrowser } function updateMobileBrowserParams() { MAX_PARTICLES_ON_SCREEN = isDesktopBrowser ? 30 : 12 } function detectBrowser() { isDesktopBrowser = !isMobileDetected(navigator.userAgent || navigator.vendor || window.opera); var c = getURLParameter("mobile"); c && 1 == parseInt(c) && (isDesktopBrowser = !1); updateMobileBrowserParams() } var loaderBar, bar, loaderWidth, barHeight = 20; function initLoaders() { var c = createjs.Graphics.getRGB(247, 247, 247); loaderBar = new createjs.Container; bar = new createjs.Shape; bar.graphics.beginFill(c) .drawRect(0, 0, 1, barHeight) .endFill(); loaderWidth = 300; var a = new createjs.Shape; a.graphics.setStrokeStyle(2) .beginStroke(c) .drawRect(-5, -5, loaderWidth + 10, barHeight + 10); loaderBar.x = container.width - loaderWidth >> 1; loaderBar.y = container.height - barHeight >> 1; loaderBar.addChild(bar, a); container.addChild(loaderBar); initSoundManager(); preload = new createjs.LoadQueue(!0, "assets/"); preload.installPlugin(createjs.Sound); preload.addEventListener("progress", handleOverallProgress); preload.addEventListener("complete", handleComplete); preload.addEventListener("fileload", handleFileLoad); isLoadAnimFromJSON && manifest.push({ src: "soccerassets.json", id: "anim_json" }); preload.loadManifest(manifest); createjs.Ticker.timingMode = createjs.Ticker.RAF_SYNCHED; isDefaultAndroid() && (createjs.Ticker.timingMode = createjs.Ticker.TIMEOUT); createjs.Ticker.setFPS(FPS) } function isDefaultAndroid() { var c = navigator.userAgent; return -1 < c.indexOf("Mozilla/5.0") && -1 < c.indexOf("Android ") && -1 < c.indexOf("AppleWebKit") && !(-1 < c.indexOf("Chrome")) } function handleOverallProgress(c) { 0 != c.total && (bar.scaleX = c.loaded / c.total * loaderWidth, stage.update()) } var fpsText, helperLabel, zoeSS, interfaceSS, bgSS, isPreloaderLogoReady = !1; function handleFileLoad(c) { "image" == c.item.type && (images[c.item.id] = c.result); files[c.item.id] = c.result; isLogoReady && "preloaderlogo" == c.item.id && showPreloaderLogo() } function showPreloaderLogo() { if (files.preloaderlogo && !isPreloaderLogoReady) { isPreloaderLogoReady = !0; var c = files.preloaderlogo, a = c.width, b = c.height, c = (new createjs.Bitmap(c)) .set({ scaleX: 0.75, scaleY: 0.75, regX: a / 2, regY: b / 2, cursor: "pointer", x: ow / 2, y: 20 + 0.75 * b }); c.setBoundingBox(-a / 2, -b / 2, a, b); c.addEventListener("mousedown", sponsorClick); loaderBar.addChild(c) } } function sponsorClick(c) { // Play68.goHome(); // window.open(SPONSOR_URL, "_blank") } function createRotationScreen() { var c = new createjs.Sprite(bgSS); c.gotoAndStop("rotateScreen"); c.x = 30; rotationContainer.addChild(c) } var isAllFilesLoaded = !1; function handleComplete(c) { isAllFilesLoaded || (isLogoReady = isAllFilesLoaded = !0) && startGame() } function startGame() { try { isGameInited || (removeFromParent(loaderBar), loaderBar = null, configureSpritesheets(), isDefaultAndroid() && (isLowQuality = !0), createSplashScreen(), createRotationScreen(), createBG(), loadSaves(), initLevelManager(), initBonusManager(), initParticleManager(), isNeedFpsMeter && (fpsText = new createjs.BitmapText("1", interfaceSS), fpsText.scaleX = fpsText.scaleY = 0.6, fpsText.letterSpacing = -7, fpsText.x = ow - 27, container.addChild(fpsText)), initInterface(), isGameInited = !0, onGameResize(), startSplash(), isSkipMenus && (isLastLevelLoad ? loadLevel(allLevels.length - 1) : loadLevel(isDesignerSettingsPreferred ? editorLevelToLoad : autoLevelToLoad)), stage.update(), createjs.Ticker.addEventListener("tick", tick), initEditorHandlers(), isGetAllProperties && getAllProperties()) } catch (c) { trace(c.name + ":" + c.message) } } var splashContainer; function startSplash() { isSkipSplash || isSponsorLogoError || !splashContainer || splashContainer.parent || rotationContainer.parent || (removeFromParent(container), stage.addChild(splashContainer), createjs.Tween.get(splashContainer) .wait(3E3) .call(addContainer) .to({ alpha: 0 }, 200) .call(disposeSplash), trace("splash"), stage.autoClear = !0) } function addContainer(c) { stage.addChildAt(container, 0) } function disposeSplash(c) { removeFromParent(splashContainer); splashContainer = null; stage.autoClear = winWidth > maxW * scaleFactor || winHeight > maxH * scaleFactor } function createSplashScreen() { var c = new createjs.Sprite(zoeSS); c.gotoAndStop("splashlogo"); c.x = ow / 2; c.y = oh / 2; c.scaleX = c.scaleY = 0.8; c.mouseEnabled = !0; splashContainer.addChild(c) } function initEditorHandlers() { isLevelEditor && stage.addEventListener("stagemousedown", handlePress) } function updateBgCache() {} var mainBg, fansBg, allBgContainer, smallBg, isNeedCacheSizeUpdate = !1; function createBG() { allBgContainer = new createjs.Container; container.addChild(allBgContainer); mainBg = (new createjs.Sprite(bgSS)) .set({ x: -18, y: 495, rotation: -90 }); mainBg.gotoAndStop("bigbg"); allBgContainer.addChild(mainBg); isLowQuality && (mainBg.gotoAndStop("smallbg"), setSpriteScale(mainBg, 2)); fansBg = (new createjs.Sprite(bgSS, "fansv")) .set({ x: -30, y: 312, scaleX: 1.15, scaleY: 1.15, rotation: 0 }); setAnimationSpeed(fansBg, 0.8); addToParent(fansBg, allBgContainer); allBgContainer.mouseEnabled = !1 } var nameCounter = 0; function handlePress(c) { isLevelEditor && (KeyboardJS.isPressed("n") && loadNextLevel(), KeyboardJS.isPressed("l") && showLevelCompleteWin(), KeyboardJS.isPressed("a") && showAchievWin(SUPER_COLLECTOR_ACHIEV), KeyboardJS.isPressed("u") && updateBgCache(), KeyboardJS.isPressed("g") && showGameCompleteWin()) } function configureSpritesheets() { isLoadAnimFromJSON && (zoeCFG = eval(files.anim_json)); validateSpritesheetCFG(zoeCFG, "zoespritesheet", !0, 2); bgSS = interfaceSS = zoeSS = new createjs.SpriteSheet(zoeCFG) } function validateSpritesheetCFG(c, a, b, g) { var f = images[a].width; a = images[a].height; c = c.frames; for (var d = c.length, e, h = 0; h < d; h++) e = c[h], b && (e[2] -= 2 * g, e[3] -= 2 * g), e[0] + e[2] > f && (e[2] = f - e[0]), e[1] + e[3] > a && (e[3] = a - e[1]), 0 > e[0] && (e[0] = 0), 0 > e[1] && (e[1] = 0) } var counter = 0, animTicker = 0, toDisposePhysicsBodies = [], toDisposeChars = [], clickedChars = [], dtScale = 1, lastDelta = 0, FPS = 30, GAME_FPS = 30, defaultDelta = 1E3 / GAME_FPS, DEFAULT_WORLD_STEP = 1 / GAME_FPS, allHeroesLen = 0, lastTime = 0, data, step = 0; function tick(c) { if (isDesktop() || !isPageLeaved) { dtScale = c.delta / defaultDelta; if (!dtScale || 0 >= dtScale) dtScale = 1; 2 < dtScale && (dtScale = 2); lastDelta = c.delta; counter++; animTicker++; for (levelStartTimer++; 0 < toDisposePhysicsBodies.length;) c = toDisposePhysicsBodies.pop(), destroyBody(c); for (; 0 < toDisposeChars.length;) currentChar = toDisposeChars.pop(), currentChar.dispose(); for (; 0 < clickedChars.length;) currentChar = clickedChars.pop(), currentChar.type === BOMB_TYPE ? currentChar.bombClick() : currentChar.type === FAN_TYPE ? currentChar.toggleFan() : currentChar.isGlass ? currentChar.breakGlass() : currentChar.physBody && (awakeAllBodies(), currentChar.removeFromField()); isGamePaused || (step = DEFAULT_WORLD_STEP * (1.2 < dtScale ? 1.2 : dtScale), space.step(step / 2), space.step(step / 2)); isPhysicsDebugDraw && debugDraw.draw(); allHeroesLen = allHeroes.length; for (c = allChars.length - 1; 0 <= c; --c) allChars[c].tick(); interfaceTick(); updateBonusManager(); updatePartManager(); interfaceTick(); isGameCompleteScreenShow && (MAX_PARTICLES_ON_SCREEN = 30, 0 == animTicker % Math.floor(FPS / 6) && createPartExplode(Math.random() * ow, Math.random() * oh, 6, PART_STAR_TYPE, gameCompleteContainer)); isNeedFpsMeter && 0 == counter % FPS && (fpsText.text = Math.floor(createjs.Ticker.getMeasuredFPS()) .toString()); 30 < counter && isNeedCacheSizeUpdate && (isNeedCacheSizeUpdate = !1, isWithCache && allBgContainer.cache(0, 0, ow + 1, oh + 1, 2)); c = 0; 0 < scoreToAdd && (c = Math.round(scoreToAdd / 7), currentLevelScore += c, scoreToAdd -= c, updateScoreLabel(currentLevelScore)); //onWindowResize(null); onGameResize(); stage.update() } } function trace(c) { isLevelEditor && console.log(c) } var currentBgIndex = 0; function showBgByLevelNum(c, a, b) { mainBg.currentAnimationFrame = a ? a : allBgIndexes[c] };