1
0
forked from sent/waves
waves/public/assets/g/stickmangolf/game.js
2025-04-09 17:11:14 -05:00

34314 lines
1.3 MiB

function circlevertices(b) {
b *= 20;
var c = [];
c.push({
x: -b / 20,
y: 0
});
for (var d = -b + 1, d = Math.sqrt(b * b - d * d), e = 1; e <= d; e++) {
var f = e,
j = Math.sqrt(b * b - f * f);
1 > b - j && c.push({
x: -j / 20,
y: -f / 20
})
}
for (e = -b + 1; e <= b - 1; e++) j = e, f = Math.sqrt(b * b - j * j), c.push({
x: j / 20,
y: -f / 20
});
for (e = d; 1 <= e; e--) f = e, j = Math.sqrt(b * b - f * f), 1 > b - j && c.push({
x: j / 20,
y: -f / 20
});
c.push({
x: b / 20,
y: 0
});
for (e = 1; e <= d; e++) f = e, j = Math.sqrt(b * b - f * f), 1 > b - j && c.push({
x: j / 20,
y: f / 20
});
for (e = b - 1; e > -b + 1; e--) j = e, f = Math.sqrt(b * b - j * j), c.push({
x: j / 20,
y: f / 20
});
for (e = d; 1 <= e; e--) f = e, j = Math.sqrt(b * b - f * f), 1 > b - j && c.push({
x: -j / 20,
y: f / 20
});
return c
}
var _STRINGS = {
Ad: {
Mobile: {
Preroll: {
ReadyIn: "The game is ready in ",
Loading: "Your game is loading...",
Close: "Close"
},
Header: {
ReadyIn: "The game is ready in ",
Loading: "Your game is loading...",
Close: "Close"
},
End: {
ReadyIn: "Advertisement ends in ",
Loading: "Please wait ...",
Close: "Close"
}
}
},
Splash: {
Loading: "Loading ...",
LogoLine1: "Some text here",
LogoLine2: "powered by mobiltr",
LogoLine3: "none"
},
Game: {
Play: "Play",
Continue: "Continue",
Ask: "Learn how to play?",
Yes: "Yes",
No: "No",
Area: "Out of Bounds !",
Water: "Water Hazard",
Hole: "Hole",
Par: "Par",
Strokes: "Strokes",
Overal: "Overall<br>Score",
Holecomplete: "Hole Complete!",
Holeinone: "Hole In One!",
Paused: "Paused",
Music: "Music",
Sound: "Sound"
},
Tutorial: {
"0": "Basic Training",
1: "Let's learn how to play.",
2: "Press and hold left button to turn<br>arrow counterclockwise.",
3: "Now press and hold right button to turn<br>arrow clockwise.",
4: "Well done!",
5: "Try to drag the screen left or right<br>to see your target hole.<br>You can also drag up and down.",
6: "Press power button to increase your<br>hitting power.",
7: 'Press "Go!" to hit the ball.',
8: "Repeat until the ball gets into the hole.",
9: "Congratulations!<br>You finished the basic training.<br>Let's play!",
10: ""
},
Results: {
Course: "Course Complete !",
Par: "Par",
Yourscore: "Your Score",
Bestscore: "Best Score"
}
};
var _SETTINGS = {
API: {
Enabled: !1,
Log: {
Events: {
InitializeGame: !1,
EndGame: !1,
Level: {
Begin: !0,
End: !0,
Win: !0,
Lose: !0,
Draw: !0
}
}
}
},
Ad: {
Mobile: {
Preroll: {
Enabled: 0,
Duration: 5,
Width: 300,
Height: 250,
Rotation: {
Enabled: !1,
Weight: {
MobileAdInGamePreroll: 999999,
MobileAdInGamePreroll2: 999999,
MobileAdInGamePreroll3: 999999
}
}
},
Header: {
Enabled: !1,
Duration: 5,
Width: 320,
Height: 50,
Rotation: {
Enabled: !1,
Weight: {
MobileAdInGameHeader: 40,
MobileAdInGameHeader2: 40,
MobileAdInGameHeader3: 20
}
}
},
Footer: {
Enabled: !1,
Duration: 5,
Width: 320,
Height: 50,
Rotation: {
Enabled: !1,
Weight: {
MobileAdInGameFooter: 40,
MobileAdInGameFooter2: 40,
MobileAdInGameFooter3: 20
}
}
},
End: {
Enabled: !1,
Duration: 1,
Width: 300,
Height: 250,
Rotation: {
Enabled: !1,
Weight: {
MobileAdInGameEnd: 40,
MobileAdInGameEnd2: 40,
MobileAdInGameEnd3: 20
}
}
}
}
},
Language: {
Default: "en"
},
DeveloperBranding: {
Splash: {
Enabled: !1
},
Logo: {
Enabled: !1,
Link: "https://www.yiv.com/",
LinkEnabled: !1,
NewWindow: !0,
Width: 166,
Height: 61
}
},
Branding: {
Splash: {
Enabled: !1
},
Logo: {
Enabled: !1,
Link: "https://www.yiv.com",
LinkEnabled: !0,
NewWindow: !0,
Width: 280,
Height: 34
}
},
MoreGames: {
Enabled: !1,
Link: "../../../www.mobiltr.com/game/links/mobile.html",
NewWindow: !0
},
Gamecenter: {
Enabled: !1
}
};
var MobileAdInGamePreroll = {};
var MobileAdInGameHeader = {};
var MobileAdInGameFooter = {};
var MobileAdInGameEnd = {};
(function(b, c) {
function d(b, d, g) {
if (g === c && 1 === b.nodeType)
if (g = "data-" + d.replace(vb, "-$1").toLowerCase(), g = b.getAttribute(g), "string" == typeof g) {
try {
g = "true" === g ? !0 : "false" === g ? !1 : "null" === g ? null : +g + "" === g ? +g : wb.test(g) ? m.parseJSON(g) : g
} catch (l) {}
m.data(b, d, g)
} else g = c;
return g
}
function e(b) {
for (var c in b)
if (!("data" === c && m.isEmptyObject(b[c])) && "toJSON" !== c) return !1;
return !0
}
function f() {
return !1
}
function j() {
return !0
}
function q(b) {
return !b || !b.parentNode || 11 === b.parentNode.nodeType
}
function n(b, c) {
do b = b[c]; while (b && 1 !== b.nodeType);
return b
}
function g(b, c, d) {
c = c || 0;
if (m.isFunction(c)) return m.grep(b, function(b, ba) {
return !!c.call(b, ba, b) === d
});
if (c.nodeType) return m.grep(b, function(b) {
return b === c === d
});
if ("string" == typeof c) {
var g = m.grep(b, function(b) {
return 1 === b.nodeType
});
if (Oc.test(c)) return m.filter(c, g, !d);
c = m.filter(c, g)
}
return m.grep(b, function(b) {
return 0 <= m.inArray(b, c) === d
})
}
function y(b) {
var c = kc.split("|");
b = b.createDocumentFragment();
if (b.createElement)
for (; c.length;) b.createElement(c.pop());
return b
}
function A(b, c) {
if (1 === c.nodeType && m.hasData(b)) {
var d, g, l;
g = m._data(b);
var e = m._data(c, g),
s = g.events;
if (s)
for (d in delete e.handle, e.events = {}, s) {
g = 0;
for (l = s[d].length; g < l; g++) m.event.add(c, d, s[d][g])
}
e.data && (e.data = m.extend({}, e.data))
}
}
function z(b, c) {
var d;
1 === c.nodeType && (c.clearAttributes && c.clearAttributes(), c.mergeAttributes && c.mergeAttributes(b), d = c.nodeName.toLowerCase(), "object" === d ? (c.parentNode && (c.outerHTML = b.outerHTML), m.support.html5Clone && b.innerHTML && !m.trim(c.innerHTML) && (c.innerHTML = b.innerHTML)) : "input" === d && lc.test(b.type) ? (c.defaultChecked = c.checked = b.checked, c.value !== b.value && (c.value = b.value)) : "option" === d ? c.selected = b.defaultSelected : "input" === d || "textarea" === d ? c.defaultValue = b.defaultValue : "script" === d && c.text !== b.text && (c.text = b.text), c.removeAttribute(m.expando))
}
function B(b) {
return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName("*") : "undefined" != typeof b.querySelectorAll ? b.querySelectorAll("*") : []
}
function C(b) {
lc.test(b.type) && (b.defaultChecked = b.checked)
}
function G(b, c) {
if (c in b) return c;
for (var d = c.charAt(0).toUpperCase() + c.slice(1), m = c, g = mc.length; g--;)
if (c = mc[g] + d, c in b) return c;
return m
}
function I(b, c) {
return b = c || b, "none" === m.css(b, "display") || !m.contains(b.ownerDocument, b)
}
function u(b, c) {
for (var d, g, l = [], e = 0, s = b.length; e < s; e++) d = b[e], d.style && (l[e] = m._data(d, "olddisplay"), c ? (!l[e] && "none" === d.style.display && (d.style.display = ""), "" === d.style.display && I(d) && (l[e] = m._data(d, "olddisplay", M(d.nodeName)))) : (g = ha(d, "display"), !l[e] && "none" !== g && m._data(d, "olddisplay", g)));
for (e = 0; e < s; e++)
if (d = b[e], d.style && (!c || "none" === d.style.display || "" === d.style.display)) d.style.display = c ? l[e] || "" : "none";
return b
}
function L(b, c, d) {
return (b = Pc.exec(c)) ? Math.max(0, b[1] - (d || 0)) + (b[2] || "px") : c
}
function E(b, c, d, g) {
c = d === (g ? "border" : "content") ? 4 : "width" === c ? 1 : 0;
for (var l = 0; 4 > c; c += 2) "margin" === d && (l += m.css(b, d + Ba[c], !0)), g ? ("content" === d && (l -= parseFloat(ha(b, "padding" + Ba[c])) || 0), "margin" !== d && (l -= parseFloat(ha(b, "border" + Ba[c] + "Width")) || 0)) : (l += parseFloat(ha(b, "padding" + Ba[c])) || 0, "padding" !== d && (l += parseFloat(ha(b, "border" + Ba[c] + "Width")) || 0));
return l
}
function Q(b, c, d) {
var g = "width" === c ? b.offsetWidth : b.offsetHeight,
l = !0,
e = m.support.boxSizing && "border-box" === m.css(b, "boxSizing");
if (0 >= g || null == g) {
g = ha(b, c);
if (0 > g || null == g) g = b.style[c];
if (xb.test(g)) return g;
l = e && (m.support.boxSizingReliable || g === b.style[c]);
g = parseFloat(g) || 0
}
return g + E(b, c, d || (e ? "border" : "content"), l) + "px"
}
function M(b) {
if (Qb[b]) return Qb[b];
var c = m("<" + b + ">").appendTo(J.body),
d = c.css("display");
c.remove();
if ("none" === d || "" === d) {
Ka = J.body.appendChild(Ka || m.extend(J.createElement("iframe"), {
frameBorder: 0,
width: 0,
height: 0
}));
if (!La || !Ka.createElement) La = (Ka.contentWindow || Ka.contentDocument).document, La.write("<!doctype html><html><body>"), La.close();
c = La.body.appendChild(La.createElement(b));
d = ha(c, "display");
J.body.removeChild(Ka)
}
return Qb[b] = d, d
}
function R(b, c, d, g) {
var l;
if (m.isArray(c)) m.each(c, function(c, Ja) {
d || Qc.test(b) ? g(b, Ja) : R(b + "[" + ("object" == typeof Ja ? c : "") + "]", Ja, d, g)
});
else if (!d && "object" === m.type(c))
for (l in c) R(b + "[" + l + "]", c[l], d, g);
else g(b, c)
}
function K(b) {
return function(c, d) {
"string" != typeof c && (d = c, c = "*");
var g, l, e = c.toLowerCase().split(qa),
s = 0,
f = e.length;
if (m.isFunction(d))
for (; s < f; s++) g = e[s], (l = /^\+/.test(g)) && (g = g.substr(1) || "*"), g = b[g] = b[g] || [], g[l ? "unshift" : "push"](d)
}
}
function X(b, d, m, g, l, e) {
l = l || d.dataTypes[0];
e = e || {};
e[l] = !0;
var s;
l = b[l];
for (var f = 0, r = l ? l.length : 0, p = b === Rb; f < r && (p || !s); f++) s = l[f](d, m, g), "string" == typeof s && (!p || e[s] ? s = c : (d.dataTypes.unshift(s), s = X(b, d, m, g, s, e)));
return (p || !s) && !e["*"] && (s = X(b, d, m, g, "*", e)), s
}
function P(b, d) {
var g, l, e = m.ajaxSettings.flatOptions || {};
for (g in d) d[g] !== c && ((e[g] ? b : l || (l = {}))[g] = d[g]);
l && m.extend(!0, b, l)
}
function S() {
try {
return new b.XMLHttpRequest
} catch (c) {}
}
function Z() {
return setTimeout(function() {
yb = c
}, 0), yb = m.now()
}
function U(b, c, d) {
var g, l = 0,
e = zb.length,
s = m.Deferred().always(function() {
delete f.elem
}),
f = function() {
for (var c = yb || Z(), c = Math.max(0, p.startTime + p.duration - c), d = 1 -
(c / p.duration || 0), g = 0, Ja = p.tweens.length; g < Ja; g++) p.tweens[g].run(d);
return s.notifyWith(b, [p, d, c]), 1 > d && Ja ? c : (s.resolveWith(b, [p]), !1)
},
p = s.promise({
elem: b,
props: m.extend({}, c),
opts: m.extend(!0, {
specialEasing: {}
}, d),
originalProperties: c,
originalOptions: d,
startTime: yb || Z(),
duration: d.duration,
tweens: [],
createTween: function(c, d) {
var g = m.Tween(b, p.opts, c, d, p.opts.specialEasing[c] || p.opts.easing);
return p.tweens.push(g), g
},
stop: function(c) {
for (var d = 0, g = c ? p.tweens.length : 0; d < g; d++) p.tweens[d].run(1);
return c ? s.resolveWith(b, [p, c]) : s.rejectWith(b, [p, c]), this
}
});
c = p.props;
d = p.opts.specialEasing;
var r, j, n, F;
for (g in c)
if (r = m.camelCase(g), j = d[r], n = c[g], m.isArray(n) && (j = n[1], n = c[g] = n[0]), g !== r && (c[r] = n, delete c[g]), (F = m.cssHooks[r]) && "expand" in F)
for (g in n = F.expand(n), delete c[r], n) g in c || (c[g] = n[g], d[g] = j);
else d[r] = j;
for (; l < e; l++)
if (g = zb[l].call(p, b, c, p.opts)) return g;
var v = p;
m.each(c, function(b, c) {
for (var ba = (bb[b] || []).concat(bb["*"]), d = 0, g = ba.length; d < g && !ba[d].call(v, b, c); d++);
});
return m.isFunction(p.opts.start) && p.opts.start.call(b, p), m.fx.timer(m.extend(f, {
anim: p,
queue: p.opts.queue,
elem: b
})), p.progress(p.opts.progress).done(p.opts.done, p.opts.complete).fail(p.opts.fail).always(p.opts.always)
}
function p(b, c, d, g, m) {
return new p.prototype.init(b, c, d, g, m)
}
function v(b, c) {
var d, g = {
height: b
},
m = 0;
for (c = c ? 1 : 0; 4 > m; m += 2 - c) d = Ba[m], g["margin" + d] = g["padding" + d] = b;
return c && (g.opacity = g.width = b), g
}
function H(b) {
return m.isWindow(b) ? b : 9 === b.nodeType ? b.defaultView || b.parentWindow : !1
}
var D, N, J = b.document,
V = b.location,
l = b.navigator,
r = b.jQuery,
O = b.$,
s = Array.prototype.push,
F = Array.prototype.slice,
aa = Array.prototype.indexOf,
T = Object.prototype.toString,
ka = Object.prototype.hasOwnProperty,
ca = String.prototype.trim,
m = function(b, c) {
return new m.fn.init(b, c, D)
},
la = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
Ma = /\S/,
qa = /\s+/,
Ab = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
cb = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
Na = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
Bb = /^[\],:{}\s]*$/,
Cb = /(?:^|:|,)(?:\s*\[)+/g,
db = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
eb = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
fb = /^-ms-/,
Db = /-([\da-z])/gi,
gb = function(b, c) {
return (c + "").toUpperCase()
},
Ca = function() {
J.addEventListener ? (J.removeEventListener("DOMContentLoaded", Ca, !1), m.ready()) : "complete" === J.readyState && (J.detachEvent("onreadystatechange", Ca), m.ready())
},
Oa = {};
m.fn = m.prototype = {
constructor: m,
init: function(b, d, g) {
var l, e;
if (!b) return this;
if (b.nodeType) return this.context = this[0] = b, this.length = 1, this;
if ("string" == typeof b) {
"<" === b.charAt(0) && ">" === b.charAt(b.length - 1) && 3 <= b.length ? l = [null, b, null] : l = cb.exec(b);
if (l && (l[1] || !d)) {
if (l[1]) return d = d instanceof m ? d[0] : d, e = d && d.nodeType ? d.ownerDocument || d : J, b = m.parseHTML(l[1], e, !0), Na.test(l[1]) && m.isPlainObject(d) && this.attr.call(b, d, !0), m.merge(this, b);
if ((d = J.getElementById(l[2])) && d.parentNode) {
if (d.id !== l[2]) return g.find(b);
this.length = 1;
this[0] = d
}
return this.context = J, this.selector = b, this
}
return !d || d.jquery ? (d || g).find(b) : this.constructor(d).find(b)
}
return m.isFunction(b) ? g.ready(b) : (b.selector !== c && (this.selector = b.selector, this.context = b.context), m.makeArray(b, this))
},
selector: "",
jquery: "1.8.2",
length: 0,
size: function() {
return this.length
},
toArray: function() {
return F.call(this)
},
get: function(b) {
return null == b ? this.toArray() : 0 > b ? this[this.length + b] : this[b]
},
pushStack: function(b, c, d) {
b = m.merge(this.constructor(), b);
return b.prevObject = this, b.context = this.context, "find" === c ? b.selector = this.selector + (this.selector ? " " : "") + d : c && (b.selector = this.selector + "." + c + "(" + d + ")"), b
},
each: function(b, c) {
return m.each(this, b, c)
},
ready: function(b) {
return m.ready.promise().done(b), this
},
eq: function(b) {
return b = +b, -1 === b ? this.slice(b) : this.slice(b, b + 1)
},
first: function() {
return this.eq(0)
},
last: function() {
return this.eq(-1)
},
slice: function() {
return this.pushStack(F.apply(this, arguments), "slice", F.call(arguments).join(","))
},
map: function(b) {
return this.pushStack(m.map(this, function(c, d) {
return b.call(c, d, c)
}))
},
end: function() {
return this.prevObject || this.constructor(null)
},
push: s,
sort: [].sort,
splice: [].splice
};
m.fn.init.prototype = m.fn;
m.extend = m.fn.extend = function() {
var b, d, g, l, e, s, f = arguments[0] || {},
p = 1,
r = arguments.length,
j = !1;
"boolean" == typeof f && (j = f, f = arguments[1] || {}, p = 2);
"object" != typeof f && !m.isFunction(f) && (f = {});
for (r === p && (f = this, --p); p < r; p++)
if (null != (b = arguments[p]))
for (d in b) g = f[d], l = b[d], f !== l && (j && l && (m.isPlainObject(l) || (e = m.isArray(l))) ? (e ? (e = !1, s = g && m.isArray(g) ? g : []) : s = g && m.isPlainObject(g) ? g : {}, f[d] = m.extend(j, s, l)) : l !== c && (f[d] = l));
return f
};
m.extend({
noConflict: function(c) {
return b.$ === m && (b.$ = O), c && b.jQuery === m && (b.jQuery = r), m
},
isReady: !1,
readyWait: 1,
holdReady: function(b) {
b ? m.readyWait++ : m.ready(!0)
},
ready: function(b) {
if (!(!0 === b ? --m.readyWait : m.isReady)) {
if (!J.body) return setTimeout(m.ready, 1);
m.isReady = !0;
!0 !== b && 0 < --m.readyWait || (N.resolveWith(J, [m]), m.fn.trigger && m(J).trigger("ready").off("ready"))
}
},
isFunction: function(b) {
return "function" === m.type(b)
},
isArray: Array.isArray || function(b) {
return "array" === m.type(b)
},
isWindow: function(b) {
return null != b && b == b.window
},
isNumeric: function(b) {
return !isNaN(parseFloat(b)) && isFinite(b)
},
type: function(b) {
return null == b ? String(b) : Oa[T.call(b)] || "object"
},
isPlainObject: function(b) {
if (!b || "object" !== m.type(b) || b.nodeType || m.isWindow(b)) return !1;
try {
if (b.constructor && !ka.call(b, "constructor") && !ka.call(b.constructor.prototype, "isPrototypeOf")) return !1
} catch (d) {
return !1
}
for (var g in b);
return g === c || ka.call(b, g)
},
isEmptyObject: function(b) {
for (var c in b) return !1;
return !0
},
error: function(b) {
throw Error(b);
},
parseHTML: function(b, c, d) {
var g;
return !b || "string" != typeof b ? null : ("boolean" == typeof c && (d = c, c = 0), c = c || J, (g = Na.exec(b)) ? [c.createElement(g[1])] : (g = m.buildFragment([b], c, d ? null : []), m.merge([], (g.cacheable ? m.clone(g.fragment) : g.fragment).childNodes)))
},
parseJSON: function(c) {
if (!c || "string" != typeof c) return null;
c = m.trim(c);
if (b.JSON && b.JSON.parse) return b.JSON.parse(c);
if (Bb.test(c.replace(db, "@").replace(eb, "]").replace(Cb, ""))) return (new Function("return " + c))();
m.error("Invalid JSON: " + c)
},
parseXML: function(ba) {
var d, g;
if (!ba || "string" != typeof ba) return null;
try {
b.DOMParser ? (g = new DOMParser, d = g.parseFromString(ba, "text/xml")) : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(ba))
} catch (l) {
d = c
}
return (!d || !d.documentElement || d.getElementsByTagName("parsererror").length) && m.error("Invalid XML: " + ba), d
},
noop: function() {},
globalEval: function(c) {
c && Ma.test(c) && (b.execScript || function(c) {
b.eval.call(b, c)
})(c)
},
camelCase: function(b) {
return b.replace(fb, "ms-").replace(Db, gb)
},
nodeName: function(b, c) {
return b.nodeName && b.nodeName.toLowerCase() === c.toLowerCase()
},
each: function(b, d, g) {
var l, e = 0,
s = b.length,
f = s === c || m.isFunction(b);
if (g)
if (f)
for (l in b) {
if (!1 === d.apply(b[l], g)) break
} else
for (; e < s && !1 !== d.apply(b[e++], g););
else if (f)
for (l in b) {
if (!1 === d.call(b[l], l, b[l])) break
} else
for (; e < s && !1 !== d.call(b[e], e, b[e++]););
return b
},
trim: ca && !ca.call("\ufeff\u00a0") ? function(b) {
return null == b ? "" : ca.call(b)
} : function(b) {
return null == b ? "" : (b + "").replace(Ab, "")
},
makeArray: function(b, c) {
var d, g = c || [];
return null != b && (d = m.type(b), null == b.length || "string" === d || "function" === d || "regexp" === d || m.isWindow(b) ? s.call(g, b) : m.merge(g, b)), g
},
inArray: function(b, c, d) {
var g;
if (c) {
if (aa) return aa.call(c, b, d);
g = c.length;
for (d = d ? 0 > d ? Math.max(0, g + d) : d : 0; d < g; d++)
if (d in c && c[d] === b) return d
}
return -1
},
merge: function(b, d) {
var g = d.length,
m = b.length,
l = 0;
if ("number" == typeof g)
for (; l < g; l++) b[m++] = d[l];
else
for (; d[l] !== c;) b[m++] = d[l++];
return b.length = m, b
},
grep: function(b, c, d) {
var g, m = [],
l = 0,
e = b.length;
for (d = !!d; l < e; l++) g = !!c(b[l], l), d !== g && m.push(b[l]);
return m
},
map: function(b, d, g) {
var l, e, s = [],
f = 0,
p = b.length;
if (b instanceof m || p !== c && "number" == typeof p && (0 < p && b[0] && b[p - 1] || 0 === p || m.isArray(b)))
for (; f < p; f++) l = d(b[f], f, g), null != l && (s[s.length] = l);
else
for (e in b) l = d(b[e], e, g), null != l && (s[s.length] = l);
return s.concat.apply([], s)
},
guid: 1,
proxy: function(b, d) {
var g, l, e;
return "string" == typeof d && (g = b[d], d = b, b = g), m.isFunction(b) ? (l = F.call(arguments, 2), e = function() {
return b.apply(d, l.concat(F.call(arguments)))
}, e.guid = b.guid = b.guid || m.guid++, e) : c
},
access: function(b, d, g, l, e, s, f) {
var p, r = null == g,
j = 0,
n = b.length;
if (g && "object" == typeof g) {
for (j in g) m.access(b, d, j, g[j], 1, s, l);
e = 1
} else if (l !== c) {
p = f === c && m.isFunction(l);
r && (p ? (p = d, d = function(b, c, d) {
return p.call(m(b), d)
}) : (d.call(b, l), d = null));
if (d)
for (; j < n; j++) d(b[j], g, p ? l.call(b[j], j, d(b[j], g)) : l, f);
e = 1
}
return e ? b : r ? d.call(b) : n ? d(b[0], g) : s
},
now: function() {
return (new Date).getTime()
}
});
m.ready.promise = function(c) {
if (!N)
if (N = m.Deferred(), "complete" === J.readyState) setTimeout(m.ready, 1);
else if (J.addEventListener) J.addEventListener("DOMContentLoaded", Ca, !1), b.addEventListener("load", m.ready, !1);
else {
J.attachEvent("onreadystatechange", Ca);
b.attachEvent("onload", m.ready);
var d = !1;
try {
d = null == b.frameElement && J.documentElement
} catch (g) {}
d && d.doScroll && function Nc() {
if (!m.isReady) {
try {
d.doScroll("left")
} catch (b) {
return setTimeout(Nc, 50)
}
m.ready()
}
}()
}
return N.promise(c)
};
m.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(b, c) {
Oa["[object " + c + "]"] = c.toLowerCase()
});
D = m(J);
var Pa = {};
m.Callbacks = function(b) {
var d;
if ("string" == typeof b) {
if (!(d = Pa[b])) {
d = b;
var g = Pa[d] = {};
d = (m.each(d.split(qa), function(b, c) {
g[c] = !0
}), g)
}
} else d = m.extend({}, b);
b = d;
var l, e, s, f, p, r, j = [],
n = !b.once && [],
F = function(c) {
l = b.memory && c;
e = !0;
r = f || 0;
f = 0;
p = j.length;
for (s = !0; j && r < p; r++)
if (!1 === j[r].apply(c[0], c[1]) && b.stopOnFalse) {
l = !1;
break
}
s = !1;
j && (n ? n.length && F(n.shift()) : l ? j = [] : v.disable())
},
v = {
add: function() {
if (j) {
var c = j.length;
(function Rc(c) {
m.each(c, function(c, d) {
var g = m.type(d);
"function" === g && (!b.unique || !v.has(d)) ? j.push(d) : d && d.length && "string" !== g && Rc(d)
})
})(arguments);
s ? p = j.length : l && (f = c, F(l))
}
return this
},
remove: function() {
return j && m.each(arguments, function(b, c) {
for (var d; - 1 < (d = m.inArray(c, j, d));) j.splice(d, 1), s && (d <= p && p--, d <= r && r--)
}), this
},
has: function(b) {
return -1 < m.inArray(b, j)
},
empty: function() {
return j = [], this
},
disable: function() {
return j = n = l = c, this
},
disabled: function() {
return !j
},
lock: function() {
return n = c, l || v.disable(), this
},
locked: function() {
return !n
},
fireWith: function(b, c) {
return c = c || [], c = [b, c.slice ? c.slice() : c], j && (!e || n) && (s ? n.push(c) : F(c)), this
},
fire: function() {
return v.fireWith(this, arguments), this
},
fired: function() {
return !!e
}
};
return v
};
m.extend({
Deferred: function(b) {
var c = [
["resolve", "done", m.Callbacks("once memory"), "resolved"],
["reject", "fail", m.Callbacks("once memory"), "rejected"],
["notify", "progress", m.Callbacks("memory")]
],
d = "pending",
g = {
state: function() {
return d
},
always: function() {
return l.done(arguments).fail(arguments), this
},
then: function() {
var b = arguments;
return m.Deferred(function(d) {
m.each(c, function(c, ba) {
var g = ba[0],
e = b[c];
l[ba[1]](m.isFunction(e) ? function() {
var b = e.apply(this, arguments);
b && m.isFunction(b.promise) ? b.promise().done(d.resolve).fail(d.reject).progress(d.notify) : d[g + "With"](this === l ? d : this, [b])
} : d[g])
});
b = null
}).promise()
},
promise: function(b) {
return null != b ? m.extend(b, g) : g
}
},
l = {};
return g.pipe = g.then, m.each(c, function(b, ba) {
var m = ba[2],
e = ba[3];
g[ba[1]] = m.add;
e && m.add(function() {
d = e
}, c[b ^ 1][2].disable, c[2][2].lock);
l[ba[0]] = m.fire;
l[ba[0] + "With"] = m.fireWith
}), g.promise(l), b && b.call(l, l), l
},
when: function(b) {
var c = 0,
d = F.call(arguments),
g = d.length,
l = 1 !== g || b && m.isFunction(b.promise) ? g : 0,
e = 1 === l ? b : m.Deferred(),
s = function(b, c, d) {
return function(ba) {
c[b] = this;
d[b] = 1 < arguments.length ? F.call(arguments) : ba;
d === f ? e.notifyWith(c, d) : --l || e.resolveWith(c, d)
}
},
f, p, r;
if (1 < g) {
f = Array(g);
p = Array(g);
for (r = Array(g); c < g; c++) d[c] && m.isFunction(d[c].promise) ? d[c].promise().done(s(c, r, d)).fail(e.reject).progress(s(c, p, f)) : --l
}
return l || e.resolveWith(r, d), e.promise()
}
});
var Eb = m,
Qa, ea, Da, ra, wa, Ea, ga, sa, Fa, Ra, ua, hb, Y = J.createElement("div");
Y.setAttribute("className", "t");
Y.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
Da = Y.getElementsByTagName("*");
ra = Y.getElementsByTagName("a")[0];
ra.style.cssText = "top:1px;float:left;opacity:.5";
if (!Da || !Da.length) Qa = {};
else {
wa = J.createElement("select");
Ea = wa.appendChild(J.createElement("option"));
ga = Y.getElementsByTagName("input")[0];
ea = {
leadingWhitespace: 3 === Y.firstChild.nodeType,
tbody: !Y.getElementsByTagName("tbody").length,
htmlSerialize: !!Y.getElementsByTagName("link").length,
style: /top/.test(ra.getAttribute("style")),
hrefNormalized: "/a" === ra.getAttribute("href"),
opacity: /^0.5/.test(ra.style.opacity),
cssFloat: !!ra.style.cssFloat,
checkOn: "on" === ga.value,
optSelected: Ea.selected,
getSetAttribute: "t" !== Y.className,
enctype: !!J.createElement("form").enctype,
html5Clone: "<:nav></:nav>" !== J.createElement("nav").cloneNode(!0).outerHTML,
boxModel: "CSS1Compat" === J.compatMode,
submitBubbles: !0,
changeBubbles: !0,
focusinBubbles: !1,
deleteExpando: !0,
noCloneEvent: !0,
inlineBlockNeedsLayout: !1,
shrinkWrapBlocks: !1,
reliableMarginRight: !0,
boxSizingReliable: !0,
pixelPosition: !1
};
ga.checked = !0;
ea.noCloneChecked = ga.cloneNode(!0).checked;
wa.disabled = !0;
ea.optDisabled = !Ea.disabled;
try {
delete Y.test
} catch (Sb) {
ea.deleteExpando = !1
}!Y.addEventListener && Y.attachEvent && Y.fireEvent && (Y.attachEvent("onclick", hb = function() {
ea.noCloneEvent = !1
}), Y.cloneNode(!0).fireEvent("onclick"), Y.detachEvent("onclick", hb));
ga = J.createElement("input");
ga.value = "t";
ga.setAttribute("type", "radio");
ea.radioValue = "t" === ga.value;
ga.setAttribute("checked", "checked");
ga.setAttribute("name", "t");
Y.appendChild(ga);
sa = J.createDocumentFragment();
sa.appendChild(Y.lastChild);
ea.checkClone = sa.cloneNode(!0).cloneNode(!0).lastChild.checked;
ea.appendChecked = ga.checked;
sa.removeChild(ga);
sa.appendChild(Y);
if (Y.attachEvent)
for (Ra in {
submit: !0,
change: !0,
focusin: !0
}) Fa = "on" + Ra, (ua = Fa in Y) || (Y.setAttribute(Fa, "return;"), ua = "function" == typeof Y[Fa]), ea[Ra + "Bubbles"] = ua;
Qa = (m(function() {
var c, d, g, l, m = J.getElementsByTagName("body")[0];
m && (c = J.createElement("div"), c.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px", m.insertBefore(c, m.firstChild), d = J.createElement("div"), c.appendChild(d), d.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", g = d.getElementsByTagName("td"), g[0].style.cssText = "padding:0;margin:0;border:0;display:none", ua = 0 === g[0].offsetHeight, g[0].style.display = "", g[1].style.display = "none", ea.reliableHiddenOffsets = ua && 0 === g[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", ea.boxSizing = 4 === d.offsetWidth, ea.doesNotIncludeMarginInBodyOffset = 1 !== m.offsetTop, b.getComputedStyle && (ea.pixelPosition = "1%" !== (b.getComputedStyle(d, null) || {}).top, ea.boxSizingReliable = "4px" === (b.getComputedStyle(d, null) || {
width: "4px"
}).width, l = J.createElement("div"), l.style.cssText = d.style.cssText = "padding:0;margin:0;border:0;display:block;overflow:hidden;", l.style.marginRight = l.style.width = "0", d.style.width = "1px", d.appendChild(l), ea.reliableMarginRight = !parseFloat((b.getComputedStyle(l, null) || {}).marginRight)), "undefined" != typeof d.style.zoom && (d.innerHTML = "", d.style.cssText = "padding:0;margin:0;border:0;display:block;overflow:hidden;width:1px;padding:1px;display:inline;zoom:1", ea.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.style.overflow = "visible", d.innerHTML = "<div></div>", d.firstChild.style.width = "5px", ea.shrinkWrapBlocks = 3 !== d.offsetWidth, c.style.zoom = 1), m.removeChild(c))
}), sa.removeChild(Y), Da = ra = wa = Ea = ga = sa = Y = null, ea)
}
Eb.support = Qa;
var wb = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
vb = /([A-Z])/g;
m.extend({
cache: {},
deletedIds: [],
uuid: 0,
expando: "jQuery" + (m.fn.jquery + Math.random()).replace(/\D/g, ""),
noData: {
embed: !0,
object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
applet: !0
},
hasData: function(b) {
return b = b.nodeType ? m.cache[b[m.expando]] : b[m.expando], !!b && !e(b)
},
data: function(b, d, g, l) {
if (m.acceptData(b)) {
var e, s, f = m.expando,
p = "string" == typeof d,
r = b.nodeType,
j = r ? m.cache : b,
n = r ? b[f] : b[f] && f;
if (n && j[n] && (l || j[n].data) || !(p && g === c)) {
n || (r ? b[f] = n = m.deletedIds.pop() || m.guid++ : n = f);
j[n] || (j[n] = {}, r || (j[n].toJSON = m.noop));
if ("object" == typeof d || "function" == typeof d) l ? j[n] = m.extend(j[n], d) : j[n].data = m.extend(j[n].data, d);
return e = j[n], l || (e.data || (e.data = {}), e = e.data), g !== c && (e[m.camelCase(d)] = g), p ? (s = e[d], null == s && (s = e[m.camelCase(d)])) : s = e, s
}
}
},
removeData: function(b, c, d) {
if (m.acceptData(b)) {
var g, l, s, f = b.nodeType,
p = f ? m.cache : b,
r = f ? b[m.expando] : m.expando;
if (p[r]) {
if (c && (g = d ? p[r] : p[r].data)) {
m.isArray(c) || (c in g ? c = [c] : (c = m.camelCase(c), c in g ? c = [c] : c = c.split(" ")));
l = 0;
for (s = c.length; l < s; l++) delete g[c[l]];
if (!(d ? e : m.isEmptyObject)(g)) return
}
if (d || !(delete p[r].data, !e(p[r]))) f ? m.cleanData([b], !0) : m.support.deleteExpando || p != p.window ? delete p[r] : p[r] = null
}
}
},
_data: function(b, c, d) {
return m.data(b, c, d, !0)
},
acceptData: function(b) {
var c = b.nodeName && m.noData[b.nodeName.toLowerCase()];
return !c || !0 !== c && b.getAttribute("classid") === c
}
});
m.fn.extend({
data: function(b, g) {
var l, e, s, f, p, r = this[0],
j = 0,
n = null;
if (b === c) {
if (this.length && (n = m.data(r), 1 === r.nodeType && !m._data(r, "parsedAttrs"))) {
s = r.attributes;
for (p = s.length; j < p; j++) f = s[j].name, f.indexOf("data-") || (f = m.camelCase(f.substring(5)), d(r, f, n[f]));
m._data(r, "parsedAttrs", !0)
}
return n
}
return "object" == typeof b ? this.each(function() {
m.data(this, b)
}) : (l = b.split(".", 2), l[1] = l[1] ? "." + l[1] : "", e = l[1] + "!", m.access(this, function(g) {
if (g === c) return n = this.triggerHandler("getData" + e, [l[0]]), n === c && r && (n = m.data(r, b), n = d(r, b, n)), n === c && l[1] ? this.data(l[0]) : n;
l[1] = g;
this.each(function() {
var c = m(this);
c.triggerHandler("setData" + e, l);
m.data(this, b, g);
c.triggerHandler("changeData" + e, l)
})
}, null, g, 1 < arguments.length, null, !1))
},
removeData: function(b) {
return this.each(function() {
m.removeData(this, b)
})
}
});
m.extend({
queue: function(b, c, d) {
var g;
if (b) return c = (c || "fx") + "queue", g = m._data(b, c), d && (!g || m.isArray(d) ? g = m._data(b, c, m.makeArray(d)) : g.push(d)), g || []
},
dequeue: function(b, c) {
c = c || "fx";
var d = m.queue(b, c),
g = d.length,
l = d.shift(),
e = m._queueHooks(b, c),
s = function() {
m.dequeue(b, c)
};
"inprogress" === l && (l = d.shift(), g--);
l && ("fx" === c && d.unshift("inprogress"), delete e.stop, l.call(b, s, e));
!g && e && e.empty.fire()
},
_queueHooks: function(b, c) {
var d = c + "queueHooks";
return m._data(b, d) || m._data(b, d, {
empty: m.Callbacks("once memory").add(function() {
m.removeData(b, c + "queue", !0);
m.removeData(b, d, !0)
})
})
}
});
m.fn.extend({
queue: function(b, d) {
var g = 2;
return "string" != typeof b && (d = b, b = "fx", g--), arguments.length < g ? m.queue(this[0], b) : d === c ? this : this.each(function() {
var c = m.queue(this, b, d);
m._queueHooks(this, b);
"fx" === b && "inprogress" !== c[0] && m.dequeue(this, b)
})
},
dequeue: function(b) {
return this.each(function() {
m.dequeue(this, b)
})
},
delay: function(b, c) {
return b = m.fx ? m.fx.speeds[b] || b : b, c = c || "fx", this.queue(c, function(c, d) {
var g = setTimeout(c, b);
d.stop = function() {
clearTimeout(g)
}
})
},
clearQueue: function(b) {
return this.queue(b || "fx", [])
},
promise: function(b, d) {
var g, l = 1,
e = m.Deferred(),
s = this,
f = this.length,
p = function() {
--l || e.resolveWith(s, [s])
};
"string" != typeof b && (d = b, b = c);
for (b = b || "fx"; f--;)(g = m._data(s[f], b + "queueHooks")) && g.empty && (l++, g.empty.add(p));
return p(), e.promise(d)
}
});
var ma, ib, Sa, Ta = /[\t\r\n]/g,
jb = /\r/g,
kb = /^(?:button|input)$/i,
lb = /^(?:button|input|object|select|textarea)$/i,
mb = /^a(?:rea|)$/i,
nb = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
Ua = m.support.getSetAttribute;
m.fn.extend({
attr: function(b, c) {
return m.access(this, m.attr, b, c, 1 < arguments.length)
},
removeAttr: function(b) {
return this.each(function() {
m.removeAttr(this, b)
})
},
prop: function(b, c) {
return m.access(this, m.prop, b, c, 1 < arguments.length)
},
removeProp: function(b) {
return b = m.propFix[b] || b, this.each(function() {
try {
this[b] = c, delete this[b]
} catch (d) {}
})
},
addClass: function(b) {
var c, d, g, l, e, s, f;
if (m.isFunction(b)) return this.each(function(c) {
m(this).addClass(b.call(this, c, this.className))
});
if (b && "string" == typeof b) {
c = b.split(qa);
d = 0;
for (g = this.length; d < g; d++)
if (l = this[d], 1 === l.nodeType)
if (!l.className && 1 === c.length) l.className = b;
else {
e = " " + l.className + " ";
s = 0;
for (f = c.length; s < f; s++) 0 > e.indexOf(" " + c[s] + " ") && (e += c[s] + " ");
l.className = m.trim(e)
}
}
return this
},
removeClass: function(b) {
var d, g, l, e, s, f, p;
if (m.isFunction(b)) return this.each(function(c) {
m(this).removeClass(b.call(this, c, this.className))
});
if (b && "string" == typeof b || b === c) {
d = (b || "").split(qa);
f = 0;
for (p = this.length; f < p; f++)
if (l = this[f], 1 === l.nodeType && l.className) {
g = (" " + l.className + " ").replace(Ta, " ");
e = 0;
for (s = d.length; e < s; e++)
for (; 0 <= g.indexOf(" " + d[e] + " ");) g = g.replace(" " + d[e] + " ", " ");
l.className = b ? m.trim(g) : ""
}
}
return this
},
toggleClass: function(b, c) {
var d = typeof b,
g = "boolean" == typeof c;
return m.isFunction(b) ? this.each(function(d) {
m(this).toggleClass(b.call(this, d, this.className, c), c)
}) : this.each(function() {
if ("string" === d)
for (var l, e = 0, s = m(this), f = c, p = b.split(qa); l = p[e++];) f = g ? f : !s.hasClass(l), s[f ? "addClass" : "removeClass"](l);
else if ("undefined" === d || "boolean" === d) this.className && m._data(this, "__className__", this.className), this.className = this.className || !1 === b ? "" : m._data(this, "__className__") || ""
})
},
hasClass: function(b) {
b = " " + b + " ";
for (var c = 0, d = this.length; c < d; c++)
if (1 === this[c].nodeType && 0 <= (" " + this[c].className + " ").replace(Ta, " ").indexOf(b)) return !0;
return !1
},
val: function(b) {
var d, g, l, e = this[0];
if (arguments.length) return l = m.isFunction(b), this.each(function(g) {
var e, s = m(this);
if (1 === this.nodeType && (l ? e = b.call(this, g, s.val()) : e = b, null == e ? e = "" : "number" == typeof e ? e += "" : m.isArray(e) && (e = m.map(e, function(b) {
return null == b ? "" : b + ""
})), d = m.valHooks[this.type] || m.valHooks[this.nodeName.toLowerCase()], !d || !("set" in d) || d.set(this, e, "value") === c)) this.value = e
});
if (e) return d = m.valHooks[e.type] || m.valHooks[e.nodeName.toLowerCase()], d && "get" in d && (g = d.get(e, "value")) !== c ? g : (g = e.value, "string" == typeof g ? g.replace(jb, "") : null == g ? "" : g)
}
});
m.extend({
valHooks: {
option: {
get: function(b) {
var c = b.attributes.value;
return !c || c.specified ? b.value : b.text
}
},
select: {
get: function(b) {
var c, d, g = b.selectedIndex,
l = [],
e = b.options,
s = "select-one" === b.type;
if (0 > g) return null;
b = s ? g : 0;
for (d = s ? g + 1 : e.length; b < d; b++)
if (c = e[b], c.selected && (m.support.optDisabled ? !c.disabled : null === c.getAttribute("disabled")) && (!c.parentNode.disabled || !m.nodeName(c.parentNode, "optgroup"))) {
c = m(c).val();
if (s) return c;
l.push(c)
}
return s && !l.length && e.length ? m(e[g]).val() : l
},
set: function(b, c) {
var d = m.makeArray(c);
return m(b).find("option").each(function() {
this.selected = 0 <= m.inArray(m(this).val(), d)
}), d.length || (b.selectedIndex = -1), d
}
}
},
attrFn: {},
attr: function(b, d, g, l) {
var e, s, f = b.nodeType;
if (b && !(3 === f || 8 === f || 2 === f)) {
if (l && m.isFunction(m.fn[d])) return m(b)[d](g);
if ("undefined" == typeof b.getAttribute) return m.prop(b, d, g);
(l = 1 !== f || !m.isXMLDoc(b)) && (d = d.toLowerCase(), s = m.attrHooks[d] || (nb.test(d) ? ib : ma));
if (g !== c) {
if (null === g) {
m.removeAttr(b, d);
return
}
return s && "set" in s && l && (e = s.set(b, g, d)) !== c ? e : (b.setAttribute(d, g + ""), g)
}
return s && "get" in s && l && null !== (e = s.get(b, d)) ? e : (e = b.getAttribute(d), null === e ? c : e)
}
},
removeAttr: function(b, c) {
var d, g, l, e, s = 0;
if (c && 1 === b.nodeType)
for (g = c.split(qa); s < g.length; s++)(l = g[s]) && (d = m.propFix[l] || l, e = nb.test(l), e || m.attr(b, l, ""), b.removeAttribute(Ua ? l : d), e && d in b && (b[d] = !1))
},
attrHooks: {
type: {
set: function(b, c) {
if (kb.test(b.nodeName) && b.parentNode) m.error("type property can't be changed");
else if (!m.support.radioValue && "radio" === c && m.nodeName(b, "input")) {
var d = b.value;
return b.setAttribute("type", c), d && (b.value = d), c
}
}
},
value: {
get: function(b, c) {
return ma && m.nodeName(b, "button") ? ma.get(b, c) : c in b ? b.value : null
},
set: function(b, c, d) {
if (ma && m.nodeName(b, "button")) return ma.set(b, c, d);
b.value = c
}
}
},
propFix: {
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
},
prop: function(b, d, g) {
var l, e, s, f = b.nodeType;
if (b && !(3 === f || 8 === f || 2 === f)) return s = 1 !== f || !m.isXMLDoc(b), s && (d = m.propFix[d] || d, e = m.propHooks[d]), g !== c ? e && "set" in e && (l = e.set(b, g, d)) !== c ? l : b[d] = g : e && "get" in e && null !== (l = e.get(b, d)) ? l : b[d]
},
propHooks: {
tabIndex: {
get: function(b) {
var d = b.getAttributeNode("tabindex");
return d && d.specified ? parseInt(d.value, 10) : lb.test(b.nodeName) || mb.test(b.nodeName) && b.href ? 0 : c
}
}
}
});
ib = {
get: function(b, d) {
var g, l = m.prop(b, d);
return !0 === l || "boolean" != typeof l && (g = b.getAttributeNode(d)) && !1 !== g.nodeValue ? d.toLowerCase() : c
},
set: function(b, c, d) {
var g;
return !1 === c ? m.removeAttr(b, d) : (g = m.propFix[d] || d, g in b && (b[g] = !0), b.setAttribute(d, d.toLowerCase())), d
}
};
Ua || (Sa = {
name: !0,
id: !0,
coords: !0
}, ma = m.valHooks.button = {
get: function(b, d) {
var g;
return g = b.getAttributeNode(d), g && (Sa[d] ? "" !== g.value : g.specified) ? g.value : c
},
set: function(b, c, d) {
var g = b.getAttributeNode(d);
return g || (g = J.createAttribute(d), b.setAttributeNode(g)), g.value = c + ""
}
}, m.each(["width", "height"], function(b, c) {
m.attrHooks[c] = m.extend(m.attrHooks[c], {
set: function(b, d) {
if ("" === d) return b.setAttribute(c, "auto"), d
}
})
}), m.attrHooks.contenteditable = {
get: ma.get,
set: function(b, c, d) {
"" === c && (c = "false");
ma.set(b, c, d)
}
});
m.support.hrefNormalized || m.each(["href", "src", "width", "height"], function(b, d) {
m.attrHooks[d] = m.extend(m.attrHooks[d], {
get: function(b) {
b = b.getAttribute(d, 2);
return null === b ? c : b
}
})
});
m.support.style || (m.attrHooks.style = {
get: function(b) {
return b.style.cssText.toLowerCase() || c
},
set: function(b, c) {
return b.style.cssText = c + ""
}
});
m.support.optSelected || (m.propHooks.selected = m.extend(m.propHooks.selected, {
get: function(b) {
b = b.parentNode;
return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null
}
}));
m.support.enctype || (m.propFix.enctype = "encoding");
m.support.checkOn || m.each(["radio", "checkbox"], function() {
m.valHooks[this] = {
get: function(b) {
return null === b.getAttribute("value") ? "on" : b.value
}
}
});
m.each(["radio", "checkbox"], function() {
m.valHooks[this] = m.extend(m.valHooks[this], {
set: function(b, c) {
if (m.isArray(c)) return b.checked = 0 <= m.inArray(m(b).val(), c)
}
})
});
var Ga = /^(?:textarea|input|select)$/i,
ob = /^([^\.]*|)(?:\.(.+)|)$/,
pb = /(?:^|\s)hover(\.\S+|)\b/,
qb = /^key/,
rb = /^(?:mouse|contextmenu)|click/,
Va = /^(?:focusinfocus|focusoutblur)$/,
Wa = function(b) {
return m.event.special.hover ? b : b.replace(pb, "mouseenter$1 mouseleave$1")
};
m.event = {
add: function(b, d, g, l, e) {
var s, f, p, r, j, n, F, v, D;
if (!(3 === b.nodeType || 8 === b.nodeType || !d || !g || !(s = m._data(b)))) {
g.handler && (F = g, g = F.handler, e = F.selector);
g.guid || (g.guid = m.guid++);
(p = s.events) || (s.events = p = {});
(f = s.handle) || (s.handle = f = function(b) {
return "undefined" != typeof m && (!b || m.event.triggered !== b.type) ? m.event.dispatch.apply(f.elem, arguments) : c
}, f.elem = b);
d = m.trim(Wa(d)).split(" ");
for (s = 0; s < d.length; s++) {
r = ob.exec(d[s]) || [];
j = r[1];
n = (r[2] || "").split(".").sort();
D = m.event.special[j] || {};
j = (e ? D.delegateType : D.bindType) || j;
D = m.event.special[j] || {};
r = m.extend({
type: j,
origType: r[1],
data: l,
handler: g,
guid: g.guid,
selector: e,
needsContext: e && m.expr.match.needsContext.test(e),
namespace: n.join(".")
}, F);
v = p[j];
if (!v && (v = p[j] = [], v.delegateCount = 0, !D.setup || !1 === D.setup.call(b, l, n, f))) b.addEventListener ? b.addEventListener(j, f, !1) : b.attachEvent && b.attachEvent("on" + j, f);
D.add && (D.add.call(b, r), r.handler.guid || (r.handler.guid = g.guid));
e ? v.splice(v.delegateCount++, 0, r) : v.push(r);
m.event.global[j] = !0
}
b = null
}
},
global: {},
remove: function(b, c, d, g, l) {
var e, s, f, p, r, j, n, F, v, D, aa = m.hasData(b) && m._data(b);
if (aa && (n = aa.events)) {
c = m.trim(Wa(c || "")).split(" ");
for (e = 0; e < c.length; e++)
if (s = ob.exec(c[e]) || [], f = p = s[1], s = s[2], f) {
F = m.event.special[f] || {};
f = (g ? F.delegateType : F.bindType) || f;
v = n[f] || [];
r = v.length;
s = s ? RegExp("(^|\\.)" + s.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
for (j = 0; j < v.length; j++) D = v[j], (l || p === D.origType) && (!d || d.guid === D.guid) && (!s || s.test(D.namespace)) && (!g || g === D.selector || "**" === g && D.selector) && (v.splice(j--, 1), D.selector && v.delegateCount--, F.remove && F.remove.call(b, D));
0 === v.length && r !== v.length && ((!F.teardown || !1 === F.teardown.call(b, s, aa.handle)) && m.removeEvent(b, f, aa.handle), delete n[f])
} else
for (f in n) m.event.remove(b, f + c[e], d, g, !0);
m.isEmptyObject(n) && (delete aa.handle, m.removeData(b, "events", !0))
}
},
customEvent: {
getData: !0,
setData: !0,
changeData: !0
},
trigger: function(d, g, l, e) {
if (!l || 3 !== l.nodeType && 8 !== l.nodeType) {
var s, f, p, r, j, n, F, v = d.type || d;
r = [];
if (!Va.test(v + m.event.triggered) && (0 <= v.indexOf("!") && (v = v.slice(0, -1), s = !0), 0 <= v.indexOf(".") && (r = v.split("."), v = r.shift(), r.sort()), l && !m.event.customEvent[v] || m.event.global[v]))
if (d = "object" == typeof d ? d[m.expando] ? d : new m.Event(v, d) : new m.Event(v), d.type = v, d.isTrigger = !0, d.exclusive = s, d.namespace = r.join("."), d.namespace_re = d.namespace ? RegExp("(^|\\.)" + r.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, r = 0 > v.indexOf(":") ? "on" + v : "", l) {
if (d.result = c, d.target || (d.target = l), g = null != g ? m.makeArray(g) : [], g.unshift(d), j = m.event.special[v] || {}, !(j.trigger && !1 === j.trigger.apply(l, g))) {
F = [
[l, j.bindType || v]
];
if (!e && !j.noBubble && !m.isWindow(l)) {
f = j.delegateType || v;
s = Va.test(f + v) ? l : l.parentNode;
for (p = l; s; s = s.parentNode) F.push([s, f]), p = s;
p === (l.ownerDocument || J) && F.push([p.defaultView || p.parentWindow || b, f])
}
for (f = 0; f < F.length && !d.isPropagationStopped(); f++) s = F[f][0], d.type = F[f][1], (n = (m._data(s, "events") || {})[d.type] && m._data(s, "handle")) && n.apply(s, g), (n = r && s[r]) && m.acceptData(s) && n.apply && !1 === n.apply(s, g) && d.preventDefault();
return d.type = v, !e && !d.isDefaultPrevented() && (!j._default || !1 === j._default.apply(l.ownerDocument, g)) && ("click" !== v || !m.nodeName(l, "a")) && m.acceptData(l) && r && l[v] && ("focus" !== v && "blur" !== v || 0 !== d.target.offsetWidth) && !m.isWindow(l) && (p = l[r], p && (l[r] = null), m.event.triggered = v, l[v](), m.event.triggered = c, p && (l[r] = p)), d.result
}
} else
for (f in l = m.cache, l) l[f].events && l[f].events[v] && m.event.trigger(d, g, l[f].handle.elem, !0)
}
},
dispatch: function(d) {
d = m.event.fix(d || b.event);
var g, l, e, s, f, p, r = (m._data(this, "events") || {})[d.type] || [],
j = r.delegateCount,
n = F.call(arguments),
v = !d.exclusive && !d.namespace,
D = m.event.special[d.type] || {},
aa = [];
n[0] = d;
d.delegateTarget = this;
if (!(D.preDispatch && !1 === D.preDispatch.call(this, d))) {
if (j && (!d.button || "click" !== d.type))
for (l = d.target; l != this; l = l.parentNode || this)
if (!0 !== l.disabled || "click" !== d.type) {
s = {};
f = [];
for (g = 0; g < j; g++) e = r[g], p = e.selector, s[p] === c && (s[p] = e.needsContext ? 0 <= m(p, this).index(l) : m.find(p, this, null, [l]).length), s[p] && f.push(e);
f.length && aa.push({
elem: l,
matches: f
})
}
r.length > j && aa.push({
elem: this,
matches: r.slice(j)
});
for (g = 0; g < aa.length && !d.isPropagationStopped(); g++) {
s = aa[g];
d.currentTarget = s.elem;
for (l = 0; l < s.matches.length && !d.isImmediatePropagationStopped(); l++)
if (e = s.matches[l], v || !d.namespace && !e.namespace || d.namespace_re && d.namespace_re.test(e.namespace)) d.data = e.data, d.handleObj = e, e = ((m.event.special[e.origType] || {}).handle || e.handler).apply(s.elem, n), e !== c && (d.result = e, !1 === e && (d.preventDefault(), d.stopPropagation()))
}
return D.postDispatch && D.postDispatch.call(this, d), d.result
}
},
props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: ["char", "charCode", "key", "keyCode"],
filter: function(b, c) {
return null == b.which && (b.which = null != c.charCode ? c.charCode : c.keyCode), b
}
},
mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function(b, d) {
var g, l, e, m = d.button,
s = d.fromElement;
return null == b.pageX && null != d.clientX && (g = b.target.ownerDocument || J, l = g.documentElement, e = g.body, b.pageX = d.clientX + (l && l.scrollLeft || e && e.scrollLeft || 0) - (l && l.clientLeft || e && e.clientLeft || 0), b.pageY = d.clientY + (l && l.scrollTop || e && e.scrollTop || 0) - (l && l.clientTop || e && e.clientTop || 0)), !b.relatedTarget && s && (b.relatedTarget = s === b.target ? d.toElement : s), !b.which && m !== c && (b.which = m & 1 ? 1 : m & 2 ? 3 : m & 4 ? 2 : 0), b
}
},
fix: function(b) {
if (b[m.expando]) return b;
var c, d, g = b,
l = m.event.fixHooks[b.type] || {},
e = l.props ? this.props.concat(l.props) : this.props;
b = m.Event(g);
for (c = e.length; c;) d = e[--c], b[d] = g[d];
return b.target || (b.target = g.srcElement || J), 3 === b.target.nodeType && (b.target = b.target.parentNode), b.metaKey = !!b.metaKey, l.filter ? l.filter(b, g) : b
},
special: {
load: {
noBubble: !0
},
focus: {
delegateType: "focusin"
},
blur: {
delegateType: "focusout"
},
beforeunload: {
setup: function(b, c, d) {
m.isWindow(this) && (this.onbeforeunload = d)
},
teardown: function(b, c) {
this.onbeforeunload === c && (this.onbeforeunload = null)
}
}
},
simulate: function(b, c, d, g) {
b = m.extend(new m.Event, d, {
type: b,
isSimulated: !0,
originalEvent: {}
});
g ? m.event.trigger(b, null, c) : m.event.dispatch.call(c, b);
b.isDefaultPrevented() && d.preventDefault()
}
};
m.event.handle = m.event.dispatch;
m.removeEvent = J.removeEventListener ? function(b, c, d) {
b.removeEventListener && b.removeEventListener(c, d, !1)
} : function(b, c, d) {
c = "on" + c;
b.detachEvent && ("undefined" == typeof b[c] && (b[c] = null), b.detachEvent(c, d))
};
m.Event = function(b, c) {
if (this instanceof m.Event) b && b.type ? (this.originalEvent = b, this.type = b.type, this.isDefaultPrevented = b.defaultPrevented || !1 === b.returnValue || b.getPreventDefault && b.getPreventDefault() ? j : f) : this.type = b, c && m.extend(this, c), this.timeStamp = b && b.timeStamp || m.now(), this[m.expando] = !0;
else return new m.Event(b, c)
};
m.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = j;
var b = this.originalEvent;
b && (b.preventDefault ? b.preventDefault() : b.returnValue = !1)
},
stopPropagation: function() {
this.isPropagationStopped = j;
var b = this.originalEvent;
b && (b.stopPropagation && b.stopPropagation(), b.cancelBubble = !0)
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = j;
this.stopPropagation()
},
isDefaultPrevented: f,
isPropagationStopped: f,
isImmediatePropagationStopped: f
};
m.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function(b, c) {
m.event.special[b] = {
delegateType: c,
bindType: c,
handle: function(b) {
var d, g = b.relatedTarget,
l = b.handleObj;
if (!g || g !== this && !m.contains(this, g)) b.type = l.origType, d = l.handler.apply(this, arguments), b.type = c;
return d
}
}
});
m.support.submitBubbles || (m.event.special.submit = {
setup: function() {
if (m.nodeName(this, "form")) return !1;
m.event.add(this, "click._submit keypress._submit", function(b) {
b = b.target;
(b = m.nodeName(b, "input") || m.nodeName(b, "button") ? b.form : c) && !m._data(b, "_submit_attached") && (m.event.add(b, "submit._submit", function(b) {
b._submit_bubble = !0
}), m._data(b, "_submit_attached", !0))
})
},
postDispatch: function(b) {
b._submit_bubble && (delete b._submit_bubble, this.parentNode && !b.isTrigger && m.event.simulate("submit", this.parentNode, b, !0))
},
teardown: function() {
if (m.nodeName(this, "form")) return !1;
m.event.remove(this, "._submit")
}
});
m.support.changeBubbles || (m.event.special.change = {
setup: function() {
if (Ga.test(this.nodeName)) {
if ("checkbox" === this.type || "radio" === this.type) m.event.add(this, "propertychange._change", function(b) {
"checked" === b.originalEvent.propertyName && (this._just_changed = !0)
}), m.event.add(this, "click._change", function(b) {
this._just_changed && !b.isTrigger && (this._just_changed = !1);
m.event.simulate("change", this, b, !0)
});
return !1
}
m.event.add(this, "beforeactivate._change", function(b) {
b = b.target;
Ga.test(b.nodeName) && !m._data(b, "_change_attached") && (m.event.add(b, "change._change", function(b) {
this.parentNode && !b.isSimulated && !b.isTrigger && m.event.simulate("change", this.parentNode, b, !0)
}), m._data(b, "_change_attached", !0))
})
},
handle: function(b) {
var c = b.target;
if (this !== c || b.isSimulated || b.isTrigger || "radio" !== c.type && "checkbox" !== c.type) return b.handleObj.handler.apply(this, arguments)
},
teardown: function() {
return m.event.remove(this, "._change"), !Ga.test(this.nodeName)
}
});
m.support.focusinBubbles || m.each({
focus: "focusin",
blur: "focusout"
}, function(b, c) {
var d = 0,
g = function(b) {
m.event.simulate(c, b.target, m.event.fix(b), !0)
};
m.event.special[c] = {
setup: function() {
0 === d++ && J.addEventListener(b, g, !0)
},
teardown: function() {
0 === --d && J.removeEventListener(b, g, !0)
}
}
});
m.fn.extend({
on: function(b, d, g, l, e) {
var s, p;
if ("object" == typeof b) {
"string" != typeof d && (g = g || d, d = c);
for (p in b) this.on(p, d, g, b[p], e);
return this
}
null == g && null == l ? (l = d, g = d = c) : null == l && ("string" == typeof d ? (l = g, g = c) : (l = g, g = d, d = c));
if (!1 === l) l = f;
else if (!l) return this;
return 1 === e && (s = l, l = function(b) {
return m().off(b), s.apply(this, arguments)
}, l.guid = s.guid || (s.guid = m.guid++)), this.each(function() {
m.event.add(this, b, l, g, d)
})
},
one: function(b, c, d, g) {
return this.on(b, c, d, g, 1)
},
off: function(b, d, g) {
var l, e;
if (b && b.preventDefault && b.handleObj) return l = b.handleObj, m(b.delegateTarget).off(l.namespace ? l.origType + "." + l.namespace : l.origType, l.selector, l.handler), this;
if ("object" == typeof b) {
for (e in b) this.off(e, d, b[e]);
return this
}
if (!1 === d || "function" == typeof d) g = d, d = c;
return !1 === g && (g = f), this.each(function() {
m.event.remove(this, b, g, d)
})
},
bind: function(b, c, d) {
return this.on(b, null, c, d)
},
unbind: function(b, c) {
return this.off(b, null, c)
},
live: function(b, c, d) {
return m(this.context).on(b, this.selector, c, d), this
},
die: function(b, c) {
return m(this.context).off(b, this.selector || "**", c), this
},
delegate: function(b, c, d, g) {
return this.on(c, b, d, g)
},
undelegate: function(b, c, d) {
return 1 === arguments.length ? this.off(b, "**") : this.off(c, b || "**", d)
},
trigger: function(b, c) {
return this.each(function() {
m.event.trigger(b, c, this)
})
},
triggerHandler: function(b, c) {
if (this[0]) return m.event.trigger(b, c, this[0], !0)
},
toggle: function(b) {
var c = arguments,
d = b.guid || m.guid++,
g = 0,
l = function(d) {
var l = (m._data(this, "lastToggle" + b.guid) || 0) % g;
return m._data(this, "lastToggle" + b.guid, l + 1), d.preventDefault(), c[l].apply(this, arguments) || !1
};
for (l.guid = d; g < c.length;) c[g++].guid = d;
return this.click(l)
},
hover: function(b, c) {
return this.mouseenter(b).mouseleave(c || b)
}
});
m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(b, c) {
m.fn[c] = function(b, d) {
return null == d && (d = b, b = null), 0 < arguments.length ? this.on(c, null, b, d) : this.trigger(c)
};
qb.test(c) && (m.event.fixHooks[c] = m.event.keyHooks);
rb.test(c) && (m.event.fixHooks[c] = m.event.mouseHooks)
});
var sb = b,
W = function(b, c, d, g) {
d = d || [];
c = c || na;
var l, e, m, s, f = c.nodeType;
if (!b || "string" != typeof b) return d;
if (1 !== f && 9 !== f) return [];
m = Fb(c);
if (!m && !g && (l = Sc.exec(b)))
if (s = l[1])
if (9 === f) {
e = c.getElementById(s);
if (!e || !e.parentNode) return d;
if (e.id === s) return d.push(e), d
} else {
if (c.ownerDocument && (e = c.ownerDocument.getElementById(s)) && nc(c, e) && e.id === s) return d.push(e), d
}
else {
if (l[2]) return Xa.apply(d, Ya.call(c.getElementsByTagName(b), 0)), d;
if ((s = l[3]) && oc && c.getElementsByClassName) return Xa.apply(d, Ya.call(c.getElementsByClassName(s), 0)), d
}
return Tb(b.replace(Gb, "$1"), c, d, g, m)
},
va = function(b) {
return function(c) {
return "input" === c.nodeName.toLowerCase() && c.type === b
}
},
Za = function(b) {
return function(c) {
var d = c.nodeName.toLowerCase();
return ("input" === d || "button" === d) && c.type === b
}
},
pa = function(b) {
return oa(function(c) {
return c = +c, oa(function(d, g) {
for (var l, e = b([], d.length, c), s = e.length; s--;) d[l = e[s]] && (d[l] = !(g[l] = d[l]))
})
})
},
xa = function(b, c, d) {
if (b === c) return d;
for (b = b.nextSibling; b;) {
if (b === c) return -1;
b = b.nextSibling
}
return 1
},
ya = function(b, c) {
var d, g, l, e, s, m, f;
if (s = pc[fa][b]) return c ? 0 : s.slice(0);
s = b;
m = [];
for (f = da.preFilter; s;) {
if (!d || (g = Tc.exec(s))) g && (s = s.slice(g[0].length)), m.push(l = []);
d = !1;
if (g = Uc.exec(s)) l.push(d = new qc(g.shift())), s = s.slice(d.length), d.type = g[0].replace(Gb, " ");
for (e in da.filter)(g = Hb[e].exec(s)) && (!f[e] || (g = f[e](g, na, !0))) && (l.push(d = new qc(g.shift())), s = s.slice(d.length), d.type = e, d.matches = g);
if (!d) break
}
return c ? s.length : s ? W.error(b) : pc(b, m).slice(0)
},
Vb = function(b, c, d) {
var g = c.dir,
l = d && "parentNode" === c.dir,
e = Vc++;
return c.first ? function(c, d, e) {
for (; c = c[g];)
if (l || 1 === c.nodeType) return b(c, d, e)
} : function(c, d, s) {
if (s)
for (; c = c[g];) {
if ((l || 1 === c.nodeType) && b(c, d, s)) return c
} else
for (var m, f = tb + " " + e + " ", p = f + Ub; c = c[g];)
if (l || 1 === c.nodeType) {
if ((m = c[fa]) === p) return c.sizset;
if ("string" == typeof m && 0 === m.indexOf(f)) {
if (c.sizset) return c
} else {
c[fa] = p;
if (b(c, d, s)) return c.sizset = !0, c;
c.sizset = !1
}
}
}
},
Wb = function(b) {
return 1 < b.length ? function(c, d, g) {
for (var l = b.length; l--;)
if (!b[l](c, d, g)) return !1;
return !0
} : b[0]
},
Ib = function(b, c, d, g, l) {
for (var e, s = [], m = 0, f = b.length, p = null != c; m < f; m++)
if (e = b[m])
if (!d || d(e, g, l)) s.push(e), p && c.push(m);
return s
},
Xb = function(b, c, d, g, l, e) {
return g && !g[fa] && (g = Xb(g)), l && !l[fa] && (l = Xb(l, e)), oa(function(e, s, m, f) {
if (!e || !l) {
var p, r, j = [],
n = [],
F = s.length;
if (!(r = e)) {
r = c || "*";
var v = m.nodeType ? [m] : m,
D = [];
p = 0;
for (var aa = v.length; p < aa; p++) W(r, v[p], D, e);
r = D
}
v = b && (e || !c) ? Ib(r, j, b, m, f) : r;
D = d ? l || (e ? b : F || g) ? [] : s : v;
d && d(v, D, m, f);
if (g) {
r = Ib(D, n);
g(r, [], m, f);
for (m = r.length; m--;)
if (p = r[m]) D[n[m]] = !(v[n[m]] = p)
}
if (e)
for (m = b && D.length; m--;) {
if (p = D[m]) e[j[m]] = !(s[j[m]] = p)
} else D = Ib(D === s ? D.splice(F, D.length) : D), l ? l(null, s, D, f) : Xa.apply(s, D)
}
})
},
Yb = function(b) {
var c, d, g, l = b.length,
e = da.relative[b[0].type];
d = e || da.relative[" "];
for (var s = e ? 1 : 0, m = Vb(function(b) {
return b === c
}, d, !0), f = Vb(function(b) {
return -1 < rc.call(c, b)
}, d, !0), p = [
function(b, d, g) {
return !e && (g || d !== Jb) || ((c = d).nodeType ? m(b, d, g) : f(b, d, g))
}
]; s < l; s++)
if (d = da.relative[b[s].type]) p = [Vb(Wb(p), d)];
else {
d = da.filter[b[s].type].apply(null, b[s].matches);
if (d[fa]) {
for (g = ++s; g < l && !da.relative[b[g].type]; g++);
return Xb(1 < s && Wb(p), 1 < s && b.slice(0, s - 1).join("").replace(Gb, "$1"), d, s < g && Yb(b.slice(s, g)), g < l && Yb(b = b.slice(g)), g < l && b.join(""))
}
p.push(d)
}
return Wb(p)
},
Tb = function(b, c, d, g, l) {
var e, s, m, f, p = ya(b);
if (!g && 1 === p.length) {
s = p[0] = p[0].slice(0);
if (2 < s.length && "ID" === (m = s[0]).type && 9 === c.nodeType && !l && da.relative[s[1].type]) {
c = da.find.ID(m.matches[0].replace(Ha, ""), c, l)[0];
if (!c) return d;
b = b.slice(s.shift().length)
}
for (e = Hb.POS.test(b) ? -1 : s.length - 1; 0 <= e; e--) {
m = s[e];
if (da.relative[f = m.type]) break;
if (f = da.find[f])
if (g = f(m.matches[0].replace(Ha, ""), Zb.test(s[0].type) && c.parentNode || c, l)) {
s.splice(e, 1);
b = g.length && s.join("");
if (!b) return Xa.apply(d, Ya.call(g, 0)), d;
break
}
}
}
return $b(b, p)(g, c, l, d, Zb.test(b)), d
},
sc = function() {},
Ub, ac, da, Kb, Fb, nc, $b, bc, ub, Jb, tc = !0,
fa = ("sizcache" + Math.random()).replace(".", ""),
qc = String,
na = sb.document,
ja = na.documentElement,
tb = 0,
Vc = 0,
Wc = [].pop,
Xa = [].push,
Ya = [].slice,
rc = [].indexOf || function(b) {
for (var c = 0, d = this.length; c < d; c++)
if (this[c] === b) return c;
return -1
},
oa = function(b, c) {
return b[fa] = null == c || c, b
},
cc = function() {
var b = {},
c = [];
return oa(function(d, g) {
return c.push(d) > da.cacheLength && delete b[c.shift()], b[d] = g
}, b)
},
uc = cc(),
pc = cc(),
vc = cc(),
wc = "\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[-\\w]|[^\\x00-\\xa0])+)[\\x20\\t\\r\\n\\f]*(?:([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+".replace("w", "w#") + ")|)|)[\\x20\\t\\r\\n\\f]*\\]",
dc = ":((?:\\\\.|[-\\w]|[^\\x00-\\xa0])+)(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + wc + ")|[^:]|\\\\.)*|.*))\\)|)",
Gb = /^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$/g,
Tc = /^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/,
Uc = /^[\x20\t\r\n\f]*([\x20\t\r\n\f>+~])[\x20\t\r\n\f]*/,
Xc = RegExp(dc),
Sc = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
Zb = /[\x20\t\r\n\f]*[+~]/,
Yc = /h\d/i,
Zc = /input|select|textarea|button/i,
Ha = /\\(?!\\)/g,
Hb = {
ID: /^#((?:\\.|[-\w]|[^\x00-\xa0])+)/,
CLASS: /^\.((?:\\.|[-\w]|[^\x00-\xa0])+)/,
NAME: /^\[name=['"]?((?:\\.|[-\w]|[^\x00-\xa0])+)['"]?\]/,
TAG: RegExp("^(" + "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+".replace("w", "w*") + ")"),
ATTR: RegExp("^" + wc),
PSEUDO: RegExp("^" + dc),
POS: /:(even|odd|eq|gt|lt|nth|first|last)(?:\([\x20\t\r\n\f]*((?:-\d)?\d*)[\x20\t\r\n\f]*\)|)(?=[^-]|$)/i,
CHILD: RegExp("^:(only|nth|first|last)-child(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)", "i"),
needsContext: RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)", "i")
},
za = function(b) {
var c = na.createElement("div");
try {
return b(c)
} catch (d) {
return !1
} finally {}
},
$c = za(function(b) {
return b.appendChild(na.createComment("")), !b.getElementsByTagName("*").length
}),
ad = za(function(b) {
return b.innerHTML = "<a href='#'></a>", b.firstChild && "undefined" !== typeof b.firstChild.getAttribute && "#" === b.firstChild.getAttribute("href")
}),
bd = za(function(b) {
b.innerHTML = "<select></select>";
b = typeof b.lastChild.getAttribute("multiple");
return "boolean" !== b && "string" !== b
}),
oc = za(function(b) {
return b.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", !b.getElementsByClassName || !b.getElementsByClassName("e").length ? !1 : (b.lastChild.className = "e", 2 === b.getElementsByClassName("e").length)
}),
cd = za(function(b) {
b.id = fa + 0;
b.innerHTML = "<a name='" + fa + "'></a><div name='" + fa + "'></div>";
ja.insertBefore(b, ja.firstChild);
var c = na.getElementsByName && na.getElementsByName(fa).length === 2 + na.getElementsByName(fa + 0).length;
return ac = !na.getElementById(fa), ja.removeChild(b), c
});
try {
Ya.call(ja.childNodes, 0)[0].nodeType
} catch (Ld) {
Ya = function(b) {
for (var c, d = []; c = this[b]; b++) d.push(c);
return d
}
}
W.matches = function(b, c) {
return W(b, null, null, c)
};
W.matchesSelector = function(b, c) {
return 0 < W(c, null, null, [b]).length
};
Kb = W.getText = function(b) {
var c, d = "",
g = 0;
if (c = b.nodeType)
if (1 === c || 9 === c || 11 === c) {
if ("string" == typeof b.textContent) return b.textContent;
for (b = b.firstChild; b; b = b.nextSibling) d += Kb(b)
} else {
if (3 === c || 4 === c) return b.nodeValue
}
else
for (; c = b[g]; g++) d += Kb(c);
return d
};
Fb = W.isXML = function(b) {
return (b = b && (b.ownerDocument || b).documentElement) ? "HTML" !== b.nodeName : !1
};
nc = W.contains = ja.contains ? function(b, c) {
var d = 9 === b.nodeType ? b.documentElement : b,
g = c && c.parentNode;
return b === g || !(!g || !(1 === g.nodeType && d.contains && d.contains(g)))
} : ja.compareDocumentPosition ? function(b, c) {
return c && !!(b.compareDocumentPosition(c) & 16)
} : function(b, c) {
for (; c = c.parentNode;)
if (c === b) return !0;
return !1
};
W.attr = function(b, c) {
var d, g = Fb(b);
return g || (c = c.toLowerCase()), (d = da.attrHandle[c]) ? d(b) : g || bd ? b.getAttribute(c) : (d = b.getAttributeNode(c), d ? "boolean" == typeof b[c] ? b[c] ? c : null : d.specified ? d.value : null : null)
};
da = W.selectors = {
cacheLength: 50,
createPseudo: oa,
match: Hb,
attrHandle: ad ? {} : {
href: function(b) {
return b.getAttribute("href", 2)
},
type: function(b) {
return b.getAttribute("type")
}
},
find: {
ID: ac ? function(b, c, d) {
if ("undefined" !== typeof c.getElementById && !d) return (b = c.getElementById(b)) && b.parentNode ? [b] : []
} : function(b, c, d) {
if ("undefined" !== typeof c.getElementById && !d) return (c = c.getElementById(b)) ? c.id === b || "undefined" !== typeof c.getAttributeNode && c.getAttributeNode("id").value === b ? [c] : void 0 : []
},
TAG: $c ? function(b, c) {
if ("undefined" !== typeof c.getElementsByTagName) return c.getElementsByTagName(b)
} : function(b, c) {
var d = c.getElementsByTagName(b);
if ("*" === b) {
for (var g, l = [], e = 0; g = d[e]; e++) 1 === g.nodeType && l.push(g);
return l
}
return d
},
NAME: cd && function(b, c) {
if ("undefined" !== typeof c.getElementsByName) return c.getElementsByName(name)
},
CLASS: oc && function(b, c, d) {
if ("undefined" !== typeof c.getElementsByClassName && !d) return c.getElementsByClassName(b)
}
},
relative: {
">": {
dir: "parentNode",
first: !0
},
" ": {
dir: "parentNode"
},
"+": {
dir: "previousSibling",
first: !0
},
"~": {
dir: "previousSibling"
}
},
preFilter: {
ATTR: function(b) {
return b[1] = b[1].replace(Ha, ""), b[3] = (b[4] || b[5] || "").replace(Ha, ""), "~=" === b[2] && (b[3] = " " + b[3] + " "), b.slice(0, 4)
},
CHILD: function(b) {
return b[1] = b[1].toLowerCase(), "nth" === b[1] ? (b[2] || W.error(b[0]), b[3] = +(b[3] ? b[4] + (b[5] || 1) : 2 * ("even" === b[2] || "odd" === b[2])), b[4] = +(b[6] + b[7] || "odd" === b[2])) : b[2] && W.error(b[0]), b
},
PSEUDO: function(b) {
var c, d;
if (Hb.CHILD.test(b[0])) return null;
if (b[3]) b[2] = b[3];
else if (c = b[4]) Xc.test(c) && (d = ya(c, !0)) && (d = c.indexOf(")", c.length - d) - c.length) && (c = c.slice(0, d), b[0] = b[0].slice(0, d)), b[2] = c;
return b.slice(0, 3)
}
},
filter: {
ID: ac ? function(b) {
return b = b.replace(Ha, ""),
function(c) {
return c.getAttribute("id") === b
}
} : function(b) {
return b = b.replace(Ha, ""),
function(c) {
return (c = "undefined" !== typeof c.getAttributeNode && c.getAttributeNode("id")) && c.value === b
}
},
TAG: function(b) {
return "*" === b ? function() {
return !0
} : (b = b.replace(Ha, "").toLowerCase(), function(c) {
return c.nodeName && c.nodeName.toLowerCase() === b
})
},
CLASS: function(b) {
var c = uc[fa][b];
return c || (c = uc(b, RegExp("(^|[\\x20\\t\\r\\n\\f])" + b + "([\\x20\\t\\r\\n\\f]|$)"))),
function(b) {
return c.test(b.className || "undefined" !== typeof b.getAttribute && b.getAttribute("class") || "")
}
},
ATTR: function(b, c, d) {
return function(g) {
g = W.attr(g, b);
return null == g ? "!=" === c : c ? (g += "", "=" === c ? g === d : "!=" === c ? g !== d : "^=" === c ? d && 0 === g.indexOf(d) : "*=" === c ? d && -1 < g.indexOf(d) : "$=" === c ? d && g.substr(g.length - d.length) === d : "~=" === c ? -1 < (" " + g + " ").indexOf(d) : "|=" === c ? g === d || g.substr(0, d.length + 1) === d + "-" : !1) : !0
}
},
CHILD: function(b, c, d, g) {
return "nth" === b ? function(b) {
var c, l;
c = b.parentNode;
if (1 === d && 0 === g) return !0;
if (c) {
l = 0;
for (c = c.firstChild; c && !(1 === c.nodeType && (l++, b === c)); c = c.nextSibling);
}
return l -= g, l === d || 0 === l % d && 0 <= l / d
} : function(c) {
var d = c;
switch (b) {
case "only":
case "first":
for (; d = d.previousSibling;)
if (1 === d.nodeType) return !1;
if ("first" === b) return !0;
d = c;
case "last":
for (; d = d.nextSibling;)
if (1 === d.nodeType) return !1;
return !0
}
}
},
PSEUDO: function(b, c) {
var d, g = da.pseudos[b] || da.setFilters[b.toLowerCase()] || W.error("unsupported pseudo: " + b);
return g[fa] ? g(c) : 1 < g.length ? (d = [b, b, "", c], da.setFilters.hasOwnProperty(b.toLowerCase()) ? oa(function(b, d) {
for (var l, e = g(b, c), s = e.length; s--;) l = rc.call(b, e[s]), b[l] = !(d[l] = e[s])
}) : function(b) {
return g(b, 0, d)
}) : g
}
},
pseudos: {
not: oa(function(b) {
var c = [],
d = [],
g = $b(b.replace(Gb, "$1"));
return g[fa] ? oa(function(b, c, d, l) {
l = g(b, null, l, []);
for (var e = b.length; e--;)
if (d = l[e]) b[e] = !(c[e] = d)
}) : function(b, l, e) {
return c[0] = b, g(c, null, e, d), !d.pop()
}
}),
has: oa(function(b) {
return function(c) {
return 0 < W(b, c).length
}
}),
contains: oa(function(b) {
return function(c) {
return -1 < (c.textContent || c.innerText || Kb(c)).indexOf(b)
}
}),
enabled: function(b) {
return !1 === b.disabled
},
disabled: function(b) {
return !0 === b.disabled
},
checked: function(b) {
var c = b.nodeName.toLowerCase();
return "input" === c && !!b.checked || "option" === c && !!b.selected
},
selected: function(b) {
return b.parentNode && b.parentNode.selectedIndex, !0 === b.selected
},
parent: function(b) {
return !da.pseudos.empty(b)
},
empty: function(b) {
var c;
for (b = b.firstChild; b;) {
if ("@" < b.nodeName || 3 === (c = b.nodeType) || 4 === c) return !1;
b = b.nextSibling
}
return !0
},
header: function(b) {
return Yc.test(b.nodeName)
},
text: function(b) {
var c, d;
return "input" === b.nodeName.toLowerCase() && "text" === (c = b.type) && (null == (d = b.getAttribute("type")) || d.toLowerCase() === c)
},
radio: va("radio"),
checkbox: va("checkbox"),
file: va("file"),
password: va("password"),
image: va("image"),
submit: Za("submit"),
reset: Za("reset"),
button: function(b) {
var c = b.nodeName.toLowerCase();
return "input" === c && "button" === b.type || "button" === c
},
input: function(b) {
return Zc.test(b.nodeName)
},
focus: function(b) {
var c = b.ownerDocument;
return b === c.activeElement && (!c.hasFocus || c.hasFocus()) && (!!b.type || !!b.href)
},
active: function(b) {
return b === b.ownerDocument.activeElement
},
first: pa(function() {
return [0]
}),
last: pa(function(b, c) {
return [c - 1]
}),
eq: pa(function(b, c, d) {
return [0 > d ? d + c : d]
}),
even: pa(function(b, c) {
for (var d = 0; d < c; d += 2) b.push(d);
return b
}),
odd: pa(function(b, c) {
for (var d = 1; d < c; d += 2) b.push(d);
return b
}),
lt: pa(function(b, c, d) {
for (c = 0 > d ? d + c : d; 0 <= --c;) b.push(c);
return b
}),
gt: pa(function(b, c, d) {
for (d = 0 > d ? d + c : d; ++d < c;) b.push(d);
return b
})
}
};
bc = ja.compareDocumentPosition ? function(b, c) {
return b === c ? (ub = !0, 0) : (!b.compareDocumentPosition || !c.compareDocumentPosition ? b.compareDocumentPosition : b.compareDocumentPosition(c) & 4) ? -1 : 1
} : function(b, c) {
if (b === c) return ub = !0, 0;
if (b.sourceIndex && c.sourceIndex) return b.sourceIndex - c.sourceIndex;
var d, g, l = [],
e = [];
d = b.parentNode;
g = c.parentNode;
var s = d;
if (d === g) return xa(b, c);
if (!d) return -1;
if (!g) return 1;
for (; s;) l.unshift(s), s = s.parentNode;
for (s = g; s;) e.unshift(s), s = s.parentNode;
d = l.length;
g = e.length;
for (s = 0; s < d && s < g; s++)
if (l[s] !== e[s]) return xa(l[s], e[s]);
return s === d ? xa(b, e[s], -1) : xa(l[s], c, 1)
};
[0, 0].sort(bc);
tc = !ub;
W.uniqueSort = function(b) {
var c, d = 1;
ub = tc;
b.sort(bc);
if (ub)
for (; c = b[d]; d++) c === b[d - 1] && b.splice(d--, 1);
return b
};
W.error = function(b) {
throw Error("Syntax error, unrecognized expression: " + b);
};
$b = W.compile = function(b, c) {
var d, g = [],
l = [],
e = vc[fa][b];
if (!e) {
c || (c = ya(b));
for (d = c.length; d--;) e = Yb(c[d]), e[fa] ? g.push(e) : l.push(e);
var s = 0 < g.length,
m = 0 < l.length,
f = function(b, c, d, e, p) {
var r, j, n = [],
F = 0,
v = "0",
D = b && [],
ba = null != p,
aa = Jb,
y = b || m && da.find.TAG("*", p && c.parentNode || c),
O = tb += null == aa ? 1 : Math.E;
for (ba && (Jb = c !== na && c, Ub = f.el); null != (p = y[v]); v++) {
if (m && p) {
for (r = 0; j = l[r]; r++)
if (j(p, c, d)) {
e.push(p);
break
}
ba && (tb = O, Ub = ++f.el)
}
s && ((p = !j && p) && F--, b && D.push(p))
}
F += v;
if (s && v !== F) {
for (r = 0; j = g[r]; r++) j(D, n, c, d);
if (b) {
if (0 < F)
for (; v--;) !D[v] && !n[v] && (n[v] = Wc.call(e));
n = Ib(n)
}
Xa.apply(e, n);
ba && !b && 0 < n.length && 1 < F + g.length && W.uniqueSort(e)
}
return ba && (tb = O, Jb = aa), D
};
d = (f.el = 0, s ? oa(f) : f);
e = vc(b, d)
}
return e
};
if (na.querySelectorAll) {
var xc, dd = Tb,
ed = /'|\\/g,
fd = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
ta = [":focus"],
Lb = [":active", ":focus"],
Mb = ja.matchesSelector || ja.mozMatchesSelector || ja.webkitMatchesSelector || ja.oMatchesSelector || ja.msMatchesSelector;
za(function(b) {
b.innerHTML = "<select><option selected=''></option></select>";
b.querySelectorAll("[selected]").length || ta.push("\\[[\\x20\\t\\r\\n\\f]*(?:checked|disabled|ismap|multiple|readonly|selected|value)");
b.querySelectorAll(":checked").length || ta.push(":checked")
});
za(function(b) {
b.innerHTML = "<p test=''></p>";
b.querySelectorAll("[test^='']").length && ta.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:\"\"|'')");
b.innerHTML = "<input type='hidden'/>";
b.querySelectorAll(":enabled").length || ta.push(":enabled", ":disabled")
});
ta = RegExp(ta.join("|"));
Tb = function(b, c, d, g, l) {
if (!g && !l && (!ta || !ta.test(b))) {
var e, s, m = !0,
f = fa;
s = c;
e = 9 === c.nodeType && b;
if (1 === c.nodeType && "object" !== c.nodeName.toLowerCase()) {
e = ya(b);
(m = c.getAttribute("id")) ? f = m.replace(ed, "\\$&"): c.setAttribute("id", f);
f = "[id='" + f + "'] ";
for (s = e.length; s--;) e[s] = f + e[s].join("");
s = Zb.test(b) && c.parentNode || c;
e = e.join(",")
}
if (e) try {
return Xa.apply(d, Ya.call(s.querySelectorAll(e), 0)), d
} catch (p) {} finally {
m || c.removeAttribute("id")
}
}
return dd(b, c, d, g, l)
};
Mb && (za(function(b) {
xc = Mb.call(b, "div");
try {
Mb.call(b, "[test!='']:sizzle"), Lb.push("!=", dc)
} catch (c) {}
}), Lb = RegExp(Lb.join("|")), W.matchesSelector = function(b, c) {
c = c.replace(fd, "='$1']");
if (!Fb(b) && !Lb.test(c) && (!ta || !ta.test(c))) try {
var d = Mb.call(b, c);
if (d || xc || b.document && 11 !== b.document.nodeType) return d
} catch (g) {}
return 0 < W(c, null, null, [b]).length
})
}
da.pseudos.nth = da.pseudos.eq;
da.filters = sc.prototype = da.pseudos;
da.setFilters = new sc;
W.attr = m.attr;
m.find = W;
m.expr = W.selectors;
m.expr[":"] = m.expr.pseudos;
m.unique = W.uniqueSort;
m.text = W.getText;
m.isXMLDoc = W.isXML;
m.contains = W.contains;
var gd = /Until$/,
hd = /^(?:parents|prev(?:Until|All))/,
Oc = /^.[^:#\[\.,]*$/,
yc = m.expr.match.needsContext,
id = {
children: !0,
contents: !0,
next: !0,
prev: !0
};
m.fn.extend({
find: function(b) {
var c, d, g, l, e, s, f = this;
if ("string" != typeof b) return m(b).filter(function() {
c = 0;
for (d = f.length; c < d; c++)
if (m.contains(f[c], this)) return !0
});
s = this.pushStack("", "find", b);
c = 0;
for (d = this.length; c < d; c++)
if (g = s.length, m.find(b, this[c], s), 0 < c)
for (l = g; l < s.length; l++)
for (e = 0; e < g; e++)
if (s[e] === s[l]) {
s.splice(l--, 1);
break
}
return s
},
has: function(b) {
var c, d = m(b, this),
g = d.length;
return this.filter(function() {
for (c = 0; c < g; c++)
if (m.contains(this, d[c])) return !0
})
},
not: function(b) {
return this.pushStack(g(this, b, !1), "not", b)
},
filter: function(b) {
return this.pushStack(g(this, b, !0), "filter", b)
},
is: function(b) {
return !!b && ("string" == typeof b ? yc.test(b) ? 0 <= m(b, this.context).index(this[0]) : 0 < m.filter(b, this).length : 0 < this.filter(b).length)
},
closest: function(b, c) {
for (var d, g = 0, l = this.length, e = [], s = yc.test(b) || "string" != typeof b ? m(b, c || this.context) : 0; g < l; g++)
for (d = this[g]; d && d.ownerDocument && d !== c && 11 !== d.nodeType;) {
if (s ? -1 < s.index(d) : m.find.matchesSelector(d, b)) {
e.push(d);
break
}
d = d.parentNode
}
return e = 1 < e.length ? m.unique(e) : e, this.pushStack(e, "closest", b)
},
index: function(b) {
return b ? "string" == typeof b ? m.inArray(this[0], m(b)) : m.inArray(b.jquery ? b[0] : b, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1
},
add: function(b, c) {
var d = "string" == typeof b ? m(b, c) : m.makeArray(b && b.nodeType ? [b] : b),
g = m.merge(this.get(), d);
return this.pushStack(q(d[0]) || q(g[0]) ? g : m.unique(g))
},
addBack: function(b) {
return this.add(null == b ? this.prevObject : this.prevObject.filter(b))
}
});
m.fn.andSelf = m.fn.addBack;
m.each({
parent: function(b) {
return (b = b.parentNode) && 11 !== b.nodeType ? b : null
},
parents: function(b) {
return m.dir(b, "parentNode")
},
parentsUntil: function(b, c, d) {
return m.dir(b, "parentNode", d)
},
next: function(b) {
return n(b, "nextSibling")
},
prev: function(b) {
return n(b, "previousSibling")
},
nextAll: function(b) {
return m.dir(b, "nextSibling")
},
prevAll: function(b) {
return m.dir(b, "previousSibling")
},
nextUntil: function(b, c, d) {
return m.dir(b, "nextSibling", d)
},
prevUntil: function(b, c, d) {
return m.dir(b, "previousSibling", d)
},
siblings: function(b) {
return m.sibling((b.parentNode || {}).firstChild, b)
},
children: function(b) {
return m.sibling(b.firstChild)
},
contents: function(b) {
return m.nodeName(b, "iframe") ? b.contentDocument || b.contentWindow.document : m.merge([], b.childNodes)
}
}, function(b, c) {
m.fn[b] = function(d, g) {
var l = m.map(this, c, d);
return gd.test(b) || (g = d), g && "string" == typeof g && (l = m.filter(g, l)), l = 1 < this.length && !id[b] ? m.unique(l) : l, 1 < this.length && hd.test(b) && (l = l.reverse()), this.pushStack(l, b, F.call(arguments).join(","))
}
});
m.extend({
filter: function(b, c, d) {
return d && (b = ":not(" + b + ")"), 1 === c.length ? m.find.matchesSelector(c[0], b) ? [c[0]] : [] : m.find.matches(b, c)
},
dir: function(b, d, g) {
var l = [];
for (b = b[d]; b && 9 !== b.nodeType && (g === c || 1 !== b.nodeType || !m(b).is(g));) 1 === b.nodeType && l.push(b), b = b[d];
return l
},
sibling: function(b, c) {
for (var d = []; b; b = b.nextSibling) 1 === b.nodeType && b !== c && d.push(b);
return d
}
});
var kc = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
jd = / jQuery\d+="(?:null|\d+)"/g,
ec = /^\s+/,
zc = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
Ac = /<([\w:]+)/,
kd = /<tbody/i,
ld = /<|&#?\w+;/,
md = /<(?:script|style|link)/i,
nd = /<(?:script|object|embed|option|style)/i,
fc = RegExp("<(?:" + kc + ")[\\s/>]", "i"),
lc = /^(?:checkbox|radio)$/,
Bc = /checked\s*(?:[^=]|=\s*.checked.)/i,
od = /\/(java|ecma)script/i,
pd = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
ia = {
option: [1, "<select multiple='multiple'>", "</select>"],
legend: [1, "<fieldset>", "</fieldset>"],
thead: [1, "<table>", "</table>"],
tr: [2, "<table><tbody>", "</tbody></table>"],
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
area: [1, "<map>", "</map>"],
_default: [0, "", ""]
},
Cc = y(J),
gc = Cc.appendChild(J.createElement("div"));
ia.optgroup = ia.option;
ia.tbody = ia.tfoot = ia.colgroup = ia.caption = ia.thead;
ia.th = ia.td;
m.support.htmlSerialize || (ia._default = [1, "X<div>", "</div>"]);
m.fn.extend({
text: function(b) {
return m.access(this, function(b) {
return b === c ? m.text(this) : this.empty().append((this[0] && this[0].ownerDocument || J).createTextNode(b))
}, null, b, arguments.length)
},
wrapAll: function(b) {
if (m.isFunction(b)) return this.each(function(c) {
m(this).wrapAll(b.call(this, c))
});
if (this[0]) {
var c = m(b, this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode && c.insertBefore(this[0]);
c.map(function() {
for (var b = this; b.firstChild && 1 === b.firstChild.nodeType;) b = b.firstChild;
return b
}).append(this)
}
return this
},
wrapInner: function(b) {
return m.isFunction(b) ? this.each(function(c) {
m(this).wrapInner(b.call(this, c))
}) : this.each(function() {
var c = m(this),
d = c.contents();
d.length ? d.wrapAll(b) : c.append(b)
})
},
wrap: function(b) {
var c = m.isFunction(b);
return this.each(function(d) {
m(this).wrapAll(c ? b.call(this, d) : b)
})
},
unwrap: function() {
return this.parent().each(function() {
m.nodeName(this, "body") || m(this).replaceWith(this.childNodes)
}).end()
},
append: function() {
return this.domManip(arguments, !0, function(b) {
(1 === this.nodeType || 11 === this.nodeType) && this.appendChild(b)
})
},
prepend: function() {
return this.domManip(arguments, !0, function(b) {
(1 === this.nodeType || 11 === this.nodeType) && this.insertBefore(b, this.firstChild)
})
},
before: function() {
if (!q(this[0])) return this.domManip(arguments, !1, function(b) {
this.parentNode.insertBefore(b, this)
});
if (arguments.length) {
var b = m.clean(arguments);
return this.pushStack(m.merge(b, this), "before", this.selector)
}
},
after: function() {
if (!q(this[0])) return this.domManip(arguments, !1, function(b) {
this.parentNode.insertBefore(b, this.nextSibling)
});
if (arguments.length) {
var b = m.clean(arguments);
return this.pushStack(m.merge(this, b), "after", this.selector)
}
},
remove: function(b, c) {
for (var d, g = 0; null != (d = this[g]); g++)
if (!b || m.filter(b, [d]).length) !c && 1 === d.nodeType && (m.cleanData(d.getElementsByTagName("*")), m.cleanData([d])), d.parentNode && d.parentNode.removeChild(d);
return this
},
empty: function() {
for (var b, c = 0; null != (b = this[c]); c++)
for (1 === b.nodeType && m.cleanData(b.getElementsByTagName("*")); b.firstChild;) b.removeChild(b.firstChild);
return this
},
clone: function(b, c) {
return b = null == b ? !1 : b, c = null == c ? b : c, this.map(function() {
return m.clone(this, b, c)
})
},
html: function(b) {
return m.access(this, function(b) {
var d = this[0] || {},
g = 0,
l = this.length;
if (b === c) return 1 === d.nodeType ? d.innerHTML.replace(jd, "") : c;
if ("string" == typeof b && !md.test(b) && (m.support.htmlSerialize || !fc.test(b)) && (m.support.leadingWhitespace || !ec.test(b)) && !ia[(Ac.exec(b) || ["", ""])[1].toLowerCase()]) {
b = b.replace(zc, "<$1></$2>");
try {
for (; g < l; g++) d = this[g] || {}, 1 === d.nodeType && (m.cleanData(d.getElementsByTagName("*")), d.innerHTML = b);
d = 0
} catch (e) {}
}
d && this.empty().append(b)
}, null, b, arguments.length)
},
replaceWith: function(b) {
return q(this[0]) ? this.length ? this.pushStack(m(m.isFunction(b) ? b() : b), "replaceWith", b) : this : m.isFunction(b) ? this.each(function(c) {
var d = m(this),
g = d.html();
d.replaceWith(b.call(this, c, g))
}) : ("string" != typeof b && (b = m(b).detach()), this.each(function() {
var c = this.nextSibling,
d = this.parentNode;
m(this).remove();
c ? m(c).before(b) : m(d).append(b)
}))
},
detach: function(b) {
return this.remove(b, !0)
},
domManip: function(b, d, g) {
b = [].concat.apply([], b);
var l, e, s, f = 0,
p = b[0],
r = [],
j = this.length;
if (!m.support.checkClone && 1 < j && "string" == typeof p && Bc.test(p)) return this.each(function() {
m(this).domManip(b, d, g)
});
if (m.isFunction(p)) return this.each(function(l) {
var e = m(this);
b[0] = p.call(this, l, d ? e.html() : c);
e.domManip(b, d, g)
});
if (this[0]) {
l = m.buildFragment(b, this, r);
s = l.fragment;
e = s.firstChild;
1 === s.childNodes.length && (s = e);
if (e) {
d = d && m.nodeName(e, "tr");
for (l = l.cacheable || j - 1; f < j; f++) g.call(d && m.nodeName(this[f], "table") ? this[f].getElementsByTagName("tbody")[0] || this[f].appendChild(this[f].ownerDocument.createElement("tbody")) : this[f], f === l ? s : m.clone(s, !0, !0))
}
s = e = null;
r.length && m.each(r, function(b, c) {
c.src ? m.ajax ? m.ajax({
url: c.src,
type: "GET",
dataType: "script",
async: !1,
global: !1,
"throws": !0
}) : m.error("no ajax") : m.globalEval((c.text || c.textContent || c.innerHTML || "").replace(pd, ""));
c.parentNode && c.parentNode.removeChild(c)
})
}
return this
}
});
m.buildFragment = function(b, d, g) {
var l, e, s, f = b[0];
return d = d || J, d = !d.nodeType && d[0] || d, d = d.ownerDocument || d, 1 === b.length && "string" == typeof f && 512 > f.length && d === J && "<" === f.charAt(0) && !nd.test(f) && (m.support.checkClone || !Bc.test(f)) && (m.support.html5Clone || !fc.test(f)) && (e = !0, l = m.fragments[f], s = l !== c), l || (l = d.createDocumentFragment(), m.clean(b, d, l, g), e && (m.fragments[f] = s && l)), {
fragment: l,
cacheable: e
}
};
m.fragments = {};
m.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function(b, c) {
m.fn[b] = function(d) {
var g, l = 0,
e = [];
d = m(d);
var s = d.length;
g = 1 === this.length && this[0].parentNode;
if ((null == g || g && 11 === g.nodeType && 1 === g.childNodes.length) && 1 === s) return d[c](this[0]), this;
for (; l < s; l++) g = (0 < l ? this.clone(!0) : this).get(), m(d[l])[c](g), e = e.concat(g);
return this.pushStack(e, b, d.selector)
}
});
m.extend({
clone: function(b, c, d) {
var g, l, e, s;
m.support.html5Clone || m.isXMLDoc(b) || !fc.test("<" + b.nodeName + ">") ? s = b.cloneNode(!0) : (gc.innerHTML = b.outerHTML, gc.removeChild(s = gc.firstChild));
if ((!m.support.noCloneEvent || !m.support.noCloneChecked) && (1 === b.nodeType || 11 === b.nodeType) && !m.isXMLDoc(b)) {
z(b, s);
g = B(b);
l = B(s);
for (e = 0; g[e]; ++e) l[e] && z(g[e], l[e])
}
if (c && (A(b, s), d)) {
g = B(b);
l = B(s);
for (e = 0; g[e]; ++e) A(g[e], l[e])
}
return s
},
clean: function(b, c, d, g) {
var l, e, s, f, p, r, j, n = c === J && Cc,
F = [];
if (!c || "undefined" == typeof c.createDocumentFragment) c = J;
for (l = 0; null != (s = b[l]); l++)
if ("number" == typeof s && (s += ""), s) {
if ("string" == typeof s)
if (ld.test(s)) {
n = n || y(c);
r = c.createElement("div");
n.appendChild(r);
s = s.replace(zc, "<$1></$2>");
e = (Ac.exec(s) || ["", ""])[1].toLowerCase();
f = ia[e] || ia._default;
p = f[0];
for (r.innerHTML = f[1] + s + f[2]; p--;) r = r.lastChild;
if (!m.support.tbody) {
p = kd.test(s);
f = "table" === e && !p ? r.firstChild && r.firstChild.childNodes : "<table>" === f[1] && !p ? r.childNodes : [];
for (e = f.length - 1; 0 <= e; --e) m.nodeName(f[e], "tbody") && !f[e].childNodes.length && f[e].parentNode.removeChild(f[e])
}!m.support.leadingWhitespace && ec.test(s) && r.insertBefore(c.createTextNode(ec.exec(s)[0]), r.firstChild);
s = r.childNodes;
r.parentNode.removeChild(r)
} else s = c.createTextNode(s);
s.nodeType ? F.push(s) : m.merge(F, s)
}
r && (s = r = n = null);
if (!m.support.appendChecked)
for (l = 0; null != (s = F[l]); l++) m.nodeName(s, "input") ? C(s) : "undefined" != typeof s.getElementsByTagName && m.grep(s.getElementsByTagName("input"), C);
if (d) {
b = function(b) {
if (!b.type || od.test(b.type)) return g ? g.push(b.parentNode ? b.parentNode.removeChild(b) : b) : d.appendChild(b)
};
for (l = 0; null != (s = F[l]); l++)
if (!m.nodeName(s, "script") || !b(s)) d.appendChild(s), "undefined" != typeof s.getElementsByTagName && (j = m.grep(m.merge([], s.getElementsByTagName("script")), b), F.splice.apply(F, [l + 1, 0].concat(j)), l += j.length)
}
return F
},
cleanData: function(b, c) {
for (var d, g, l, e, s = 0, f = m.expando, p = m.cache, r = m.support.deleteExpando, j = m.event.special; null != (l = b[s]); s++)
if (c || m.acceptData(l))
if (d = (g = l[f]) && p[g]) {
if (d.events)
for (e in d.events) j[e] ? m.event.remove(l, e) : m.removeEvent(l, e, d.handle);
p[g] && (delete p[g], r ? delete l[f] : l.removeAttribute ? l.removeAttribute(f) : l[f] = null, m.deletedIds.push(g))
}
}
});
var Nb, Aa;
m.uaMatch = function(b) {
b = b.toLowerCase();
b = /(chrome)[ \/]([\w.]+)/.exec(b) || /(webkit)[ \/]([\w.]+)/.exec(b) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(b) || /(msie) ([\w.]+)/.exec(b) || 0 > b.indexOf("compatible") && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(b) || [];
return {
browser: b[1] || "",
version: b[2] || "0"
}
};
Nb = m.uaMatch(l.userAgent);
Aa = {};
Nb.browser && (Aa[Nb.browser] = !0, Aa.version = Nb.version);
Aa.chrome ? Aa.webkit = !0 : Aa.webkit && (Aa.safari = !0);
m.browser = Aa;
m.sub = function() {
function b(c, d) {
return new b.fn.init(c, d)
}
m.extend(!0, b, this);
b.superclass = this;
b.fn = b.prototype = this();
b.fn.constructor = b;
b.sub = this.sub;
b.fn.init = function(d, g) {
return g && g instanceof m && !(g instanceof b) && (g = b(g)), m.fn.init.call(this, d, g, c)
};
b.fn.init.prototype = b.fn;
var c = b(J);
return b
};
var ha, Ka, La, hc = /alpha\([^)]*\)/i,
qd = /opacity=([^)]*)/,
rd = /^(top|right|bottom|left)$/,
sd = /^(none|table(?!-c[ea]).+)/,
Dc = /^margin/,
Pc = RegExp("^(" + la + ")(.*)$", "i"),
xb = RegExp("^(" + la + ")(?!px)[a-z%]+$", "i"),
td = RegExp("^([-+])=(" + la + ")", "i"),
Qb = {},
ud = {
position: "absolute",
visibility: "hidden",
display: "block"
},
Ec = {
letterSpacing: 0,
fontWeight: 400
},
Ba = ["Top", "Right", "Bottom", "Left"],
mc = ["Webkit", "O", "Moz", "ms"],
vd = m.fn.toggle;
m.fn.extend({
css: function(b, d) {
return m.access(this, function(b, d, g) {
return g !== c ? m.style(b, d, g) : m.css(b, d)
}, b, d, 1 < arguments.length)
},
show: function() {
return u(this, !0)
},
hide: function() {
return u(this)
},
toggle: function(b, c) {
var d = "boolean" == typeof b;
return m.isFunction(b) && m.isFunction(c) ? vd.apply(this, arguments) : this.each(function() {
(d ? b : I(this)) ? m(this).show(): m(this).hide()
})
}
});
m.extend({
cssHooks: {
opacity: {
get: function(b, c) {
if (c) {
var d = ha(b, "opacity");
return "" === d ? "1" : d
}
}
}
},
cssNumber: {
fillOpacity: !0,
fontWeight: !0,
lineHeight: !0,
opacity: !0,
orphans: !0,
widows: !0,
zIndex: !0,
zoom: !0
},
cssProps: {
"float": m.support.cssFloat ? "cssFloat" : "styleFloat"
},
style: function(b, d, g, l) {
if (b && !(3 === b.nodeType || 8 === b.nodeType || !b.style)) {
var e, s, f, p = m.camelCase(d),
r = b.style;
d = m.cssProps[p] || (m.cssProps[p] = G(r, p));
f = m.cssHooks[d] || m.cssHooks[p];
if (g === c) return f && "get" in f && (e = f.get(b, !1, l)) !== c ? e : r[d];
s = typeof g;
"string" === s && (e = td.exec(g)) && (g = (e[1] + 1) * e[2] + parseFloat(m.css(b, d)), s = "number");
if (!(null == g || "number" === s && isNaN(g)))
if ("number" === s && !m.cssNumber[p] && (g += "px"), !f || !("set" in f) || (g = f.set(b, g, l)) !== c) try {
r[d] = g
} catch (j) {}
}
},
css: function(b, d, g, l) {
var e, s, f, p = m.camelCase(d);
return d = m.cssProps[p] || (m.cssProps[p] = G(b.style, p)), f = m.cssHooks[d] || m.cssHooks[p], f && "get" in f && (e = f.get(b, !0, l)), e === c && (e = ha(b, d)), "normal" === e && d in Ec && (e = Ec[d]), g || l !== c ? (s = parseFloat(e), g || m.isNumeric(s) ? s || 0 : e) : e
},
swap: function(b, c, d) {
var g, l = {};
for (g in c) l[g] = b.style[g], b.style[g] = c[g];
d = d.call(b);
for (g in c) b.style[g] = l[g];
return d
}
});
b.getComputedStyle ? ha = function(c, d) {
var g, l, e, s, f = b.getComputedStyle(c, null),
p = c.style;
return f && (g = f[d], "" === g && !m.contains(c.ownerDocument, c) && (g = m.style(c, d)), xb.test(g) && Dc.test(d) && (l = p.width, e = p.minWidth, s = p.maxWidth, p.minWidth = p.maxWidth = p.width = g, g = f.width, p.width = l, p.minWidth = e, p.maxWidth = s)), g
} : J.documentElement.currentStyle && (ha = function(b, c) {
var d, g, l = b.currentStyle && b.currentStyle[c],
e = b.style;
return null == l && e && e[c] && (l = e[c]), xb.test(l) && !rd.test(c) && (d = e.left, g = b.runtimeStyle && b.runtimeStyle.left, g && (b.runtimeStyle.left = b.currentStyle.left), e.left = "fontSize" === c ? "1em" : l, l = e.pixelLeft + "px", e.left = d, g && (b.runtimeStyle.left = g)), "" === l ? "auto" : l
});
m.each(["height", "width"], function(b, c) {
m.cssHooks[c] = {
get: function(b, d, g) {
if (d) return 0 === b.offsetWidth && sd.test(ha(b, "display")) ? m.swap(b, ud, function() {
return Q(b, c, g)
}) : Q(b, c, g)
},
set: function(b, d, g) {
return L(b, d, g ? E(b, c, g, m.support.boxSizing && "border-box" === m.css(b, "boxSizing")) : 0)
}
}
});
m.support.opacity || (m.cssHooks.opacity = {
get: function(b, c) {
return qd.test((c && b.currentStyle ? b.currentStyle.filter : b.style.filter) || "") ? 0.01 * parseFloat(RegExp.$1) + "" : c ? "1" : ""
},
set: function(b, c) {
var d = b.style,
g = b.currentStyle,
l = m.isNumeric(c) ? "alpha(opacity=" + 100 * c + ")" : "",
e = g && g.filter || d.filter || "";
d.zoom = 1;
if (!(1 <= c && "" === m.trim(e.replace(hc, "")) && d.removeAttribute && (d.removeAttribute("filter"), g && !g.filter))) d.filter = hc.test(e) ? e.replace(hc, l) : e + " " + l
}
});
m(function() {
m.support.reliableMarginRight || (m.cssHooks.marginRight = {
get: function(b, c) {
return m.swap(b, {
display: "inline-block"
}, function() {
if (c) return ha(b, "marginRight")
})
}
});
!m.support.pixelPosition && m.fn.position && m.each(["top", "left"], function(b, c) {
m.cssHooks[c] = {
get: function(b, d) {
if (d) {
var g = ha(b, c);
return xb.test(g) ? m(b).position()[c] + "px" : g
}
}
}
})
});
m.expr && m.expr.filters && (m.expr.filters.hidden = function(b) {
return 0 === b.offsetWidth && 0 === b.offsetHeight || !m.support.reliableHiddenOffsets && "none" === (b.style && b.style.display || ha(b, "display"))
}, m.expr.filters.visible = function(b) {
return !m.expr.filters.hidden(b)
});
m.each({
margin: "",
padding: "",
border: "Width"
}, function(b, c) {
m.cssHooks[b + c] = {
expand: function(d) {
var g = "string" == typeof d ? d.split(" ") : [d],
l = {};
for (d = 0; 4 > d; d++) l[b + Ba[d] + c] = g[d] || g[d - 2] || g[0];
return l
}
};
Dc.test(b) || (m.cssHooks[b + c].set = L)
});
var wd = /%20/g,
Qc = /\[\]$/,
Fc = /\r?\n/g,
xd = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
yd = /^(?:select|textarea)/i;
m.fn.extend({
serialize: function() {
return m.param(this.serializeArray())
},
serializeArray: function() {
return this.map(function() {
return this.elements ? m.makeArray(this.elements) : this
}).filter(function() {
return this.name && !this.disabled && (this.checked || yd.test(this.nodeName) || xd.test(this.type))
}).map(function(b, c) {
var d = m(this).val();
return null == d ? null : m.isArray(d) ? m.map(d, function(b) {
return {
name: c.name,
value: b.replace(Fc, "\r\n")
}
}) : {
name: c.name,
value: d.replace(Fc, "\r\n")
}
}).get()
}
});
m.param = function(b, d) {
var g, l = [],
e = function(b, c) {
c = m.isFunction(c) ? c() : null == c ? "" : c;
l[l.length] = encodeURIComponent(b) + "=" + encodeURIComponent(c)
};
d === c && (d = m.ajaxSettings && m.ajaxSettings.traditional);
if (m.isArray(b) || b.jquery && !m.isPlainObject(b)) m.each(b, function() {
e(this.name, this.value)
});
else
for (g in b) R(g, b[g], d, e);
return l.join("&").replace(wd, "+")
};
var $a, Ia, zd = /#.*$/,
Ad = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
Bd = /^(?:GET|HEAD)$/,
Cd = /^\/\//,
Gc = /\?/,
Dd = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
Ed = /([?&])_=[^&]*/,
Hc = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
Ic = m.fn.load,
Rb = {},
Jc = {},
Kc = ["*/"] + ["*"];
try {
Ia = V.href
} catch (Md) {
Ia = J.createElement("a"), Ia.href = "", Ia = Ia.href
}
$a = Hc.exec(Ia.toLowerCase()) || [];
m.fn.load = function(b, d, g) {
if ("string" != typeof b && Ic) return Ic.apply(this, arguments);
if (!this.length) return this;
var l, e, s, f = this,
p = b.indexOf(" ");
return 0 <= p && (l = b.slice(p, b.length), b = b.slice(0, p)), m.isFunction(d) ? (g = d, d = c) : d && "object" == typeof d && (e = "POST"), m.ajax({
url: b,
type: e,
dataType: "html",
data: d,
complete: function(b, c) {
g && f.each(g, s || [b.responseText, c, b])
}
}).done(function(b) {
s = arguments;
f.html(l ? m("<div>").append(b.replace(Dd, "")).find(l) : b)
}), this
};
m.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(b, c) {
m.fn[c] = function(b) {
return this.on(c, b)
}
});
m.each(["get", "post"], function(b, d) {
m[d] = function(b, g, l, e) {
return m.isFunction(g) && (e = e || l, l = g, g = c), m.ajax({
type: d,
url: b,
data: g,
success: l,
dataType: e
})
}
});
m.extend({
getScript: function(b, d) {
return m.get(b, c, d, "script")
},
getJSON: function(b, c, d) {
return m.get(b, c, d, "json")
},
ajaxSetup: function(b, c) {
return c ? P(b, m.ajaxSettings) : (c = b, b = m.ajaxSettings), P(b, c), b
},
ajaxSettings: {
url: Ia,
isLocal: /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test($a[1]),
global: !0,
type: "GET",
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
processData: !0,
async: !0,
accepts: {
xml: "application/xml, text/xml",
html: "text/html",
text: "text/plain",
json: "application/json, text/javascript",
"*": Kc
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText"
},
converters: {
"* text": b.String,
"text html": !0,
"text json": m.parseJSON,
"text xml": m.parseXML
},
flatOptions: {
context: !0,
url: !0
}
},
ajaxPrefilter: K(Rb),
ajaxTransport: K(Jc),
ajax: function(b, d) {
function g(b, d, s, r) {
var n, u, H, N, V, J = d;
if (2 !== A) {
A = 2;
p && clearTimeout(p);
f = c;
e = r || "";
T.readyState = 0 < b ? 4 : 0;
if (s) {
N = F;
r = T;
var z, B, q, ka, C = N.contents,
E = N.dataTypes,
la = N.responseFields;
for (B in la) B in s && (r[la[B]] = s[B]);
for (;
"*" === E[0];) E.shift(), z === c && (z = N.mimeType || r.getResponseHeader("content-type"));
if (z)
for (B in C)
if (C[B] && C[B].test(z)) {
E.unshift(B);
break
}
if (E[0] in s) q = E[0];
else {
for (B in s) {
if (!E[0] || N.converters[B + " " + E[0]]) {
q = B;
break
}
ka || (ka = B)
}
q = q || ka
}
N = s = q ? (q !== E[0] && E.unshift(q), s[q]) : void 0
}
if (200 <= b && 300 > b || 304 === b)
if (F.ifModified && (V = T.getResponseHeader("Last-Modified"), V && (m.lastModified[l] = V), V = T.getResponseHeader("Etag"), V && (m.etag[l] = V)), 304 === b) J = "notmodified", n = !0;
else {
var ca;
a: {
n = F;
u = N;
var L, J = n.dataTypes.slice();
s = J[0];
z = {};
B = 0;
n.dataFilter && (u = n.dataFilter(u, n.dataType));
if (J[1])
for (ca in n.converters) z[ca.toLowerCase()] = n.converters[ca];
for (; H = J[++B];)
if ("*" !== H) {
if ("*" !== s && s !== H) {
ca = z[s + " " + H] || z["* " + H];
if (!ca)
for (L in z)
if (V = L.split(" "), V[1] === H && (ca = z[s + " " + V[0]] || z["* " + V[0]])) {
!0 === ca ? ca = z[L] : !0 !== z[L] && (H = V[0], J.splice(B--, 0, H));
break
}
if (!0 !== ca)
if (ca && n["throws"]) u = ca(u);
else try {
u = ca(u)
} catch (Ma) {
ca = {
state: "parsererror",
error: ca ? Ma : "No conversion from " + s + " to " + H
};
break a
}
}
s = H
}
ca = {
state: "success",
data: u
}
}
n = ca;
J = n.state;
u = n.data;
H = n.error;
n = !H
}
else if (H = J, !J || b) J = "error", 0 > b && (b = 0);
T.status = b;
T.statusText = (d || J) + "";
n ? aa.resolveWith(v, [u, J, T]) : aa.rejectWith(v, [T, J, H]);
T.statusCode(O);
O = c;
j && D.trigger("ajax" + (n ? "Success" : "Error"), [T, F, n ? u : H]);
y.fireWith(v, [T, J]);
j && (D.trigger("ajaxComplete", [T, F]), --m.active || m.event.trigger("ajaxStop"))
}
}
"object" == typeof b && (d = b, b = c);
d = d || {};
var l, e, s, f, p, r, j, n, F = m.ajaxSetup({}, d),
v = F.context || F,
D = v !== F && (v.nodeType || v instanceof m) ? m(v) : m.event,
aa = m.Deferred(),
y = m.Callbacks("once memory"),
O = F.statusCode || {},
u = {},
H = {},
A = 0,
N = "canceled",
T = {
readyState: 0,
setRequestHeader: function(b, c) {
if (!A) {
var d = b.toLowerCase();
b = H[d] = H[d] || b;
u[b] = c
}
return this
},
getAllResponseHeaders: function() {
return 2 === A ? e : null
},
getResponseHeader: function(b) {
var d;
if (2 === A) {
if (!s)
for (s = {}; d = Ad.exec(e);) s[d[1].toLowerCase()] = d[2];
d = s[b.toLowerCase()]
}
return d === c ? null : d
},
overrideMimeType: function(b) {
return A || (F.mimeType = b), this
},
abort: function(b) {
return b = b || N, f && f.abort(b), g(0, b), this
}
};
aa.promise(T);
T.success = T.done;
T.error = T.fail;
T.complete = y.add;
T.statusCode = function(b) {
if (b) {
var c;
if (2 > A)
for (c in b) O[c] = [O[c], b[c]];
else c = b[T.status], T.always(c)
}
return this
};
F.url = ((b || F.url) + "").replace(zd, "").replace(Cd, $a[1] + "//");
F.dataTypes = m.trim(F.dataType || "*").toLowerCase().split(qa);
null == F.crossDomain && (r = Hc.exec(F.url.toLowerCase()) || !1, F.crossDomain = r && r.join(":") + (r[3] ? "" : "http:" === r[1] ? 80 : 443) !== $a.join(":") + ($a[3] ? "" : "http:" === $a[1] ? 80 : 443));
F.data && F.processData && "string" != typeof F.data && (F.data = m.param(F.data, F.traditional));
X(Rb, F, d, T);
if (2 === A) return T;
j = F.global;
F.type = F.type.toUpperCase();
F.hasContent = !Bd.test(F.type);
j && 0 === m.active++ && m.event.trigger("ajaxStart");
if (!F.hasContent && (F.data && (F.url += (Gc.test(F.url) ? "&" : "?") + F.data, delete F.data), l = F.url, !1 === F.cache)) {
r = m.now();
var V = F.url.replace(Ed, "$1_=" + r);
F.url = V + (V === F.url ? (Gc.test(F.url) ? "&" : "?") + "_=" + r : "")
}(F.data && F.hasContent && !1 !== F.contentType || d.contentType) && T.setRequestHeader("Content-Type", F.contentType);
F.ifModified && (l = l || F.url, m.lastModified[l] && T.setRequestHeader("If-Modified-Since", m.lastModified[l]), m.etag[l] && T.setRequestHeader("If-None-Match", m.etag[l]));
T.setRequestHeader("Accept", F.dataTypes[0] && F.accepts[F.dataTypes[0]] ? F.accepts[F.dataTypes[0]] + ("*" !== F.dataTypes[0] ? ", " + Kc + "; q=0.01" : "") : F.accepts["*"]);
for (n in F.headers) T.setRequestHeader(n, F.headers[n]);
if (!F.beforeSend || !1 !== F.beforeSend.call(v, T, F) && 2 !== A) {
N = "abort";
for (n in {
success: 1,
error: 1,
complete: 1
}) T[n](F[n]);
if (f = X(Jc, F, d, T)) {
T.readyState = 1;
j && D.trigger("ajaxSend", [T, F]);
F.async && 0 < F.timeout && (p = setTimeout(function() {
T.abort("timeout")
}, F.timeout));
try {
A = 1, f.send(u, g)
} catch (J) {
if (2 > A) g(-1, J);
else throw J;
}
} else g(-1, "No Transport");
return T
}
return T.abort()
},
active: 0,
lastModified: {},
etag: {}
});
var Lc = [],
Fd = /\?/,
Ob = /(=)\?(?=&|$)|\?\?/,
Gd = m.now();
m.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var b = Lc.pop() || m.expando + "_" + Gd++;
return this[b] = !0, b
}
});
m.ajaxPrefilter("json jsonp", function(d, g, l) {
var e, s, f, p = d.data,
r = d.url,
j = !1 !== d.jsonp,
n = j && Ob.test(r),
F = j && !n && "string" == typeof p && !(d.contentType || "").indexOf("application/x-www-form-urlencoded") && Ob.test(p);
if ("jsonp" === d.dataTypes[0] || n || F) return e = d.jsonpCallback = m.isFunction(d.jsonpCallback) ? d.jsonpCallback() : d.jsonpCallback, s = b[e], n ? d.url = r.replace(Ob, "$1" + e) : F ? d.data = p.replace(Ob, "$1" + e) : j && (d.url += (Fd.test(r) ? "&" : "?") + d.jsonp + "=" + e), d.converters["script json"] = function() {
return f || m.error(e + " was not called"), f[0]
}, d.dataTypes[0] = "json", b[e] = function() {
f = arguments
}, l.always(function() {
b[e] = s;
d[e] && (d.jsonpCallback = g.jsonpCallback, Lc.push(e));
f && m.isFunction(s) && s(f[0]);
f = s = c
}), "script"
});
m.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /javascript|ecmascript/
},
converters: {
"text script": function(b) {
return m.globalEval(b), b
}
}
});
m.ajaxPrefilter("script", function(b) {
b.cache === c && (b.cache = !1);
b.crossDomain && (b.type = "GET", b.global = !1)
});
m.ajaxTransport("script", function(b) {
if (b.crossDomain) {
var d, g = J.head || J.getElementsByTagName("head")[0] || J.documentElement;
return {
send: function(l, e) {
d = J.createElement("script");
d.async = "async";
b.scriptCharset && (d.charset = b.scriptCharset);
d.src = b.url;
d.onload = d.onreadystatechange = function(b, l) {
if (l || !d.readyState || /loaded|complete/.test(d.readyState)) d.onload = d.onreadystatechange = null, g && d.parentNode && g.removeChild(d), d = c, l || e(200, "success")
};
g.insertBefore(d, g.firstChild)
},
abort: function() {
d && d.onload(0, 1)
}
}
}
});
var ab, ic = b.ActiveXObject ? function() {
for (var b in ab) ab[b](0, 1)
} : !1,
Hd = 0;
m.ajaxSettings.xhr = b.ActiveXObject ? function() {
var c;
if (!(c = !this.isLocal && S())) a: {
try {
c = new b.ActiveXObject("Microsoft.XMLHTTP");
break a
} catch (d) {}
c = void 0
}
return c
} : S;
var jc = m.ajaxSettings.xhr();
m.extend(m.support, {
ajax: !!jc,
cors: !!jc && "withCredentials" in jc
});
m.support.ajax && m.ajaxTransport(function(d) {
if (!d.crossDomain || m.support.cors) {
var g;
return {
send: function(l, e) {
var s, f, p = d.xhr();
d.username ? p.open(d.type, d.url, d.async, d.username, d.password) : p.open(d.type, d.url, d.async);
if (d.xhrFields)
for (f in d.xhrFields) p[f] = d.xhrFields[f];
d.mimeType && p.overrideMimeType && p.overrideMimeType(d.mimeType);
!d.crossDomain && !l["X-Requested-With"] && (l["X-Requested-With"] = "XMLHttpRequest");
try {
for (f in l) p.setRequestHeader(f, l[f])
} catch (r) {}
p.send(d.hasContent && d.data || null);
g = function(b, l) {
var f, r, j, n, F;
try {
if (g && (l || 4 === p.readyState))
if (g = c, s && (p.onreadystatechange = m.noop, ic && delete ab[s]), l) 4 !== p.readyState && p.abort();
else {
f = p.status;
j = p.getAllResponseHeaders();
n = {};
(F = p.responseXML) && F.documentElement && (n.xml = F);
try {
n.text = p.responseText
} catch (v) {}
try {
r = p.statusText
} catch (D) {
r = ""
}!f && d.isLocal && !d.crossDomain ? f = n.text ? 200 : 404 : 1223 === f && (f = 204)
}
} catch (aa) {
l || e(-1, aa)
}
n && e(f, r, n, j)
};
d.async ? 4 === p.readyState ? setTimeout(g, 0) : (s = ++Hd, ic && (ab || (ab = {}, m(b).unload(ic)), ab[s] = g), p.onreadystatechange = g) : g()
},
abort: function() {
g && g(0, 1)
}
}
}
});
var yb, Pb, Id = /^(?:toggle|show|hide)$/,
Jd = RegExp("^(?:([-+])=|)(" + la + ")([a-z%]*)$", "i"),
Kd = /queueHooks$/,
zb = [
function(b, c, d) {
var g, l, e, s, f, p, r = this,
j = b.style,
n = {},
F = [],
v = b.nodeType && I(b);
d.queue || (f = m._queueHooks(b, "fx"), null == f.unqueued && (f.unqueued = 0, p = f.empty.fire, f.empty.fire = function() {
f.unqueued || p()
}), f.unqueued++, r.always(function() {
r.always(function() {
f.unqueued--;
m.queue(b, "fx").length || f.empty.fire()
})
}));
1 === b.nodeType && ("height" in c || "width" in c) && (d.overflow = [j.overflow, j.overflowX, j.overflowY], "inline" === m.css(b, "display") && "none" === m.css(b, "float") && (!m.support.inlineBlockNeedsLayout || "inline" === M(b.nodeName) ? j.display = "inline-block" : j.zoom = 1));
d.overflow && (j.overflow = "hidden", m.support.shrinkWrapBlocks || r.done(function() {
j.overflow = d.overflow[0];
j.overflowX = d.overflow[1];
j.overflowY = d.overflow[2]
}));
for (g in c) l = c[g], Id.exec(l) && (delete c[g], l !== (v ? "hide" : "show") && F.push(g));
if (l = F.length) {
e = m._data(b, "fxshow") || m._data(b, "fxshow", {});
v ? m(b).show() : r.done(function() {
m(b).hide()
});
r.done(function() {
var c;
m.removeData(b, "fxshow", !0);
for (c in n) m.style(b, c, n[c])
});
for (g = 0; g < l; g++) c = F[g], s = r.createTween(c, v ? e[c] : 0), n[c] = e[c] || m.style(b, c), c in e || (e[c] = s.start, v && (s.end = s.start, s.start = "width" === c || "height" === c ? 1 : 0))
}
}
],
bb = {
"*": [
function(b, c) {
var d, g, l = this.createTween(b, c),
e = Jd.exec(c),
s = l.cur(),
f = +s || 0,
p = 1,
r = 20;
if (e) {
d = +e[2];
g = e[3] || (m.cssNumber[b] ? "" : "px");
if ("px" !== g && f) {
f = m.css(l.elem, b, !0) || d || 1;
do p = p || ".5", f /= p, m.style(l.elem, b, f + g); while (p !== (p = l.cur() / s) && 1 !== p && --r)
}
l.unit = g;
l.start = f;
l.end = e[1] ? f + (e[1] + 1) * d : d
}
return l
}
]
};
m.Animation = m.extend(U, {
tweener: function(b, c) {
m.isFunction(b) ? (c = b, b = ["*"]) : b = b.split(" ");
for (var d, g = 0, l = b.length; g < l; g++) d = b[g], bb[d] = bb[d] || [], bb[d].unshift(c)
},
prefilter: function(b, c) {
c ? zb.unshift(b) : zb.push(b)
}
});
m.Tween = p;
p.prototype = {
constructor: p,
init: function(b, c, d, g, l, e) {
this.elem = b;
this.prop = d;
this.easing = l || "swing";
this.options = c;
this.start = this.now = this.cur();
this.end = g;
this.unit = e || (m.cssNumber[d] ? "" : "px")
},
cur: function() {
var b = p.propHooks[this.prop];
return b && b.get ? b.get(this) : p.propHooks._default.get(this)
},
run: function(b) {
var c, d = p.propHooks[this.prop];
return this.options.duration ? this.pos = c = m.easing[this.easing](b, this.options.duration * b, 0, 1, this.options.duration) : this.pos = c = b, this.now = (this.end - this.start) * c + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), d && d.set ? d.set(this) : p.propHooks._default.set(this), this
}
};
p.prototype.init.prototype = p.prototype;
p.propHooks = {
_default: {
get: function(b) {
var c;
return null == b.elem[b.prop] || b.elem.style && null != b.elem.style[b.prop] ? (c = m.css(b.elem, b.prop, !1, ""), !c || "auto" === c ? 0 : c) : b.elem[b.prop]
},
set: function(b) {
m.fx.step[b.prop] ? m.fx.step[b.prop](b) : b.elem.style && (null != b.elem.style[m.cssProps[b.prop]] || m.cssHooks[b.prop]) ? m.style(b.elem, b.prop, b.now + b.unit) : b.elem[b.prop] = b.now
}
}
};
p.propHooks.scrollTop = p.propHooks.scrollLeft = {
set: function(b) {
b.elem.nodeType && b.elem.parentNode && (b.elem[b.prop] = b.now)
}
};
m.each(["toggle", "show", "hide"], function(b, c) {
var d = m.fn[c];
m.fn[c] = function(g, l, e) {
return null == g || "boolean" == typeof g || !b && m.isFunction(g) && m.isFunction(l) ? d.apply(this, arguments) : this.animate(v(c, !0), g, l, e)
}
});
m.fn.extend({
fadeTo: function(b, c, d, g) {
return this.filter(I).css("opacity", 0).show().end().animate({
opacity: c
}, b, d, g)
},
animate: function(b, c, d, g) {
var l = m.isEmptyObject(b),
e = m.speed(c, d, g);
c = function() {
var c = U(this, m.extend({}, b), e);
l && c.stop(!0)
};
return l || !1 === e.queue ? this.each(c) : this.queue(e.queue, c)
},
stop: function(b, d, g) {
var l = function(b) {
var c = b.stop;
delete b.stop;
c(g)
};
return "string" != typeof b && (g = d, d = b, b = c), d && !1 !== b && this.queue(b || "fx", []), this.each(function() {
var c = !0,
d = null != b && b + "queueHooks",
e = m.timers,
s = m._data(this);
if (d) s[d] && s[d].stop && l(s[d]);
else
for (d in s) s[d] && s[d].stop && Kd.test(d) && l(s[d]);
for (d = e.length; d--;) e[d].elem === this && (null == b || e[d].queue === b) && (e[d].anim.stop(g), c = !1, e.splice(d, 1));
(c || !g) && m.dequeue(this, b)
})
}
});
m.each({
slideDown: v("show"),
slideUp: v("hide"),
slideToggle: v("toggle"),
fadeIn: {
opacity: "show"
},
fadeOut: {
opacity: "hide"
},
fadeToggle: {
opacity: "toggle"
}
}, function(b, c) {
m.fn[b] = function(b, d, g) {
return this.animate(c, b, d, g)
}
});
m.speed = function(b, c, d) {
var g = b && "object" == typeof b ? m.extend({}, b) : {
complete: d || !d && c || m.isFunction(b) && b,
duration: b,
easing: d && c || c && !m.isFunction(c) && c
};
g.duration = m.fx.off ? 0 : "number" == typeof g.duration ? g.duration : g.duration in m.fx.speeds ? m.fx.speeds[g.duration] : m.fx.speeds._default;
if (null == g.queue || !0 === g.queue) g.queue = "fx";
return g.old = g.complete, g.complete = function() {
m.isFunction(g.old) && g.old.call(this);
g.queue && m.dequeue(this, g.queue)
}, g
};
m.easing = {
linear: function(b) {
return b
},
swing: function(b) {
return 0.5 - Math.cos(b * Math.PI) / 2
}
};
m.timers = [];
m.fx = p.prototype.init;
m.fx.tick = function() {
for (var b, c = m.timers,
d = 0; d < c.length; d++) b = c[d], !b() && c[d] === b && c.splice(d--, 1);
c.length || m.fx.stop()
};
m.fx.timer = function(b) {
b() && m.timers.push(b) && !Pb && (Pb = setInterval(m.fx.tick, m.fx.interval))
};
m.fx.interval = 13;
m.fx.stop = function() {
clearInterval(Pb);
Pb = null
};
m.fx.speeds = {
slow: 600,
fast: 200,
_default: 400
};
m.fx.step = {};
m.expr && m.expr.filters && (m.expr.filters.animated = function(b) {
return m.grep(m.timers, function(c) {
return b === c.elem
}).length
});
var Mc = /^(?:body|html)$/i;
m.fn.offset = function(b) {
if (arguments.length) return b === c ? this : this.each(function(c) {
m.offset.setOffset(this, b, c)
});
var d, g, l, e, s, f, p, r = {
top: 0,
left: 0
},
j = this[0],
n = j && j.ownerDocument;
if (n) return (g = n.body) === j ? m.offset.bodyOffset(j) : (d = n.documentElement, m.contains(d, j) ? ("undefined" != typeof j.getBoundingClientRect && (r = j.getBoundingClientRect()), l = H(n), e = d.clientTop || g.clientTop || 0, s = d.clientLeft || g.clientLeft || 0, f = l.pageYOffset || d.scrollTop, p = l.pageXOffset || d.scrollLeft, {
top: r.top + f - e,
left: r.left + p - s
}) : r)
};
m.offset = {
bodyOffset: function(b) {
var c = b.offsetTop,
d = b.offsetLeft;
return m.support.doesNotIncludeMarginInBodyOffset && (c += parseFloat(m.css(b, "marginTop")) || 0, d += parseFloat(m.css(b, "marginLeft")) || 0), {
top: c,
left: d
}
},
setOffset: function(b, c, d) {
var g = m.css(b, "position");
"static" === g && (b.style.position = "relative");
var l = m(b),
e = l.offset(),
s = m.css(b, "top"),
f = m.css(b, "left"),
p = {},
r = {},
j, n;
("absolute" === g || "fixed" === g) && -1 < m.inArray("auto", [s, f]) ? (r = l.position(), j = r.top, n = r.left) : (j = parseFloat(s) || 0, n = parseFloat(f) || 0);
m.isFunction(c) && (c = c.call(b, d, e));
null != c.top && (p.top = c.top - e.top + j);
null != c.left && (p.left = c.left - e.left + n);
"using" in c ? c.using.call(b, p) : l.css(p)
}
};
m.fn.extend({
position: function() {
if (this[0]) {
var b = this[0],
c = this.offsetParent(),
d = this.offset(),
g = Mc.test(c[0].nodeName) ? {
top: 0,
left: 0
} : c.offset();
return d.top -= parseFloat(m.css(b, "marginTop")) || 0, d.left -= parseFloat(m.css(b, "marginLeft")) || 0, g.top += parseFloat(m.css(c[0], "borderTopWidth")) || 0, g.left += parseFloat(m.css(c[0], "borderLeftWidth")) || 0, {
top: d.top - g.top,
left: d.left - g.left
}
}
},
offsetParent: function() {
return this.map(function() {
for (var b = this.offsetParent || J.body; b && !Mc.test(b.nodeName) && "static" === m.css(b, "position");) b = b.offsetParent;
return b || J.body
})
}
});
m.each({
scrollLeft: "pageXOffset",
scrollTop: "pageYOffset"
}, function(b, d) {
var g = /Y/.test(d);
m.fn[b] = function(l) {
return m.access(this, function(b, l, e) {
var s = H(b);
if (e === c) return s ? d in s ? s[d] : s.document.documentElement[l] : b[l];
s ? s.scrollTo(g ? m(s).scrollLeft() : e, g ? e : m(s).scrollTop()) : b[l] = e
}, b, l, arguments.length, null)
}
});
m.each({
Height: "height",
Width: "width"
}, function(b, d) {
m.each({
padding: "inner" +
b,
content: d,
"": "outer" + b
}, function(g, l) {
m.fn[l] = function(l, e) {
var s = arguments.length && (g || "boolean" != typeof l),
f = g || (!0 === l || !0 === e ? "margin" : "border");
return m.access(this, function(d, g, l) {
var e;
return m.isWindow(d) ? d.document.documentElement["client" + b] : 9 === d.nodeType ? (e = d.documentElement, Math.max(d.body["scroll" + b], e["scroll" + b], d.body["offset" + b], e["offset" + b], e["client" + b])) : l === c ? m.css(d, g, l, f) : m.style(d, g, l, f)
}, d, s ? l : c, s, null)
}
})
});
b.jQuery = b.$ = m;
"function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function() {
return m
})
})(window);
function getInternetExplorerVersion() {
var b = -1;
"Microsoft Internet Explorer" == navigator.appName && null != /MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent) && (b = parseFloat(RegExp.$1));
return b
}
var ie = getInternetExplorerVersion();
function getQueryVariable(b) {
for (var c = window.location.search.substring(1).split("&"), d = 0; d < c.length; d++) {
var e = c[d].split("=");
if (decodeURIComponent(e[0]) == b) return decodeURIComponent(e[1])
}
}
this.jukebox = {};
jukebox.Player = function(b, c) {
this.id = ++jukebox.__jukeboxId;
this.origin = c || null;
this.settings = {};
for (var d in this.defaults) this.settings[d] = this.defaults[d];
if ("[object Object]" === Object.prototype.toString.call(b))
for (var e in b) this.settings[e] = b[e];
"[object Function]" === Object.prototype.toString.call(jukebox.Manager) && (jukebox.Manager = new jukebox.Manager);
this.resource = this.isPlaying = null;
this.resource = "[object Object]" === Object.prototype.toString.call(jukebox.Manager) ? jukebox.Manager.getPlayableResource(this.settings.resources) : this.settings.resources[0] || null;
if (null === this.resource) throw "Your browser can't playback the given resources - or you have missed to include jukebox.Manager";
this.__init();
return this
};
jukebox.__jukeboxId = 0;
jukebox.Player.prototype = {
defaults: {
resources: [],
autoplay: !1,
spritemap: {},
flashMediaElement: "./swf/FlashMediaElement.swf",
timeout: 1E3
},
__addToManager: function() {
!0 !== this.__wasAddedToManager && (jukebox.Manager.add(this), this.__wasAddedToManager = !0)
},
__init: function() {
var b = this,
c = this.settings,
d = {},
e;
jukebox.Manager && void 0 !== jukebox.Manager.features && (d = jukebox.Manager.features);
if (!0 === d.html5audio) {
this.context = new Audio;
this.context.src = this.resource;
if (null === this.origin) {
var f = function(c) {
b.__addToManager(c)
};
this.context.addEventListener("canplaythrough", f, !0);
window.setTimeout(function() {
b.context.removeEventListener("canplaythrough", f, !0);
f("timeout")
}, c.timeout)
}
this.context.autobuffer = !0;
this.context.preload = !0;
for (e in this.HTML5API) this[e] = this.HTML5API[e];
1 < d.channels ? !0 === c.autoplay ? this.context.autoplay = !0 : void 0 !== c.spritemap[c.autoplay] && this.play(c.autoplay) : 1 === d.channels && void 0 !== c.spritemap[c.autoplay] && (this.backgroundMusic = c.spritemap[c.autoplay], this.backgroundMusic.started = Date.now ? Date.now() : +new Date, this.play(c.autoplay));
1 == d.channels && !0 !== c.canPlayBackground && (window.addEventListener("pagehide", function() {
null !== b.isPlaying && (b.pause(), b.__wasAutoPaused = !0)
}), window.addEventListener("pageshow", function() {
b.__wasAutoPaused && (b.resume(), delete b._wasAutoPaused)
}))
} else if (!0 === d.flashaudio) {
for (e in this.FLASHAPI) this[e] = this.FLASHAPI[e];
d = ["id=jukebox-flashstream-" + this.id, "autoplay=" + c.autoplay, "file=" + window.encodeURIComponent(this.resource)];
this.__initFlashContext(d);
!0 === c.autoplay ? this.play(0) : c.spritemap[c.autoplay] && this.play(c.autoplay)
} else throw "Your Browser does not support Flash Audio or HTML5 Audio.";
},
__initFlashContext: function(b) {
var c, d = this.settings.flashMediaElement,
e, f = {
flashvars: b.join("&"),
quality: "high",
bgcolor: "#000000",
wmode: "transparent",
allowscriptaccess: "always",
allowfullscreen: "true"
};
if (navigator.userAgent.match(/MSIE/)) {
c = document.createElement("div");
document.getElementsByTagName("body")[0].appendChild(c);
var j = document.createElement("object");
j.id = "jukebox-flashstream-" + this.id;
j.setAttribute("type", "application/x-shockwave-flash");
j.setAttribute("classid", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");
j.setAttribute("width", "0");
j.setAttribute("height", "0");
f.movie = d + "?x=" + (Date.now ? Date.now() : +new Date);
f.flashvars = b.join("&amp;");
for (e in f) b = document.createElement("param"), b.setAttribute("name", e), b.setAttribute("value", f[e]), j.appendChild(b);
c.outerHTML = j.outerHTML;
this.context = document.getElementById("jukebox-flashstream-" + this.id)
} else {
c = document.createElement("embed");
c.id = "jukebox-flashstream-" + this.id;
c.setAttribute("type", "application/x-shockwave-flash");
c.setAttribute("width", "100");
c.setAttribute("height", "100");
f.play = !1;
f.loop = !1;
f.src = d + "?x=" + (Date.now ? Date.now() : +new Date);
for (e in f) c.setAttribute(e, f[e]);
document.getElementsByTagName("body")[0].appendChild(c);
this.context = c
}
},
backgroundHackForiOS: function() {
if (void 0 !== this.backgroundMusic) {
var b = Date.now ? Date.now() : +new Date;
void 0 === this.backgroundMusic.started ? (this.backgroundMusic.started = b, this.setCurrentTime(this.backgroundMusic.start)) : (this.backgroundMusic.lastPointer = (b - this.backgroundMusic.started) / 1E3 % (this.backgroundMusic.end - this.backgroundMusic.start) + this.backgroundMusic.start, this.play(this.backgroundMusic.lastPointer))
}
},
play: function(b, c) {
if (null !== this.isPlaying && !0 !== c) void 0 !== jukebox.Manager && jukebox.Manager.addToQueue(b, this.id);
else {
var d = this.settings.spritemap,
e;
if (void 0 !== d[b]) e = d[b].start;
else if ("number" === typeof b) {
e = b;
for (var f in d)
if (e >= d[f].start && e <=
d[f].end) {
b = f;
break
}
}
void 0 !== e && "[object Object]" === Object.prototype.toString.call(d[b]) && (this.isPlaying = this.settings.spritemap[b], this.context.play && this.context.play(), this.wasReady = this.setCurrentTime(e))
}
},
stop: function() {
this.__lastPosition = 0;
this.isPlaying = null;
this.backgroundMusic ? this.backgroundHackForiOS() : this.context.pause();
return !0
},
pause: function() {
this.isPlaying = null;
this.__lastPosition = this.getCurrentTime();
this.context.pause();
return this.__lastPosition
},
resume: function(b) {
b = "number" === typeof b ? b : this.__lastPosition;
if (null !== b) return this.play(b), this.__lastPosition = null, !0;
this.context.play();
return !1
},
HTML5API: {
getVolume: function() {
return this.context.volume || 1
},
setVolume: function(b) {
this.context.volume = b;
return 1E-4 > Math.abs(this.context.volume - b) ? !0 : !1
},
getCurrentTime: function() {
return this.context.currentTime || 0
},
setCurrentTime: function(b) {
try {
return this.context.currentTime = b, !0
} catch (c) {
return !1
}
}
},
FLASHAPI: {
getVolume: function() {
return this.context && "function" === typeof this.context.getVolume ? this.context.getVolume() : 1
},
setVolume: function(b) {
return this.context && "function" === typeof this.context.setVolume ? (this.context.setVolume(b), !0) : !1
},
getCurrentTime: function() {
return this.context && "function" === typeof this.context.getCurrentTime ? this.context.getCurrentTime() : 0
},
setCurrentTime: function(b) {
return this.context && "function" === typeof this.context.setCurrentTime ? this.context.setCurrentTime(b) : !1
}
}
};
if (void 0 === this.jukebox) throw "jukebox.Manager requires jukebox.Player (Player.js) to run properly.";
jukebox.Manager = function(b) {
this.features = {};
this.codecs = {};
this.__players = {};
this.__playersLength = 0;
this.__clones = {};
this.__queue = [];
this.settings = {};
for (var c in this.defaults) this.settings[c] = this.defaults[c];
if ("[object Object]" === Object.prototype.toString.call(b))
for (var d in b) this.settings[d] = b[d];
this.__detectFeatures();
jukebox.Manager.__initialized = !1 === this.settings.useGameLoop ? window.setInterval(function() {
jukebox.Manager.loop()
}, 20) : !0
};
jukebox.Manager.prototype = {
defaults: {
useFlash: !1,
useGameLoop: !1
},
__detectFeatures: function() {
var b = window.Audio && new Audio;
if (b && b.canPlayType && !1 === this.settings.useFlash) {
for (var c = [{
e: "3gp",
m: ["audio/3gpp", "audio/amr"]
}, {
e: "aac",
m: ["audio/aac", "audio/aacp"]
}, {
e: "amr",
m: ["audio/amr", "audio/3gpp"]
}, {
e: "caf",
m: ["audio/IMA-ADPCM", "audio/x-adpcm", 'audio/x-aiff; codecs="IMA-ADPCM, ADPCM"']
}, {
e: "m4a",
m: 'audio/mp4{audio/mp4; codecs="mp4a.40.2,avc1.42E01E"{audio/mpeg4{audio/mpeg4-generic{audio/mp4a-latm{audio/MP4A-LATM{audio/x-m4a'.split("{")
}, {
e: "mp3",
m: ["audio/mp3", "audio/mpeg", 'audio/mpeg; codecs="mp3"', "audio/MPA", "audio/mpa-robust"]
}, {
e: "mpga",
m: ["audio/MPA", "audio/mpa-robust", "audio/mpeg", "video/mpeg"]
}, {
e: "mp4",
m: ["audio/mp4", "video/mp4"]
}, {
e: "ogg",
m: ["application/ogg", "audio/ogg", 'audio/ogg; codecs="theora, vorbis"', "video/ogg", 'video/ogg; codecs="theora, vorbis"']
}, {
e: "wav",
m: ["audio/wave", "audio/wav", 'audio/wav; codecs="1"', "audio/x-wav", "audio/x-pn-wav"]
}, {
e: "webm",
m: ["audio/webm", 'audio/webm; codecs="vorbis"', "video/webm"]
}], d, e, f = 0, j = c.length; f < j; f++)
if (e = c[f].e, c[f].m.length && "object" === typeof c[f].m)
for (var q = 0, n = c[f].m.length; q < n; q++)
if (d = c[f].m[q], "" !== b.canPlayType(d)) {
this.codecs[e] = d;
break
} else this.codecs[e] || (this.codecs[e] = !1);
this.features.html5audio = !(!this.codecs.mp3 && !this.codecs.ogg && !this.codecs.webm && !this.codecs.wav);
this.features.channels = 8;
b.volume = 0.1337;
this.features.volume = !!(1E-4 > Math.abs(b.volume - 0.1337));
navigator.userAgent.match(/iPhone|iPod|iPad/i) && (this.features.channels = 1)
}
this.features.flashaudio = !!navigator.mimeTypes["application/x-shockwave-flash"] || !!navigator.plugins["Shockwave Flash"] || !1;
if (window.ActiveXObject) try {
new ActiveXObject("ShockwaveFlash.ShockwaveFlash.10"), this.features.flashaudio = !0
} catch (g) {}!0 === this.settings.useFlash && (this.features.flashaudio = !0);
!0 === this.features.flashaudio && !this.features.html5audio && (this.codecs.mp3 = "audio/mp3", this.codecs.mpga = "audio/mpeg", this.codecs.mp4 = "audio/mp4", this.codecs.m4a = "audio/mp4", this.codecs["3gp"] = "audio/3gpp", this.codecs.amr = "audio/amr", this.features.volume = !0, this.features.channels = 1)
},
__getPlayerById: function(b) {
return this.__players && void 0 !== this.__players[b] ? this.__players[b] : null
},
__getClone: function(b, c) {
for (var d in this.__clones) {
var e = this.__clones[d];
if (null === e.isPlaying && e.origin === b) return e
}
if ("[object Object]" === Object.prototype.toString.call(c)) {
d = {};
for (var f in c) d[f] = c[f];
d.autoplay = !1;
f = new jukebox.Player(d, b);
f.isClone = !0;
f.wasReady = !1;
return this.__clones[f.id] = f
}
return null
},
loop: function() {
if (0 !== this.__playersLength)
if (this.__queue.length && this.__playersLength < this.features.channels) {
var b = this.__queue[0],
c = this.__getPlayerById(b.origin);
if (null !== c) {
var d = this.__getClone(b.origin, c.settings);
null !== d && (!0 === this.features.volume && (c = this.__players[b.origin]) && d.setVolume(c.getVolume()), this.add(d), d.play(b.pointer, !0))
}
this.__queue.splice(0, 1)
} else
for (d in this.__queue.length && 1 === this.features.channels && (b = this.__queue[0], c = this.__getPlayerById(b.origin), null !== c && c.play(b.pointer, !0), this.__queue.splice(0, 1)), this.__players) b = this.__players[d], c = b.getCurrentTime() || 0, b.isPlaying && !1 === b.wasReady ? b.wasReady = b.setCurrentTime(b.isPlaying.start) : b.isPlaying && !0 === b.wasReady ? c > b.isPlaying.end && (!0 === b.isPlaying.loop ? b.play(b.isPlaying.start, !0) : b.stop()) : b.isClone && null === b.isPlaying ? this.remove(b) : void 0 !== b.backgroundMusic && null === b.isPlaying && c > b.backgroundMusic.end && b.backgroundHackForiOS()
},
getPlayableResource: function(b) {
"[object Array]" !== Object.prototype.toString.call(b) && (b = [b]);
for (var c = 0, d = b.length; c < d; c++) {
var e = b[c],
f = e.match(/\.([^\.]*)$/)[1];
if (f && this.codecs[f]) return e
}
return null
},
add: function(b) {
return b instanceof jukebox.Player && void 0 === this.__players[b.id] ? (this.__playersLength++, this.__players[b.id] = b, !0) : !1
},
remove: function(b) {
return b instanceof jukebox.Player && void 0 !== this.__players[b.id] ? (this.__playersLength--, delete this.__players[b.id], !0) : !1
},
addToQueue: function(b, c) {
return ("string" === typeof b || "number" === typeof b) && void 0 !== this.__players[c] ? (this.__queue.push({
pointer: b,
origin: c
}), !0) : !1
}
};
(function() {
var b = function() {
this.init()
};
b.prototype = {
init: function() {
var b = this || c;
b._codecs = {};
b._howls = [];
b._muted = !1;
b._volume = 1;
b._canPlayEvent = "canplaythrough";
b._navigator = "undefined" !== typeof window && window.navigator ? window.navigator : null;
b.masterGain = null;
b.noAudio = !1;
b.usingWebAudio = !0;
b.autoSuspend = !0;
b.ctx = null;
b.mobileAutoEnable = !0;
b._setup();
return b
},
volume: function(b) {
var d = this || c;
b = parseFloat(b);
d.ctx || n();
if ("undefined" !== typeof b && 0 <= b && 1 >= b) {
d._volume = b;
if (d._muted) return d;
d.usingWebAudio && (d.masterGain.gain.value = b);
for (var e = 0; e < d._howls.length; e++)
if (!d._howls[e]._webAudio)
for (var f = d._howls[e]._getSoundIds(), j = 0; j < f.length; j++) {
var q = d._howls[e]._soundById(f[j]);
q && q._node && (q._node.volume = q._volume * b)
}
return d
}
return d._volume
},
mute: function(b) {
var d = this || c;
d.ctx || n();
d._muted = b;
d.usingWebAudio && (d.masterGain.gain.value = b ? 0 : d._volume);
for (var e = 0; e < d._howls.length; e++)
if (!d._howls[e]._webAudio)
for (var f = d._howls[e]._getSoundIds(), j = 0; j < f.length; j++) {
var q = d._howls[e]._soundById(f[j]);
q && q._node && (q._node.muted = b ? !0 : q._muted)
}
return d
},
unload: function() {
for (var b = this || c, d = b._howls.length - 1; 0 <= d; d--) b._howls[d].unload();
b.usingWebAudio && b.ctx && "undefined" !== typeof b.ctx.close && (b.ctx.close(), b.ctx = null, n());
return b
},
codecs: function(b) {
return (this || c)._codecs[b.replace(/^x-/, "")]
},
_setup: function() {
var b = this || c;
b.state = b.ctx ? b.ctx.state || "running" : "running";
b._autoSuspend();
if (!b.usingWebAudio)
if ("undefined" !== typeof Audio) try {
var d = new Audio;
"undefined" === typeof d.oncanplaythrough && (b._canPlayEvent = "canplay")
} catch (e) {
b.noAudio = !0
} else b.noAudio = !0;
try {
d = new Audio, d.muted && (b.noAudio = !0)
} catch (f) {}
b.noAudio || b._setupCodecs();
return b
},
_setupCodecs: function() {
var b = this || c,
d = null;
try {
d = "undefined" !== typeof Audio ? new Audio : null
} catch (e) {
return b
}
if (!d || "function" !== typeof d.canPlayType) return b;
var f = d.canPlayType("audio/mpeg;").replace(/^no$/, ""),
j = b._navigator && b._navigator.userAgent.match(/OPR\/([0-6].)/g),
j = j && 33 > parseInt(j[0].split("/")[1], 10);
b._codecs = {
mp3: !(j || !f && !d.canPlayType("audio/mp3;").replace(/^no$/, "")),
mpeg: !!f,
opus: !!d.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ""),
ogg: !!d.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
oga: !!d.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
wav: !!d.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""),
aac: !!d.canPlayType("audio/aac;").replace(/^no$/, ""),
caf: !!d.canPlayType("audio/x-caf;").replace(/^no$/, ""),
m4a: !!(d.canPlayType("audio/x-m4a;") || d.canPlayType("audio/m4a;") || d.canPlayType("audio/aac;")).replace(/^no$/, ""),
mp4: !!(d.canPlayType("audio/x-mp4;") || d.canPlayType("audio/mp4;") || d.canPlayType("audio/aac;")).replace(/^no$/, ""),
weba: !!d.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ""),
webm: !!d.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ""),
dolby: !!d.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/, ""),
flac: !!(d.canPlayType("audio/x-flac;") || d.canPlayType("audio/flac;")).replace(/^no$/, "")
};
return b
},
_enableMobileAudio: function() {
var b = this || c,
d = /iPhone|iPad|iPod|Android|BlackBerry|BB10|Silk|Mobi/i.test(b._navigator && b._navigator.userAgent),
e = !!("ontouchend" in window || b._navigator && 0 < b._navigator.maxTouchPoints || b._navigator && 0 < b._navigator.msMaxTouchPoints);
if (!b._mobileEnabled && b.ctx && (d || e)) {
b._mobileEnabled = !1;
!b._mobileUnloaded && 44100 !== b.ctx.sampleRate && (b._mobileUnloaded = !0, b.unload());
b._scratchBuffer = b.ctx.createBuffer(1, 1, 22050);
var f = function() {
var c = b.ctx.createBufferSource();
c.buffer = b._scratchBuffer;
c.connect(b.ctx.destination);
"undefined" === typeof c.start ? c.noteOn(0) : c.start(0);
c.onended = function() {
c.disconnect(0);
b._mobileEnabled = !0;
b.mobileAutoEnable = !1;
document.removeEventListener("touchend", f, !0)
}
};
document.addEventListener("touchend", f, !0);
return b
}
},
_autoSuspend: function() {
var b = this;
if (b.autoSuspend && b.ctx && "undefined" !== typeof b.ctx.suspend && c.usingWebAudio) {
for (var d = 0; d < b._howls.length; d++)
if (b._howls[d]._webAudio)
for (var e = 0; e < b._howls[d]._sounds.length; e++)
if (!b._howls[d]._sounds[e]._paused) return b;
b._suspendTimer && clearTimeout(b._suspendTimer);
b._suspendTimer = setTimeout(function() {
b.autoSuspend && (b._suspendTimer = null, b.state = "suspending", b.ctx.suspend().then(function() {
b.state = "suspended";
b._resumeAfterSuspend && (delete b._resumeAfterSuspend, b._autoResume())
}))
}, 3E4);
return b
}
},
_autoResume: function() {
var b = this;
if (b.ctx && "undefined" !== typeof b.ctx.resume && c.usingWebAudio) return "running" === b.state && b._suspendTimer ? (clearTimeout(b._suspendTimer), b._suspendTimer = null) : "suspended" === b.state ? (b.state = "resuming", b.ctx.resume().then(function() {
b.state = "running";
for (var c = 0; c < b._howls.length; c++) b._howls[c]._emit("resume")
}), b._suspendTimer && (clearTimeout(b._suspendTimer), b._suspendTimer = null)) : "suspending" === b.state && (b._resumeAfterSuspend = !0), b
}
};
var c = new b,
d = function(b) {
!b.src || 0 === b.src.length ? console.error("An array of source files must be passed with any new Howl.") : this.init(b)
};
d.prototype = {
init: function(b) {
var d = this;
c.ctx || n();
d._autoplay = b.autoplay || !1;
d._format = "string" !== typeof b.format ? b.format : [b.format];
d._html5 = b.html5 || !1;
d._muted = b.mute || !1;
d._loop = b.loop || !1;
d._pool = b.pool || 5;
d._preload = "boolean" === typeof b.preload ? b.preload : !0;
d._rate = b.rate || 1;
d._sprite = b.sprite || {};
d._src = "string" !== typeof b.src ? b.src : [b.src];
d._volume = void 0 !== b.volume ? b.volume : 1;
d._duration = 0;
d._state = "unloaded";
d._sounds = [];
d._endTimers = {};
d._queue = [];
d._onend = b.onend ? [{
fn: b.onend
}] : [];
d._onfade = b.onfade ? [{
fn: b.onfade
}] : [];
d._onload = b.onload ? [{
fn: b.onload
}] : [];
d._onloaderror = b.onloaderror ? [{
fn: b.onloaderror
}] : [];
d._onpause = b.onpause ? [{
fn: b.onpause
}] : [];
d._onplay = b.onplay ? [{
fn: b.onplay
}] : [];
d._onstop = b.onstop ? [{
fn: b.onstop
}] : [];
d._onmute = b.onmute ? [{
fn: b.onmute
}] : [];
d._onvolume = b.onvolume ? [{
fn: b.onvolume
}] : [];
d._onrate = b.onrate ? [{
fn: b.onrate
}] : [];
d._onseek = b.onseek ? [{
fn: b.onseek
}] : [];
d._onresume = [];
d._webAudio = c.usingWebAudio && !d._html5;
"undefined" !== typeof c.ctx && c.ctx && c.mobileAutoEnable && c._enableMobileAudio();
c._howls.push(d);
d._autoplay && d._queue.push({
event: "play",
action: function() {
d.play()
}
});
d._preload && d.load();
return d
},
load: function() {
var b = null;
if (c.noAudio) this._emit("loaderror", null, "No audio support.");
else {
"string" === typeof this._src && (this._src = [this._src]);
for (var d = 0; d < this._src.length; d++) {
var n, z;
if (this._format && this._format[d]) n = this._format[d];
else {
z = this._src[d];
if ("string" !== typeof z) {
this._emit("loaderror", null, "Non-string found in selected audio sources - ignoring.");
continue
}(n = /^data:audio\/([^;,]+);/i.exec(z)) || (n = /\.([^.]+)$/.exec(z.split("?", 1)[0]));
n && (n = n[1].toLowerCase())
}
if (c.codecs(n)) {
b = this._src[d];
break
}
}
if (b) {
this._src = b;
this._state = "loading";
"https:" === window.location.protocol && "http:" === b.slice(0, 5) && (this._html5 = !0, this._webAudio = !1);
new e(this);
if (this._webAudio) {
var B = this,
C = B._src;
if (f[C]) B._duration = f[C].duration, q(B);
else if (/^data:[^;]+;base64,/.test(C)) {
b = atob(C.split(",")[1]);
d = new Uint8Array(b.length);
for (n = 0; n < b.length; ++n) d[n] = b.charCodeAt(n);
j(d.buffer, B)
} else {
var G = new XMLHttpRequest;
G.open("GET", C, !0);
G.responseType = "arraybuffer";
G.onload = function() {
var b = (G.status + "")[0];
"0" !== b && "2" !== b && "3" !== b ? B._emit("loaderror", null, "Failed loading audio file with status: " +
G.status + ".") : j(G.response, B)
};
G.onerror = function() {
B._webAudio && (B._html5 = !0, B._webAudio = !1, B._sounds = [], delete f[C], B.load())
};
try {
G.send()
} catch (I) {
G.onerror()
}
}
}
return this
}
this._emit("loaderror", null, "No codec support for selected audio sources.")
}
},
play: function(b, d) {
var e = this,
f = null;
if ("number" === typeof b) f = b, b = null;
else {
if ("string" === typeof b && "loaded" === e._state && !e._sprite[b]) return null;
if ("undefined" === typeof b) {
b = "__default";
for (var j = 0, n = 0; n < e._sounds.length; n++) e._sounds[n]._paused && !e._sounds[n]._ended && (j++, f = e._sounds[n]._id);
1 === j ? b = null : f = null
}
}
var q = f ? e._soundById(f) : e._inactiveSound();
if (!q) return null;
f && !b && (b = q._sprite || "__default");
if ("loaded" !== e._state && !e._sprite[b]) return e._queue.push({
event: "play",
action: function() {
e.play(e._soundById(q._id) ? q._id : void 0)
}
}), q._id;
if (f && !q._paused) return d || setTimeout(function() {
e._emit("play", q._id)
}, 0), q._id;
e._webAudio && c._autoResume();
var I = Math.max(0, 0 < q._seek ? q._seek : e._sprite[b][0] / 1E3),
u = Math.max(0, (e._sprite[b][0] + e._sprite[b][1]) /
1E3 - I),
L = 1E3 * u / Math.abs(q._rate);
q._paused = !1;
q._ended = !1;
q._sprite = b;
q._seek = I;
q._start = e._sprite[b][0] / 1E3;
q._stop = (e._sprite[b][0] + e._sprite[b][1]) / 1E3;
q._loop = !(!q._loop && !e._sprite[b][2]);
var E = q._node;
if (e._webAudio) f = function() {
e._refreshBuffer(q);
E.gain.setValueAtTime(q._muted || e._muted ? 0 : q._volume, c.ctx.currentTime);
q._playStart = c.ctx.currentTime;
"undefined" === typeof E.bufferSource.start ? q._loop ? E.bufferSource.noteGrainOn(0, I, 86400) : E.bufferSource.noteGrainOn(0, I, u) : q._loop ? E.bufferSource.start(0,
I, 86400) : E.bufferSource.start(0, I, u);
Infinity !== L && (e._endTimers[q._id] = setTimeout(e._ended.bind(e, q), L));
d || setTimeout(function() {
e._emit("play", q._id)
}, 0)
}, j = "running" === c.state, "loaded" === e._state && j ? f() : (e.once(j ? "load" : "resume", f, j ? q._id : null), e._clearTimer(q._id));
else {
var Q = function() {
E.currentTime = I;
E.muted = q._muted || e._muted || c._muted || E.muted;
E.volume = q._volume * c.volume();
E.playbackRate = q._rate;
setTimeout(function() {
E.play();
Infinity !== L && (e._endTimers[q._id] = setTimeout(e._ended.bind(e, q), L));
d || e._emit("play", q._id)
}, 0)
},
f = "loaded" === e._state && (window && window.ejecta || !E.readyState && c._navigator.isCocoonJS);
if (4 === E.readyState || f) Q();
else {
var M = function() {
Q();
E.removeEventListener(c._canPlayEvent, M, !1)
};
E.addEventListener(c._canPlayEvent, M, !1);
e._clearTimer(q._id)
}
}
return q._id
},
pause: function(b, c) {
var d = this;
if ("loaded" !== d._state) return d._queue.push({
event: "pause",
action: function() {
d.pause(b)
}
}), d;
for (var e = d._getSoundIds(b), f = 0; f < e.length; f++) {
d._clearTimer(e[f]);
var j = d._soundById(e[f]);
if (j && !j._paused && (j._seek = d.seek(e[f]), j._rateSeek = 0, j._paused = !0, d._stopFade(e[f]), j._node))
if (d._webAudio) {
if (!j._node.bufferSource) break;
"undefined" === typeof j._node.bufferSource.stop ? j._node.bufferSource.noteOff(0) : j._node.bufferSource.stop(0);
d._cleanBuffer(j._node)
} else(!isNaN(j._node.duration) || Infinity === j._node.duration) && j._node.pause();
c || d._emit("pause", j ? j._id : null)
}
return d
},
stop: function(b, c) {
var d = this;
if ("loaded" !== d._state) return d._queue.push({
event: "stop",
action: function() {
d.stop(b)
}
}), d;
for (var e = d._getSoundIds(b), f = 0; f < e.length; f++) {
d._clearTimer(e[f]);
var j = d._soundById(e[f]);
if (j && (j._seek = j._start || 0, j._rateSeek = 0, j._paused = !0, j._ended = !0, d._stopFade(e[f]), j._node))
if (d._webAudio) {
if (!j._node.bufferSource) {
c || d._emit("stop", j._id);
break
}
"undefined" === typeof j._node.bufferSource.stop ? j._node.bufferSource.noteOff(0) : j._node.bufferSource.stop(0);
d._cleanBuffer(j._node)
} else if (!isNaN(j._node.duration) || Infinity === j._node.duration) j._node.currentTime = j._start || 0, j._node.pause();
j && !c && d._emit("stop", j._id)
}
return d
},
mute: function(b, d) {
var e = this;
if ("loaded" !== e._state) return e._queue.push({
event: "mute",
action: function() {
e.mute(b, d)
}
}), e;
if ("undefined" === typeof d)
if ("boolean" === typeof b) e._muted = b;
else return e._muted;
for (var f = e._getSoundIds(d), j = 0; j < f.length; j++) {
var n = e._soundById(f[j]);
n && (n._muted = b, e._webAudio && n._node ? n._node.gain.setValueAtTime(b ? 0 : n._volume, c.ctx.currentTime) : n._node && (n._node.muted = c._muted ? !0 : b), e._emit("mute", n._id))
}
return e
},
volume: function() {
var b = this,
d = arguments,
e, f;
if (0 === d.length) return b._volume;
1 === d.length || 2 === d.length && "undefined" === typeof d[1] ? 0 <= b._getSoundIds().indexOf(d[0]) ? f = parseInt(d[0], 10) : e = parseFloat(d[0]) : 2 <= d.length && (e = parseFloat(d[0]), f = parseInt(d[1], 10));
var j;
if ("undefined" !== typeof e && 0 <= e && 1 >= e) {
if ("loaded" !== b._state) return b._queue.push({
event: "volume",
action: function() {
b.volume.apply(b, d)
}
}), b;
"undefined" === typeof f && (b._volume = e);
f = b._getSoundIds(f);
for (var n = 0; n < f.length; n++)
if (j = b._soundById(f[n])) j._volume = e, d[2] || b._stopFade(f[n]), b._webAudio && j._node && !j._muted ? j._node.gain.setValueAtTime(e, c.ctx.currentTime) : j._node && !j._muted && (j._node.volume = e * c.volume()), b._emit("volume", j._id)
} else return (j = f ? b._soundById(f) : b._sounds[0]) ? j._volume : 0;
return b
},
fade: function(b, d, e, f) {
var j = this,
n = Math.abs(b - d),
q = b > d ? "out" : "in",
I = n / 0.01,
n = 0 < I ? e / I : e;
4 > n && (I = Math.ceil(I / (4 / n)), n = 4);
if ("loaded" !== j._state) return j._queue.push({
event: "fade",
action: function() {
j.fade(b, d, e, f)
}
}), j;
j.volume(b, f);
for (var u = j._getSoundIds(f), L = 0; L < u.length; L++) {
var E = j._soundById(u[L]);
if (E) {
f || j._stopFade(u[L]);
if (j._webAudio && !E._muted) {
var Q = c.ctx.currentTime,
M = Q + e / 1E3;
E._volume = b;
E._node.gain.setValueAtTime(b, Q);
E._node.gain.linearRampToValueAtTime(d, M)
}
var R = b;
E._interval = setInterval(function(b, c) {
0 < I && (R += "in" === q ? 0.01 : -0.01);
R = Math.max(0, R);
R = Math.min(1, R);
R = Math.round(100 * R) / 100;
j._webAudio ? ("undefined" === typeof f && (j._volume = R), c._volume = R) : j.volume(R, b, !0);
R === d && (clearInterval(c._interval), c._interval = null, j.volume(R, b), j._emit("fade",
b))
}.bind(j, u[L], E), n)
}
}
return j
},
_stopFade: function(b) {
var d = this._soundById(b);
d && d._interval && (this._webAudio && d._node.gain.cancelScheduledValues(c.ctx.currentTime), clearInterval(d._interval), d._interval = null, this._emit("fade", b));
return this
},
loop: function() {
var b = arguments,
c, d;
if (0 === b.length) return this._loop;
if (1 === b.length)
if ("boolean" === typeof b[0]) this._loop = c = b[0];
else return (b = this._soundById(parseInt(b[0], 10))) ? b._loop : !1;
else 2 === b.length && (c = b[0], d = parseInt(b[1], 10));
d = this._getSoundIds(d);
for (var e = 0; e < d.length; e++)
if (b = this._soundById(d[e]))
if (b._loop = c, this._webAudio && b._node && b._node.bufferSource && (b._node.bufferSource.loop = c)) b._node.bufferSource.loopStart = b._start || 0, b._node.bufferSource.loopEnd = b._stop;
return this
},
rate: function() {
var b = this,
d = arguments,
e, f;
0 === d.length ? f = b._sounds[0]._id : 1 === d.length ? 0 <= b._getSoundIds().indexOf(d[0]) ? f = parseInt(d[0], 10) : e = parseFloat(d[0]) : 2 === d.length && (e = parseFloat(d[0]), f = parseInt(d[1], 10));
var j;
if ("number" === typeof e) {
if ("loaded" !== b._state) return b._queue.push({
event: "rate",
action: function() {
b.rate.apply(b, d)
}
}), b;
"undefined" === typeof f && (b._rate = e);
f = b._getSoundIds(f);
for (var n = 0; n < f.length; n++)
if (j = b._soundById(f[n])) {
j._rateSeek = b.seek(f[n]);
j._playStart = b._webAudio ? c.ctx.currentTime : j._playStart;
j._rate = e;
b._webAudio && j._node && j._node.bufferSource ? j._node.bufferSource.playbackRate.value = e : j._node && (j._node.playbackRate = e);
var q = b.seek(f[n]),
q = 1E3 * ((b._sprite[j._sprite][0] + b._sprite[j._sprite][1]) / 1E3 - q) / Math.abs(j._rate);
if (b._endTimers[f[n]] || !j._paused) b._clearTimer(f[n]),
b._endTimers[f[n]] = setTimeout(b._ended.bind(b, j), q);
b._emit("rate", j._id)
}
} else return (j = b._soundById(f)) ? j._rate : b._rate;
return b
},
seek: function() {
var b = this,
d = arguments,
e, f;
0 === d.length ? f = b._sounds[0]._id : 1 === d.length ? 0 <= b._getSoundIds().indexOf(d[0]) ? f = parseInt(d[0], 10) : (f = b._sounds[0]._id, e = parseFloat(d[0])) : 2 === d.length && (e = parseFloat(d[0]), f = parseInt(d[1], 10));
if ("undefined" === typeof f) return b;
if ("loaded" !== b._state) return b._queue.push({
event: "seek",
action: function() {
b.seek.apply(b, d)
}
}), b;
var j = b._soundById(f);
if (j)
if ("number" === typeof e && 0 <= e) {
var n = b.playing(f);
n && b.pause(f, !0);
j._seek = e;
j._ended = !1;
b._clearTimer(f);
n && b.play(f, !0);
!b._webAudio && j._node && (j._node.currentTime = e);
b._emit("seek", f)
} else return b._webAudio ? (e = b.playing(f) ? c.ctx.currentTime - j._playStart : 0, j._seek + ((j._rateSeek ? j._rateSeek - j._seek : 0) + e * Math.abs(j._rate))) : j._node.currentTime;
return b
},
playing: function(b) {
if ("number" === typeof b) return (b = this._soundById(b)) ? !b._paused : !1;
for (b = 0; b < this._sounds.length; b++)
if (!this._sounds[b]._paused) return !0;
return !1
},
duration: function(b) {
var c = this._duration;
(b = this._soundById(b)) && (c = this._sprite[b._sprite][1] / 1E3);
return c
},
state: function() {
return this._state
},
unload: function() {
for (var b = this._sounds, d = 0; d < b.length; d++) {
b[d]._paused || (this.stop(b[d]._id), this._emit("end", b[d]._id));
this._webAudio || (b[d]._node.src = "data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=", b[d]._node.removeEventListener("error", b[d]._errorFn, !1), b[d]._node.removeEventListener(c._canPlayEvent, b[d]._loadFn, !1));
delete b[d]._node;
this._clearTimer(b[d]._id);
var e = c._howls.indexOf(this);
0 <= e && c._howls.splice(e, 1)
}
b = !0;
for (d = 0; d < c._howls.length; d++)
if (c._howls[d]._src === this._src) {
b = !1;
break
}
f && b && delete f[this._src];
c.noAudio = !1;
this._state = "unloaded";
this._sounds = [];
return null
},
on: function(b, c, d, e) {
b = this["_on" + b];
"function" === typeof c && b.push(e ? {
id: d,
fn: c,
once: e
} : {
id: d,
fn: c
});
return this
},
off: function(b, c, d) {
var e = this["_on" + b],
f = 0;
if (c)
for (f = 0; f < e.length; f++) {
if (c === e[f].fn && d === e[f].id) {
e.splice(f, 1);
break
}
} else if (b) this["_on" + b] = [];
else {
b = Object.keys(this);
for (f = 0; f < b.length; f++) 0 === b[f].indexOf("_on") && Array.isArray(this[b[f]]) && (this[b[f]] = [])
}
return this
},
once: function(b, c, d) {
this.on(b, c, d, 1);
return this
},
_emit: function(b, c, d) {
for (var e = this["_on" + b], f = e.length - 1; 0 <= f; f--)
if (!e[f].id || e[f].id === c || "load" === b) setTimeout(function(b) {
b.call(this, c, d)
}.bind(this, e[f].fn), 0), e[f].once && this.off(b, e[f].fn, e[f].id);
return this
},
_loadQueue: function() {
var b = this;
if (0 < b._queue.length) {
var c = b._queue[0];
b.once(c.event, function() {
b._queue.shift();
b._loadQueue()
});
c.action()
}
return b
},
_ended: function(b) {
var d = b._sprite,
d = !(!b._loop && !this._sprite[d][2]);
this._emit("end", b._id);
!this._webAudio && d && this.stop(b._id, !0).play(b._id);
if (this._webAudio && d) {
this._emit("play", b._id);
b._seek = b._start || 0;
b._rateSeek = 0;
b._playStart = c.ctx.currentTime;
var e = 1E3 * (b._stop - b._start) / Math.abs(b._rate);
this._endTimers[b._id] = setTimeout(this._ended.bind(this, b), e)
}
this._webAudio && !d && (b._paused = !0, b._ended = !0, b._seek =
b._start || 0, b._rateSeek = 0, this._clearTimer(b._id), this._cleanBuffer(b._node), c._autoSuspend());
!this._webAudio && !d && this.stop(b._id);
return this
},
_clearTimer: function(b) {
this._endTimers[b] && (clearTimeout(this._endTimers[b]), delete this._endTimers[b]);
return this
},
_soundById: function(b) {
for (var c = 0; c < this._sounds.length; c++)
if (b === this._sounds[c]._id) return this._sounds[c];
return null
},
_inactiveSound: function() {
this._drain();
for (var b = 0; b < this._sounds.length; b++)
if (this._sounds[b]._ended) return this._sounds[b].reset();
return new e(this)
},
_drain: function() {
var b = this._pool,
c = 0,
d = 0;
if (!(this._sounds.length < b)) {
for (d = 0; d < this._sounds.length; d++) this._sounds[d]._ended && c++;
for (d = this._sounds.length - 1; 0 <= d && !(c <= b); d--) this._sounds[d]._ended && (this._webAudio && this._sounds[d]._node && this._sounds[d]._node.disconnect(0), this._sounds.splice(d, 1), c--)
}
},
_getSoundIds: function(b) {
if ("undefined" === typeof b) {
b = [];
for (var c = 0; c < this._sounds.length; c++) b.push(this._sounds[c]._id);
return b
}
return [b]
},
_refreshBuffer: function(b) {
b._node.bufferSource = c.ctx.createBufferSource();
b._node.bufferSource.buffer = f[this._src];
b._panner ? b._node.bufferSource.connect(b._panner) : b._node.bufferSource.connect(b._node);
if (b._node.bufferSource.loop = b._loop) b._node.bufferSource.loopStart = b._start || 0, b._node.bufferSource.loopEnd = b._stop;
b._node.bufferSource.playbackRate.value = b._rate;
return this
},
_cleanBuffer: function(b) {
if (this._scratchBuffer) {
b.bufferSource.onended = null;
b.bufferSource.disconnect(0);
try {
b.bufferSource.buffer = this._scratchBuffer
} catch (c) {}
}
b.bufferSource = null;
return this
}
};
var e = function(b) {
this._parent = b;
this.init()
};
e.prototype = {
init: function() {
var b = this._parent;
this._muted = b._muted;
this._loop = b._loop;
this._volume = b._volume;
this._muted = b._muted;
this._rate = b._rate;
this._seek = 0;
this._ended = this._paused = !0;
this._sprite = "__default";
this._id = Math.round(Date.now() * Math.random());
b._sounds.push(this);
this.create();
return this
},
create: function() {
var b = this._parent,
d = c._muted || this._muted || this._parent._muted ? 0 : this._volume;
b._webAudio ? (this._node = "undefined" === typeof c.ctx.createGain ? c.ctx.createGainNode() : c.ctx.createGain(), this._node.gain.setValueAtTime(d, c.ctx.currentTime), this._node.paused = !0, this._node.connect(c.masterGain)) : (this._node = new Audio, this._errorFn = this._errorListener.bind(this), this._node.addEventListener("error", this._errorFn, !1), this._loadFn = this._loadListener.bind(this), this._node.addEventListener(c._canPlayEvent, this._loadFn, !1), this._node.src = b._src, this._node.preload = "auto", this._node.volume = d * c.volume(), this._node.load());
return this
},
reset: function() {
var b = this._parent;
this._muted = b._muted;
this._loop = b._loop;
this._volume = b._volume;
this._muted = b._muted;
this._rate = b._rate;
this._rateSeek = this._seek = 0;
this._ended = this._paused = !0;
this._sprite = "__default";
this._id = Math.round(Date.now() * Math.random());
return this
},
_errorListener: function() {
this._parent._emit("loaderror", this._id, this._node.error ? this._node.error.code : 0);
this._node.removeEventListener("error", this._errorListener, !1)
},
_loadListener: function() {
var b = this._parent;
b._duration = Math.ceil(10 * this._node.duration) / 10;
0 === Object.keys(b._sprite).length && (b._sprite = {
__default: [0, 1E3 * b._duration]
});
"loaded" !== b._state && (b._state = "loaded", b._emit("load"), b._loadQueue());
this._node.removeEventListener(c._canPlayEvent, this._loadFn, !1)
}
};
var f = {},
j = function(b, d) {
c.ctx.decodeAudioData(b, function(b) {
b && 0 < d._sounds.length && (f[d._src] = b, q(d, b))
}, function() {
d._emit("loaderror", null, "Decoding audio data failed.")
})
},
q = function(b, c) {
c && !b._duration && (b._duration = c.duration);
0 === Object.keys(b._sprite).length &&
(b._sprite = {
__default: [0, 1E3 * b._duration]
});
"loaded" !== b._state && (b._state = "loaded", b._emit("load"), b._loadQueue())
},
n = function() {
try {
"undefined" !== typeof AudioContext ? c.ctx = new AudioContext : "undefined" !== typeof webkitAudioContext ? c.ctx = new webkitAudioContext : c.usingWebAudio = !1
} catch (b) {
c.usingWebAudio = !1
}
var d = /iP(hone|od|ad)/.test(c._navigator && c._navigator.platform),
e = c._navigator && c._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),
e = e ? parseInt(e[1], 10) : null;
if (d && e && 9 > e && (d = /safari/.test(c._navigator && c._navigator.userAgent.toLowerCase()), c._navigator && c._navigator.standalone && !d || c._navigator && !c._navigator.standalone && !d)) c.usingWebAudio = !1;
c.usingWebAudio && (c.masterGain = "undefined" === typeof c.ctx.createGain ? c.ctx.createGainNode() : c.ctx.createGain(), c.masterGain.gain.value = 1, c.masterGain.connect(c.ctx.destination));
c._setup()
};
"function" === typeof define && define.amd && define([], function() {
return {
Howler: c,
Howl: d
}
});
"undefined" !== typeof exports && (exports.Howler = c, exports.Howl = d);
"undefined" !== typeof window ? (window.HowlerGlobal = b, window.Howler = c, window.Howl = d, window.Sound = e) : "undefined" !== typeof global && (global.HowlerGlobal = b, global.Howler = c, global.Howl = d, global.Sound = e)
})();
(function() {
HowlerGlobal.prototype._pos = [0, 0, 0];
HowlerGlobal.prototype._orientation = [0, 0, -1, 0, 1, 0];
HowlerGlobal.prototype.stereo = function(b) {
if (!this.ctx || !this.ctx.listener) return this;
for (var c = this._howls.length - 1; 0 <= c; c--) this._howls[c].stereo(b);
return this
};
HowlerGlobal.prototype.pos = function(b, c, d) {
if (!this.ctx || !this.ctx.listener) return this;
c = "number" !== typeof c ? this._pos[1] : c;
d = "number" !== typeof d ? this._pos[2] : d;
if ("number" === typeof b) this._pos = [b, c, d], this.ctx.listener.setPosition(this._pos[0], this._pos[1], this._pos[2]);
else return this._pos;
return this
};
HowlerGlobal.prototype.orientation = function(b, c, d, e, g, y) {
if (!this.ctx || !this.ctx.listener) return this;
var A = this._orientation;
c = "number" !== typeof c ? A[1] : c;
d = "number" !== typeof d ? A[2] : d;
e = "number" !== typeof e ? A[3] : e;
g = "number" !== typeof g ? A[4] : g;
y = "number" !== typeof y ? A[5] : y;
if ("number" === typeof b) this._orientation = [b, c, d, e, g, y], this.ctx.listener.setOrientation(b, c, d, e, g, y);
else return A;
return this
};
var b = Howl.prototype.init;
Howl.prototype.init = function(c) {
this._orientation = c.orientation || [1, 0, 0];
this._stereo = c.stereo || null;
this._pos = c.pos || null;
this._pannerAttr = {
coneInnerAngle: "undefined" !== typeof c.coneInnerAngle ? c.coneInnerAngle : 360,
coneOuterAngle: "undefined" !== typeof c.coneOuterAngle ? c.coneOuterAngle : 360,
coneOuterGain: "undefined" !== typeof c.coneOuterGain ? c.coneOuterGain : 0,
distanceModel: "undefined" !== typeof c.distanceModel ? c.distanceModel : "inverse",
maxDistance: "undefined" !== typeof c.maxDistance ? c.maxDistance : 1E4,
panningModel: "undefined" !== typeof c.panningModel ? c.panningModel : "HRTF",
refDistance: "undefined" !== typeof c.refDistance ? c.refDistance : 1,
rolloffFactor: "undefined" !== typeof c.rolloffFactor ? c.rolloffFactor : 1
};
this._onstereo = c.onstereo ? [{
fn: c.onstereo
}] : [];
this._onpos = c.onpos ? [{
fn: c.onpos
}] : [];
this._onorientation = c.onorientation ? [{
fn: c.onorientation
}] : [];
return b.call(this, c)
};
Howl.prototype.stereo = function(b, c) {
var d = this;
if (!d._webAudio) return d;
if ("loaded" !== d._state) return d._queue.push({
event: "stereo",
action: function() {
d.stereo(b, c)
}
}), d;
var n = "undefined" === typeof Howler.ctx.createStereoPanner ? "spatial" : "stereo";
if ("undefined" === typeof c)
if ("number" === typeof b) d._stereo = b, d._pos = [b, 0, 0];
else return d._stereo;
for (var g = d._getSoundIds(c), y = 0; y < g.length; y++) {
var A = d._soundById(g[y]);
if (A)
if ("number" === typeof b) A._stereo = b, A._pos = [b, 0, 0], A._node && (A._pannerAttr.panningModel = "equalpower", (!A._panner || !A._panner.pan) && e(A, n), "spatial" === n ? A._panner.setPosition(b, 0, 0) : A._panner.pan.value = b), d._emit("stereo", A._id);
else return A._stereo
}
return d
};
Howl.prototype.pos = function(b, c, d, n) {
var g = this;
if (!g._webAudio) return g;
if ("loaded" !== g._state) return g._queue.push({
event: "pos",
action: function() {
g.pos(b, c, d, n)
}
}), g;
c = "number" !== typeof c ? 0 : c;
d = "number" !== typeof d ? -0.5 : d;
if ("undefined" === typeof n)
if ("number" === typeof b) g._pos = [b, c, d];
else return g._pos;
for (var y = g._getSoundIds(n), A = 0; A < y.length; A++) {
var z = g._soundById(y[A]);
if (z)
if ("number" === typeof b) z._pos = [b, c, d], z._node && ((!z._panner || z._panner.pan) && e(z, "spatial"), z._panner.setPosition(b, c, d)), g._emit("pos", z._id);
else return z._pos
}
return g
};
Howl.prototype.orientation = function(b, c, d, n) {
var g = this;
if (!g._webAudio) return g;
if ("loaded" !== g._state) return g._queue.push({
event: "orientation",
action: function() {
g.orientation(b, c, d, n)
}
}), g;
c = "number" !== typeof c ? g._orientation[1] : c;
d = "number" !== typeof d ? g._orientation[2] : d;
if ("undefined" === typeof n)
if ("number" === typeof b) g._orientation = [b, c, d];
else return g._orientation;
for (var y = g._getSoundIds(n), A = 0; A < y.length; A++) {
var z = g._soundById(y[A]);
if (z)
if ("number" === typeof b) z._orientation = [b, c, d], z._node && (z._panner || (z._pos || (z._pos = g._pos || [0, 0, -0.5]), e(z, "spatial")), z._panner.setOrientation(b, c, d)), g._emit("orientation", z._id);
else return z._orientation
}
return g
};
Howl.prototype.pannerAttr = function() {
var b = arguments,
c, d;
if (!this._webAudio) return this;
if (0 === b.length) return this._pannerAttr;
if (1 === b.length)
if ("object" === typeof b[0]) c = b[0], "undefined" === typeof d && (this._pannerAttr = {
coneInnerAngle: "undefined" !== typeof c.coneInnerAngle ? c.coneInnerAngle : this._coneInnerAngle,
coneOuterAngle: "undefined" !== typeof c.coneOuterAngle ? c.coneOuterAngle : this._coneOuterAngle,
coneOuterGain: "undefined" !== typeof c.coneOuterGain ? c.coneOuterGain : this._coneOuterGain,
distanceModel: "undefined" !== typeof c.distanceModel ? c.distanceModel : this._distanceModel,
maxDistance: "undefined" !== typeof c.maxDistance ? c.maxDistance : this._maxDistance,
panningModel: "undefined" !== typeof c.panningModel ? c.panningModel : this._panningModel,
refDistance: "undefined" !== typeof c.refDistance ? c.refDistance : this._refDistance,
rolloffFactor: "undefined" !== typeof c.rolloffFactor ? c.rolloffFactor : this._rolloffFactor
});
else return (b = this._soundById(parseInt(b[0], 10))) ? b._pannerAttr : this._pannerAttr;
else 2 === b.length && (c = b[0], d = parseInt(b[1], 10));
d = this._getSoundIds(d);
for (var n = 0; n < d.length; n++)
if (b = this._soundById(d[n])) {
var g = b._pannerAttr,
g = {
coneInnerAngle: "undefined" !== typeof c.coneInnerAngle ? c.coneInnerAngle : g.coneInnerAngle,
coneOuterAngle: "undefined" !== typeof c.coneOuterAngle ? c.coneOuterAngle : g.coneOuterAngle,
coneOuterGain: "undefined" !== typeof c.coneOuterGain ? c.coneOuterGain : g.coneOuterGain,
distanceModel: "undefined" !== typeof c.distanceModel ? c.distanceModel : g.distanceModel,
maxDistance: "undefined" !== typeof c.maxDistance ? c.maxDistance : g.maxDistance,
panningModel: "undefined" !== typeof c.panningModel ? c.panningModel : g.panningModel,
refDistance: "undefined" !== typeof c.refDistance ? c.refDistance : g.refDistance,
rolloffFactor: "undefined" !== typeof c.rolloffFactor ? c.rolloffFactor : g.rolloffFactor
},
y = b._panner;
y ? (y.coneInnerAngle = g.coneInnerAngle, y.coneOuterAngle = g.coneOuterAngle, y.coneOuterGain = g.coneOuterGain, y.distanceModel = g.distanceModel, y.maxDistance = g.maxDistance, y.panningModel = g.panningModel, y.refDistance = g.refDistance, y.rolloffFactor = g.rolloffFactor) : (b._pos || (b._pos = this._pos || [0, 0, -0.5]), e(b, "spatial"))
}
return this
};
var c = Sound.prototype.init;
Sound.prototype.init = function() {
var b = this._parent;
this._orientation = b._orientation;
this._stereo = b._stereo;
this._pos = b._pos;
this._pannerAttr = b._pannerAttr;
c.call(this);
this._stereo ? b.stereo(this._stereo) : this._pos && b.pos(this._pos[0], this._pos[1], this._pos[2], this._id)
};
var d = Sound.prototype.reset;
Sound.prototype.reset = function() {
var b = this._parent;
this._orientation = b._orientation;
this._pos = b._pos;
this._pannerAttr = b._pannerAttr;
return d.call(this)
};
var e = function(b, c) {
"spatial" === (c || "spatial") ? (b._panner = Howler.ctx.createPanner(), b._panner.coneInnerAngle = b._pannerAttr.coneInnerAngle, b._panner.coneOuterAngle = b._pannerAttr.coneOuterAngle, b._panner.coneOuterGain = b._pannerAttr.coneOuterGain, b._panner.distanceModel = b._pannerAttr.distanceModel, b._panner.maxDistance = b._pannerAttr.maxDistance, b._panner.panningModel = b._pannerAttr.panningModel, b._panner.refDistance = b._pannerAttr.refDistance, b._panner.rolloffFactor = b._pannerAttr.rolloffFactor, b._panner.setPosition(b._pos[0], b._pos[1], b._pos[2]), b._panner.setOrientation(b._orientation[0], b._orientation[1], b._orientation[2])) : (b._panner = Howler.ctx.createStereoPanner(), b._panner.pan.value = b._stereo);
b._panner.connect(b._node);
b._paused || b._parent.pause(b._id, !0).play(b._id)
}
})();
(function(b) {
Number.prototype.map = function(b, c, d, e) {
return d + (e - d) * ((this - b) / (c - b))
};
Number.prototype.limit = function(b, c) {
return Math.min(c, Math.max(b, this))
};
Number.prototype.round = function(b) {
b = Math.pow(10, b || 0);
return Math.round(this * b) / b
};
Number.prototype.floor = function() {
return Math.floor(this)
};
Number.prototype.ceil = function() {
return Math.ceil(this)
};
Number.prototype.toInt = function() {
return this | 0
};
Number.prototype.toRad = function() {
return this / 180 * Math.PI
};
Number.prototype.toDeg = function() {
return 180 *
this / Math.PI
};
Array.prototype.erase = function(b) {
for (var c = this.length; c--;) this[c] === b && this.splice(c, 1);
return this
};
Array.prototype.random = function() {
return this[Math.floor(Math.random() * this.length)]
};
Function.prototype.bind = Function.prototype.bind || function(b) {
if ("function" !== typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
var c = Array.prototype.slice.call(arguments, 1),
d = this,
e = function() {},
f = function() {
return d.apply(this instanceof e && b ? this : b, c.concat(Array.prototype.slice.call(arguments)))
};
e.prototype = this.prototype;
f.prototype = new e;
return f
};
b.ig = {
game: null,
debug: null,
version: "1.23",
global: b,
modules: {},
resources: [],
ready: !1,
baked: !1,
nocache: "",
ua: {},
prefix: b.ImpactPrefix || "",
lib: "lib/",
_current: null,
_loadQueue: [],
_waitForOnload: 0,
$: function(b) {
return "#" == b.charAt(0) ? document.getElementById(b.substr(1)) : document.getElementsByTagName(b)
},
$new: function(b) {
return document.createElement(b)
},
copy: function(b) {
if (!b || "object" != typeof b || b instanceof HTMLElement || b instanceof ig.Class) return b;
if (b instanceof Array)
for (var c = [], d = 0, e = b.length; d < e; d++) c[d] = ig.copy(b[d]);
else
for (d in c = {}, b) c[d] = ig.copy(b[d]);
return c
},
merge: function(b, c) {
for (var d in c) {
var e = c[d];
if ("object" != typeof e || e instanceof HTMLElement || e instanceof ig.Class || null === e) b[d] = e;
else {
if (!b[d] || "object" != typeof b[d]) b[d] = e instanceof Array ? [] : {};
ig.merge(b[d], e)
}
}
return b
},
ksort: function(b) {
if (!b || "object" != typeof b) return [];
var c = [],
d = [],
e;
for (e in b) c.push(e);
c.sort();
for (e = 0; e < c.length; e++) d.push(b[c[e]]);
return d
},
setVendorAttribute: function(b, c, d) {
var e = c.charAt(0).toUpperCase() + c.substr(1);
b[c] = "undefined" !== typeof b.imageSmoothingEnabled ? b["ms" + e] = b["moz" + e] = b["o" + e] = d : b["ms" + e] = b["moz" + e] = b["webkit" + e] = b["o" + e] = d
},
getVendorAttribute: function(b, c) {
var d = c.charAt(0).toUpperCase() + c.substr(1);
return "undefined" !== typeof b.imageSmoothingEnabled ? b[c] || b["ms" + d] || b["moz" + d] || b["o" + d] : b[c] || b["ms" + d] || b["moz" + d] || b["webkit" + d] || b["o" + d]
},
normalizeVendorAttribute: function(b, c) {
var d = ig.getVendorAttribute(b, c);
!b[c] && d && (b[c] = d)
},
getImagePixels: function(b, c, d, e, f) {
var j = ig.$new("canvas");
j.width = b.width;
j.height = b.height;
var q = j.getContext("2d");
ig.System.SCALE.CRISP(j, q);
var G = ig.getVendorAttribute(q, "backingStorePixelRatio") || 1;
ig.normalizeVendorAttribute(q, "getImageDataHD");
var I = b.width / G,
u = b.height / G;
j.width = Math.ceil(I);
j.height = Math.ceil(u);
q.drawImage(b, 0, 0, I, u);
return 1 === G ? q.getImageData(c, d, e, f) : q.getImageDataHD(c, d, e, f)
},
module: function(b) {
if (ig._current) throw "Module '" +
ig._current.name + "' defines nothing";
if (ig.modules[b] && ig.modules[b].body) throw "Module '" + b + "' is already defined";
ig._current = {
name: b,
requires: [],
loaded: !1,
body: null
};
ig.modules[b] = ig._current;
ig._loadQueue.push(ig._current);
return ig
},
requires: function() {
ig._current.requires = Array.prototype.slice.call(arguments);
return ig
},
defines: function(b) {
ig._current.body = b;
ig._current = null;
ig._initDOMReady()
},
addResource: function(b) {
ig.resources.push(b)
},
setNocache: function(b) {
ig.nocache = b ? "?" + Date.now() : ""
},
log: function() {},
assert: function() {},
show: function() {},
mark: function() {},
_loadScript: function(b, c) {
ig.modules[b] = {
name: b,
requires: [],
loaded: !1,
body: null
};
ig._waitForOnload++;
var d = ig.prefix + ig.lib + b.replace(/\./g, "/") + ".js" + ig.nocache,
e = ig.$new("script");
e.type = "text/javascript";
e.src = d;
e.onload = function() {
ig._waitForOnload--;
ig._execModules()
};
e.onerror = function() {
throw "Failed to load module " + b + " at " + d + " required from " + c;
};
ig.$("head")[0].appendChild(e)
},
_execModules: function() {
for (var b = !1, c = 0; c < ig._loadQueue.length; c++) {
for (var d = ig._loadQueue[c], e = !0, f = 0; f < d.requires.length; f++) {
var j = d.requires[f];
ig.modules[j] ? ig.modules[j].loaded || (e = !1) : (e = !1, ig._loadScript(j, d.name))
}
e && d.body && (ig._loadQueue.splice(c, 1), d.loaded = !0, d.body(), b = !0, c--)
}
if (b) ig._execModules();
else if (!ig.baked && 0 == ig._waitForOnload && 0 != ig._loadQueue.length) {
b = [];
for (c = 0; c < ig._loadQueue.length; c++) {
e = [];
j = ig._loadQueue[c].requires;
for (f = 0; f < j.length; f++) d = ig.modules[j[f]], (!d || !d.loaded) && e.push(j[f]);
b.push(ig._loadQueue[c].name + " (requires: " + e.join(", ") + ")")
}
throw "Unresolved (or circular?) dependencies. Most likely there's a name/path mismatch for one of the listed modules or a previous syntax error prevents a module from loading:\n" + b.join("\n");
}
},
_DOMReady: function() {
if (!ig.modules["dom.ready"].loaded) {
if (!document.body) return setTimeout(ig._DOMReady, 13);
ig.modules["dom.ready"].loaded = !0;
ig._waitForOnload--;
ig._execModules()
}
return 0
},
_boot: function() {
document.location.href.match(/\?nocache/) && ig.setNocache(!0);
ig.ua.pixelRatio = b.devicePixelRatio || 1;
ig.ua.viewport = {
width: b.innerWidth,
height: b.innerHeight
};
ig.ua.screen = {
width: b.screen.availWidth * ig.ua.pixelRatio,
height: b.screen.availHeight * ig.ua.pixelRatio
};
ig.ua.iPhone = /iPhone/i.test(navigator.userAgent);
ig.ua.iPhone4 = ig.ua.iPhone && 2 == ig.ua.pixelRatio;
ig.ua.iPad = /iPad/i.test(navigator.userAgent);
ig.ua.android = /android/i.test(navigator.userAgent);
ig.ua.winPhone = /Windows Phone/i.test(navigator.userAgent);
ig.ua.is_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);
ig.ua.is_safari_or_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
ig.ua.iOS = ig.ua.iPhone || ig.ua.iPad;
ig.ua.iOS6_tag = /OS 6_/i.test(navigator.userAgent);
ig.ua.iOS6 = (ig.ua.iPhone || ig.ua.iPad) && ig.ua.iOS6_tag;
ig.ua.iOSgt5 = ig.ua.iOS && 5 < parseInt(navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/)[1]);
ig.ua.HTCONE = /HTC_One/i.test(navigator.userAgent);
ig.ua.winPhone = /Windows Phone/i.test(navigator.userAgent);
ig.ua.Kindle = /Silk/i.test(navigator.userAgent);
ig.ua.touchDevice = "ontouchstart" in
b || b.navigator.msMaxTouchPoints;
ig.ua.mobile = ig.ua.iOS || ig.ua.android || ig.ua.iOS6 || ig.ua.winPhone || ig.ua.Kindle || /mobile/i.test(navigator.userAgent)
},
_initDOMReady: function() {
ig.modules["dom.ready"] ? ig._execModules() : (ig._boot(), ig.modules["dom.ready"] = {
requires: [],
loaded: !1,
body: null
}, ig._waitForOnload++, "complete" === document.readyState ? ig._DOMReady() : (document.addEventListener("DOMContentLoaded", ig._DOMReady, !1), b.addEventListener("load", ig._DOMReady, !1)))
}
};
ig.normalizeVendorAttribute(b, "requestAnimationFrame");
if (b.requestAnimationFrame) {
var c = 1,
d = {};
b.ig.setAnimation = function(e, g) {
var f = c++;
d[f] = !0;
var j = function() {
d[f] && (b.requestAnimationFrame(j, g), e())
};
b.requestAnimationFrame(j, g);
return f
};
b.ig.clearAnimation = function(b) {
delete d[b]
}
} else b.ig.setAnimation = function(c) {
return b.setInterval(c, 1E3 / 60)
}, b.ig.clearAnimation = function(c) {
b.clearInterval(c)
};
var e = !1,
f = /xyz/.test(function() {
xyz
}) ? /\bparent\b/ : /.*/,
j = 0;
b.ig.Class = function() {};
var q = function(b) {
var c = this.prototype,
d = {},
e;
for (e in b) "function" == typeof b[e] && "function" == typeof c[e] && f.test(b[e]) ? (d[e] = c[e], c[e] = function(b, c) {
return function() {
var e = this.parent;
this.parent = d[b];
var g = c.apply(this, arguments);
this.parent = e;
return g
}
}(e, b[e])) : c[e] = b[e]
};
b.ig.Class.extend = function(c) {
function d() {
if (!e) {
if (this.staticInstantiate) {
var b = this.staticInstantiate.apply(this, arguments);
if (b) return b
}
for (var c in this) "object" == typeof this[c] && (this[c] = ig.copy(this[c]));
this.init && this.init.apply(this, arguments)
}
return this
}
var y = this.prototype;
e = !0;
var A = new this;
e = !1;
for (var z in c) A[z] = "function" == typeof c[z] && "function" == typeof y[z] && f.test(c[z]) ? function(b, c) {
return function() {
var d = this.parent;
this.parent = y[b];
var e = c.apply(this, arguments);
this.parent = d;
return e
}
}(z, c[z]) : c[z];
d.prototype = A;
d.prototype.constructor = d;
d.extend = b.ig.Class.extend;
d.inject = q;
d.classId = A.classId = ++j;
return d
};
b.ImpactMixin && ig.merge(ig, b.ImpactMixin)
})(window);
ig.baked = !0;
ig.module("impact.image").defines(function() {
ig.Image = ig.Class.extend({
data: null,
width: 0,
height: 0,
loaded: !1,
failed: !1,
loadCallback: null,
path: "",
staticInstantiate: function(b) {
return ig.Image.cache[b] || null
},
init: function(b) {
this.path = b;
this.load()
},
load: function(b) {
this.loaded ? b && b(this.path, !0) : (!this.loaded && ig.ready ? (this.loadCallback = b || null, this.data = new Image, this.data.onload = this.onload.bind(this), this.data.onerror = this.onerror.bind(this), this.data.src = ig.prefix + this.path + ig.nocache) : ig.addResource(this), ig.Image.cache[this.path] = this)
},
reload: function() {
this.loaded = !1;
this.data = new Image;
this.data.onload = this.onload.bind(this);
this.data.src = this.path + "?" + Date.now()
},
onload: function() {
this.width = this.data.width;
this.height = this.data.height;
this.loaded = !0;
1 != ig.system.scale && this.resize(ig.system.scale);
this.loadCallback && this.loadCallback(this.path, !0)
},
onerror: function() {
this.failed = !0;
this.loadCallback && this.loadCallback(this.path, !1)
},
resize: function(b) {
var c = ig.getImagePixels(this.data, 0, 0, this.width, this.height),
d = this.width * b,
e = this.height * b,
f = ig.$new("canvas");
f.width = d;
f.height = e;
for (var j = f.getContext("2d"), q = j.getImageData(0, 0, d, e), n = 0; n < e; n++)
for (var g = 0; g < d; g++) {
var y = 4 * (Math.floor(n / b) * this.width + Math.floor(g / b)),
A = 4 * (n * d + g);
q.data[A] = c.data[y];
q.data[A + 1] = c.data[y + 1];
q.data[A + 2] = c.data[y + 2];
q.data[A + 3] = c.data[y + 3]
}
j.putImageData(q, 0, 0);
this.data = f
},
draw: function(b, c, d, e, f, j) {
if (this.loaded) {
var q = ig.system.scale;
f = (f ? f : this.width) * q;
j = (j ? j : this.height) * q;
ig.system.context.drawImage(this.data, d ? d * q : 0, e ? e * q : 0, f, j, ig.system.getDrawPos(b), ig.system.getDrawPos(c), f, j);
ig.Image.drawCount++
}
},
drawTile: function(b, c, d, e, f, j, q) {
f = f ? f : e;
if (this.loaded && !(e > this.width || f > this.height)) {
var n = ig.system.scale,
g = Math.floor(e * n),
y = Math.floor(f * n),
A = j ? -1 : 1,
z = q ? -1 : 1;
if (j || q) ig.system.context.save(), ig.system.context.scale(A, z);
ig.system.context.drawImage(this.data, Math.floor(d * e) % this.width * n, Math.floor(d * e / this.width) * f * n, g, y, ig.system.getDrawPos(b) * A - (j ? g : 0), ig.system.getDrawPos(c) * z - (q ? y : 0), g, y);
(j || q) && ig.system.context.restore();
ig.Image.drawCount++
}
}
});
ig.Image.drawCount = 0;
ig.Image.cache = {};
ig.Image.reloadCache = function() {
for (var b in ig.Image.cache) ig.Image.cache[b].reload()
}
});
ig.baked = !0;
ig.module("impact.font").requires("impact.image").defines(function() {
ig.Font = ig.Image.extend({
widthMap: [],
indices: [],
firstChar: 32,
alpha: 1,
letterSpacing: 1,
lineSpacing: 0,
onload: function(b) {
this._loadMetrics(this.data);
this.parent(b)
},
widthForString: function(b) {
if (-1 !== b.indexOf("\n")) {
b = b.split("\n");
for (var c = 0, d = 0; d < b.length; d++) c = Math.max(c, this._widthForLine(b[d]));
return c
}
return this._widthForLine(b)
},
_widthForLine: function(b) {
for (var c = 0, d = 0; d < b.length; d++) c += this.widthMap[b.charCodeAt(d) - this.firstChar] +
this.letterSpacing;
return c
},
heightForString: function(b) {
return b.split("\n").length * (this.height + this.lineSpacing)
},
draw: function(b, c, d, e) {
"string" != typeof b && (b = b.toString());
if (-1 !== b.indexOf("\n")) {
b = b.split("\n");
for (var f = this.height + this.lineSpacing, j = 0; j < b.length; j++) this.draw(b[j], c, d + j * f, e)
} else {
if (e == ig.Font.ALIGN.RIGHT || e == ig.Font.ALIGN.CENTER) j = this._widthForLine(b), c -= e == ig.Font.ALIGN.CENTER ? j / 2 : j;
1 !== this.alpha && (ig.system.context.globalAlpha = this.alpha);
for (j = 0; j < b.length; j++) e = b.charCodeAt(j), c += this._drawChar(e - this.firstChar, c, d);
1 !== this.alpha && (ig.system.context.globalAlpha = 1);
ig.Image.drawCount += b.length
}
},
_drawChar: function(b, c, d) {
if (!this.loaded || 0 > b || b >= this.indices.length) return 0;
var e = ig.system.scale,
f = this.widthMap[b] * e,
j = (this.height - 2) * e;
ig.system.context.drawImage(this.data, this.indices[b] * e, 0, f, j, ig.system.getDrawPos(c), ig.system.getDrawPos(d), f, j);
return this.widthMap[b] + this.letterSpacing
},
_loadMetrics: function(b) {
this.height = b.height - 1;
this.widthMap = [];
this.indices = [];
for (var c = ig.getImagePixels(b, 0, b.height - 1, b.width, 1), d = 0, e = 0, f = 0; f < b.width; f++) {
var j = 4 * f + 3;
127 < c.data[j] ? e++ : 128 > c.data[j] && e && (this.widthMap.push(e), this.indices.push(f - e), d++, e = 0)
}
this.widthMap.push(e);
this.indices.push(f - e)
}
});
ig.Font.ALIGN = {
LEFT: 0,
RIGHT: 1,
CENTER: 2
}
});
ig.baked = !0;
ig.module("impact.sound").defines(function() {
ig.SoundManager = ig.Class.extend({
clips: {},
volume: 1,
format: null,
init: function() {
if (!ig.Sound.enabled || !window.Audio) ig.Sound.enabled = !1;
else {
for (var b = new Audio, c = 0; c < ig.Sound.use.length; c++) {
var d = ig.Sound.use[c];
if (b.canPlayType(d.mime)) {
this.format = d;
break
}
}
this.format || (ig.Sound.enabled = !1)
}
},
load: function(b, c, d) {
var e = ig.prefix + b.replace(/[^\.]+$/, this.format.ext) + ig.nocache;
if (this.clips[b]) {
if (c && this.clips[b].length < ig.Sound.channels)
for (c = this.clips[b].length; c < ig.Sound.channels; c++) {
var f = new Audio(e);
f.load();
this.clips[b].push(f)
}
return this.clips[b][0]
}
var j = new Audio(e);
d && (j.addEventListener("canplaythrough", function n(c) {
j.removeEventListener("canplaythrough", n, !1);
d(b, !0, c)
}, !1), j.addEventListener("error", function(c) {
d(b, !1, c)
}, !1));
j.preload = "auto";
j.load();
this.clips[b] = [j];
if (c)
for (c = 1; c < ig.Sound.channels; c++) f = new Audio(e), f.load(), this.clips[b].push(f);
return j
},
get: function(b) {
b = this.clips[b];
for (var c = 0, d; d = b[c++];)
if (d.paused || d.ended) return d.ended && (d.currentTime = 0), d;
b[0].pause();
b[0].currentTime = 0;
return b[0]
}
});
ig.Music = ig.Class.extend({
tracks: [],
namedTracks: {},
currentTrack: null,
currentIndex: 0,
random: !1,
_volume: 1,
_loop: !1,
_fadeInterval: 0,
_fadeTimer: null,
_endedCallbackBound: null,
init: function() {
this._endedCallbackBound = this._endedCallback.bind(this);
Object.defineProperty ? (Object.defineProperty(this, "volume", {
get: this.getVolume.bind(this),
set: this.setVolume.bind(this)
}), Object.defineProperty(this, "loop", {
get: this.getLooping.bind(this),
set: this.setLooping.bind(this)
})) : this.__defineGetter__ && (this.__defineGetter__("volume", this.getVolume.bind(this)), this.__defineSetter__("volume", this.setVolume.bind(this)), this.__defineGetter__("loop", this.getLooping.bind(this)), this.__defineSetter__("loop", this.setLooping.bind(this)))
},
add: function(b, c) {
if (ig.Sound.enabled) {
var d = ig.soundManager.load(b instanceof ig.Sound ? b.path : b, !1);
d.loop = this._loop;
d.volume = this._volume;
d.addEventListener("ended", this._endedCallbackBound, !1);
this.tracks.push(d);
c && (this.namedTracks[c] = d);
this.currentTrack || (this.currentTrack = d)
}
},
next: function() {
this.tracks.length && (this.stop(), this.currentIndex = this.random ? Math.floor(Math.random() * this.tracks.length) : (this.currentIndex + 1) % this.tracks.length, this.currentTrack = this.tracks[this.currentIndex], this.play())
},
pause: function() {
this.currentTrack && this.currentTrack.pause()
},
stop: function() {
this.currentTrack && (this.currentTrack.pause(), this.currentTrack.currentTime = 0)
},
play: function(b) {
if (b && this.namedTracks[b]) b = this.namedTracks[b], b != this.currentTrack && (this.stop(), this.currentTrack = b);
else if (!this.currentTrack) return;
this.currentTrack.play()
},
getLooping: function() {
return this._loop
},
setLooping: function(b) {
this._loop = b;
for (var c in this.tracks) this.tracks[c].loop = b
},
getVolume: function() {
return this._volume
},
setVolume: function(b) {
this._volume = b.limit(0, 1);
for (var c in this.tracks) this.tracks[c].volume = this._volume
},
fadeOut: function(b) {
this.currentTrack && (clearInterval(this._fadeInterval), this.fadeTimer = new ig.Timer(b), this._fadeInterval = setInterval(this._fadeStep.bind(this), 50))
},
_fadeStep: function() {
var b = this.fadeTimer.delta().map(-this.fadeTimer.target, 0, 1, 0).limit(0, 1) * this._volume;
0.01 >= b ? (this.stop(), this.currentTrack.volume = this._volume, clearInterval(this._fadeInterval)) : this.currentTrack.volume = b
},
_endedCallback: function() {
this._loop ? this.play() : this.next()
}
});
ig.Sound = ig.Class.extend({
path: "",
volume: 1,
currentClip: null,
multiChannel: !0,
init: function(b, c) {
this.path = b;
this.multiChannel = !1 !== c;
this.load()
},
load: function(b) {
ig.Sound.enabled ? ig.ready ? ig.soundManager.load(this.path, this.multiChannel, b) : ig.addResource(this) : b && b(this.path, !0)
},
play: function() {
ig.Sound.enabled && (this.currentClip = ig.soundManager.get(this.path), this.currentClip.volume = ig.soundManager.volume * this.volume, this.currentClip.play())
},
stop: function() {
this.currentClip && (this.currentClip.pause(), this.currentClip.currentTime = 0)
}
});
ig.Sound.FORMAT = {
MP3: {
ext: "mp3",
mime: "audio/mpeg"
},
M4A: {
ext: "m4a",
mime: "audio/mp4; codecs=mp4a"
},
OGG: {
ext: "ogg",
mime: "audio/ogg; codecs=vorbis"
},
WEBM: {
ext: "webm",
mime: "audio/webm; codecs=vorbis"
},
CAF: {
ext: "caf",
mime: "audio/x-caf"
}
};
ig.Sound.use = [ig.Sound.FORMAT.OGG, ig.Sound.FORMAT.MP3];
ig.Sound.channels = 4;
ig.Sound.enabled = !0
});
ig.baked = !0;
ig.module("impact.loader").requires("impact.image", "impact.font", "impact.sound").defines(function() {
ig.Loader = ig.Class.extend({
resources: [],
gameClass: null,
status: 0,
done: !1,
_unloaded: [],
_drawStatus: 0,
_intervalId: 0,
_loadCallbackBound: null,
init: function(b, c) {
this.gameClass = b;
this.resources = c;
this._loadCallbackBound = this._loadCallback.bind(this);
for (var d = 0; d < this.resources.length; d++) this._unloaded.push(this.resources[d].path)
},
load: function() {
ig.system.clear("#000");
if (this.resources.length) {
for (var b = 0; b < this.resources.length; b++) this.loadResource(this.resources[b]);
this._intervalId = setInterval(this.draw.bind(this), 16)
} else this.end()
},
loadResource: function(b) {
b.load(this._loadCallbackBound)
},
end: function() {
this.done || (this.done = !0, clearInterval(this._intervalId))
},
draw: function() {},
_loadCallback: function(b, c) {
if (c) this._unloaded.erase(b);
else throw "Failed to load resource: " + b;
this.status = 1 - this._unloaded.length / this.resources.length;
0 == this._unloaded.length && setTimeout(this.end.bind(this), 250)
}
})
});
ig.baked = !0;
ig.module("impact.timer").defines(function() {
ig.Timer = ig.Class.extend({
target: 0,
base: 0,
last: 0,
pausedAt: 0,
init: function(b) {
this.last = this.base = ig.Timer.time;
this.target = b || 0
},
set: function(b) {
this.target = b || 0;
this.base = ig.Timer.time;
this.pausedAt = 0
},
reset: function() {
this.base = ig.Timer.time;
this.pausedAt = 0
},
tick: function() {
var b = ig.Timer.time - this.last;
this.last = ig.Timer.time;
return this.pausedAt ? 0 : b
},
delta: function() {
return (this.pausedAt || ig.Timer.time) - this.base - this.target
},
pause: function() {
this.pausedAt || (this.pausedAt = ig.Timer.time)
},
unpause: function() {
this.pausedAt && (this.base += ig.Timer.time - this.pausedAt, this.pausedAt = 0)
}
});
ig.Timer._last = 0;
ig.Timer.time = Number.MIN_VALUE;
ig.Timer.timeScale = 1;
ig.Timer.maxStep = 0.05;
ig.Timer.step = function() {
var b = Date.now();
ig.Timer.time += Math.min((b - ig.Timer._last) / 1E3, ig.Timer.maxStep) * ig.Timer.timeScale;
ig.Timer._last = b
}
});
ig.baked = !0;
ig.module("impact.system").requires("impact.timer", "impact.image").defines(function() {
ig.System = ig.Class.extend({
fps: 30,
width: 320,
height: 240,
realWidth: 320,
realHeight: 240,
scale: 1,
tick: 0,
animationId: 0,
newGameClass: null,
running: !1,
delegate: null,
clock: null,
canvas: null,
context: null,
init: function(b, c, d, e, f) {
this.fps = c;
this.clock = new ig.Timer;
this.canvas = ig.$(b);
this.resize(d, e, f);
this.context = this.canvas.getContext("2d");
this.getDrawPos = ig.System.drawMode;
1 != this.scale && (ig.System.scaleMode = ig.System.SCALE.CRISP);
ig.System.scaleMode(this.canvas, this.context)
},
resize: function(b, c, d) {
this.width = b;
this.height = c;
this.scale = d || this.scale;
this.realWidth = this.width * this.scale;
this.realHeight = this.height * this.scale;
this.canvas.width = this.realWidth;
this.canvas.height = this.realHeight
},
setGame: function(b) {
this.running ? this.newGameClass = b : this.setGameNow(b)
},
setGameNow: function(b) {
ig.game = new b;
ig.system.setDelegate(ig.game)
},
setDelegate: function(b) {
if ("function" == typeof b.run) this.delegate = b, this.startRunLoop();
else throw "System.setDelegate: No run() function in object";
},
stopRunLoop: function() {
ig.clearAnimation(this.animationId);
this.running = !1
},
startRunLoop: function() {
this.stopRunLoop();
this.animationId = ig.setAnimation(this.run.bind(this), this.canvas);
this.running = !0
},
clear: function(b) {
this.context.fillStyle = b;
this.context.fillRect(0, 0, this.realWidth, this.realHeight)
},
run: function() {
ig.Timer.step();
this.tick = this.clock.tick();
this.delegate.run();
ig.input.clearPressed();
this.newGameClass && (this.setGameNow(this.newGameClass), this.newGameClass = null)
},
getDrawPos: null
});
ig.System.DRAW = {
AUTHENTIC: function(b) {
return Math.round(b) * this.scale
},
SMOOTH: function(b) {
return Math.round(b * this.scale)
},
SUBPIXEL: function(b) {
return b * this.scale
}
};
ig.System.drawMode = ig.System.DRAW.SMOOTH;
ig.System.SCALE = {
CRISP: function(b, c) {
ig.setVendorAttribute(c, "imageSmoothingEnabled", !1);
b.style.imageRendering = "-moz-crisp-edges";
b.style.imageRendering = "-o-crisp-edges";
b.style.imageRendering = "-webkit-optimize-contrast";
b.style.imageRendering = "crisp-edges";
b.style.msInterpolationMode = "nearest-neighbor"
},
SMOOTH: function(b, c) {
ig.setVendorAttribute(c, "imageSmoothingEnabled", !0);
b.style.imageRendering = "";
b.style.msInterpolationMode = ""
}
};
ig.System.scaleMode = ig.System.SCALE.SMOOTH
});
ig.baked = !0;
ig.module("impact.input").defines(function() {
ig.KEY = {
MOUSE1: -1,
MOUSE2: -3,
MWHEEL_UP: -4,
MWHEEL_DOWN: -5,
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
PAUSE: 19,
CAPS: 20,
ESC: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT_ARROW: 37,
UP_ARROW: 38,
RIGHT_ARROW: 39,
DOWN_ARROW: 40,
INSERT: 45,
DELETE: 46,
_0: 48,
_1: 49,
_2: 50,
_3: 51,
_4: 52,
_5: 53,
_6: 54,
_7: 55,
_8: 56,
_9: 57,
A: 65,
B: 66,
C: 67,
D: 68,
E: 69,
F: 70,
G: 71,
H: 72,
I: 73,
J: 74,
K: 75,
L: 76,
M: 77,
N: 78,
O: 79,
P: 80,
Q: 81,
R: 82,
S: 83,
T: 84,
U: 85,
V: 86,
W: 87,
X: 88,
Y: 89,
Z: 90,
NUMPAD_0: 96,
NUMPAD_1: 97,
NUMPAD_2: 98,
NUMPAD_3: 99,
NUMPAD_4: 100,
NUMPAD_5: 101,
NUMPAD_6: 102,
NUMPAD_7: 103,
NUMPAD_8: 104,
NUMPAD_9: 105,
MULTIPLY: 106,
ADD: 107,
SUBSTRACT: 109,
DECIMAL: 110,
DIVIDE: 111,
F1: 112,
F2: 113,
F3: 114,
F4: 115,
F5: 116,
F6: 117,
F7: 118,
F8: 119,
F9: 120,
F10: 121,
F11: 122,
F12: 123,
SHIFT: 16,
CTRL: 17,
ALT: 18,
PLUS: 187,
COMMA: 188,
MINUS: 189,
PERIOD: 190
};
ig.Input = ig.Class.extend({
bindings: {},
actions: {},
presses: {},
locks: {},
delayedKeyup: {},
isUsingMouse: !1,
isUsingKeyboard: !1,
isUsingAccelerometer: !1,
mouse: {
x: 0,
y: 0
},
accel: {
x: 0,
y: 0,
z: 0
},
initMouse: function() {
if (!this.isUsingMouse) {
this.isUsingMouse = !0;
var b = this.mousewheel.bind(this);
ig.system.canvas.addEventListener("mousewheel", b, !1);
ig.system.canvas.addEventListener("DOMMouseScroll", b, !1);
ig.system.canvas.addEventListener("contextmenu", this.contextmenu.bind(this), !1);
ig.system.canvas.addEventListener("mousedown", this.keydown.bind(this), !1);
ig.system.canvas.addEventListener("mouseup", this.keyup.bind(this), !1);
ig.system.canvas.addEventListener("mousemove", this.mousemove.bind(this), !1);
ig.ua.touchDevice && (ig.system.canvas.addEventListener("touchstart", this.keydown.bind(this), !1), ig.system.canvas.addEventListener("touchend", this.keyup.bind(this), !1), ig.system.canvas.addEventListener("touchmove", this.mousemove.bind(this), !1), ig.system.canvas.addEventListener("MSPointerDown", this.keydown.bind(this), !1), ig.system.canvas.addEventListener("MSPointerUp", this.keyup.bind(this), !1), ig.system.canvas.addEventListener("MSPointerMove", this.mousemove.bind(this), !1), ig.system.canvas.style.msTouchAction = "none")
}
},
initKeyboard: function() {
this.isUsingKeyboard || (this.isUsingKeyboard = !0, window.addEventListener("keydown", this.keydown.bind(this), !1), window.addEventListener("keyup", this.keyup.bind(this), !1))
},
initAccelerometer: function() {
this.isUsingAccelerometer || window.addEventListener("devicemotion", this.devicemotion.bind(this), !1)
},
mousewheel: function(b) {
var c = this.bindings[0 < (b.wheelDelta ? b.wheelDelta : -1 * b.detail) ? ig.KEY.MWHEEL_UP : ig.KEY.MWHEEL_DOWN];
c && (this.actions[c] = !0, this.presses[c] = !0, this.delayedKeyup[c] = !0, b.stopPropagation(), b.preventDefault())
},
mousemove: function(b) {
var c = parseInt(ig.system.canvas.offsetWidth) || ig.system.realWidth;
ig.ua.mobile && (c = ig.system.realWidth);
var c = ig.system.scale * (c / ig.system.realWidth),
d = {
left: 0,
top: 0
};
ig.system.canvas.getBoundingClientRect && (d = ig.system.canvas.getBoundingClientRect());
b = b.touches ? b.touches[0] : b;
this.mouse.x = (b.clientX - d.left) / c;
this.mouse.y = (b.clientY - d.top) / c
},
contextmenu: function(b) {
this.bindings[ig.KEY.MOUSE2] && (b.stopPropagation(), b.preventDefault())
},
keydown: function(b) {
var c = b.target.tagName;
if (!("INPUT" == c || "TEXTAREA" ==
c))
if (c = "keydown" == b.type ? b.keyCode : 2 == b.button ? ig.KEY.MOUSE2 : ig.KEY.MOUSE1, ("touchstart" == b.type || "mousedown" == b.type) && this.mousemove(b), c = this.bindings[c]) this.actions[c] = !0, this.locks[c] || (this.presses[c] = !0, this.locks[c] = !0), b.stopPropagation(), b.preventDefault()
},
keyup: function(b) {
var c = b.target.tagName;
if (!("INPUT" == c || "TEXTAREA" == c))
if (c = this.bindings["keyup" == b.type ? b.keyCode : 2 == b.button ? ig.KEY.MOUSE2 : ig.KEY.MOUSE1]) this.delayedKeyup[c] = !0, b.stopPropagation(), b.preventDefault()
},
devicemotion: function(b) {
this.accel = b.accelerationIncludingGravity
},
bind: function(b, c) {
0 > b ? this.initMouse() : 0 < b && this.initKeyboard();
this.bindings[b] = c
},
bindTouch: function(b, c) {
var d = ig.$(b),
e = this;
d.addEventListener("touchstart", function(b) {
e.touchStart(b, c)
}, !1);
d.addEventListener("touchend", function(b) {
e.touchEnd(b, c)
}, !1);
d.addEventListener("MSPointerDown", function(b) {
e.touchStart(b, c)
}, !1);
d.addEventListener("MSPointerUp", function(b) {
e.touchEnd(b, c)
}, !1)
},
unbind: function(b) {
this.delayedKeyup[this.bindings[b]] = !0;
this.bindings[b] = null
},
unbindAll: function() {
this.bindings = {};
this.actions = {};
this.presses = {};
this.locks = {};
this.delayedKeyup = {}
},
state: function(b) {
return this.actions[b]
},
pressed: function(b) {
return this.presses[b]
},
released: function(b) {
return !!this.delayedKeyup[b]
},
clearPressed: function() {
for (var b in this.delayedKeyup) this.actions[b] = !1, this.locks[b] = !1;
this.delayedKeyup = {};
this.presses = {}
},
touchStart: function(b, c) {
this.actions[c] = !0;
this.presses[c] = !0;
b.stopPropagation();
b.preventDefault();
return !1
},
touchEnd: function(b, c) {
this.delayedKeyup[c] = !0;
b.stopPropagation();
b.preventDefault();
return !1
}
})
});
ig.baked = !0;
ig.module("impact.impact").requires("dom.ready", "impact.loader", "impact.system", "impact.input", "impact.sound").defines(function() {
ig.main = function(b, c, d, e, f, j, q) {
ig.system = new ig.System(b, d, e, f, j || 1);
ig.input = new ig.Input;
ig.soundManager = new ig.SoundManager;
ig.music = new ig.Music;
ig.ready = !0;
(new(q || ig.Loader)(c, ig.resources)).load()
}
});
ig.baked = !0;
ig.module("impact.animation").requires("impact.timer", "impact.image").defines(function() {
ig.AnimationSheet = ig.Class.extend({
width: 8,
height: 8,
image: null,
init: function(b, c, d) {
this.width = c;
this.height = d;
this.image = new ig.Image(b)
}
});
ig.Animation = ig.Class.extend({
sheet: null,
timer: null,
sequence: [],
flip: {
x: !1,
y: !1
},
pivot: {
x: 0,
y: 0
},
frame: 0,
tile: 0,
loopCount: 0,
alpha: 1,
angle: 0,
init: function(b, c, d, e) {
this.sheet = b;
this.pivot = {
x: b.width / 2,
y: b.height / 2
};
this.timer = new ig.Timer;
this.frameTime = c;
this.sequence = d;
this.stop = !!e;
this.tile = this.sequence[0]
},
rewind: function() {
this.timer.set();
this.frame = this.loopCount = 0;
this.tile = this.sequence[0];
return this
},
gotoFrame: function(b) {
this.timer.set(this.frameTime * -b - 1E-4);
this.update()
},
gotoRandomFrame: function() {
this.gotoFrame(Math.floor(Math.random() * this.sequence.length))
},
update: function() {
var b = Math.floor(this.timer.delta() / this.frameTime);
this.loopCount = Math.floor(b / this.sequence.length);
this.frame = this.stop && 0 < this.loopCount ? this.sequence.length - 1 : b % this.sequence.length;
this.tile = this.sequence[this.frame]
},
draw: function(b, c) {
var d = Math.max(this.sheet.width, this.sheet.height);
b > ig.system.width || c > ig.system.height || (0 > b + d || 0 > c + d) || (1 != this.alpha && (ig.system.context.globalAlpha = this.alpha), 0 == this.angle ? this.sheet.image.drawTile(b, c, this.tile, this.sheet.width, this.sheet.height, this.flip.x, this.flip.y) : (ig.system.context.save(), ig.system.context.translate(ig.system.getDrawPos(b + this.pivot.x), ig.system.getDrawPos(c + this.pivot.y)), ig.system.context.rotate(this.angle), this.sheet.image.drawTile(-this.pivot.x, -this.pivot.y, this.tile, this.sheet.width, this.sheet.height, this.flip.x, this.flip.y), ig.system.context.restore()), 1 != this.alpha && (ig.system.context.globalAlpha = 1))
}
})
});
ig.baked = !0;
ig.module("impact.entity").requires("impact.animation", "impact.impact").defines(function() {
ig.Entity = ig.Class.extend({
id: 0,
settings: {},
size: {
x: 16,
y: 16
},
offset: {
x: 0,
y: 0
},
pos: {
x: 0,
y: 0
},
last: {
x: 0,
y: 0
},
vel: {
x: 0,
y: 0
},
accel: {
x: 0,
y: 0
},
friction: {
x: 0,
y: 0
},
maxVel: {
x: 100,
y: 100
},
zIndex: 0,
gravityFactor: 1,
standing: !1,
bounciness: 0,
minBounceVelocity: 40,
anims: {},
animSheet: null,
currentAnim: null,
health: 10,
type: 0,
checkAgainst: 0,
collides: 0,
_killed: !1,
slopeStanding: {
min: (44).toRad(),
max: (136).toRad()
},
init: function(b, c, d) {
this.id = ++ig.Entity._lastId;
this.pos.x = this.last.x = b;
this.pos.y = this.last.y = c;
ig.merge(this, d)
},
reset: function(b, c, d) {
var e = this.constructor.prototype;
this.pos.x = b;
this.pos.y = c;
this.last.x = b;
this.last.y = c;
this.vel.x = e.vel.x;
this.vel.y = e.vel.y;
this.accel.x = e.accel.x;
this.accel.y = e.accel.y;
this.health = e.health;
this._killed = e._killed;
this.standing = e.standing;
this.type = e.type;
this.checkAgainst = e.checkAgainst;
this.collides = e.collides;
ig.merge(this, d)
},
addAnim: function(b, c, d, e) {
if (!this.animSheet) throw "No animSheet to add the animation " +
b + " to.";
c = new ig.Animation(this.animSheet, c, d, e);
this.anims[b] = c;
this.currentAnim || (this.currentAnim = c);
return c
},
update: function() {
this.last.x = this.pos.x;
this.last.y = this.pos.y;
this.vel.y += ig.game.gravity * ig.system.tick * this.gravityFactor;
this.vel.x = this.getNewVelocity(this.vel.x, this.accel.x, this.friction.x, this.maxVel.x);
this.vel.y = this.getNewVelocity(this.vel.y, this.accel.y, this.friction.y, this.maxVel.y);
var b = ig.game.collisionMap.trace(this.pos.x, this.pos.y, this.vel.x * ig.system.tick, this.vel.y * ig.system.tick, this.size.x, this.size.y);
this.handleMovementTrace(b);
this.currentAnim && this.currentAnim.update()
},
getNewVelocity: function(b, c, d, e) {
return c ? (b + c * ig.system.tick).limit(-e, e) : d ? (c = d * ig.system.tick, 0 < b - c ? b - c : 0 > b + c ? b + c : 0) : b.limit(-e, e)
},
handleMovementTrace: function(b) {
this.standing = !1;
b.collision.y && (0 < this.bounciness && Math.abs(this.vel.y) > this.minBounceVelocity ? this.vel.y *= -this.bounciness : (0 < this.vel.y && (this.standing = !0), this.vel.y = 0));
b.collision.x && (this.vel.x = 0 < this.bounciness && Math.abs(this.vel.x) > this.minBounceVelocity ? this.vel.x * -this.bounciness : 0);
if (b.collision.slope) {
var c = b.collision.slope;
if (0 < this.bounciness) {
var d = this.vel.x * c.nx + this.vel.y * c.ny;
this.vel.x = (this.vel.x - 2 * c.nx * d) * this.bounciness;
this.vel.y = (this.vel.y - 2 * c.ny * d) * this.bounciness
} else d = (this.vel.x * c.x + this.vel.y * c.y) / (c.x * c.x + c.y * c.y), this.vel.x = c.x * d, this.vel.y = c.y * d, c = Math.atan2(c.x, c.y), c > this.slopeStanding.min && c < this.slopeStanding.max && (this.standing = !0)
}
this.pos = b.pos
},
draw: function() {
this.currentAnim && this.currentAnim.draw(this.pos.x -
this.offset.x - ig.game._rscreen.x, this.pos.y - this.offset.y - ig.game._rscreen.y)
},
kill: function() {
ig.game.removeEntity(this)
},
receiveDamage: function(b) {
this.health -= b;
0 >= this.health && this.kill()
},
touches: function(b) {
return !(this.pos.x >= b.pos.x + b.size.x || this.pos.x + this.size.x <= b.pos.x || this.pos.y >= b.pos.y + b.size.y || this.pos.y + this.size.y <= b.pos.y)
},
distanceTo: function(b) {
var c = this.pos.x + this.size.x / 2 - (b.pos.x + b.size.x / 2);
b = this.pos.y + this.size.y / 2 - (b.pos.y + b.size.y / 2);
return Math.sqrt(c * c + b * b)
},
angleTo: function(b) {
return Math.atan2(b.pos.y +
b.size.y / 2 - (this.pos.y + this.size.y / 2), b.pos.x + b.size.x / 2 - (this.pos.x + this.size.x / 2))
},
check: function() {},
collideWith: function() {},
ready: function() {},
erase: function() {}
});
ig.Entity._lastId = 0;
ig.Entity.COLLIDES = {
NEVER: 0,
LITE: 1,
PASSIVE: 2,
ACTIVE: 4,
FIXED: 8
};
ig.Entity.TYPE = {
NONE: 0,
A: 1,
B: 2,
BOTH: 3
};
ig.Entity.checkPair = function(b, c) {
b.checkAgainst & c.type && b.check(c);
c.checkAgainst & b.type && c.check(b);
b.collides && c.collides && b.collides + c.collides > ig.Entity.COLLIDES.ACTIVE && ig.Entity.solveCollision(b, c)
};
ig.Entity.solveCollision = function(b, c) {
var d = null;
if (b.collides == ig.Entity.COLLIDES.LITE || c.collides == ig.Entity.COLLIDES.FIXED) d = b;
else if (c.collides == ig.Entity.COLLIDES.LITE || b.collides == ig.Entity.COLLIDES.FIXED) d = c;
b.last.x + b.size.x > c.last.x && b.last.x < c.last.x + c.size.x ? (b.last.y < c.last.y ? ig.Entity.seperateOnYAxis(b, c, d) : ig.Entity.seperateOnYAxis(c, b, d), b.collideWith(c, "y"), c.collideWith(b, "y")) : b.last.y + b.size.y > c.last.y && b.last.y < c.last.y + c.size.y && (b.last.x < c.last.x ? ig.Entity.seperateOnXAxis(b, c, d) : ig.Entity.seperateOnXAxis(c, b, d), b.collideWith(c, "x"), c.collideWith(b, "x"))
};
ig.Entity.seperateOnXAxis = function(b, c, d) {
var e = b.pos.x + b.size.x - c.pos.x;
d ? (d.vel.x = -d.vel.x * d.bounciness + (b === d ? c : b).vel.x, c = ig.game.collisionMap.trace(d.pos.x, d.pos.y, d == b ? -e : e, 0, d.size.x, d.size.y), d.pos.x = c.pos.x) : (d = (b.vel.x - c.vel.x) / 2, b.vel.x = -d, c.vel.x = d, d = ig.game.collisionMap.trace(b.pos.x, b.pos.y, -e / 2, 0, b.size.x, b.size.y), b.pos.x = Math.floor(d.pos.x), b = ig.game.collisionMap.trace(c.pos.x, c.pos.y, e / 2, 0, c.size.x, c.size.y), c.pos.x = Math.ceil(b.pos.x))
};
ig.Entity.seperateOnYAxis = function(b, c, d) {
var e = b.pos.y + b.size.y - c.pos.y;
if (d) {
c = b === d ? c : b;
d.vel.y = -d.vel.y * d.bounciness + c.vel.y;
var f = 0;
d == b && Math.abs(d.vel.y - c.vel.y) < d.minBounceVelocity && (d.standing = !0, f = c.vel.x * ig.system.tick);
b = ig.game.collisionMap.trace(d.pos.x, d.pos.y, f, d == b ? -e : e, d.size.x, d.size.y);
d.pos.y = b.pos.y;
d.pos.x = b.pos.x
} else ig.game.gravity && (c.standing || 0 < b.vel.y) ? (d = ig.game.collisionMap.trace(b.pos.x, b.pos.y, 0, -(b.pos.y + b.size.y - c.pos.y), b.size.x, b.size.y), b.pos.y = d.pos.y, 0 < b.bounciness && b.vel.y > b.minBounceVelocity ? b.vel.y *= -b.bounciness : (b.standing = !0, b.vel.y = 0)) : (d = (b.vel.y - c.vel.y) / 2, b.vel.y = -d, c.vel.y = d, f = c.vel.x * ig.system.tick, d = ig.game.collisionMap.trace(b.pos.x, b.pos.y, f, -e / 2, b.size.x, b.size.y), b.pos.y = d.pos.y, b = ig.game.collisionMap.trace(c.pos.x, c.pos.y, 0, e / 2, c.size.x, c.size.y), c.pos.y = b.pos.y)
}
});
ig.baked = !0;
ig.module("impact.map").defines(function() {
ig.Map = ig.Class.extend({
tilesize: 8,
width: 1,
height: 1,
data: [
[]
],
name: null,
init: function(b, c) {
this.tilesize = b;
this.data = c;
this.height = c.length;
this.width = c[0].length;
this.pxWidth = this.width * this.tilesize;
this.pxHeight = this.height * this.tilesize
},
getTile: function(b, c) {
var d = Math.floor(b / this.tilesize),
e = Math.floor(c / this.tilesize);
return 0 <= d && d < this.width && 0 <= e && e < this.height ? this.data[e][d] : 0
},
setTile: function(b, c, d) {
b = Math.floor(b / this.tilesize);
c = Math.floor(c /
this.tilesize);
0 <= b && b < this.width && 0 <= c && c < this.height && (this.data[c][b] = d)
}
})
});
ig.baked = !0;
ig.module("impact.collision-map").requires("impact.map").defines(function() {
ig.CollisionMap = ig.Map.extend({
lastSlope: 1,
tiledef: null,
init: function(b, c, f) {
this.parent(b, c);
this.tiledef = f || ig.CollisionMap.defaultTileDef;
for (var j in this.tiledef) j | 0 > this.lastSlope && (this.lastSlope = j | 0)
},
trace: function(b, c, f, j, q, n) {
var g = {
collision: {
x: !1,
y: !1,
slope: !1
},
pos: {
x: b,
y: c
},
tile: {
x: 0,
y: 0
}
},
y = Math.ceil(Math.max(Math.abs(f), Math.abs(j)) / this.tilesize);
if (1 < y)
for (var A = f / y, z = j / y, B = 0; B < y && (A || z) && !(this._traceStep(g,
b, c, A, z, q, n, f, j, B), b = g.pos.x, c = g.pos.y, g.collision.x && (f = A = 0), g.collision.y && (j = z = 0), g.collision.slope); B++);
else this._traceStep(g, b, c, f, j, q, n, f, j, 0);
return g
},
_traceStep: function(b, c, f, j, q, n, g, y, A, z) {
b.pos.x += j;
b.pos.y += q;
var B = 0;
if (j) {
var C = 0 < j ? n : 0,
G = 0 > j ? this.tilesize : 0,
B = Math.max(Math.floor(f / this.tilesize), 0),
I = Math.min(Math.ceil((f + g) / this.tilesize), this.height);
j = Math.floor((b.pos.x + C) / this.tilesize);
var u = Math.floor((c + C) / this.tilesize);
if (0 < z || j == u || 0 > u || u >= this.width) u = -1;
if (0 <= j && j < this.width)
for (var L =
B; L < I && !(-1 != u && (B = this.data[L][u], 1 < B && B <= this.lastSlope && this._checkTileDef(b, B, c, f, y, A, n, g, u, L))); L++)
if (B = this.data[L][j], 1 == B || B > this.lastSlope || 1 < B && this._checkTileDef(b, B, c, f, y, A, n, g, j, L)) {
if (1 < B && B <= this.lastSlope && b.collision.slope) break;
b.collision.x = !0;
b.tile.x = B;
c = b.pos.x = j * this.tilesize - C + G;
y = 0;
break
}
}
if (q) {
C = 0 < q ? g : 0;
q = 0 > q ? this.tilesize : 0;
B = Math.max(Math.floor(b.pos.x / this.tilesize), 0);
G = Math.min(Math.ceil((b.pos.x + n) / this.tilesize), this.width);
L = Math.floor((b.pos.y + C) / this.tilesize);
I = Math.floor((f + C) / this.tilesize);
if (0 < z || L == I || 0 > I || I >= this.height) I = -1;
if (0 <= L && L < this.height)
for (j = B; j < G && !(-1 != I && (B = this.data[I][j], 1 < B && B <= this.lastSlope && this._checkTileDef(b, B, c, f, y, A, n, g, j, I))); j++)
if (B = this.data[L][j], 1 == B || B > this.lastSlope || 1 < B && this._checkTileDef(b, B, c, f, y, A, n, g, j, L)) {
if (1 < B && B <= this.lastSlope && b.collision.slope) break;
b.collision.y = !0;
b.tile.y = B;
b.pos.y = L * this.tilesize - C + q;
break
}
}
},
_checkTileDef: function(b, c, f, j, q, n, g, y, A, z) {
var B = this.tiledef[c];
if (!B) return !1;
c = (B[2] -
B[0]) * this.tilesize;
var C = (B[3] - B[1]) * this.tilesize,
G = B[4];
g = f + q + (0 > C ? g : 0) - (A + B[0]) * this.tilesize;
y = j + n + (0 < c ? y : 0) - (z + B[1]) * this.tilesize;
if (0 < c * y - C * g) {
if (0 > q * -C + n * c) return G;
A = Math.sqrt(c * c + C * C);
z = C / A;
A = -c / A;
var I = g * z + y * A,
B = z * I,
I = A * I;
if (B * B + I * I >= q * q + n * n) return G || 0.5 > c * (y - n) - C * (g - q);
b.pos.x = f + q - B;
b.pos.y = j + n - I;
b.collision.slope = {
x: c,
y: C,
nx: z,
ny: A
};
return !0
}
return !1
}
});
var b = 1 / 3,
c = 2 / 3;
ig.CollisionMap.defaultTileDef = {
5: [0, 1, 1, c, !0],
6: [0, c, 1, b, !0],
7: [0, b, 1, 0, !0],
3: [0, 1, 1, 0.5, !0],
4: [0, 0.5, 1, 0, !0],
2: [0, 1, 1, 0, !0],
10: [0.5, 1, 1, 0, !0],
21: [0, 1, 0.5, 0, !0],
32: [c, 1, 1, 0, !0],
43: [b, 1, c, 0, !0],
54: [0, 1, b, 0, !0],
27: [0, 0, 1, b, !0],
28: [0, b, 1, c, !0],
29: [0, c, 1, 1, !0],
25: [0, 0, 1, 0.5, !0],
26: [0, 0.5, 1, 1, !0],
24: [0, 0, 1, 1, !0],
11: [0, 0, 0.5, 1, !0],
22: [0.5, 0, 1, 1, !0],
33: [0, 0, b, 1, !0],
44: [b, 0, c, 1, !0],
55: [c, 0, 1, 1, !0],
16: [1, b, 0, 0, !0],
17: [1, c, 0, b, !0],
18: [1, 1, 0, c, !0],
14: [1, 0.5, 0, 0, !0],
15: [1, 1, 0, 0.5, !0],
13: [1, 1, 0, 0, !0],
8: [0.5, 1, 0, 0, !0],
19: [1, 1, 0.5, 0, !0],
30: [b, 1, 0, 0, !0],
41: [c, 1, b, 0, !0],
52: [1, 1, c, 0, !0],
38: [1, c, 0, 1, !0],
39: [1, b, 0, c, !0],
40: [1, 0, 0, b, !0],
36: [1, 0.5, 0, 1, !0],
37: [1, 0, 0, 0.5, !0],
35: [1, 0, 0, 1, !0],
9: [1, 0, 0.5, 1, !0],
20: [0.5, 0, 0, 1, !0],
31: [1, 0, c, 1, !0],
42: [c, 0, b, 1, !0],
53: [b, 0, 0, 1, !0],
12: [0, 0, 1, 0, !1],
23: [1, 1, 0, 1, !1],
34: [1, 0, 1, 1, !1],
45: [0, 1, 0, 0, !1]
};
ig.CollisionMap.staticNoCollision = {
trace: function(b, c, f, j) {
return {
collision: {
x: !1,
y: !1,
slope: !1
},
pos: {
x: b + f,
y: c + j
},
tile: {
x: 0,
y: 0
}
}
}
}
});
ig.baked = !0;
ig.module("impact.background-map").requires("impact.map", "impact.image").defines(function() {
ig.BackgroundMap = ig.Map.extend({
tiles: null,
scroll: {
x: 0,
y: 0
},
distance: 1,
repeat: !1,
tilesetName: "",
foreground: !1,
enabled: !0,
preRender: !1,
preRenderedChunks: null,
chunkSize: 512,
debugChunks: !1,
anims: {},
init: function(b, c, d) {
this.parent(b, c);
this.setTileset(d)
},
setTileset: function(b) {
this.tilesetName = b instanceof ig.Image ? b.path : b;
this.tiles = new ig.Image(this.tilesetName);
this.preRenderedChunks = null
},
setScreenPos: function(b, c) {
this.scroll.x = b / this.distance;
this.scroll.y = c / this.distance
},
preRenderMapToChunks: function() {
var b = this.width * this.tilesize * ig.system.scale,
c = this.height * this.tilesize * ig.system.scale;
this.chunkSize = Math.min(Math.max(b, c), this.chunkSize);
var d = Math.ceil(b / this.chunkSize),
e = Math.ceil(c / this.chunkSize);
this.preRenderedChunks = [];
for (var f = 0; f < e; f++) {
this.preRenderedChunks[f] = [];
for (var j = 0; j < d; j++) this.preRenderedChunks[f][j] = this.preRenderChunk(j, f, j == d - 1 ? b - j * this.chunkSize : this.chunkSize, f == e - 1 ? c - f * this.chunkSize : this.chunkSize)
}
},
preRenderChunk: function(b, c, d, e) {
var f = d / this.tilesize / ig.system.scale + 1,
j = e / this.tilesize / ig.system.scale + 1,
q = b * this.chunkSize / ig.system.scale % this.tilesize,
n = c * this.chunkSize / ig.system.scale % this.tilesize;
b = Math.floor(b * this.chunkSize / this.tilesize / ig.system.scale);
c = Math.floor(c * this.chunkSize / this.tilesize / ig.system.scale);
var g = ig.$new("canvas");
g.width = d;
g.height = e;
g.retinaResolutionEnabled = !1;
e = g.getContext("2d");
ig.System.scaleMode(g, e);
d = ig.system.context;
ig.system.context = e;
for (e = 0; e < f; e++)
for (var y = 0; y < j; y++)
if (e + b < this.width && y + c < this.height) {
var A = this.data[y + c][e + b];
A && this.tiles.drawTile(e * this.tilesize - q, y * this.tilesize - n, A - 1, this.tilesize)
}
ig.system.context = d;
return g
},
draw: function() {
this.tiles.loaded && this.enabled && (this.preRender ? this.drawPreRendered() : this.drawTiled())
},
drawPreRendered: function() {
this.preRenderedChunks || this.preRenderMapToChunks();
var b = ig.system.getDrawPos(this.scroll.x),
c = ig.system.getDrawPos(this.scroll.y);
if (this.repeat) var d = this.width * this.tilesize * ig.system.scale,
b = (b % d + d) % d,
d = this.height * this.tilesize * ig.system.scale,
c = (c % d + d) % d;
var d = Math.max(Math.floor(b / this.chunkSize), 0),
e = Math.max(Math.floor(c / this.chunkSize), 0),
f = Math.ceil((b + ig.system.realWidth) / this.chunkSize),
j = Math.ceil((c + ig.system.realHeight) / this.chunkSize),
q = this.preRenderedChunks[0].length,
n = this.preRenderedChunks.length;
this.repeat || (f = Math.min(f, q), j = Math.min(j, n));
for (var g = 0; e < j; e++) {
for (var y = 0, A = d; A < f; A++) {
var z = this.preRenderedChunks[e % n][A % q],
B = -b + A * this.chunkSize - y,
C = -c + e * this.chunkSize - g;
ig.system.context.drawImage(z, B, C);
ig.Image.drawCount++;
this.debugChunks && (ig.system.context.strokeStyle = "#f0f", ig.system.context.strokeRect(B, C, this.chunkSize, this.chunkSize));
this.repeat && z.width < this.chunkSize && B + z.width < ig.system.realWidth && (y += this.chunkSize - z.width, f++)
}
this.repeat && z.height < this.chunkSize && C + z.height < ig.system.realHeight && (g += this.chunkSize - z.height, j++)
}
},
drawTiled: function() {
for (var b = 0, c = null, d = (this.scroll.x / this.tilesize).toInt(), e = (this.scroll.y / this.tilesize).toInt(), f = this.scroll.x % this.tilesize, j = this.scroll.y % this.tilesize, q = -f - this.tilesize, f = ig.system.width + this.tilesize - f, n = ig.system.height + this.tilesize - j, g = -1, j = -j - this.tilesize; j < n; g++, j += this.tilesize) {
var y = g + e;
if (y >= this.height || 0 > y) {
if (!this.repeat) continue;
y = (y % this.height + this.height) % this.height
}
for (var A = -1, z = q; z < f; A++, z += this.tilesize) {
b = A + d;
if (b >= this.width || 0 > b) {
if (!this.repeat) continue;
b = (b % this.width + this.width) % this.width
}
if (b = this.data[y][b])(c = this.anims[b -
1]) ? c.draw(z, j) : this.tiles.drawTile(z, j, b - 1, this.tilesize)
}
}
}
})
});
ig.baked = !0;
ig.module("impact.game").requires("impact.impact", "impact.entity", "impact.collision-map", "impact.background-map").defines(function() {
ig.Game = ig.Class.extend({
clearColor: "#000000",
gravity: 0,
screen: {
x: 0,
y: 0
},
_rscreen: {
x: 0,
y: 0
},
entities: [],
namedEntities: {},
collisionMap: ig.CollisionMap.staticNoCollision,
backgroundMaps: [],
backgroundAnims: {},
autoSort: !1,
sortBy: null,
cellSize: 64,
_deferredKill: [],
_levelToLoad: null,
_doSortEntities: !1,
staticInstantiate: function() {
this.sortBy = this.sortBy || ig.Game.SORT.Z_INDEX;
ig.game = this;
return null
},
loadLevel: function(b) {
this.screen = {
x: 0,
y: 0
};
this.entities = [];
this.namedEntities = {};
for (var c = 0; c < b.entities.length; c++) {
var d = b.entities[c];
this.spawnEntity(d.type, d.x, d.y, d.settings)
}
this.sortEntities();
this.collisionMap = ig.CollisionMap.staticNoCollision;
this.backgroundMaps = [];
for (c = 0; c < b.layer.length; c++)
if (d = b.layer[c], "collision" == d.name) this.collisionMap = new ig.CollisionMap(d.tilesize, d.data);
else {
var e = new ig.BackgroundMap(d.tilesize, d.data, d.tilesetName);
e.anims = this.backgroundAnims[d.tilesetName] || {};
e.repeat = d.repeat;
e.distance = d.distance;
e.foreground = !!d.foreground;
e.preRender = !!d.preRender;
e.name = d.name;
this.backgroundMaps.push(e)
}
for (c = 0; c < this.entities.length; c++) this.entities[c].ready()
},
loadLevelDeferred: function(b) {
this._levelToLoad = b
},
getMapByName: function(b) {
if ("collision" == b) return this.collisionMap;
for (var c = 0; c < this.backgroundMaps.length; c++)
if (this.backgroundMaps[c].name == b) return this.backgroundMaps[c];
return null
},
getEntityByName: function(b) {
return this.namedEntities[b]
},
getEntitiesByType: function(b) {
b = "string" === typeof b ? ig.global[b] : b;
for (var c = [], d = 0; d < this.entities.length; d++) {
var e = this.entities[d];
e instanceof b && !e._killed && c.push(e)
}
return c
},
spawnEntity: function(b, c, d, e) {
var f = "string" === typeof b ? ig.global[b] : b;
if (!f) throw "Can't spawn entity of type " + b;
b = new f(c, d, e || {});
this.entities.push(b);
b.name && (this.namedEntities[b.name] = b);
return b
},
sortEntities: function() {
this.entities.sort(this.sortBy)
},
sortEntitiesDeferred: function() {
this._doSortEntities = !0
},
removeEntity: function(b) {
b.name && delete this.namedEntities[b.name];
b._killed = !0;
b.type = ig.Entity.TYPE.NONE;
b.checkAgainst = ig.Entity.TYPE.NONE;
b.collides = ig.Entity.COLLIDES.NEVER;
this._deferredKill.push(b)
},
run: function() {
this.update();
this.draw()
},
update: function() {
this._levelToLoad && (this.loadLevel(this._levelToLoad), this._levelToLoad = null);
this.updateEntities();
this.checkEntities();
for (var b = 0; b < this._deferredKill.length; b++) this._deferredKill[b].erase(), this.entities.erase(this._deferredKill[b]);
this._deferredKill = [];
if (this._doSortEntities || this.autoSort) this.sortEntities(), this._doSortEntities = !1;
for (var c in this.backgroundAnims) {
var b = this.backgroundAnims[c],
d;
for (d in b) b[d].update()
}
},
updateEntities: function() {
for (var b = 0; b < this.entities.length; b++) {
var c = this.entities[b];
c._killed || c.update()
}
},
draw: function() {
this.clearColor && ig.system.clear(this.clearColor);
this._rscreen.x = ig.system.getDrawPos(this.screen.x) / ig.system.scale;
this._rscreen.y = ig.system.getDrawPos(this.screen.y) / ig.system.scale;
var b;
for (b = 0; b < this.backgroundMaps.length; b++) {
var c =
this.backgroundMaps[b];
if (c.foreground) break;
c.setScreenPos(this.screen.x, this.screen.y);
c.draw()
}
this.drawEntities();
for (b; b < this.backgroundMaps.length; b++) c = this.backgroundMaps[b], c.setScreenPos(this.screen.x, this.screen.y), c.draw()
},
drawEntities: function() {
for (var b = 0; b < this.entities.length; b++) this.entities[b].draw()
},
checkEntities: function() {
for (var b = {}, c = 0; c < this.entities.length; c++) {
var d = this.entities[c];
if (!(d.type == ig.Entity.TYPE.NONE && d.checkAgainst == ig.Entity.TYPE.NONE && d.collides == ig.Entity.COLLIDES.NEVER))
for (var e = {}, f = Math.floor(d.pos.y / this.cellSize), j = Math.floor((d.pos.x + d.size.x) / this.cellSize) + 1, q = Math.floor((d.pos.y + d.size.y) / this.cellSize) + 1, n = Math.floor(d.pos.x / this.cellSize); n < j; n++)
for (var g = f; g < q; g++)
if (b[n])
if (b[n][g]) {
for (var y = b[n][g], A = 0; A < y.length; A++) d.touches(y[A]) && !e[y[A].id] && (e[y[A].id] = !0, ig.Entity.checkPair(d, y[A]));
y.push(d)
} else b[n][g] = [d];
else b[n] = {}, b[n][g] = [d]
}
}
});
ig.Game.SORT = {
Z_INDEX: function(b, c) {
return b.zIndex - c.zIndex
},
POS_X: function(b, c) {
return b.pos.x + b.size.x - (c.pos.x +
c.size.x)
},
POS_Y: function(b, c) {
return b.pos.y + b.size.y - (c.pos.y + c.size.y)
}
}
});
ig.baked = !0;
ig.module("impact.debug.menu").requires("dom.ready", "impact.system").defines(function() {
ig.System.inject({
run: function() {
ig.debug.beforeRun();
this.parent();
ig.debug.afterRun()
},
setGameNow: function(b) {
this.parent(b);
ig.debug.ready()
}
});
ig.Debug = ig.Class.extend({
options: {},
panels: {},
numbers: {},
container: null,
panelMenu: null,
activePanel: null,
debugTime: 0,
debugTickAvg: 0.016,
debugRealTime: Date.now(),
init: function() {
var b = ig.$new("link");
b.rel = "stylesheet";
b.type = "text/css";
b.href = ig.prefix + "game.css";
ig.$("body")[0].appendChild(b);
this.container = ig.$new("div");
this.container.className = "ig_debug";
ig.$("body")[0].appendChild(this.container);
this.panelMenu = ig.$new("div");
this.panelMenu.innerHTML = '<div class="ig_debug_head">Impact.Debug:</div>';
this.panelMenu.className = "ig_debug_panel_menu";
this.container.appendChild(this.panelMenu);
this.numberContainer = ig.$new("div");
this.numberContainer.className = "ig_debug_stats";
this.panelMenu.appendChild(this.numberContainer);
window.console && window.console.log && window.console.assert && (ig.log = console.log.bind ? console.log.bind(console) : console.log, ig.assert = console.assert.bind ? console.assert.bind(console) : console.assert);
ig.show = this.showNumber.bind(this)
},
addNumber: function(b) {
var c = ig.$new("span");
this.numberContainer.appendChild(c);
this.numberContainer.appendChild(document.createTextNode(b));
this.numbers[b] = c
},
showNumber: function(b, c, d) {
this.numbers[b] || this.addNumber(b, d);
this.numbers[b].textContent = c
},
addPanel: function(b) {
var c = new b.type(b.name, b.label);
if (b.options)
for (var d = 0; d < b.options.length; d++) {
var e = b.options[d];
c.addOption(new ig.DebugOption(e.name, e.object, e.property))
}
this.panels[c.name] = c;
c.container.style.display = "none";
this.container.appendChild(c.container);
b = ig.$new("div");
b.className = "ig_debug_menu_item";
b.textContent = c.label;
b.addEventListener("click", function() {
this.togglePanel(c)
}.bind(this), !1);
c.menuItem = b;
e = !1;
for (d = 1; d < this.panelMenu.childNodes.length; d++) {
var f = this.panelMenu.childNodes[d];
if (f.textContent > c.label) {
this.panelMenu.insertBefore(b, f);
e = !0;
break
}
}
e || this.panelMenu.appendChild(b)
},
showPanel: function(b) {
this.togglePanel(this.panels[b])
},
togglePanel: function(b) {
b != this.activePanel && this.activePanel && (this.activePanel.toggle(!1), this.activePanel.menuItem.className = "ig_debug_menu_item", this.activePanel = null);
var c = "block" != b.container.style.display;
b.toggle(c);
b.menuItem.className = "ig_debug_menu_item" + (c ? " active" : "");
c && (this.activePanel = b)
},
ready: function() {
for (var b in this.panels) this.panels[b].ready()
},
beforeRun: function() {
var b = Date.now();
this.debugTickAvg = 0.8 * this.debugTickAvg + 0.2 * (b - this.debugRealTime);
this.debugRealTime = b;
this.activePanel && this.activePanel.beforeRun()
},
afterRun: function() {
var b = Date.now() - this.debugRealTime;
this.debugTime = 0.8 * this.debugTime + 0.2 * b;
this.activePanel && this.activePanel.afterRun();
this.showNumber("ms", this.debugTime.toFixed(2));
this.showNumber("fps", Math.round(1E3 / this.debugTickAvg));
this.showNumber("draws", ig.Image.drawCount);
ig.game && ig.game.entities && this.showNumber("entities", ig.game.entities.length);
ig.Image.drawCount = 0
}
});
ig.DebugPanel = ig.Class.extend({
active: !1,
container: null,
options: [],
panels: [],
label: "",
name: "",
init: function(b, c) {
this.name = b;
this.label = c;
this.container = ig.$new("div");
this.container.className = "ig_debug_panel " + this.name
},
toggle: function(b) {
this.active = b;
this.container.style.display = b ? "block" : "none"
},
addPanel: function(b) {
this.panels.push(b);
this.container.appendChild(b.container)
},
addOption: function(b) {
this.options.push(b);
this.container.appendChild(b.container)
},
ready: function() {},
beforeRun: function() {},
afterRun: function() {}
});
ig.DebugOption = ig.Class.extend({
name: "",
labelName: "",
className: "ig_debug_option",
label: null,
mark: null,
container: null,
active: !1,
colors: {
enabled: "#fff",
disabled: "#444"
},
init: function(b, c, d) {
this.name = b;
this.object = c;
this.property = d;
this.active = this.object[this.property];
this.container = ig.$new("div");
this.container.className = "ig_debug_option";
this.label = ig.$new("span");
this.label.className = "ig_debug_label";
this.label.textContent = this.name;
this.mark = ig.$new("span");
this.mark.className = "ig_debug_label_mark";
this.container.appendChild(this.mark);
this.container.appendChild(this.label);
this.container.addEventListener("click", this.click.bind(this), !1);
this.setLabel()
},
setLabel: function() {
this.mark.style.backgroundColor = this.active ? this.colors.enabled : this.colors.disabled
},
click: function(b) {
this.active = !this.active;
this.object[this.property] = this.active;
this.setLabel();
b.stopPropagation();
b.preventDefault();
return !1
}
});
ig.debug = new ig.Debug
});
ig.baked = !0;
ig.module("impact.debug.entities-panel").requires("impact.debug.menu", "impact.entity").defines(function() {
ig.Entity.inject({
colors: {
names: "#fff",
velocities: "#0f0",
boxes: "#f00"
},
draw: function() {
this.parent();
ig.Entity._debugShowBoxes && (ig.system.context.strokeStyle = this.colors.boxes, ig.system.context.lineWidth = 1, ig.system.context.strokeRect(ig.system.getDrawPos(this.pos.x.round() - ig.game.screen.x) - 0.5, ig.system.getDrawPos(this.pos.y.round() - ig.game.screen.y) - 0.5, this.size.x * ig.system.scale, this.size.y * ig.system.scale));
if (ig.Entity._debugShowVelocities) {
var b = this.pos.x + this.size.x / 2,
c = this.pos.y + this.size.y / 2;
this._debugDrawLine(this.colors.velocities, b, c, b + this.vel.x, c + this.vel.y)
}
if (ig.Entity._debugShowNames && (this.name && (ig.system.context.fillStyle = this.colors.names, ig.system.context.fillText(this.name, ig.system.getDrawPos(this.pos.x - ig.game.screen.x), ig.system.getDrawPos(this.pos.y - ig.game.screen.y))), "object" == typeof this.target))
for (var d in this.target)(b = ig.game.getEntityByName(this.target[d])) && this._debugDrawLine(this.colors.names, this.pos.x + this.size.x / 2, this.pos.y + this.size.y / 2, b.pos.x + b.size.x / 2, b.pos.y + b.size.y / 2)
},
_debugDrawLine: function(b, c, d, e, f) {
ig.system.context.strokeStyle = b;
ig.system.context.lineWidth = 1;
ig.system.context.beginPath();
ig.system.context.moveTo(ig.system.getDrawPos(c - ig.game.screen.x), ig.system.getDrawPos(d - ig.game.screen.y));
ig.system.context.lineTo(ig.system.getDrawPos(e - ig.game.screen.x), ig.system.getDrawPos(f - ig.game.screen.y));
ig.system.context.stroke();
ig.system.context.closePath()
}
});
ig.Entity._debugEnableChecks = !0;
ig.Entity._debugShowBoxes = !1;
ig.Entity._debugShowVelocities = !1;
ig.Entity._debugShowNames = !1;
ig.Entity.oldCheckPair = ig.Entity.checkPair;
ig.Entity.checkPair = function(b, c) {
ig.Entity._debugEnableChecks && ig.Entity.oldCheckPair(b, c)
};
ig.debug.addPanel({
type: ig.DebugPanel,
name: "entities",
label: "Entities",
options: [{
name: "Checks & Collisions",
object: ig.Entity,
property: "_debugEnableChecks"
}, {
name: "Show Collision Boxes",
object: ig.Entity,
property: "_debugShowBoxes"
}, {
name: "Show Velocities",
object: ig.Entity,
property: "_debugShowVelocities"
}, {
name: "Show Names & Targets",
object: ig.Entity,
property: "_debugShowNames"
}]
})
});
ig.baked = !0;
ig.module("impact.debug.maps-panel").requires("impact.debug.menu", "impact.game", "impact.background-map").defines(function() {
ig.Game.inject({
loadLevel: function(b) {
this.parent(b);
ig.debug.panels.maps.load(this)
}
});
ig.DebugMapsPanel = ig.DebugPanel.extend({
maps: [],
mapScreens: [],
init: function(b, c) {
this.parent(b, c);
this.load()
},
load: function(b) {
this.options = [];
this.panels = [];
if (!b || !b.backgroundMaps.length) this.container.innerHTML = "<em>No Maps Loaded</em>";
else {
this.maps = b.backgroundMaps;
this.mapScreens = [];
this.container.innerHTML = "";
for (b = 0; b < this.maps.length; b++) {
var c = this.maps[b],
d = new ig.DebugPanel(b, "Layer " + b),
e = new ig.$new("strong");
e.textContent = b + ": " + c.tiles.path;
d.container.appendChild(e);
d.addOption(new ig.DebugOption("Enabled", c, "enabled"));
d.addOption(new ig.DebugOption("Pre Rendered", c, "preRender"));
d.addOption(new ig.DebugOption("Show Chunks", c, "debugChunks"));
this.generateMiniMap(d, c, b);
this.addPanel(d)
}
}
},
generateMiniMap: function(b, c, d) {
var e = ig.system.scale,
f = ig.$new("canvas"),
j = f.getContext("2d"),
q = c.tiles.width * e,
n = c.tiles.height * e,
g = q / c.tilesize,
y = n / c.tilesize;
f.width = g;
f.height = y;
j.drawImage(c.tiles.data, 0, 0, q, n, 0, 0, g, y);
j = ig.$new("canvas");
j.width = c.width * e;
j.height = c.height * e;
y = j.getContext("2d");
ig.game.clearColor && (y.fillStyle = ig.game.clearColor, y.fillRect(0, 0, q, n));
for (n = q = 0; n < c.width; n++)
for (var A = 0; A < c.height; A++)(q = c.data[A][n]) && y.drawImage(f, Math.floor((q - 1) * e % g), Math.floor((q - 1) * e / g) * e, e, e, n * e, A * e, e, e);
f = ig.$new("div");
f.className = "ig_debug_map_container";
f.style.width = c.width * e + "px";
f.style.height = c.height * e + "px";
g = ig.$new("div");
g.className = "ig_debug_map_screen";
g.style.width = ig.system.width / c.tilesize * e - 2 + "px";
g.style.height = ig.system.height / c.tilesize * e - 2 + "px";
this.mapScreens[d] = g;
f.appendChild(j);
f.appendChild(g);
b.container.appendChild(f)
},
afterRun: function() {
for (var b = ig.system.scale, c = 0; c < this.maps.length; c++) {
var d = this.maps[c],
e = this.mapScreens[c];
if (d && e) {
var f = d.scroll.x / d.tilesize,
j = d.scroll.y / d.tilesize;
d.repeat && (f %= d.width, j %= d.height);
e.style.left = f * b + "px";
e.style.top = j * b + "px"
}
}
}
});
ig.debug.addPanel({
type: ig.DebugMapsPanel,
name: "maps",
label: "Background Maps"
})
});
ig.baked = !0;
ig.module("impact.debug.graph-panel").requires("impact.debug.menu", "impact.system", "impact.game", "impact.image").defines(function() {
ig.Game.inject({
draw: function() {
ig.graph.beginClock("draw");
this.parent();
ig.graph.endClock("draw")
},
update: function() {
ig.graph.beginClock("update");
this.parent();
ig.graph.endClock("update")
},
checkEntities: function() {
ig.graph.beginClock("checks");
this.parent();
ig.graph.endClock("checks")
}
});
ig.DebugGraphPanel = ig.DebugPanel.extend({
clocks: {},
marks: [],
textY: 0,
height: 128,
ms: 64,
timeBeforeRun: 0,
init: function(b, c) {
this.parent(b, c);
this.mark16ms = (this.height - 16 * (this.height / this.ms)).round();
this.mark33ms = (this.height - 33 * (this.height / this.ms)).round();
this.msHeight = this.height / this.ms;
this.graph = ig.$new("canvas");
this.graph.width = window.innerWidth;
this.graph.height = this.height;
this.container.appendChild(this.graph);
this.ctx = this.graph.getContext("2d");
this.ctx.fillStyle = "#444";
this.ctx.fillRect(0, this.mark16ms, this.graph.width, 1);
this.ctx.fillRect(0, this.mark33ms, this.graph.width, 1);
this.addGraphMark("16ms", this.mark16ms);
this.addGraphMark("33ms", this.mark33ms);
this.addClock("draw", "Draw", "#13baff");
this.addClock("update", "Entity Update", "#bb0fff");
this.addClock("checks", "Entity Checks & Collisions", "#a2e908");
this.addClock("lag", "System Lag", "#f26900");
ig.mark = this.mark.bind(this);
ig.graph = this
},
addGraphMark: function(b, c) {
var d = ig.$new("span");
d.className = "ig_debug_graph_mark";
d.textContent = b;
d.style.top = c.round() + "px";
this.container.appendChild(d)
},
addClock: function(b, c, d) {
var e = ig.$new("span");
e.className = "ig_debug_legend_color";
e.style.backgroundColor = d;
var f = ig.$new("span");
f.className = "ig_debug_legend_number";
f.appendChild(document.createTextNode("0"));
var j = ig.$new("span");
j.className = "ig_debug_legend";
j.appendChild(e);
j.appendChild(document.createTextNode(c + " ("));
j.appendChild(f);
j.appendChild(document.createTextNode("ms)"));
this.container.appendChild(j);
this.clocks[b] = {
description: c,
color: d,
current: 0,
start: Date.now(),
avg: 0,
html: f
}
},
beginClock: function(b, c) {
this.clocks[b].start = Date.now() + (c || 0)
},
endClock: function(b) {
b = this.clocks[b];
b.current = Math.round(Date.now() - b.start);
b.avg = 0.8 * b.avg + 0.2 * b.current
},
mark: function(b, c) {
this.active && this.marks.push({
msg: b,
color: c || "#fff"
})
},
beforeRun: function() {
this.endClock("lag");
this.timeBeforeRun = Date.now()
},
afterRun: function() {
var b = Date.now() - this.timeBeforeRun;
this.beginClock("lag", Math.max(1E3 / ig.system.fps - b, 0));
var b = this.graph.width - 1,
c = this.height;
this.ctx.drawImage(this.graph, -1, 0);
this.ctx.fillStyle = "#000";
this.ctx.fillRect(b, 0, 1, this.height);
this.ctx.fillStyle = "#444";
this.ctx.fillRect(b, this.mark16ms, 1, 1);
this.ctx.fillStyle = "#444";
this.ctx.fillRect(b, this.mark33ms, 1, 1);
for (var d in this.clocks) {
var e = this.clocks[d];
e.html.textContent = e.avg.toFixed(2);
if (e.color && 0 < e.current) {
this.ctx.fillStyle = e.color;
var f = e.current * this.msHeight,
c = c - f;
this.ctx.fillRect(b, c, 1, f);
e.current = 0
}
}
this.ctx.textAlign = "right";
this.ctx.textBaseline = "top";
this.ctx.globalAlpha = 0.5;
for (d = 0; d < this.marks.length; d++) c = this.marks[d], this.ctx.fillStyle = c.color, this.ctx.fillRect(b, 0, 1, this.height), c.msg && (this.ctx.fillText(c.msg, b - 1, this.textY), this.textY = (this.textY + 8) % 32);
this.ctx.globalAlpha = 1;
this.marks = []
}
});
ig.debug.addPanel({
type: ig.DebugGraphPanel,
name: "graph",
label: "Performance"
})
});
ig.baked = !0;
ig.module("impact.debug.debug").requires("impact.debug.entities-panel", "impact.debug.maps-panel", "impact.debug.graph-panel").defines(function() {});
ig.baked = !0;
ig.module("plugins.patches.webkit-image-smoothing-patch").defines(function() {
ig.System && (ig.System.SCALE = {
CRISP: function(b, c) {
c.imageSmoothingEnabled = c.msImageSmoothingEnabled = c.mozImageSmoothingEnabled = c.oImageSmoothingEnabled = !1;
b.style.imageRendering = "-moz-crisp-edges";
b.style.imageRendering = "-o-crisp-edges";
b.style.imageRendering = "-webkit-optimize-contrast";
b.style.imageRendering = "crisp-edges";
b.style.msInterpolationMode = "nearest-neighbor"
},
SMOOTH: function(b, c) {
c.imageSmoothingEnabled = c.msImageSmoothingEnabled = c.mozImageSmoothingEnabled = c.oImageSmoothingEnabled = !0;
b.style.imageRendering = "";
b.style.msInterpolationMode = ""
}
}, ig.System.scaleMode = ig.System.SCALE.SMOOTH)
});
ig.baked = !0;
ig.module("plugins.patches.windowfocus-onMouseDown-patch").defines(function() {
var b = !1;
try {
b = window.self !== window.top, !1 === b && (b = 0 < window.frames.length)
} catch (c) {
b = !0
}
ig.Input.inject({
keydown: function(c) {
var e = c.target.tagName;
if (!("INPUT" == e || "TEXTAREA" == e))
if (e = "keydown" == c.type ? c.keyCode : 2 == c.button ? ig.KEY.MOUSE2 : ig.KEY.MOUSE1, b && 0 > e && window.focus(), ("touchstart" == c.type || "mousedown" == c.type) && this.mousemove(c), e = this.bindings[e]) this.actions[e] = !0, this.locks[e] || (this.presses[e] = !0, this.locks[e] = !0), c.stopPropagation(), c.preventDefault()
}
})
});
ig.baked = !0;
ig.module("plugins.handlers.dom-handler").defines(function() {
ig.DomHandler = ig.Class.extend({
JQUERYAVAILABLE: !1,
init: function() {
this.JQUERYAVAILABLE = this._jqueryAvailable()
},
_jqueryAvailable: function() {
return "undefined" !== typeof jQuery
},
addEvent: function(b, c, d, e) {
if (this.JQUERYAVAILABLE) b.on(c, d);
else b.addEventListener(c, d, e)
},
create: function(b) {
return this.JQUERYAVAILABLE ? $("<" + b + ">") : ig.$new(b)
},
getElementByClass: function(b) {
return this.JQUERYAVAILABLE ? $("." + b) : document.getElementsByClassName(b)
},
getElementById: function(b) {
return this.JQUERYAVAILABLE ? 0 < $(b).length ? $(b) : null : ig.$(b)
},
appendChild: function(b, c) {
this.JQUERYAVAILABLE ? b.append(c) : b.appendChild(c)
},
appendToBody: function(b) {
this.JQUERYAVAILABLE ? $("body").append(b) : document.body.appendChild(b)
},
resize: function(b, c, d) {
if (this.JQUERYAVAILABLE) b.width(c.toFixed(2)), b.height(d.toFixed(2));
else {
var e = b.style.visibility;
c = "width:" + c.toFixed(2) + "px; height:" + d.toFixed(2) + "px;";
this.attr(b, "style", c);
b.style.visibility = e
}
},
resizeOffsetLeft: function(b, c, d, e) {
if (this.JQUERYAVAILABLE) b.width(c.toFixed(2)), b.height(d.toFixed(2)), b.css("left", e);
else {
var f = b.style.visibility;
c = "width:" + c.toFixed(2) + "px; height:" + d.toFixed(2) + "px; left: " + e.toFixed(2) + "px;";
this.attr(b, "style", c);
b.style.visibility = f
}
},
css: function(b, c) {
if (this.JQUERYAVAILABLE) b.css(c);
else {
var d = "",
e;
for (e in c) d += e + ":" + c[e] + ";";
this.attr(b, "style", d)
}
},
getOffsets: function(b) {
return this.JQUERYAVAILABLE ? (b = b.offset(), {
left: b.left,
top: b.top
}) : {
left: b.offsetLeft,
top: b.offsetTop
}
},
attr: function(b, c, d) {
if ("undefined" === typeof d) return this.JQUERYAVAILABLE ? b.attr(c) : b.getAttribute(c);
this.JQUERYAVAILABLE ? b.attr(c, d) : b.setAttribute(c, d)
},
show: function(b) {
this.JQUERYAVAILABLE ? (b.show(), b.css("visibility", "visible")) : b && (b.style ? b.style.visibility = "visible" : b[0] && (b[0].style.visibility = "visible"))
},
hide: function(b) {
this.JQUERYAVAILABLE ? (b.hide(), b.css("visibility", "hidden")) : b && (b.style ? b.style.visibility = "hidden" : b[0] && (b[0].style.visibility = "hidden"))
},
getQueryVariable: function(b) {
for (var c = window.location.search.substring(1).split("&"), d = 0; d < c.length; d++) {
var e = c[d].split("=");
if (decodeURIComponent(e[0]) == b) return decodeURIComponent(e[1])
}
},
forcedDeviceDetection: function() {
var b = this.getQueryVariable("device");
if (b) switch (b) {
case "mobile":
console.log("serving mobile version ...");
ig.ua.mobile = !0;
break;
case "desktop":
console.log("serving desktop version ...");
ig.ua.mobile = !1;
break;
default:
console.log("serving universal version ...")
} else console.log("serving universal version ...")
},
forcedDeviceRotation: function() {
var b = this.getQueryVariable("force-rotate");
if (b) switch (b) {
case "portrait":
console.log("force rotate to portrait");
window.orientation = 0;
break;
case "landscape":
console.log("force rotate to horizontal");
window.orientation = 90;
break;
default:
alert("wrong command/type in param force-rotate. Defaulting value to portrait"), window.orientation = 0
}
}
})
});
ig.baked = !0;
ig.module("plugins.data.vector").defines(function() {
Vector2 = ig.Class.extend({
x: null,
y: null,
valType: "number",
init: function(b, c) {
typeof b === this.valType && typeof c === this.valType && (this.x = b, this.y = c)
},
row: function(b) {
typeof b === this.valType && (this.y = b);
return this.y
},
col: function(b) {
typeof b === this.valType && (this.x = b);
return this.x
},
magnitude: function() {
return Math.sqrt(this.x * this.x + this.y * this.y)
},
unitVector: function() {
var b = this.magnitude();
if (0 < b) return new Vector2(this.x / b, this.y / b);
throw "Divide by 0 error in unitVector function of vector:" +
this;
},
add: function(b) {
return new Vector2(this.x + b.x, this.y + b.y)
},
subtract: function(b) {
return new Vector2(this.x - b.x, this.y - b.y)
},
dotProduct: function(b) {
return this.x * b.x + this.y * b.y
},
multiplyByScalar: function(b) {
return new Vector2(b * this.x, b * this.y)
}
})
});
ig.baked = !0;
ig.module("plugins.handlers.size-handler").requires("plugins.data.vector").defines(function() {
ig.SizeHandler = ig.Class.extend({
portraitMode: !1,
desktop: {
actualSize: new Vector2(window.innerWidth, window.innerHeight),
actualResolution: new Vector2(960, 540)
},
mobile: {
actualSize: new Vector2(window.innerWidth, window.innerHeight),
actualResolution: new Vector2(960, 540)
},
windowSize: new Vector2(window.innerWidth, window.innerHeight),
scaleRatioMultiplier: new Vector2(1, 1),
sizeRatio: new Vector2(1, 1),
scale: 1,
domHandler: null,
dynamicClickableEntityDivs: {},
coreDivsToResize: ["#canvas", "#play", "#orientate"],
adsToResize: {
},
init: function(b) {
this.domHandler = b;
if ("undefined" === typeof b) throw "undefined Dom Handler for Size Handler";
this.sizeCalcs();
this.eventListenerSetup();
this.samsungFix()
},
sizeCalcs: function() {
this.windowSize = new Vector2(window.innerWidth, window.innerHeight);
if (ig.ua.mobile) {
this.mobile.actualSize = new Vector2(window.innerWidth, window.innerHeight);
var b = new Vector2(this.mobile.actualResolution.x, this.mobile.actualResolution.y);
this.scaleRatioMultiplier = new Vector2(this.mobile.actualSize.x / b.x, this.mobile.actualSize.y / b.y);
var c = Math.min(this.scaleRatioMultiplier.x, this.scaleRatioMultiplier.y);
this.mobile.actualSize.x = b.x * this.scaleRatioMultiplier.x;
this.mobile.actualSize.y = b.y * this.scaleRatioMultiplier.y
} else this.desktop.actualSize = new Vector2(window.innerWidth, window.innerHeight), b = new Vector2(this.desktop.actualResolution.x, this.desktop.actualResolution.y), this.scaleRatioMultiplier = new Vector2(this.desktop.actualSize.x / b.x, this.desktop.actualSize.y / b.y), c = Math.min(this.scaleRatioMultiplier.x, this.scaleRatioMultiplier.y), this.desktop.actualSize.x = b.x * c, this.desktop.actualSize.y = b.y * c;
this.sizeRatio.x = window.innerWidth / this.mobile.actualResolution.x;
this.sizeRatio.y = window.innerHeight / this.mobile.actualResolution.y
},
resizeLayers: function() {
for (var b = 0; b < this.coreDivsToResize.length; b++) {
var c = ig.domHandler.getElementById(this.coreDivsToResize[b]);
ig.ua.mobile ? ig.domHandler.resize(c, Math.floor(ig.sizeHandler.mobile.actualSize.x), Math.floor(ig.sizeHandler.mobile.actualSize.y)) : ig.domHandler.resizeOffsetLeft(c, Math.floor(ig.sizeHandler.desktop.actualSize.x), Math.floor(ig.sizeHandler.desktop.actualSize.y), Math.floor(ig.sizeHandler.windowSize.x / 2 - ig.sizeHandler.desktop.actualSize.x / 2))
}
for (var d in this.adsToResize) {
var b = ig.domHandler.getElementById("#" +
d),
c = ig.domHandler.getElementById("#" + d + "-Box"),
e = (window.innerWidth - this.adsToResize[d]["box-width"]) / 2 + "px",
f = (window.innerHeight - this.adsToResize[d]["box-height"]) / 2 + "px";
b && ig.domHandler.css(b, {
width: window.innerWidth,
height: window.innerHeight
});
c && ig.domHandler.css(c, {
left: e,
top: f
})
}
for (d in this.dynamicClickableEntityDivs) {
c = Math.min(ig.sizeHandler.scaleRatioMultiplier.x, ig.sizeHandler.scaleRatioMultiplier.y);
b = ig.domHandler.getElementById("#" + d);
if (ig.ua.mobile) var j = this.dynamicClickableEntityDivs[d].entity_pos_x,
q = this.dynamicClickableEntityDivs[d].entity_pos_y,
f = this.dynamicClickableEntityDivs[d].width,
e = this.dynamicClickableEntityDivs[d].height,
n = Math.floor(j * this.scaleRatioMultiplier.x) + "px",
q = Math.floor(q * this.scaleRatioMultiplier.y) + "px",
f = Math.floor(f * this.scaleRatioMultiplier.x) + "px",
c = Math.floor(e * this.scaleRatioMultiplier.y) + "px";
else var e = ig.domHandler.getElementById("#canvas"),
e = ig.domHandler.getOffsets(e),
n = e.left,
g = e.top,
j = this.dynamicClickableEntityDivs[d].entity_pos_x,
q = this.dynamicClickableEntityDivs[d].entity_pos_y,
f = this.dynamicClickableEntityDivs[d].width,
e = this.dynamicClickableEntityDivs[d].height,
n = Math.floor(n + j * c) + "px",
q = Math.floor(g + q * c) + "px",
f = Math.floor(f * c) + "px",
c = Math.floor(e * c) + "px";
ig.domHandler.css(b, {
"float": "left",
position: "absolute",
left: n,
top: q,
width: f,
height: c,
"z-index": 3
})
}
},
resize: function() {
this.sizeCalcs();
this.resizeLayers()
},
reorient: function() {
if (ig.ua.mobile) {
var b = this.portraitMode ? window.innerHeight < window.innerWidth : window.innerHeight > window.innerWidth,
c = this.domHandler.getElementById("#orientate"),
d = this.domHandler.getElementById("#game");
b ? (this.domHandler.show(c), this.domHandler.hide(d)) : (this.domHandler.show(d), this.domHandler.hide(c))
}
ig.ua.mobile ? (this.resize(), this.resizeAds()) : this.resize()
},
resizeAds: function() {
for (var b in this.adsToResize) {
var c = ig.domHandler.getElementById("#" + b),
d = ig.domHandler.getElementById("#" + b + "-Box"),
e = (window.innerWidth - this.adsToResize[b]["box-width"]) / 2 + "px",
f = (window.innerHeight - this.adsToResize[b]["box-height"]) / 2 + "px";
c && ig.domHandler.css(c, {
width: window.innerWidth,
height: window.innerHeight
});
d && ig.domHandler.css(d, {
left: e,
top: f
})
}
},
samsungFix: function() {
ig.ua.android && !(4.2 > parseFloat(navigator.userAgent.slice(navigator.userAgent.indexOf("Android") + 8, navigator.userAgent.indexOf("Android") + 11))) && (!(0 > navigator.userAgent.indexOf("GT")) && !(0 < navigator.userAgent.indexOf("Chrome")) && !(0 < navigator.userAgent.indexOf("Firefox"))) && (document.addEventListener("touchstart", function(b) {
b.preventDefault();
return !1
}, !1), document.addEventListener("touchmove", function(b) {
b.preventDefault();
return !1
}, !1), document.addEventListener("touchend", function(b) {
b.preventDefault();
return !1
}, !1))
},
orientationInterval: null,
orientationTimeout: null,
orientationHandler: function() {
this.reorient();
window.scrollTo(0, 1)
},
orientationDelayHandler: function() {
null == this.orientationInterval && (this.orientationInterval = window.setInterval(this.orientationHandler.bind(this), 100));
null == this.orientationTimeout && (this.orientationTimeout = window.setTimeout(function() {
this.clearAllIntervals()
}.bind(this), 2E3))
},
clearAllIntervals: function() {
window.clearInterval(this.orientationInterval);
this.orientationInterval = null;
window.clearTimeout(this.orientationTimeout);
this.orientationTimeout = null
},
eventListenerSetup: function() {
ig.ua.iOS ? (window.addEventListener("orientationchange", this.orientationDelayHandler.bind(this)), window.addEventListener("resize", this.orientationDelayHandler.bind(this))) : (window.addEventListener("orientationchange", this.orientationHandler.bind(this)), window.addEventListener("resize", this.orientationHandler.bind(this)));
document.ontouchmove = function(b) {
window.scrollTo(0, 1);
b.preventDefault()
}
}
})
});
ig.baked = !0;
ig.module("plugins.handlers.api-handler").defines(function() {
ig.ApiHandler = ig.Class.extend({
apiAvailable: {
MJSPreroll: function() {
ig.ua.mobile && ig.domHandler.JQUERYAVAILABLE && _SETTINGS
// && _SETTINGS.Ad.Mobile.Preroll.Enabled && MobileAdInGamePreroll.Initialize()
},
MJSHeader: function() {
ig.ua.mobile && ig.domHandler.JQUERYAVAILABLE
// && _SETTINGS.Ad.Mobile.Header.Enabled && MobileAdInGameHeader.Initialize()
},
MJSFooter: function() {
ig.ua.mobile && ig.domHandler.JQUERYAVAILABLE
// && _SETTINGS.Ad.Mobile.Footer.Enabled && MobileAdInGameFooter.Initialize()
},
MJSEnd: function() {
ig.ua.mobile && ig.domHandler.JQUERYAVAILABLE
// && _SETTINGS.Ad.Mobile.End.Enabled && MobileAdInGameEnd.Initialize()
}
},
run: function(b, c) {
if (this.apiAvailable[b]) this.apiAvailable[b](c)
}
})
});
ig.baked = !0;
ig.module("plugins.audio.sound-player").defines(function() {
SoundPlayer = ig.Class.extend({
tagName: "SoundPlayer",
stayMuteFlag: !1,
debug: !1,
init: function() {
this.debug && console.log(this.tagName)
},
play: function(b) {
this.debug && console.log("play sound ", b)
},
stop: function() {
this.debug && console.log("stop sound ")
},
volume: function() {
this.debug && console.log("set volume")
},
mute: function(b) {
this.debug && console.log("mute");
"undefined" === typeof b ? this.stayMuteFlag = !0 : b && (this.stayMuteFlag = !0)
},
unmute: function(b) {
this.debug && console.log("unmute");
"undefined" === typeof b ? this.stayMuteFlag = !1 : b && (this.stayMuteFlag = !1)
}
})
});
ig.baked = !0;
ig.module("plugins.audio.impact-music-player").requires("plugins.audio.sound-player").defines(function() {
ImpactMusicPlayer = SoundPlayer.extend({
tagName: "ImpactMusicPlayer",
bgmPlaying: !1,
soundList: {},
init: function(b, c) {
this.parent(b, c);
for (var d in b) this.soundList[d] = d, ig.music.add(b[d].path + ".*", d);
c && c.loop && (ig.music.loop = c.loop)
},
play: function(b) {
this.stayMuteFlag || (this.bgmPlaying = !0, "undefined" === typeof b ? ig.music.play(b) : ig.music.play())
},
stop: function() {
this.bgmPlaying = !1;
ig.music.pause()
},
volume: function(b) {
console.log("impactmusic:", b);
ig.music.volume = 0 > b ? 0 : isNaN(b) ? 1 : 1 < b ? 1 : b
},
getVolume: function() {
return ig.music.volume
},
mute: function(b) {
this.parent(b);
this.bgmPlaying && this.stop()
},
unmute: function(b) {
this.parent(b);
this.play()
}
})
});
ig.baked = !0;
ig.module("plugins.audio.impact-sound-player").requires("plugins.audio.sound-player").defines(function() {
ImpactSoundPlayer = SoundPlayer.extend({
tagName: "ImpactSoundPlayer",
soundList: {},
init: function(b, c) {
this.parent(b, c);
for (var d in b) {
var e = new ig.Sound(b[d].path + ".*");
this.soundList[d] = e
}
},
play: function(b) {
this.stayMuteFlag || ("object" === typeof b ? (console.log(b + " exists"), b.play()) : "string" === typeof b && this.soundList[b].play())
},
stop: function(b) {
this.parent(b);
b.stop()
},
volume: function(b) {
ig.soundManager.volume = 0 > b ? 0 : isNaN(b) ? 1 : 1 < b ? 1 : b
},
getVolume: function() {
return ig.soundManager.volume
},
mute: function(b) {
this.parent(b);
ig.Sound.enabled = !1
},
unmute: function(b) {
this.parent(b);
ig.Sound.enabled = !0
}
})
});
ig.baked = !0;
ig.module("plugins.audio.howler-player").requires("plugins.audio.sound-player").defines(function() {
HowlerPlayer = SoundPlayer.extend({
tagName: "HowlerPlayer",
soundList: {},
init: function(b, c) {
this.parent(b, c);
for (var d in b) {
var e = b[d].path,
e = new Howl({
src: [e + "." + ig.Sound.FORMAT.OGG.ext, e + "." + ig.Sound.FORMAT.MP3.ext]
});
this.soundList[d] = e
}
},
play: function(b) {
this.stayMuteFlag || ("object" === typeof b ? b.play() : "string" === typeof b && this.soundList[b].play())
},
stop: function(b) {
this.parent(b);
b.stop()
},
volume: function(b) {
for (var c in this.soundList) {
if (0 > b) {
this.soundList[c].volume(0);
break
}
isNaN(b) ? this.soundList[c].volume(1) : 1 < b ? this.soundList[c].volume(1) : this.soundList[c].volume(b)
}
},
getVolume: function() {
for (var b in this.soundList) return this.soundList[b].volume()
},
mute: function(b) {
this.parent(b);
Howler.mute(!0)
},
unmute: function(b) {
this.parent(b);
Howler.mute(!1)
}
})
});
ig.baked = !0;
ig.module("plugins.audio.howler-music-player").requires("plugins.audio.sound-player").defines(function() {
HowlerMusicPlayer = SoundPlayer.extend({
tagName: "HowlerMusicPlayer",
bgmPlaying: !1,
soundList: {},
init: function(b, c) {
this.parent(b, c);
for (var d in b) {
var e = b[d].path,
e = new Howl({
src: [e + "." + ig.Sound.FORMAT.OGG.ext, e + "." + ig.Sound.FORMAT.MP3.ext],
loop: !0,
autoplay: !1,
onend: function() {}.bind(this)
});
this.soundList[d] = e
}
},
play: function(b) {
if (!this.stayMuteFlag && !this.bgmPlaying)
if ("object" === typeof b) this.bgmPlaying = !0, b.play();
else if ("string" === typeof b) this.bgmPlaying = !0, this.soundList[b].play();
else
for (var c in this.soundList) {
this.soundList[c].play();
this.bgmPlaying = !0;
break
}
},
stop: function(b) {
this.parent(b);
if (this.bgmPlaying) {
for (var c in this.soundList) this.soundList[c].stop();
this.bgmPlaying = !1
}
},
volume: function(b) {
for (var c in this.soundList) {
if (0 > b) {
this.soundList[c].volume(0);
break
}
isNaN(b) ? this.soundList[c].volume(1) : 1 < b ? this.soundList[c].volume(1) : this.soundList[c].volume(b)
}
},
getVolume: function() {
for (var b in this.soundList) return this.soundList[b].volume()
},
mute: function(b) {
this.parent(b);
Howler.mute(!0)
},
unmute: function(b) {
this.parent(b);
Howler.mute(!1)
}
})
});
ig.baked = !0;
ig.module("plugins.audio.jukebox-player").requires("plugins.audio.sound-player").defines(function() {
JukeboxPlayer = SoundPlayer.extend({
tagName: "JukeboxPlayer",
bgmPlaying: !1,
soundList: {},
jukeboxPlayer: null,
pausePosition: 0,
premuteVolume: 0,
minVolume: 0.0010,
init: function(b, c) {
this.parent(b, c);
for (var d in b) {
this.soundList[d] = d;
var e = b[d].path;
this.jukeboxPlayer = new jukebox.Player({
resources: [e + "." + ig.Sound.FORMAT.OGG.ext, e + "." + ig.Sound.FORMAT.MP3.ext],
autoplay: !1,
spritemap: {
music: {
start: b[d].startMp3,
end: b[d].endMp3,
loop: !0
}
}
})
}
},
play: function() {
this.stayMuteFlag || (this.bgmPlaying = !0, this.pausePosition ? (console.log("resume"), this.jukeboxPlayer.resume(this.pausePosition)) : (console.log("play"), this.jukeboxPlayer.play(this.jukeboxPlayer.settings.spritemap.music.start, !0)), this.premuteVolume = this.getVolume())
},
stop: function() {
this.bgmPlaying = !1;
this.pausePosition = this.jukeboxPlayer.pause()
},
volume: function(b) {
console.log("jukebox:", b);
0 >= b ? this.jukeboxPlayer.setVolume(this.minVolume) : isNaN(b) ? this.jukeboxPlayer.setVolume(1) : 1 < b ? this.jukeboxPlayer.setVolume(1) : this.jukeboxPlayer.setVolume(b)
},
getVolume: function() {
return this.jukeboxPlayer.getVolume()
},
mute: function(b) {
this.parent(b);
this.bgmPlaying && (console.log("jukebox", this.premuteVolume), this.stayMuteFlag || (this.premuteVolume = this.getVolume()), this.jukeboxPlayer.pause(), this.jukeboxPlayer.setVolume(this.minVolume))
},
unmute: function(b) {
this.parent(b);
this.stayMuteFlag || (console.log("jukebox", this.premuteVolume), this.jukeboxPlayer.setVolume(this.premuteVolume), this.jukeboxPlayer.resume())
}
})
});
ig.baked = !0;
ig.module("plugins.audio.webaudio-music-player").requires("plugins.audio.sound-player").defines(function() {
WebaudioMusicPlayer = SoundPlayer.extend({
tagName: "WebaudioMusicPlayer",
bgmPlaying: !1,
isSupported: !1,
muteFlag: !1,
pausedTime: 0,
webaudio: null,
useHTML5Audio: !1,
audio: null,
inactiveAudio: null,
codecs: null,
_volume: 1,
soundList: {},
init: function(b) {
this.webaudio = {
compatibility: {},
gainNode: null,
buffer: null,
source_loop: {},
source_once: {}
};
try {
this.AudioContext = window.AudioContext || window.webkitAudioContext, this.webaudio.context = new this.AudioContext, this.isSupported = !0
} catch (c) {
console.log("Web Audio API not supported in this browser."), this.webaudio = null, this.useHTML5Audio = !0
}
if (this.useHTML5Audio)
if ("undefined" !== typeof Audio) try {
new Audio
} catch (d) {
this.useHTML5Audio = !1
} else this.useHTML5Audio = !1;
this.useHTML5Audio && (this.audio = new Audio, this.isSupported = !0, this.initHTML5Audio(b));
if (!this.isSupported) return null;
this.webaudio && this.initWebAudio(b)
},
initWebAudio: function(b) {
ig.ua.iOS && this.initIOSWebAudioUnlock();
this.webaudio.gainNode = this.webaudio.context.createGain();
this.webaudio.gainNode.connect(this.webaudio.context.destination);
this.webaudio.gainNode.gain.value = this._volume;
var c = "start",
d = "stop",
e = this.webaudio.context.createBufferSource();
"function" !== typeof e.start && (c = "noteOn");
this.webaudio.compatibility.start = c;
"function" !== typeof e.stop && (d = "noteOff");
this.webaudio.compatibility.stop = d;
for (var f in b) {
this.soundList[f] = f;
c = b[f].path;
b = c + "." + ig.Sound.FORMAT.MP3.ext;
var j = c + "." + ig.Sound.FORMAT.OGG.ext;
ig.ua.mobile ? ig.ua.iOS && (j = b) : (c = navigator.userAgent.toLowerCase(), -1 != c.indexOf("safari") && -1 >= c.indexOf("chrome") && (j = b));
var q = new XMLHttpRequest;
q.open("GET", j, !0);
q.responseType = "arraybuffer";
q.onload = function() {
this.webaudio.context.decodeAudioData(q.response, function(b) {
this.webaudio.buffer = b;
this.webaudio.source_loop = {};
this.bgmPlaying ? this.play() : this.stop()
}.bind(this), function() {
console.log('Error decoding audio "' + j + '".')
})
}.bind(this);
q.send();
break
}
},
initIOSWebAudioUnlock: function() {
if (this.webaudio) {
webaudio = this.webaudio;
var b = function() {
var c = webaudio.context,
d = c.createBuffer(1, 1, 22050),
e = c.createBufferSource();
e.buffer = d;
e.connect(c.destination);
"undefined" === typeof e.start ? e.noteOn(0) : e.start(0);
setTimeout(function() {
(e.playbackState === e.PLAYING_STATE || e.playbackState === e.FINISHED_STATE) && window.removeEventListener("touchend", b, !1)
}, 0)
};
window.addEventListener("touchend", b, !1)
}
},
initHTML5Audio: function(b) {
if (this.useHTML5Audio && this.audio) {
var c = this.audio;
this.codecs = {};
this.codecs = {
mp3: !!c.canPlayType("audio/mpeg;").replace(/^no$/, ""),
opus: !!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ""),
ogg: !!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
wav: !!c.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""),
aac: !!c.canPlayType("audio/aac;").replace(/^no$/, ""),
m4a: !!(c.canPlayType("audio/x-m4a;") || c.canPlayType("audio/m4a;") || c.canPlayType("audio/aac;")).replace(/^no$/, ""),
mp4: !!(c.canPlayType("audio/x-mp4;") || c.canPlayType("audio/mp4;") || c.canPlayType("audio/aac;")).replace(/^no$/, ""),
weba: !!c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, "")
};
this.is = {
ff: Boolean(null != window.mozInnerScreenX && /firefox/.test(navigator.userAgent.toLowerCase())),
ie: Boolean(document.all && !window.opera),
opera: Boolean(window.opera),
chrome: Boolean(window.chrome),
safari: Boolean(!window.chrome && /safari/.test(navigator.userAgent.toLowerCase()) && window.getComputedStyle && !window.globalStorage && !window.opera)
};
this.playDelay = -60;
this.stopDelay = 30;
this.is.chrome && (this.playDelay = -25);
this.is.chrome && (this.stopDelay = 25);
this.is.ff && (this.playDelay = -25);
this.is.ff && (this.stopDelay = 85);
this.is.opera && (this.playDelay = 5);
this.is.opera && (this.stopDelay = 0);
for (var d in b) {
this.soundList[d] = d;
var e = b[d].path,
c = e + "." + ig.Sound.FORMAT.OGG.ext,
e = e + "." + ig.Sound.FORMAT.MP3.ext,
f = null;
this.codecs[ig.Sound.FORMAT.OGG.ext.toLowerCase()] ? f = c : this.codecs[ig.Sound.FORMAT.MP3.ext.toLowerCase()] && (f = e);
if (f) {
ig.ua.mobile ? ig.ua.iOS && (f = e) : (b = navigator.userAgent.toLowerCase(), -1 != b.indexOf("safari") && -1 >= b.indexOf("chrome") && (f = e));
this.audio.addEventListener("error", function() {
this.audio.error && 4 === this.audio.error.code && (this.isSupported = !1)
}, !1);
this.audio.src = f;
this.audio._pos = 0;
this.audio.preload = "auto";
this.audio.volume = this._volume;
this.inactiveAudio = new Audio;
this.inactiveAudio.src = f;
this.inactiveAudio._pos = 0;
this.inactiveAudio.preload = "auto";
this.inactiveAudio.volume = this._volume;
this.inactiveAudio.load();
var j = function() {
this._duration = this.audio.duration;
this._loaded || (this._loaded = !0);
this.bgmPlaying ? this.play() : this.stop();
this.audio.removeEventListener("canplaythrough", j, !1)
}.bind(this);
this.audio.addEventListener("canplaythrough", j, !1);
this.audio.load();
break
}
}
}
},
play: function(b) {
if (this.isSupported)
if (this.bgmPlaying = !0, this.webaudio)
if (this.webaudio.buffer) {
if (!this.muteFlag && (this.bgmPlaying = !0, !this.webaudio.source_loop._playing)) {
this.webaudio.source_loop = this.webaudio.context.createBufferSource();
this.webaudio.source_loop.buffer = this.webaudio.buffer;
this.webaudio.source_loop.loop = !0;
this.webaudio.source_loop.connect(this.webaudio.gainNode);
isNaN(b) && (b = 0, this.pausedTime && (b = this.pausedTime));
this.webaudio.source_loop._startTime = this.webaudio.context.currentTime;
if ("noteOn" === this.webaudio.compatibility.start) this.webaudio.source_once = this.webaudio.context.createBufferSource(), this.webaudio.source_once.buffer = this.webaudio.buffer, this.webaudio.source_once.connect(this.webaudio.gainNode), this.webaudio.source_once.noteGrainOn(0, b, this.webaudio.buffer.duration - b), this.webaudio.source_loop[this.webaudio.compatibility.start](this.webaudio.context.currentTime + (this.webaudio.buffer.duration -
b));
else this.webaudio.source_loop[this.webaudio.compatibility.start](0, b);
this.webaudio.source_loop._playing = !0
}
} else this.bgmPlaying = !0;
else if (this.audio) {
var c = this.audio;
if (!this.muteFlag) {
this.bgmPlaying = !0;
isNaN(b) && (b = 0, this.pausedTime && (b = this.pausedTime));
var d = this._duration - b;
this._onEndTimer && (clearTimeout(this._onEndTimer), this._onEndTimer = null);
this._onEndTimer = setTimeout(function() {
this.audio.currentTime = 0;
this.audio.pause();
this.pausedTime = 0;
if (this.inactiveAudio) {
var b = this.audio;
this.audio = this.inactiveAudio;
this.inactiveAudio = b
}
this.play()
}.bind(this), 1E3 * d + this.playDelay);
4 === c.readyState || !c.readyState && navigator.isCocoonJS ? (c.readyState = 4, c.currentTime = b, c.muted = this.muteFlag || c.muted, c.volume = this._volume, setTimeout(function() {
c.play()
}, 0)) : (clearTimeout(this._onEndTimer), this._onEndTimer = null, function() {
var b = function() {
try {
this.play()
} catch (d) {
console.log(d.message)
}
c.removeEventListener("canplaythrough", b, !1)
}.bind(this);
c.addEventListener("canplaythrough", b, !1)
}())
}
}
},
stop: function() {
this.bgmPlaying = !1;
if (this.isSupported)
if (this.webaudio) {
if (this.webaudio.source_loop._playing && (this.webaudio.source_loop[this.webaudio.compatibility.stop](0), this.webaudio.source_loop._playing = !1, this.pausedTime += this.webaudio.context.currentTime - this.webaudio.source_loop._startTime, this.pausedTime %= this.webaudio.source_loop.buffer.duration, this.webaudio.source_loop._startTime = 0, "noteOn" === this.webaudio.compatibility.start)) this.webaudio.source_once[this.webaudio.compatibility.stop](0)
} else if (this.audio) {
var b = this.audio;
this.pausedTime = b.currentTime;
b.currentTime = 0;
b.pause();
clearTimeout(this._onEndTimer);
this._onEndTimer = null
}
},
volume: function(b) {
this.isSupported && (this._volume = b, 0 > this._volume ? this._volume = 0 : 1 < this._volume && (this._volume = 1), this.webaudio ? this.webaudio.gainNode && (this.webaudio.gainNode.gain.value = this._volume) : this.audio && (this.audio.volume = this._volume, this.inactiveAudio && (this.inactiveAudio.volume = this._volume)))
},
getVolume: function() {
return !this.isSupported ? 0 : this._volume
},
mute: function(b) {
this.parent(b);
!1 == this.muteFlag && (this.muteFlag = !0, this.bgmPlaying && (this.stop(), this.bgmPlaying = !0))
},
unmute: function(b) {
this.parent(b);
!this.stayMuteFlag && !0 == this.muteFlag && (this.muteFlag = !1, this.bgmPlaying && this.play())
}
})
});
ig.baked = !0;
ig.module("plugins.audio.sound-info").defines(function() {
SoundInfo = ig.Class.extend({
FORMATS: {
OGG: ".ogg",
MP3: ".mp3"
},
sfx: {
kittyopeningSound: {
path: "media/audio/opening/kittyopening"
},
staticSound: {
path: "media/audio/play/static"
},
openingSound: {
path: "media/audio/opening/opening"
},
hit_hight: {
path: "media/audio/play/hit3"
},
hit_low: {
path: "media/audio/play/hit_low"
},
hole: {
path: "media/audio/play/ball_in_hole"
},
watersplash: {
path: "media/audio/play/watersplash"
},
ding1: {
path: "media/audio/play/ding1"
},
button1: {
path: "media/audio/play/button1"
},
button2: {
path: "media/audio/play/button2"
}
},
bgm: {
background: {
path: "media/audio/bgm2",
startOgg: 0,
endOgg: 21.463,
startMp3: 0,
endMp3: 21.463
}
}
})
});
ig.baked = !0;
ig.module("plugins.audio.sound-handler").requires("plugins.audio.impact-music-player", "plugins.audio.impact-sound-player", "plugins.audio.howler-player", "plugins.audio.howler-music-player", "plugins.audio.jukebox-player", "plugins.audio.webaudio-music-player", "plugins.audio.sound-info").defines(function() {
ig.SoundHandler = ig.Class.extend({
bgmPlayer: null,
sfxPlayer: null,
focusBlurMute: !1,
soundInfo: new SoundInfo,
init: function() {
console.log("Initiating sound handler");
this.initWindowHandler();
ig.ua.mobile ? (this.initPowerButtonFix(), this.bgmPlayer = new WebaudioMusicPlayer(this.soundInfo.bgm, {
loop: !0
}), this.bgmPlayer.isSupported || (this.bgmPlayer = new JukeboxPlayer(this.soundInfo.bgm, {
loop: !0
}))) : (this.bgmPlayer = new WebaudioMusicPlayer(this.soundInfo.bgm, {
loop: !0
}), this.bgmPlayer.isSupported || (this.bgmPlayer = new ImpactMusicPlayer(this.soundInfo.bgm, {
loop: !0
})));
this.sfxPlayer = new HowlerPlayer(this.soundInfo.sfx)
},
checkBGM: function() {
return this.bgmPlayer.stayMuteFlag
},
checkSFX: function() {
return this.sfxPlayer.stayMuteFlag
},
muteSFX: function(b) {
this.sfxPlayer && this.sfxPlayer.mute(b)
},
muteBGM: function(b) {
this.bgmPlayer && this.bgmPlayer.mute(b)
},
unmuteSFX: function(b) {
this.sfxPlayer && this.sfxPlayer.unmute(b)
},
unmuteBGM: function(b) {
this.bgmPlayer && this.bgmPlayer.unmute(b)
},
muteAll: function(b) {
this.muteSFX(b);
this.muteBGM(b)
},
unmuteAll: function(b) {
this.unmuteSFX(b);
this.unmuteBGM(b)
},
forceMuteAll: function() {
this.focusBlurMute || this.muteAll(!1);
this.focusBlurMute = !0
},
forceUnMuteAll: function() {
this.focusBlurMute && (this.unmuteAll(!1), this.focusBlurMute = !1)
},
initWindowHandler: function() {
"true" === ig.domHandler.getQueryVariable("webview") ? ($(window).focus(function() {
ig.soundHandler && ig.soundHandler.forceUnMuteAll()
}), $(window).blur(function() {
ig.game && ig.game.controller && "GameCtrl" == ig.game.controller.name && (!ig.game.states.isPaused && !ig.game.controller.startCounter) && ig.game.controller.fnTriggerPause();
ig.soundHandler && ig.soundHandler.forceMuteAll()
})) : ($(window).focusin(function() {
ig.soundHandler && ig.soundHandler.forceUnMuteAll()
}), $(window).focusout(function() {
ig.game && ig.game.controller && "GameCtrl" == ig.game.controller.name && (!ig.game.states.isPaused && !ig.game.controller.startCounter) && ig.game.controller.fnTriggerPause();
ig.soundHandler && ig.soundHandler.forceMuteAll()
}))
},
initPowerButtonFix: function() {
var b = this.getHiddenProp();
b && (b = b.replace(/[H|h]idden/, "") + "visibilitychange", document.addEventListener(b, this.visChange));
window.addEventListener("pagehide", function() {
ig.game && ig.game.controller && "GameCtrl" == ig.game.controller.name && (!ig.game.states.isPaused && !ig.game.controller.startCounter) && ig.game.controller.fnTriggerPause();
ig.soundHandler && ig.soundHandler.forceMuteAll()
}, !1);
window.addEventListener("pageshow", function() {
ig.soundHandler && ig.soundHandler.forceUnMuteAll()
}, !1)
},
getHiddenProp: function() {
var b = ["webkit", "moz", "ms", "o"];
if ("hidden" in document) return "hidden";
for (var c = 0; c < b.length; c++)
if (b[c] + "Hidden" in document) return b[c] + "Hidden";
return null
},
isHidden: function() {
var b = this.getHiddenProp();
return !b ? !1 : document[b]
},
visChange: function() {
ig.soundHandler.isHidden() ? (ig.ua.mobile && ig.game && ig.game.controller && "GameCtrl" == ig.game.controller.name && (!ig.game.states.isPaused && !ig.game.controller.startCounter) && ig.game.controller.fnTriggerPause(), ig.soundHandler && ig.soundHandler.forceMuteAll()) : ig.soundHandler && ig.soundHandler.forceUnMuteAll()
},
saveVolume: function() {
this.sfxPlayer && ig.game.io.storageSet("soundVolume", this.sfxPlayer.getVolume());
this.bgmPlayer && ig.game.io.storageSet("musicVolume", this.bgmPlayer.getVolume())
},
forceLoopBGM: function() {
var b;
if (!this.focusBlurMute && this.bgmPlayer.bgmPlaying && this.bgmPlayer) {
var c = this.bgmPlayer.jukeboxPlayer;
if (c) {
null != window.mozInnerScreenX && /firefox/.test(navigator.userAgent.toLowerCase());
b = Boolean(window.chrome);
!window.chrome && /safari/.test(navigator.userAgent.toLowerCase());
var d = 0.1;
ig.ua.mobile && (d = 0.115, ig.ua.android && (d = 0.45, b && (d = 0.3)));
c.settings.spritemap.music && (b = c.settings.spritemap.music.end - d, c.getCurrentTime() >= b && (b = c.settings.spritemap.music.start, ig.ua.android ? this.forcelooped || (c.play(b, !0), this.forcelooped = !0, setTimeout(function() {
ig.soundHandler.forcelooped = !1
}, d)) : c.setCurrentTime(b)))
} else "ImpactMusicPlayer" == this.bgmPlayer.tagName && (null != window.mozInnerScreenX && /firefox/.test(navigator.userAgent.toLowerCase()), b = Boolean(window.chrome), !window.chrome && /safari/.test(navigator.userAgent.toLowerCase()), d = 0.1, ig.ua.mobile && (d = 0.115, ig.ua.android && (d = 0.45, b && (d = 0.3))), c = 0, "mp3" == ig.soundManager.format.ext && (c = 0.05), ig.music.currentTrack && (b = ig.music.currentTrack.duration -
d, ig.music.currentTrack.currentTime >= b && (ig.ua.android ? this.forcelooped || (ig.music.currentTrack.pause(), ig.music.currentTrack.currentTime = c, ig.music.currentTrack.play(), this.forcelooped = !0, setTimeout(function() {
ig.soundHandler.forcelooped = !1
}, d)) : ig.music.currentTrack.currentTime = c)))
}
}
})
});
ig.baked = !0;
ig.module("plugins.io.storage").defines(function() {
ig.Storage = ig.Class.extend({
staticInstantiate: function() {
return !ig.Storage.instance ? null : ig.Storage.instance
},
init: function() {
ig.Storage.instance = this
},
isCapable: function() {
return "undefined" !== typeof window.localStorage
},
isSet: function(b) {
return null !== this.get(b)
},
initUnset: function(b, c) {
null === this.get(b) && this.set(b, c)
},
get: function(b) {
if (!this.isCapable()) return null;
try {
return JSON.parse(localStorage.getItem(b))
} catch (c) {
return window.localStorage.getItem(b)
}
},
getInt: function(b) {
return ~~this.get(b)
},
getFloat: function(b) {
return parseFloat(this.get(b))
},
getBool: function(b) {
return !!this.get(b)
},
key: function(b) {
return this.isCapable() ? window.localStorage.key(b) : null
},
set: function(b, c) {
if (!this.isCapable()) return null;
try {
window.localStorage.setItem(b, JSON.stringify(c))
} catch (d) {
console.log(d)
}
},
setHighest: function(b, c) {
c > this.getFloat(b) && this.set(b, c)
},
remove: function(b) {
if (!this.isCapable()) return null;
window.localStorage.removeItem(b)
},
clear: function() {
if (!this.isCapable()) return null;
window.localStorage.clear()
}
})
});
ig.baked = !0;
ig.module("plugins.io.mouse").defines(function() {
Mouse = ig.Class.extend({
bindings: {
click: [ig.KEY.MOUSE1]
},
init: function() {
ig.input.initMouse();
for (var b in this.bindings) {
this[b] = b;
for (var c = 0; c < this.bindings[b].length; c++) ig.input.bind(this.bindings[b][c], b)
}
},
getPos: function() {
if (ig.ua.mobile) var b = ig.input.mouse.x / ig.sizeHandler.sizeRatio.x,
c = ig.input.mouse.y / ig.sizeHandler.sizeRatio.y;
else b = ig.input.mouse.x, c = ig.input.mouse.y;
return new Vector2(b, c)
}
})
});
ig.baked = !0;
ig.module("plugins.io.keyboard").defines(function() {
Keyboard = ig.Class.extend({
bindings: {
jump: [ig.KEY.W, ig.KEY.UP_ARROW],
moveright: [ig.KEY.D, ig.KEY.RIGHT_ARROW],
moveleft: [ig.KEY.A, ig.KEY.LEFT_ARROW],
shoot: [ig.KEY.S, ig.KEY.DOWN_ARROW, ig.KEY.SPACE]
},
init: function() {
for (var b in this.bindings) {
this[b] = b;
for (var c = 0; c < this.bindings[b].length; c++) ig.input.bind(this.bindings[b][c], b)
}
}
})
});
ig.baked = !0;
ig.module("plugins.io.gamepad-input").defines(function() {
ig.PADKEY = {
BUTTON_0: 0,
PADBUTTON_1: 1,
BUTTON_2: 2,
BUTTON_3: 3,
BUTTON_LEFT_BUMPER: 4,
BUTTON_RIGHT_BUMPER: 5,
BUTTON_LEFT_TRIGGER: 6,
BUTTON_RIGHT_TRIGGER: 7,
BUTTON_LEFT_JOYSTICK: 10,
BUTTON_RIGHT_JOYSTICK: 11,
BUTTON_DPAD_UP: 12,
BUTTON_DPAD_DOWN: 13,
BUTTON_DPAD_LEFT: 14,
BUTTON_DPAD_RIGHT: 15,
BUTTON_MENU: 16,
AXIS_LEFT_JOYSTICK_X: 0,
AXIS_LEFT_JOYSTICK_Y: 1,
AXIS_RIGHT_JOYSTICK_X: 2,
AXIS_RIGHT_JOYSTICK_Y: 3
};
ig.GamepadInput = ig.Class.extend({
isInit: !1,
isSupported: !1,
list: [],
bindings: {},
states: {},
presses: {},
releases: {},
downLocks: {},
upLocks: {},
leftStick: {
x: 0,
y: 0
},
rightStick: {
x: 0,
y: 0
},
start: function() {
if (!this.isInit) {
this.isInit = !0;
var b = navigator.getGamepads || navigator.webkitGetGamepads;
b && (!navigator.getGamepads && navigator.webkitGetGamepads && (navigator.getGamepads = navigator.webkitGetGamepads), this.list = navigator.getGamepads());
this.isSupported = b
}
},
isAvailable: function() {
return this.isInit && this.isSupported
},
buttonPressed: function(b) {
return "object" == typeof b ? b.pressed : 1 == b
},
buttonDown: function(b) {
if (b = this.bindings[b]) this.states[b] = !0, this.downLocks[b] || (this.presses[b] = !0, this.downLocks[b] = !0)
},
buttonUp: function(b) {
if ((b = this.bindings[b]) && this.downLocks[b] && !this.upLocks[b]) this.states[b] = !1, this.releases[b] = !0, this.upLocks[b] = !0
},
clearPressed: function() {
for (var b in this.releases) this.states[b] = !1, this.downLocks[b] = !1;
this.releases = {};
this.presses = {};
this.upLocks = {}
},
bind: function(b, c) {
this.bindings[b] = c
},
unbind: function(b) {
this.releases[this.bindings[b]] = !0;
this.bindings[b] = null
},
unbindAll: function() {
this.bindings = {};
this.states = {};
this.presses = {};
this.releases = {};
this.downLocks = {};
this.upLocks = {}
},
state: function(b) {
return this.states[b]
},
pressed: function(b) {
return this.presses[b]
},
released: function(b) {
return this.releases[b]
},
clamp: function(b, c, d) {
return b < c ? c : b > d ? d : b
},
pollGamepads: function() {
if (this.isSupported) {
this.leftStick.x = 0;
this.leftStick.y = 0;
this.rightStick.x = 0;
this.rightStick.y = 0;
this.list = navigator.getGamepads();
for (var b in this.bindings) {
for (var c = !1, d = 0; d < this.list.length; d++) {
var e = this.list[d];
if (e && e.buttons && this.buttonPressed(e.buttons[b])) {
c = !0;
break
}
}
c ? this.buttonDown(b) : this.buttonUp(b)
}
for (d = 0; d < this.list.length; d++)
if ((e = this.list[d]) && e.axes) {
b = e.axes[ig.GAMEPADINPUT.AXIS_LEFT_JOYSTICK_X];
var c = e.axes[ig.GAMEPADINPUT.AXIS_LEFT_JOYSTICK_Y],
f = e.axes[ig.GAMEPADINPUT.AXIS_RIGHT_JOYSTICK_X],
e = e.axes[ig.GAMEPADINPUT.AXIS_RIGHT_JOYSTICK_Y];
this.leftStick.x += isNaN(b) ? 0 : b;
this.leftStick.y += isNaN(c) ? 0 : c;
this.rightStick.x += isNaN(f) ? 0 : f;
this.rightStick.y += isNaN(e) ? 0 : e
}
0 < this.list.length && (this.leftStick.x = this.clamp(this.leftStick.x, -1, 1), this.leftStick.y = this.clamp(this.leftStick.y, -1, 1), this.rightStick.x = this.clamp(this.rightStick.x, -1, 1), this.rightStick.y = this.clamp(this.rightStick.y, -1, 1))
}
}
})
});
ig.baked = !0;
ig.module("plugins.io.gamepad").requires("plugins.io.gamepad-input").defines(function() {
Gamepad = ig.Class.extend({
bindings: {
padJump: [ig.PADKEY.BUTTON_0]
},
init: function() {
ig.gamepadInput.start();
for (var b in this.bindings)
for (var c = 0; c < this.bindings[b].length; c++) ig.gamepadInput.bind(this.bindings[b][c], b)
},
press: function() {},
held: function() {},
release: function() {}
})
});
ig.baked = !0;
ig.module("plugins.io.multitouch").defines(function() {
Multitouch = ig.Class.extend({
init: function() {
ig.multitouchInput.start()
},
getTouchesPos: function() {
if (ig.ua.mobile) {
if (0 < ig.multitouchInput.touches.length) {
for (var b = [], c = 0; c < ig.multitouchInput.touches.length; c++) {
var d = ig.multitouchInput.touches[c];
b.push({
x: d.x,
y: d.y
})
}
return b
}
return null
}
}
})
});
ig.baked = !0;
ig.module("plugins.io.multitouch-input").defines(function() {
ig.MultitouchInput = ig.Class.extend({
isStart: !1,
touches: [],
multitouchCapable: !1,
lastEventUp: null,
start: function() {
this.isStart || (this.isStart = !0, navigator.maxTouchPoints && 1 < navigator.maxTouchPoints && (this.multitouchCapable = !0), ig.ua.touchDevice && (window.navigator.msPointerEnabled && (ig.system.canvas.addEventListener("MSPointerDown", this.touchdown.bind(this), !1), ig.system.canvas.addEventListener("MSPointerUp", this.touchup.bind(this), !1), ig.system.canvas.addEventListener("MSPointerMove", this.touchmove.bind(this), !1), ig.system.canvas.style.msContentZooming = "none", ig.system.canvas.style.msTouchAction = "none"), ig.system.canvas.addEventListener("touchstart", this.touchdown.bind(this), !1), ig.system.canvas.addEventListener("touchend", this.touchup.bind(this), !1), ig.system.canvas.addEventListener("touchmove", this.touchmove.bind(this), !1)))
},
touchmove: function(b) {
if (ig.ua.touchDevice) {
var c = parseInt(ig.system.canvas.offsetWidth) || ig.system.realWidth,
d = parseInt(ig.system.canvas.offsetHeight) || ig.system.realHeight,
c = ig.system.scale * (c / ig.system.realWidth),
d = ig.system.scale * (d / ig.system.realHeight);
if (b.touches) {
for (; 0 < this.touches.length;) this.touches.pop();
!this.multitouchCapable && 1 < b.touches.length && (this.multitouchCapable = !0);
var e = {
left: 0,
top: 0
};
ig.system.canvas.getBoundingClientRect && (e = ig.system.canvas.getBoundingClientRect());
for (var f = 0; f < b.touches.length; f++) {
var j = b.touches[f];
j && this.touches.push({
x: (j.clientX - e.left) / c,
y: (j.clientY - e.top) / d
})
}
} else this.windowMove(b)
}
},
touchdown: function(b) {
var c =
parseInt(ig.system.canvas.offsetWidth) || ig.system.realWidth,
d = parseInt(ig.system.canvas.offsetHeight) || ig.system.realHeight,
c = ig.system.scale * (c / ig.system.realWidth),
d = ig.system.scale * (d / ig.system.realHeight);
if (window.navigator.msPointerEnabled) this.windowKeyDown(b);
else if (ig.ua.touchDevice && b.touches) {
for (; 0 < this.touches.length;) this.touches.pop();
!this.multitouchCapable && 1 < b.touches.length && (this.multitouchCapable = !0);
var e = {
left: 0,
top: 0
};
ig.system.canvas.getBoundingClientRect && (e = ig.system.canvas.getBoundingClientRect());
for (var f = 0; f < b.touches.length; f++) {
var j = b.touches[f];
j && this.touches.push({
x: (j.clientX - e.left) / c,
y: (j.clientY - e.top) / d
})
}
}
},
touchup: function(b) {
var c = parseInt(ig.system.canvas.offsetWidth) || ig.system.realWidth;
parseInt(ig.system.canvas.offsetHeight);
c = ig.system.scale * (c / ig.system.realWidth);
if (window.navigator.msPointerEnabled) this.windowKeyUp(b);
else {
this.lastEventUp = b;
var d = {
left: 0,
top: 0
};
ig.system.canvas.getBoundingClientRect && (d = ig.system.canvas.getBoundingClientRect());
if (ig.ua.touchDevice) {
b =
(b.changedTouches[0].clientX - d.left) / c;
for (c = 0; c < this.touches.length; c++) this.touches[c].x >= b - 40 && this.touches[c].x <= b + 40 && this.touches.splice(c, 1)
}
}
},
windowKeyDown: function(b) {
var c = parseInt(ig.system.canvas.offsetWidth) || ig.system.realWidth,
d = parseInt(ig.system.canvas.offsetHeight) || ig.system.realHeight,
c = ig.system.scale * (c / ig.system.realWidth),
d = ig.system.scale * (d / ig.system.realHeight);
if (window.navigator.msPointerEnabled) {
var e = {
left: 0,
top: 0
};
ig.system.canvas.getBoundingClientRect && (e = ig.system.canvas.getBoundingClientRect());
b = b.changedTouches ? b.changedTouches : [b];
for (var f = 0; f < b.length; ++f) {
for (var j = b[f], q = "undefined" != typeof j.identifier ? j.identifier : "undefined" != typeof j.pointerId ? j.pointerId : 1, n = (j.clientX - e.left) / c, j = (j.clientY - e.top) / d, g = 0; g < this.touches.length; ++g) this.touches[g].identifier == q && this.touches.splice(g, 1);
this.touches.push({
x: n,
y: j,
identifier: q
})
}
for (c = 0; c < this.touches.length; c++);
}
},
windowKeyUp: function(b) {
b = "undefined" != typeof b.identifier ? b.identifier : "undefined" != typeof b.pointerId ? b.pointerId :
1;
for (var c = 0; c < this.touches.length; ++c) this.touches[c].identifier == b && this.touches.splice(c, 1);
for (; 0 < this.touches.length;) this.touches.pop()
},
windowMove: function(b) {
var c = parseInt(ig.system.canvas.offsetWidth) || ig.system.realWidth,
d = parseInt(ig.system.canvas.offsetHeight) || ig.system.realHeight,
c = ig.system.scale * (c / ig.system.realWidth),
d = ig.system.scale * (d / ig.system.realHeight),
e = {
left: 0,
top: 0
};
ig.system.canvas.getBoundingClientRect && (e = ig.system.canvas.getBoundingClientRect());
if (window.navigator.msPointerEnabled)
for (var f = "undefined" != typeof b.identifier ? b.identifier : "undefined" != typeof b.pointerId ? b.pointerId : 1, j = 0; j < this.touches.length; ++j)
if (this.touches[j].identifier == f) {
var q = (b.clientY - e.top) / d;
this.touches[j].x = (b.clientX - e.left) / c;
this.touches[j].y = q
}
}
})
});
ig.baked = !0;
ig.module("plugins.io.io-manager").requires("plugins.io.storage", "plugins.io.mouse", "plugins.io.keyboard", "plugins.io.gamepad", "plugins.io.multitouch", "plugins.io.multitouch-input", "plugins.io.gamepad-input").defines(function() {
IoManager = ig.Class.extend({
storage: null,
localStorageSupport: !1,
gamekey: "TeamKaboom",
mouse: null,
keyboard: null,
multitouch: null,
gamepad: null,
init: function() {
ig.multitouchInput = new ig.MultitouchInput;
ig.gamepadInput = new ig.GamepadInput;
this.unbindAll();
this.initStorage();
this.initMouse();
this.initKeyboard()
},
unbindAll: function() {
ig.input.unbindAll();
ig.gamepadInput.unbindAll()
},
initStorage: function() {
this._supportsLocalStorage() && (this.storage = new ig.Storage)
},
initMouse: function() {
this.mouse = new Mouse
},
initKeyboard: function() {
this.keyboard = new Keyboard
},
initMultitouch: function() {
this.multitouch = new Multitouch
},
initGamepad: function() {
this.gamepad = new Gamepad
},
press: function(b) {
return ig.input.pressed(b) || this.gamepad.press(b) ? !0 : !1
},
held: function(b) {
return ig.input.state(b) || this.gamepad.state(b) ? !0 : !1
},
release: function(b) {
return ig.input.released(b) || this.gamepad.released(b) ? !0 : !1
},
getClickPos: function() {
return this.mouse.getPos()
},
getTouchesPos: function() {
return this.multitouch.getTouchesPos()
},
checkOverlap: function(b, c, d, e, f) {
return b.x > c + e || b.x < c || b.y > d + f || b.y < d ? !1 : !0
},
_supportsLocalStorage: function() {
try {
return localStorage.setItem("test", "test"), localStorage.removeItem("test"), this.localStorageSupport = "localStorage" in window && null !== window.localStorage
} catch (b) {
return this.localStorageSupport
}
},
storageIsSet: function(b) {
return !this.localStorageSupport ? null : this.storage.isSet(b)
},
storageGet: function(b) {
return !this.localStorageSupport ? null : this.storage.get(b)
},
storageSet: function(b, c) {
if (!this.localStorageSupport) return null;
this.storage.set(b, c)
},
assert: function(b, c, d) {
if (c !== d) throw "actualValue:" + c + " not equal to testValue:" + d + " at " + b;
}
})
});
ig.baked = !0;
ig.module("plugins.splash-loader").requires("impact.loader", "impact.animation").defines(function() {
ig.SplashLoader = ig.Loader.extend({
// burgor 3kh0
splashDesktop: new ig.Image("media/graphics/menu/background.png"),
loadBlack: new ig.Image("media/graphics/menu/loadingblack.png"),
loadGreen: new ig.Image("media/graphics/menu/loadinggreen.png"),
logo: new ig.Image("media/graphics/menu/logo.png"),
assets: [new ig.Image("media/graphics/backgrounds/desktop/background.jpg"), new ig.Image("media/graphics/backgrounds/mobile/background.jpg"), new ig.Image("media/graphics/gameplay/background_1.png"), new ig.Image("media/graphics/gameplay/background_2.png"), new ig.Image("media/graphics/gameplay/background_3.png"), new ig.Image("media/graphics/gameplay/ball/ballwhite.png"), new ig.Image("media/graphics/gameplay/ballcount.png"), new ig.Image("media/graphics/gameplay/blackbar.png"), new ig.Image("media/graphics/gameplay/bonusstar.png"), new ig.Image("media/graphics/gameplay/bonusstarbg.png"), new ig.Image("media/graphics/gameplay/btbuy.png"), new ig.Image("media/graphics/gameplay/btcontinue.png"), new ig.Image("media/graphics/gameplay/btexitdemo.png"), new ig.Image("media/graphics/gameplay/bthome.png"), new ig.Image("media/graphics/gameplay/bthomebig.png"), new ig.Image("media/graphics/gameplay/btplay.png"), new ig.Image("media/graphics/gameplay/btplay2.png"), new ig.Image("media/graphics/gameplay/btresume.png"), new ig.Image("media/graphics/gameplay/bttryagain.png"), new ig.Image("media/graphics/gameplay/bttutorial.png"), new ig.Image("media/graphics/gameplay/cloud1.png"), new ig.Image("media/graphics/gameplay/cloud2.png"), new ig.Image("media/graphics/gameplay/cloud3.png"), new ig.Image("media/graphics/gameplay/compas.png"), new ig.Image("media/graphics/gameplay/cornerbg.png"), new ig.Image("media/graphics/gameplay/darkbg.png"), new ig.Image("media/graphics/gameplay/direction.png"), new ig.Image("media/graphics/gameplay/dragarrow.png"), new ig.Image("media/graphics/gameplay/dragarrow2.png"), new ig.Image("media/graphics/gameplay/flag.png"), new ig.Image("media/graphics/gameplay/go.png"), new ig.Image("media/graphics/gameplay/greenbar.png"), new ig.Image("media/graphics/gameplay/hole.png"), new ig.Image("media/graphics/gameplay/money.png"), new ig.Image("media/graphics/gameplay/pandora.png"), new ig.Image("media/graphics/gameplay/pause.png"), new ig.Image("media/graphics/gameplay/player/hit1.png"), new ig.Image("media/graphics/gameplay/player/hit1low.png"), new ig.Image("media/graphics/gameplay/player/hit1lowrev.png"), new ig.Image("media/graphics/gameplay/player/hit1rev.png"), new ig.Image("media/graphics/gameplay/player/hit2.png"), new ig.Image("media/graphics/gameplay/player/hit2low.png"), new ig.Image("media/graphics/gameplay/player/hit2lowrev.png"), new ig.Image("media/graphics/gameplay/player/hit2rev.png"), new ig.Image("media/graphics/gameplay/player/hit3.png"), new ig.Image("media/graphics/gameplay/player/hit3low.png"), new ig.Image("media/graphics/gameplay/player/hit3lowrev.png"), new ig.Image("media/graphics/gameplay/player/hit3rev.png"), new ig.Image("media/graphics/gameplay/player/hit4.png"), new ig.Image("media/graphics/gameplay/player/hit4low.png"), new ig.Image("media/graphics/gameplay/player/hit4lowrev.png"), new ig.Image("media/graphics/gameplay/player/hit4rev.png"), new ig.Image("media/graphics/gameplay/player/hit5.png"), new ig.Image("media/graphics/gameplay/player/hit5low.png"), new ig.Image("media/graphics/gameplay/player/hit5lowrev.png"), new ig.Image("media/graphics/gameplay/player/hit5rev.png"), new ig.Image("media/graphics/gameplay/player/hit6.png"), new ig.Image("media/graphics/gameplay/player/hit6low.png"), new ig.Image("media/graphics/gameplay/player/hit6lowrev.png"), new ig.Image("media/graphics/gameplay/player/hit6rev.png"), new ig.Image("media/graphics/gameplay/popuppausebg.png"), new ig.Image("media/graphics/gameplay/resultboard.png"), new ig.Image("media/graphics/gameplay/rock.png"), new ig.Image("media/graphics/gameplay/rock2.png"), new ig.Image("media/graphics/gameplay/shopbg.png"), new ig.Image("media/graphics/gameplay/shopbg2.png"), new ig.Image("media/graphics/gameplay/star/blue.png"), new ig.Image("media/graphics/gameplay/star/green.png"), new ig.Image("media/graphics/gameplay/star/purple.png"), new ig.Image("media/graphics/gameplay/star/white.png"), new ig.Image("media/graphics/gameplay/star/yellow.png"), new ig.Image("media/graphics/gameplay/turn_left.png"), new ig.Image("media/graphics/gameplay/turn_right.png"), new ig.Image("media/graphics/gameplay/water_bottom.png"), new ig.Image("media/graphics/gameplay/water_top.png"), new ig.Image("media/graphics/close-button.png"), new ig.Image("media/graphics/close-button.png"), new ig.Image("media/graphics/menu/arrow_left.png"), new ig.Image("media/graphics/menu/arrow_right.png"), new ig.Image("media/graphics/menu/background.png"), new ig.Image("media/graphics/menu/ball_1.png"), new ig.Image("media/graphics/menu/ball_2.png"), new ig.Image("media/graphics/menu/ball_3.png"), new ig.Image("media/graphics/menu/ball_4.png"), new ig.Image("media/graphics/menu/ball_5.png"), new ig.Image("media/graphics/menu/ball_6.png"), new ig.Image("media/graphics/menu/bgtext.png"), new ig.Image("media/graphics/menu/bt_close_popup.png"), new ig.Image("media/graphics/menu/btmoregames.png"), new ig.Image("media/graphics/menu/btmusic.png"), new ig.Image("media/graphics/menu/btplay.png"), new ig.Image("media/graphics/menu/btshop.png"), new ig.Image("media/graphics/menu/btsound.png"), new ig.Image("media/graphics/menu/bttutorial.png"), new ig.Image("media/graphics/menu/handtouch.png"), new ig.Image("media/graphics/menu/hat_black.png"), new ig.Image("media/graphics/menu/hat_bunny.png"), new ig.Image("media/graphics/menu/hat_chrown.png"), new ig.Image("media/graphics/menu/hat_empty.png"), new ig.Image("media/graphics/menu/hat_pirate.png"), new ig.Image("media/graphics/menu/hat_witch.png"), new ig.Image("media/graphics/menu/loadingblack.png"), new ig.Image("media/graphics/menu/loadinggreen.png"), new ig.Image("media/graphics/menu/logo.png"), new ig.Image("media/graphics/misc/invisible.png"), new ig.Image("media/graphics/orientate/landscape.jpg"), new ig.Image("media/graphics/orientate/portrait.jpg"), new ig.Image("media/graphics/orientate/scroll_down.png"), new ig.Image("media/graphics/overlays/close-button.png"), new ig.Image("media/graphics/overlays/close-button2.png"), new ig.Image("media/graphics/splash/desktop/cover.jpg"), new ig.Image("media/graphics/splash/mobile/cover-start.jpg"), new ig.Image("media/graphics/splash/mobile/cover.jpg"), new ig.Image("media/graphics/sprites/btn_more_games.png"), new ig.Image("media/graphics/sprites/door.png")],
init: function(b, c) {
this.parent(b, c);
ig.apiHandler.run("MJSPreroll")
},
end: function() {
this.parent();
if (ig.ua.mobile) {
var b = ig.domHandler.getElementById("#play");
ig.domHandler.show(b)
}
ig.system.setGame(MyGame)
},
setupCustomAnimation: function() {
this.customAnim = new ig.Animation(this.customAnim, 0.05, [0, 1, 2, 3, 4, 5]);
this.customAnim.currentFrame = 0;
ig.loadingScreen = this;
ig.loadingScreen.animationTimer = window.setInterval("ig.loadingScreen.animate()", 100)
},
animate: function() {
this.customAnim.currentFrame < this.customAnim.sequence.length ? this.customAnim.currentFrame++ : this.customAnim.currentFrame = 0;
this.customAnim.gotoFrame(this.customAnim.currentFrame)
},
draw: function() {
this._drawStatus += (this.status - this._drawStatus) / 5;
ig.system.context.fillStyle = "#000";
ig.system.context.fillRect(0, 0, ig.system.width, ig.system.height);
this.splashDesktop.draw(0, 0);
this.logo.draw(170, 20);
this.loadBlack.draw(320, 420);
this.loadGreen.draw(320, 421, 1, 1, 320 * this._drawStatus, 19);
var b = (100 * this._drawStatus).toFixed(0).toString() + "%";
ig.system.context.fillStyle =
"#ffffff";
ig.system.context.font = "30px FredokaOne";
ig.system.context.textAlign = "center";
ig.system.context.fillText(b, 480, 480)
}
})
});
ig.baked = !0;
ig.module("plugins.tween").requires("impact.entity").defines(function() {
Array.prototype.indexOf || (Array.prototype.indexOf = function(b) {
for (var c = 0; c < this.length; ++c)
if (this[c] === b) return c;
return -1
});
ig.Entity.prototype.tweens = [];
ig.Entity.prototype._preTweenUpdate = ig.Entity.prototype.update;
ig.Entity.prototype.update = function() {
this._preTweenUpdate();
if (0 < this.tweens.length) {
for (var b = [], c = 0; c < this.tweens.length; c++) this.tweens[c].update(), this.tweens[c].complete || b.push(this.tweens[c]);
this.tweens = b
}
};
ig.Entity.prototype.tween = function(b, c, d) {
b = new ig.Tween(this, b, c, d);
this.tweens.push(b);
return b
};
ig.Entity.prototype.pauseTweens = function() {
for (var b = 0; b < this.tweens.length; b++) this.tweens[b].pause()
};
ig.Entity.prototype.resumeTweens = function() {
for (var b = 0; b < this.tweens.length; b++) this.tweens[b].resume()
};
ig.Entity.prototype.stopTweens = function(b) {
for (var c = 0; c < this.tweens.length; c++) this.tweens[c].stop(b)
};
ig.Tween = function(b, c, d, e) {
var f = {},
j = {},
q = {},
n = 0,
g = !1,
y = !1,
A = !1;
this.duration = d;
this.paused = this.complete = !1;
this.easing = ig.Tween.Easing.Linear.EaseNone;
this.onComplete = !1;
this.loop = this.delay = 0;
this.loopCount = -1;
ig.merge(this, e);
this.loopNum = this.loopCount;
this.chain = function(b) {
A = b
};
this.initEnd = function(b, c, d) {
if ("object" !== typeof c[b]) d[b] = c[b];
else
for (subprop in c[b]) d[b] || (d[b] = {}), this.initEnd(subprop, c[b], d[b])
};
this.initStart = function(b, c, d, e) {
if ("object" !== typeof d[b]) "undefined" !== typeof c[b] && (e[b] = d[b]);
else
for (subprop in d[b]) e[b] || (e[b] = {}), "undefined" !== typeof c[b] && this.initStart(subprop, c[b], d[b], e[b])
};
this.start = function() {
this.paused = this.complete = !1;
this.loopNum = this.loopCount;
n = 0; - 1 == b.tweens.indexOf(this) && b.tweens.push(this);
y = !0;
g = new ig.Timer;
for (var d in c) this.initEnd(d, c, j);
for (d in j) this.initStart(d, j, b, f), this.initDelta(d, q, b, j)
};
this.initDelta = function(b, c, d, e) {
if ("object" !== typeof e[b]) c[b] = e[b] - d[b];
else
for (subprop in e[b]) c[b] || (c[b] = {}), this.initDelta(subprop, c[b], d[b], e[b])
};
this.propUpdate = function(b, c, d, e, g) {
if ("object" !== typeof d[b]) c[b] = "undefined" != typeof d[b] ? d[b] + e[b] * g : c[b];
else
for (subprop in d[b]) this.propUpdate(subprop, c[b], d[b], e[b], g)
};
this.propSet = function(b, c, d) {
if ("object" !== typeof c[b]) d[b] = c[b];
else
for (subprop in c[b]) d[b] || (d[b] = {}), this.propSet(subprop, c[b], d[b])
};
this.update = function() {
if (!y) return !1;
if (this.delay) {
if (g.delta() < this.delay) return;
this.delay = 0;
g.reset()
}
if (this.paused || this.complete) return !1;
var c = (g.delta() + n) / this.duration,
c = 1 < c ? 1 : c,
d = this.easing(c);
for (property in q) this.propUpdate(property, b, f, q, d);
if (1 <= c) {
if (0 == this.loopNum ||
!this.loop) {
this.complete = !0;
if (this.onComplete) this.onComplete();
A && A.start();
return !1
}
if (this.loop == ig.Tween.Loop.Revert) {
for (property in f) this.propSet(property, f, b);
n = 0;
g.reset(); - 1 != this.loopNum && this.loopNum--
} else if (this.loop == ig.Tween.Loop.Reverse) {
c = {};
d = {};
ig.merge(c, j);
ig.merge(d, f);
ig.merge(f, c);
ig.merge(j, d);
for (property in j) this.initDelta(property, q, b, j);
n = 0;
g.reset(); - 1 != this.loopNum && this.loopNum--
}
}
};
this.pause = function() {
this.paused = !0;
n += g.delta()
};
this.resume = function() {
this.paused = !1;
g.reset()
};
this.stop = function(b) {
b && (this.loop = this.complete = this.paused = !1, n += d, this.update());
this.complete = !0
// 3kh0 on top
}
};
ig.Tween.Loop = {
Revert: 1,
Reverse: 2
};
ig.Tween.Easing = {
Linear: {},
Quadratic: {},
Cubic: {},
Quartic: {},
Quintic: {},
Sinusoidal: {},
Exponential: {},
Circular: {},
Elastic: {},
Back: {},
Bounce: {}
};
ig.Tween.Easing.Linear.EaseNone = function(b) {
return b
};
ig.Tween.Easing.Quadratic.EaseIn = function(b) {
return b * b
};
ig.Tween.Easing.Quadratic.EaseOut = function(b) {
return -b * (b - 2)
};
ig.Tween.Easing.Quadratic.EaseInOut = function(b) {
return 1 > (b *= 2) ? 0.5 * b * b : -0.5 * (--b * (b - 2) - 1)
};
ig.Tween.Easing.Cubic.EaseIn = function(b) {
return b * b * b
};
ig.Tween.Easing.Cubic.EaseOut = function(b) {
return --b * b * b + 1
};
ig.Tween.Easing.Cubic.EaseInOut = function(b) {
return 1 > (b *= 2) ? 0.5 * b * b * b : 0.5 * ((b -= 2) * b * b + 2)
};
ig.Tween.Easing.Quartic.EaseIn = function(b) {
return b * b * b * b
};
ig.Tween.Easing.Quartic.EaseOut = function(b) {
return -(--b * b * b * b - 1)
};
ig.Tween.Easing.Quartic.EaseInOut = function(b) {
return 1 > (b *= 2) ? 0.5 * b * b * b * b : -0.5 * ((b -= 2) * b * b * b - 2)
};
ig.Tween.Easing.Quintic.EaseIn = function(b) {
return b * b * b * b * b
};
ig.Tween.Easing.Quintic.EaseOut = function(b) {
return (b -= 1) * b * b * b * b + 1
};
ig.Tween.Easing.Quintic.EaseInOut = function(b) {
return 1 > (b *= 2) ? 0.5 * b * b * b * b * b : 0.5 * ((b -= 2) * b * b * b * b + 2)
};
ig.Tween.Easing.Sinusoidal.EaseIn = function(b) {
return -Math.cos(b * Math.PI / 2) + 1
};
ig.Tween.Easing.Sinusoidal.EaseOut = function(b) {
return Math.sin(b * Math.PI / 2)
};
ig.Tween.Easing.Sinusoidal.EaseInOut = function(b) {
return -0.5 * (Math.cos(Math.PI * b) - 1)
};
ig.Tween.Easing.Exponential.EaseIn = function(b) {
return 0 == b ? 0 : Math.pow(2, 10 * (b - 1))
};
ig.Tween.Easing.Exponential.EaseOut = function(b) {
return 1 == b ? 1 : -Math.pow(2, -10 * b) + 1
};
ig.Tween.Easing.Exponential.EaseInOut = function(b) {
return 0 == b ? 0 : 1 == b ? 1 : 1 > (b *= 2) ? 0.5 * Math.pow(2, 10 * (b - 1)) : 0.5 * (-Math.pow(2, -10 * (b - 1)) + 2)
};
ig.Tween.Easing.Circular.EaseIn = function(b) {
return -(Math.sqrt(1 - b * b) - 1)
};
ig.Tween.Easing.Circular.EaseOut = function(b) {
return Math.sqrt(1 - --b * b)
};
ig.Tween.Easing.Circular.EaseInOut = function(b) {
return 1 > (b /= 0.5) ? -0.5 * (Math.sqrt(1 - b * b) - 1) : 0.5 * (Math.sqrt(1 - (b -= 2) * b) + 1)
};
ig.Tween.Easing.Elastic.EaseIn = function(b) {
var c, d = 0.1,
e = 0.4;
if (0 == b) return 0;
if (1 == b) return 1;
e || (e = 0.3);
!d || 1 > d ? (d = 1, c = e / 4) : c = e / (2 * Math.PI) * Math.asin(1 / d);
return -(d * Math.pow(2, 10 * (b -= 1)) * Math.sin(2 * (b - c) * Math.PI / e))
};
ig.Tween.Easing.Elastic.EaseOut = function(b) {
var c, d = 0.1,
e = 0.4;
if (0 == b) return 0;
if (1 == b) return 1;
e || (e = 0.3);
!d || 1 > d ? (d = 1, c = e / 4) : c = e / (2 * Math.PI) * Math.asin(1 / d);
return d * Math.pow(2, -10 * b) * Math.sin(2 * (b - c) * Math.PI / e) + 1
};
ig.Tween.Easing.Elastic.EaseInOut = function(b) {
var c, d = 0.1,
e = 0.4;
if (0 == b) return 0;
if (1 == b) return 1;
e || (e = 0.3);
!d || 1 > d ? (d = 1, c = e / 4) : c = e / (2 * Math.PI) * Math.asin(1 / d);
return 1 > (b *= 2) ? -0.5 * d * Math.pow(2, 10 * (b -= 1)) * Math.sin(2 * (b - c) * Math.PI / e) : 0.5 * d * Math.pow(2, -10 * (b -= 1)) * Math.sin(2 * (b - c) * Math.PI / e) + 1
};
ig.Tween.Easing.Back.EaseIn = function(b) {
return b * b * (2.70158 * b - 1.70158)
};
ig.Tween.Easing.Back.EaseOut = function(b) {
return (b -= 1) * b * (2.70158 * b + 1.70158) + 1
};
ig.Tween.Easing.Back.EaseInOut = function(b) {
return 1 > (b *= 2) ? 0.5 * b * b * (3.5949095 * b - 2.5949095) : 0.5 * ((b -= 2) * b * (3.5949095 * b + 2.5949095) + 2)
};
ig.Tween.Easing.Bounce.EaseIn = function(b) {
return 1 - ig.Tween.Easing.Bounce.EaseOut(1 - b)
};
ig.Tween.Easing.Bounce.EaseOut = function(b) {
return (b /= 1) < 1 / 2.75 ? 7.5625 * b * b : b < 2 / 2.75 ? 7.5625 * (b -= 1.5 / 2.75) * b + 0.75 : b < 2.5 / 2.75 ? 7.5625 * (b -= 2.25 / 2.75) * b + 0.9375 : 7.5625 * (b -= 2.625 / 2.75) * b + 0.984375
};
ig.Tween.Easing.Bounce.EaseInOut = function(b) {
return 0.5 > b ? 0.5 * ig.Tween.Easing.Bounce.EaseIn(2 * b) : 0.5 * ig.Tween.Easing.Bounce.EaseOut(2 * b - 1) + 0.5
}
});
ig.baked = !0;
ig.module("plugins.url-parameters").defines(function() {
ig.UrlParameters = ig.Class.extend({
init: function() {
switch (getQueryVariable("iphone")) {
case "true":
ig.ua.iPhone = !0, console.log("iPhone mode")
}
var b = getQueryVariable("webview");
if (b) switch (b) {
case "true":
ig.ua.is_uiwebview = !0, console.log("webview mode")
}
if (b = getQueryVariable("debug")) switch (b) {
case "true":
ig.game.showDebugMenu(), console.log("debug mode")
}
switch (getQueryVariable("view")) {
case "stats":
ig.game.resetPlayerStats(), ig.game.endGame()
}
getQueryVariable("ad")
}
})
});
ig.baked = !0;
ig.module("plugins.director").requires("impact.impact").defines(function() {
ig.Director = ig.Class.extend({
init: function(b, c) {
this.game = b;
this.levels = [];
this.currentLevel = 0;
this.append(c)
},
loadLevel: function(b) {
for (var c in ig.sizeHandler.dynamicClickableEntityDivs) {
var d = ig.domHandler.getElementById("#" + c);
ig.domHandler.hide(d)
}
this.currentLevel = b;
this.game.loadLevel(this.levels[b]);
return !0
},
loadLevelWithoutEntities: function(b) {
this.currentLevel = b;
this.game.loadLevelWithoutEntities(this.levels[b]);
return !0
},
append: function(b) {
newLevels = [];
return "object" === typeof b ? (b.constructor === [].constructor ? newLevels = b : newLevels[0] = b, this.levels = this.levels.concat(newLevels), !0) : !1
},
nextLevel: function() {
return this.currentLevel + 1 < this.levels.length ? this.loadLevel(this.currentLevel + 1) : !1
},
previousLevel: function() {
return 0 <= this.currentLevel - 1 ? this.loadLevel(this.currentLevel - 1) : !1
},
jumpTo: function(b) {
var c = null;
for (i = 0; i < this.levels.length; i++) this.levels[i] == b && (c = i);
return 0 <= c ? this.loadLevel(c) : !1
},
firstLevel: function() {
return this.loadLevel(0)
},
lastLevel: function() {
return this.loadLevel(this.levels.length - 1)
},
reloadLevel: function() {
return this.loadLevel(this.currentLevel)
}
})
});
ig.baked = !0;
ig.module("plugins.impact-storage").requires("impact.game").defines(function() {
ig.Storage = ig.Class.extend({
staticInstantiate: function() {
return !ig.Storage.instance ? null : ig.Storage.instance
},
init: function() {
ig.Storage.instance = this
},
isCapable: function() {
return "undefined" !== typeof window.localStorage
},
isSet: function(b) {
return null !== this.get(b)
},
initUnset: function(b, c) {
null === this.get(b) && this.set(b, c)
},
get: function(b) {
if (!this.isCapable()) return null;
try {
return JSON.parse(localStorage.getItem(b))
} catch (c) {
return window.localStorage.getItem(b)
}
},
getInt: function(b) {
return ~~this.get(b)
},
getFloat: function(b) {
return parseFloat(this.get(b))
},
getBool: function(b) {
return !!this.get(b)
},
key: function(b) {
return this.isCapable() ? window.localStorage.key(b) : null
},
set: function(b, c) {
if (!this.isCapable()) return null;
try {
window.localStorage.setItem(b, JSON.stringify(c))
} catch (d) {
console.log(d)
}
},
setHighest: function(b, c) {
c > this.getFloat(b) && this.set(b, c)
},
remove: function(b) {
if (!this.isCapable()) return null;
window.localStorage.removeItem(b)
},
clear: function() {
if (!this.isCapable()) return null;
window.localStorage.clear()
}
})
});
ig.baked = !0;
ig.module("plugins.fake-storage").requires("impact.game").defines(function() {
ig.FakeStorage = ig.Class.extend({
tempData: {},
init: function() {
ig.FakeStorage.instance = this
},
initUnset: function(b, c) {
null === this.get(b) && this.set(b, c)
},
set: function(b, c) {
this.tempData[b] = JSON.stringify(c)
},
setHighest: function(b, c) {
c > this.getFloat(b) && this.set(b, c)
},
get: function(b) {
return "undefined" == typeof this.tempData[b] ? null : JSON.parse(this.tempData[b])
},
getInt: function(b) {
return ~~this.get(b)
},
getFloat: function(b) {
return parseFloat(this.get(b))
},
getBool: function(b) {
return !!this.get(b)
},
isSet: function(b) {
return null !== this.get(b)
},
remove: function() {
delete this.tempData.key
},
clear: function() {
this.tempData = {}
}
})
});
ig.baked = !0;
ig.module("plugins.scale").requires("impact.entity").defines(function() {
ig.Entity.inject({
scale: {
x: 1,
y: 1
},
_offset: {
x: 0,
y: 0
},
_scale: {
x: 1,
y: 1
},
_size: {
x: 0,
y: 0
},
init: function(b, c, d) {
this.parent(b, c, d);
this._offset.x = this.offset.x;
this._offset.y = this.offset.y;
this._size.x = this.size.x;
this._size.y = this.size.y;
this.setScale(this.scale.x, this.scale.y)
},
draw: function() {
var b = ig.system.context;
b.save();
b.translate(ig.system.getDrawPos(this.pos.x.round() - this.offset.x - ig.game.screen.x), ig.system.getDrawPos(this.pos.y.round() -
this.offset.y - ig.game.screen.y));
b.scale(this._scale.x, this._scale.y);
this.currentAnim && this.currentAnim.draw(0, 0);
b.restore()
},
setScale: function(b, c) {
var d = this.size.x,
e = this.size.y;
this.scale.x = b || this.scale.x;
this.scale.y = c || this.scale.y;
this._scale.x = this.scale.x / ig.system.scale;
this._scale.y = this.scale.y / ig.system.scale;
this.offset.x = this._offset.x * this._scale.x;
this.offset.y = this._offset.y * this._scale.y;
this.size.x = this._size.x * this._scale.x;
this.size.y = this._size.y * this._scale.y;
this.pos.x += (d - this.size.x) / 2;
this.pos.y += (e - this.size.y) / 2
}
})
});
ig.baked = !0;
ig.module("plugins.animation-scaling").requires("impact.animation").defines(function() {
ig.Animation.inject({
scale: {
x: 1,
y: 1
},
draw: function(b, c) {
var d = ig.system.scale;
ig.system.context.save();
var e = b + this.sheet.width / 2,
f = c + this.sheet.height / 2;
ig.system.context.translate(e * d, f * d);
ig.system.context.scale(this.scale.x, this.scale.y);
ig.system.context.translate(-e * d, -f * d);
this.parent(b, c);
ig.system.context.restore()
}
})
});
var Box2D = {
SCALE: 0.1
};
(function(b, c) {
function d() {}!(Object.prototype.defineProperty instanceof Function) && Object.prototype.__defineGetter__ instanceof Function && Object.prototype.__defineSetter__ instanceof Function && (Object.defineProperty = function(b, c, d) {
d.get instanceof Function && b.__defineGetter__(c, d.get);
d.set instanceof Function && b.__defineSetter__(c, d.set)
});
b.inherit = function(b, c) {
d.prototype = c.prototype;
b.prototype = new d;
b.prototype.constructor = b
};
b.generateCallback = function(b, c) {
return function() {
c.apply(b, arguments)
}
};
b.NVector = function(b) {
b === c && (b = 0);
for (var d = Array(b || 0), j = 0; j < b; ++j) d[j] = 0;
return d
};
b.is = function(b, d) {
return null === b ? !1 : d instanceof Function && b instanceof d || b.constructor.__implements != c && b.constructor.__implements[d] ? !0 : !1
};
b.parseUInt = function(b) {
return Math.abs(parseInt(b))
}
})(Box2D);
var Vector = Array,
Vector_a2j_Number = Box2D.NVector;
"undefined" === typeof Box2D && (Box2D = {});
"undefined" === typeof Box2D.Collision && (Box2D.Collision = {});
"undefined" === typeof Box2D.Collision.Shapes && (Box2D.Collision.Shapes = {});
"undefined" === typeof Box2D.Common && (Box2D.Common = {});
"undefined" === typeof Box2D.Common.Math && (Box2D.Common.Math = {});
"undefined" === typeof Box2D.Dynamics && (Box2D.Dynamics = {});
"undefined" === typeof Box2D.Dynamics.Contacts && (Box2D.Dynamics.Contacts = {});
"undefined" === typeof Box2D.Dynamics.Controllers && (Box2D.Dynamics.Controllers = {});
"undefined" === typeof Box2D.Dynamics.Joints && (Box2D.Dynamics.Joints = {});
(function() {
function b() {
b.b2AABB.apply(this, arguments)
}
function c() {
c.b2Bound.apply(this, arguments)
}
function d() {
d.b2BoundValues.apply(this, arguments);
this.constructor === d && this.b2BoundValues.apply(this, arguments)
}
function e() {
e.b2Collision.apply(this, arguments)
}
function f() {
f.b2ContactID.apply(this, arguments);
this.constructor === f && this.b2ContactID.apply(this, arguments)
}
function j() {
j.b2ContactPoint.apply(this, arguments)
}
function q() {
q.b2Distance.apply(this, arguments)
}
function n() {
n.b2DistanceInput.apply(this, arguments)
}
function g() {
g.b2DistanceOutput.apply(this, arguments)
}
function y() {
y.b2DistanceProxy.apply(this, arguments)
}
function A() {
A.b2DynamicTree.apply(this, arguments);
this.constructor === A && this.b2DynamicTree.apply(this, arguments)
}
function z() {
z.b2DynamicTreeBroadPhase.apply(this, arguments)
}
function B() {
B.b2DynamicTreeNode.apply(this, arguments)
}
function C() {
C.b2DynamicTreePair.apply(this, arguments)
}
function G() {
G.b2Manifold.apply(this, arguments);
this.constructor === G && this.b2Manifold.apply(this, arguments)
}
function I() {
I.b2ManifoldPoint.apply(this, arguments);
this.constructor === I && this.b2ManifoldPoint.apply(this, arguments)
}
function u() {
u.b2Point.apply(this, arguments)
}
function L() {
L.b2RayCastInput.apply(this, arguments);
this.constructor === L && this.b2RayCastInput.apply(this, arguments)
}
function E() {
E.b2RayCastOutput.apply(this, arguments)
}
function Q() {
Q.b2Segment.apply(this, arguments)
}
function M() {
M.b2SeparationFunction.apply(this, arguments)
}
function R() {
R.b2Simplex.apply(this, arguments);
this.constructor === R && this.b2Simplex.apply(this, arguments)
}
function K() {
K.b2SimplexCache.apply(this, arguments)
}
function X() {
X.b2SimplexVertex.apply(this, arguments)
}
function P() {
P.b2TimeOfImpact.apply(this, arguments)
}
function S() {
S.b2TOIInput.apply(this, arguments)
}
function Z() {
Z.b2WorldManifold.apply(this, arguments);
this.constructor === Z && this.b2WorldManifold.apply(this, arguments)
}
function U() {
U.ClipVertex.apply(this, arguments)
}
function p() {
p.Features.apply(this, arguments)
}
function v() {
v.b2CircleShape.apply(this, arguments);
this.constructor === v && this.b2CircleShape.apply(this, arguments)
}
function H() {
H.b2EdgeChainDef.apply(this, arguments);
this.constructor === H && this.b2EdgeChainDef.apply(this, arguments)
}
function D() {
D.b2EdgeShape.apply(this, arguments);
this.constructor === D && this.b2EdgeShape.apply(this, arguments)
}
function N() {
N.b2MassData.apply(this, arguments)
}
function J() {
J.b2PolygonShape.apply(this, arguments);
this.constructor === J && this.b2PolygonShape.apply(this, arguments)
}
function V() {
V.b2Shape.apply(this, arguments);
this.constructor === V && this.b2Shape.apply(this, arguments)
}
function l() {
l.b2Color.apply(this, arguments);
this.constructor === l && this.b2Color.apply(this, arguments)
}
function r() {
r.b2Settings.apply(this, arguments)
}
function O() {
O.b2Mat22.apply(this, arguments);
this.constructor === O && this.b2Mat22.apply(this, arguments)
}
function s() {
s.b2Mat33.apply(this, arguments);
this.constructor === s && this.b2Mat33.apply(this, arguments)
}
function F() {
F.b2Math.apply(this, arguments)
}
function aa() {
aa.b2Sweep.apply(this, arguments)
}
function T() {
T.b2Transform.apply(this, arguments);
this.constructor === T && this.b2Transform.apply(this, arguments)
}
function ka() {
ka.b2Vec2.apply(this, arguments);
this.constructor === ka && this.b2Vec2.apply(this, arguments)
}
function ca() {
ca.b2Vec3.apply(this, arguments);
this.constructor === ca && this.b2Vec3.apply(this, arguments)
}
function m() {
m.b2Body.apply(this, arguments);
this.constructor === m && this.b2Body.apply(this, arguments)
}
function la() {
la.b2BodyDef.apply(this, arguments);
this.constructor === la && this.b2BodyDef.apply(this, arguments)
}
function Ma() {
Ma.b2ContactFilter.apply(this, arguments)
}
function qa() {
qa.b2ContactImpulse.apply(this, arguments)
}
function Ab() {
Ab.b2ContactListener.apply(this, arguments)
}
function cb() {
cb.b2ContactManager.apply(this, arguments);
this.constructor === cb && this.b2ContactManager.apply(this, arguments)
}
function Na() {
Na.b2DebugDraw.apply(this, arguments);
this.constructor === Na && this.b2DebugDraw.apply(this, arguments)
}
function Bb() {
Bb.b2DestructionListener.apply(this, arguments)
}
function Cb() {
Cb.b2FilterData.apply(this, arguments)
}
function db() {
db.b2Fixture.apply(this, arguments);
this.constructor === db && this.b2Fixture.apply(this, arguments)
}
function eb() {
eb.b2FixtureDef.apply(this, arguments);
this.constructor === eb && this.b2FixtureDef.apply(this, arguments)
}
function fb() {
fb.b2Island.apply(this, arguments);
this.constructor === fb && this.b2Island.apply(this, arguments)
}
function Db() {
Db.b2TimeStep.apply(this, arguments)
}
function gb() {
gb.b2World.apply(this, arguments);
this.constructor === gb && this.b2World.apply(this, arguments)
}
function Ca() {
Ca.b2CircleContact.apply(this, arguments)
}
function Oa() {
Oa.b2Contact.apply(this, arguments);
this.constructor === Oa && this.b2Contact.apply(this, arguments)
}
function Pa() {
Pa.b2ContactConstraint.apply(this, arguments);
this.constructor === Pa && this.b2ContactConstraint.apply(this, arguments)
}
function Eb() {
Eb.b2ContactConstraintPoint.apply(this, arguments)
}
function Qa() {
Qa.b2ContactEdge.apply(this, arguments)
}
function ea() {
ea.b2ContactFactory.apply(this, arguments);
this.constructor === ea && this.b2ContactFactory.apply(this, arguments)
}
function Da() {
Da.b2ContactRegister.apply(this, arguments)
}
function ra() {
ra.b2ContactResult.apply(this, arguments)
}
function wa() {
wa.b2ContactSolver.apply(this, arguments);
this.constructor === wa && this.b2ContactSolver.apply(this, arguments)
}
function Ea() {
Ea.b2EdgeAndCircleContact.apply(this, arguments)
}
function ga() {
ga.b2NullContact.apply(this, arguments);
this.constructor === ga && this.b2NullContact.apply(this, arguments)
}
function sa() {
sa.b2PolyAndCircleContact.apply(this, arguments)
}
function Fa() {
Fa.b2PolyAndEdgeContact.apply(this, arguments)
}
function Ra() {
Ra.b2PolygonContact.apply(this, arguments)
}
function ua() {
ua.b2PositionSolverManifold.apply(this, arguments);
this.constructor === ua && this.b2PositionSolverManifold.apply(this, arguments)
}
function hb() {
hb.b2BuoyancyController.apply(this, arguments)
}
function Y() {
Y.b2ConstantAccelController.apply(this, arguments)
}
function Sb() {
Sb.b2ConstantForceController.apply(this, arguments)
}
function wb() {
wb.b2Controller.apply(this, arguments)
}
function vb() {
vb.b2ControllerEdge.apply(this, arguments)
}
function ma() {
ma.b2GravityController.apply(this, arguments)
}
function ib() {
ib.b2TensorDampingController.apply(this, arguments)
}
function Sa() {
Sa.b2DistanceJoint.apply(this, arguments);
this.constructor === Sa && this.b2DistanceJoint.apply(this, arguments)
}
function Ta() {
Ta.b2DistanceJointDef.apply(this, arguments);
this.constructor === Ta && this.b2DistanceJointDef.apply(this, arguments)
}
function jb() {
jb.b2FrictionJoint.apply(this, arguments);
this.constructor === jb && this.b2FrictionJoint.apply(this, arguments)
}
function kb() {
kb.b2FrictionJointDef.apply(this, arguments);
this.constructor === kb && this.b2FrictionJointDef.apply(this, arguments)
}
function lb() {
lb.b2GearJoint.apply(this, arguments);
this.constructor === lb && this.b2GearJoint.apply(this, arguments)
}
function mb() {
mb.b2GearJointDef.apply(this, arguments);
this.constructor === mb && this.b2GearJointDef.apply(this, arguments)
}
function nb() {
nb.b2Jacobian.apply(this, arguments)
}
function Ua() {
Ua.b2Joint.apply(this, arguments);
this.constructor === Ua && this.b2Joint.apply(this, arguments)
}
function Ga() {
Ga.b2JointDef.apply(this, arguments);
this.constructor === Ga && this.b2JointDef.apply(this, arguments)
}
function ob() {
ob.b2JointEdge.apply(this, arguments)
}
function pb() {
pb.b2LineJoint.apply(this, arguments);
this.constructor === pb && this.b2LineJoint.apply(this, arguments)
}
function qb() {
qb.b2LineJointDef.apply(this, arguments);
this.constructor === qb && this.b2LineJointDef.apply(this, arguments)
}
function rb() {
rb.b2MouseJoint.apply(this, arguments);
this.constructor === rb && this.b2MouseJoint.apply(this, arguments)
}
function Va() {
Va.b2MouseJointDef.apply(this, arguments);
this.constructor === Va && this.b2MouseJointDef.apply(this, arguments)
}
function Wa() {
Wa.b2PrismaticJoint.apply(this, arguments);
this.constructor === Wa && this.b2PrismaticJoint.apply(this, arguments)
}
function sb() {
sb.b2PrismaticJointDef.apply(this, arguments);
this.constructor === sb && this.b2PrismaticJointDef.apply(this, arguments)
}
function W() {
W.b2PulleyJoint.apply(this, arguments);
this.constructor === W && this.b2PulleyJoint.apply(this, arguments)
}
function va() {
va.b2PulleyJointDef.apply(this, arguments);
this.constructor === va && this.b2PulleyJointDef.apply(this, arguments)
}
function Za() {
Za.b2RevoluteJoint.apply(this, arguments);
this.constructor === Za && this.b2RevoluteJoint.apply(this, arguments)
}
function pa() {
pa.b2RevoluteJointDef.apply(this, arguments);
this.constructor === pa && this.b2RevoluteJointDef.apply(this, arguments)
}
function xa() {
xa.b2WeldJoint.apply(this, arguments);
this.constructor === xa && this.b2WeldJoint.apply(this, arguments)
}
function ya() {
ya.b2WeldJointDef.apply(this, arguments);
this.constructor === ya && this.b2WeldJointDef.apply(this, arguments)
}
Box2D.Collision.IBroadPhase = "Box2D.Collision.IBroadPhase";
Box2D.Collision.b2AABB = b;
Box2D.Collision.b2Bound = c;
Box2D.Collision.b2BoundValues = d;
Box2D.Collision.b2Collision = e;
Box2D.Collision.b2ContactID = f;
Box2D.Collision.b2ContactPoint = j;
Box2D.Collision.b2Distance = q;
Box2D.Collision.b2DistanceInput = n;
Box2D.Collision.b2DistanceOutput = g;
Box2D.Collision.b2DistanceProxy = y;
Box2D.Collision.b2DynamicTree = A;
Box2D.Collision.b2DynamicTreeBroadPhase = z;
Box2D.Collision.b2DynamicTreeNode = B;
Box2D.Collision.b2DynamicTreePair = C;
Box2D.Collision.b2Manifold = G;
Box2D.Collision.b2ManifoldPoint = I;
Box2D.Collision.b2Point = u;
Box2D.Collision.b2RayCastInput = L;
Box2D.Collision.b2RayCastOutput = E;
Box2D.Collision.b2Segment = Q;
Box2D.Collision.b2SeparationFunction = M;
Box2D.Collision.b2Simplex = R;
Box2D.Collision.b2SimplexCache = K;
Box2D.Collision.b2SimplexVertex = X;
Box2D.Collision.b2TimeOfImpact = P;
Box2D.Collision.b2TOIInput = S;
Box2D.Collision.b2WorldManifold = Z;
Box2D.Collision.ClipVertex = U;
Box2D.Collision.Features = p;
Box2D.Collision.Shapes.b2CircleShape = v;
Box2D.Collision.Shapes.b2EdgeChainDef = H;
Box2D.Collision.Shapes.b2EdgeShape = D;
Box2D.Collision.Shapes.b2MassData = N;
Box2D.Collision.Shapes.b2PolygonShape = J;
Box2D.Collision.Shapes.b2Shape = V;
Box2D.Common.b2internal = "Box2D.Common.b2internal";
Box2D.Common.b2Color = l;
Box2D.Common.b2Settings = r;
Box2D.Common.Math.b2Mat22 = O;
Box2D.Common.Math.b2Mat33 = s;
Box2D.Common.Math.b2Math = F;
Box2D.Common.Math.b2Sweep = aa;
Box2D.Common.Math.b2Transform = T;
Box2D.Common.Math.b2Vec2 = ka;
Box2D.Common.Math.b2Vec3 = ca;
Box2D.Dynamics.b2Body = m;
Box2D.Dynamics.b2BodyDef = la;
Box2D.Dynamics.b2ContactFilter = Ma;
Box2D.Dynamics.b2ContactImpulse = qa;
Box2D.Dynamics.b2ContactListener = Ab;
Box2D.Dynamics.b2ContactManager = cb;
Box2D.Dynamics.b2DebugDraw = Na;
Box2D.Dynamics.b2DestructionListener = Bb;
Box2D.Dynamics.b2FilterData = Cb;
Box2D.Dynamics.b2Fixture = db;
Box2D.Dynamics.b2FixtureDef = eb;
Box2D.Dynamics.b2Island = fb;
Box2D.Dynamics.b2TimeStep = Db;
Box2D.Dynamics.b2World = gb;
Box2D.Dynamics.Contacts.b2CircleContact = Ca;
Box2D.Dynamics.Contacts.b2Contact = Oa;
Box2D.Dynamics.Contacts.b2ContactConstraint = Pa;
Box2D.Dynamics.Contacts.b2ContactConstraintPoint = Eb;
Box2D.Dynamics.Contacts.b2ContactEdge = Qa;
Box2D.Dynamics.Contacts.b2ContactFactory = ea;
Box2D.Dynamics.Contacts.b2ContactRegister = Da;
Box2D.Dynamics.Contacts.b2ContactResult = ra;
Box2D.Dynamics.Contacts.b2ContactSolver = wa;
Box2D.Dynamics.Contacts.b2EdgeAndCircleContact = Ea;
Box2D.Dynamics.Contacts.b2NullContact = ga;
Box2D.Dynamics.Contacts.b2PolyAndCircleContact = sa;
Box2D.Dynamics.Contacts.b2PolyAndEdgeContact = Fa;
Box2D.Dynamics.Contacts.b2PolygonContact = Ra;
Box2D.Dynamics.Contacts.b2PositionSolverManifold = ua;
Box2D.Dynamics.Controllers.b2BuoyancyController = hb;
Box2D.Dynamics.Controllers.b2ConstantAccelController = Y;
Box2D.Dynamics.Controllers.b2ConstantForceController = Sb;
Box2D.Dynamics.Controllers.b2Controller = wb;
Box2D.Dynamics.Controllers.b2ControllerEdge = vb;
Box2D.Dynamics.Controllers.b2GravityController = ma;
Box2D.Dynamics.Controllers.b2TensorDampingController = ib;
Box2D.Dynamics.Joints.b2DistanceJoint = Sa;
Box2D.Dynamics.Joints.b2DistanceJointDef = Ta;
Box2D.Dynamics.Joints.b2FrictionJoint = jb;
Box2D.Dynamics.Joints.b2FrictionJointDef = kb;
Box2D.Dynamics.Joints.b2GearJoint = lb;
Box2D.Dynamics.Joints.b2GearJointDef = mb;
Box2D.Dynamics.Joints.b2Jacobian = nb;
Box2D.Dynamics.Joints.b2Joint = Ua;
Box2D.Dynamics.Joints.b2JointDef = Ga;
Box2D.Dynamics.Joints.b2JointEdge = ob;
Box2D.Dynamics.Joints.b2LineJoint = pb;
Box2D.Dynamics.Joints.b2LineJointDef = qb;
Box2D.Dynamics.Joints.b2MouseJoint = rb;
Box2D.Dynamics.Joints.b2MouseJointDef = Va;
Box2D.Dynamics.Joints.b2PrismaticJoint = Wa;
Box2D.Dynamics.Joints.b2PrismaticJointDef = sb;
Box2D.Dynamics.Joints.b2PulleyJoint = W;
Box2D.Dynamics.Joints.b2PulleyJointDef = va;
Box2D.Dynamics.Joints.b2RevoluteJoint = Za;
Box2D.Dynamics.Joints.b2RevoluteJointDef = pa;
Box2D.Dynamics.Joints.b2WeldJoint = xa;
Box2D.Dynamics.Joints.b2WeldJointDef = ya
})();
Box2D.postDefs = [];
(function() {
var b = Box2D.Collision.Shapes.b2CircleShape,
c = Box2D.Collision.Shapes.b2PolygonShape,
d = Box2D.Collision.Shapes.b2Shape,
e = Box2D.Common.b2Settings,
f = Box2D.Common.Math.b2Math,
j = Box2D.Common.Math.b2Sweep,
q = Box2D.Common.Math.b2Transform,
n = Box2D.Common.Math.b2Vec2,
g = Box2D.Collision.b2AABB,
y = Box2D.Collision.b2Bound,
A = Box2D.Collision.b2BoundValues,
z = Box2D.Collision.b2Collision,
B = Box2D.Collision.b2ContactID,
C = Box2D.Collision.b2ContactPoint,
G = Box2D.Collision.b2Distance,
I = Box2D.Collision.b2DistanceInput,
u = Box2D.Collision.b2DistanceOutput,
L = Box2D.Collision.b2DistanceProxy,
E = Box2D.Collision.b2DynamicTree,
Q = Box2D.Collision.b2DynamicTreeBroadPhase,
M = Box2D.Collision.b2DynamicTreeNode,
R = Box2D.Collision.b2DynamicTreePair,
K = Box2D.Collision.b2Manifold,
X = Box2D.Collision.b2ManifoldPoint,
P = Box2D.Collision.b2Point,
S = Box2D.Collision.b2RayCastInput,
Z = Box2D.Collision.b2RayCastOutput,
U = Box2D.Collision.b2Segment,
p = Box2D.Collision.b2SeparationFunction,
v = Box2D.Collision.b2Simplex,
H = Box2D.Collision.b2SimplexCache,
D = Box2D.Collision.b2SimplexVertex,
N = Box2D.Collision.b2TimeOfImpact,
J = Box2D.Collision.b2TOIInput,
V = Box2D.Collision.b2WorldManifold,
l = Box2D.Collision.ClipVertex,
r = Box2D.Collision.Features,
O = Box2D.Collision.IBroadPhase;
g.b2AABB = function() {
this.lowerBound = new n;
this.upperBound = new n
};
g.prototype.IsValid = function() {
var b = this.upperBound.y - this.lowerBound.y;
return 0 <= this.upperBound.x - this.lowerBound.x && 0 <= b && this.lowerBound.IsValid() && this.upperBound.IsValid()
};
g.prototype.GetCenter = function() {
return new n((this.lowerBound.x +
this.upperBound.x) / 2, (this.lowerBound.y + this.upperBound.y) / 2)
};
g.prototype.GetExtents = function() {
return new n((this.upperBound.x - this.lowerBound.x) / 2, (this.upperBound.y - this.lowerBound.y) / 2)
};
g.prototype.Contains = function(b) {
return this.lowerBound.x <= b.lowerBound.x && this.lowerBound.y <= b.lowerBound.y && b.upperBound.x <= this.upperBound.x && b.upperBound.y <= this.upperBound.y
};
g.prototype.RayCast = function(b, c) {
var d = -Number.MAX_VALUE,
e = Number.MAX_VALUE,
l = c.p1.x,
g = c.p1.y,
m = c.p2.x - c.p1.x,
f = c.p2.y - c.p1.y,
p =
Math.abs(f),
r = b.normal,
j = 0,
n = 0,
v = 0;
if (Math.abs(m) < Number.MIN_VALUE) {
if (l < this.lowerBound.x || this.upperBound.x < l) return !1
} else if (j = 1 / m, n = (this.lowerBound.x - l) * j, j *= this.upperBound.x - l, v = -1, n > j && (v = n, n = j, j = v, v = 1), n > d && (r.x = v, r.y = 0, d = n), e = Math.min(e, j), d > e) return !1;
if (p < Number.MIN_VALUE) {
if (g < this.lowerBound.y || this.upperBound.y < g) return !1
} else if (j = 1 / f, n = (this.lowerBound.y - g) * j, j *= this.upperBound.y - g, v = -1, n > j && (v = n, n = j, j = v, v = 1), n > d && (r.y = v, r.x = 0, d = n), e = Math.min(e, j), d > e) return !1;
b.fraction = d;
return !0
};
g.prototype.TestOverlap = function(b) {
var c = b.lowerBound.y - this.upperBound.y,
d = this.lowerBound.y - b.upperBound.y;
return 0 < b.lowerBound.x - this.upperBound.x || 0 < c || 0 < this.lowerBound.x - b.upperBound.x || 0 < d ? !1 : !0
};
g.Combine = function(b, c) {
var d = new g;
d.Combine(b, c);
return d
};
g.prototype.Combine = function(b, c) {
this.lowerBound.x = Math.min(b.lowerBound.x, c.lowerBound.x);
this.lowerBound.y = Math.min(b.lowerBound.y, c.lowerBound.y);
this.upperBound.x = Math.max(b.upperBound.x, c.upperBound.x);
this.upperBound.y = Math.max(b.upperBound.y, c.upperBound.y)
};
y.b2Bound = function() {};
y.prototype.IsLower = function() {
return 0 == (this.value & 1)
};
y.prototype.IsUpper = function() {
return 1 == (this.value & 1)
};
y.prototype.Swap = function(b) {
var c = this.value,
d = this.proxy,
e = this.stabbingCount;
this.value = b.value;
this.proxy = b.proxy;
this.stabbingCount = b.stabbingCount;
b.value = c;
b.proxy = d;
b.stabbingCount = e
};
A.b2BoundValues = function() {};
A.prototype.b2BoundValues = function() {
this.lowerValues = new Vector_a2j_Number;
this.lowerValues[0] = 0;
this.lowerValues[1] = 0;
this.upperValues = new Vector_a2j_Number;
this.upperValues[0] = 0;
this.upperValues[1] = 0
};
z.b2Collision = function() {};
z.ClipSegmentToLine = function(b, c, d, e) {
void 0 === e && (e = 0);
var l, g = 0;
l = c[0];
var m = l.v;
l = c[1];
var f = l.v,
p = d.x * m.x + d.y * m.y - e;
l = d.x * f.x + d.y * f.y - e;
0 >= p && b[g++].Set(c[0]);
0 >= l && b[g++].Set(c[1]);
0 > p * l && (d = p / (p - l), l = b[g], l = l.v, l.x = m.x + d * (f.x - m.x), l.y = m.y + d * (f.y - m.y), l = b[g], l.id = (0 < p ? c[0] : c[1]).id, ++g);
return g
};
z.EdgeSeparation = function(b, c, d, e, l) {
void 0 === d && (d = 0);
parseInt(b.m_vertexCount);
var g = b.m_vertices;
b = b.m_normals;
var m = parseInt(e.m_vertexCount),
f = e.m_vertices,
p, r;
p = c.R;
r = b[d];
b = p.col1.x * r.x + p.col2.x * r.y;
e = p.col1.y * r.x + p.col2.y * r.y;
p = l.R;
var j = p.col1.x * b + p.col1.y * e;
p = p.col2.x * b + p.col2.y * e;
for (var n = 0, v = Number.MAX_VALUE, D = 0; D < m; ++D) r = f[D], r = r.x * j + r.y * p, r < v && (v = r, n = D);
r = g[d];
p = c.R;
d = c.position.x + (p.col1.x * r.x + p.col2.x * r.y);
c = c.position.y + (p.col1.y * r.x + p.col2.y * r.y);
r = f[n];
p = l.R;
g = l.position.x + (p.col1.x * r.x + p.col2.x * r.y);
l = l.position.y + (p.col1.y * r.x + p.col2.y * r.y);
return (g - d) * b + (l - c) * e
};
z.FindMaxSeparation = function(b, c, d, e, l) {
var g = parseInt(c.m_vertexCount),
m = c.m_normals,
f, p;
p = l.R;
f = e.m_centroid;
var r = l.position.x + (p.col1.x * f.x + p.col2.x * f.y),
j = l.position.y + (p.col1.y * f.x + p.col2.y * f.y);
p = d.R;
f = c.m_centroid;
r -= d.position.x + (p.col1.x * f.x + p.col2.x * f.y);
j -= d.position.y + (p.col1.y * f.x + p.col2.y * f.y);
p = r * d.R.col1.x + j * d.R.col1.y;
for (var j = r * d.R.col2.x + j * d.R.col2.y, r = 0, n = -Number.MAX_VALUE, v = 0; v < g; ++v) f = m[v], f = f.x * p + f.y * j, f > n && (n = f, r = v);
m = z.EdgeSeparation(c, d, r, e, l);
f = parseInt(0 <= r - 1 ? r - 1 : g - 1);
p = z.EdgeSeparation(c, d, f, e, l);
var j = parseInt(r + 1 < g ? r + 1 : 0),
n = z.EdgeSeparation(c, d, j, e, l),
D = 0,
O = 0;
if (p > m && p > n) O = -1, v = f, D = p;
else if (n > m) O = 1, v = j, D = n;
else return b[0] = r, m;
for (;;)
if (r = -1 == O ? 0 <= v - 1 ? v - 1 : g - 1 : v + 1 < g ? v + 1 : 0, m = z.EdgeSeparation(c, d, r, e, l), m > D) v = r, D = m;
else break;
b[0] = v;
return D
};
z.FindIncidentEdge = function(b, c, d, e, l, g) {
void 0 === e && (e = 0);
parseInt(c.m_vertexCount);
var m = c.m_normals,
f = parseInt(l.m_vertexCount);
c = l.m_vertices;
l = l.m_normals;
var p;
p = d.R;
d = m[e];
var m = p.col1.x * d.x + p.col2.x * d.y,
r = p.col1.y * d.x + p.col2.y * d.y;
p = g.R;
d = p.col1.x * m + p.col1.y * r;
r = p.col2.x * m + p.col2.y * r;
m = d;
p = 0;
for (var j = Number.MAX_VALUE, n = 0; n < f; ++n) d = l[n], d = m * d.x + r * d.y, d < j && (j = d, p = n);
l = parseInt(p);
m = parseInt(l + 1 < f ? l + 1 : 0);
f = b[0];
d = c[l];
p = g.R;
f.v.x = g.position.x + (p.col1.x * d.x + p.col2.x * d.y);
f.v.y = g.position.y + (p.col1.y * d.x + p.col2.y * d.y);
f.id.features.referenceEdge = e;
f.id.features.incidentEdge = l;
f.id.features.incidentVertex = 0;
f = b[1];
d = c[m];
p = g.R;
f.v.x = g.position.x + (p.col1.x * d.x + p.col2.x * d.y);
f.v.y = g.position.y + (p.col1.y * d.x + p.col2.y * d.y);
f.id.features.referenceEdge = e;
f.id.features.incidentEdge = m;
f.id.features.incidentVertex = 1
};
z.MakeClipPointVector = function() {
var b = new Vector(2);
b[0] = new l;
b[1] = new l;
return b
};
z.CollidePolygons = function(b, c, d, l, g) {
var f;
b.m_pointCount = 0;
var m = c.m_radius + l.m_radius;
z.s_edgeAO[0] = 0;
var p = z.FindMaxSeparation(z.s_edgeAO, c, d, l, g);
f = z.s_edgeAO[0];
if (!(p > m)) {
var r;
z.s_edgeBO[0] = 0;
var j = z.FindMaxSeparation(z.s_edgeBO, l, g, c, d);
r = z.s_edgeBO[0];
if (!(j > m)) {
var n = 0,
v = 0;
j > 0.98 * p + 0.0010 ? (p = l, l = c, c = g, n = r, b.m_type = K.e_faceB, v = 1) : (p = c, c = d, d = g, n = f, b.m_type = K.e_faceA, v = 0);
f = z.s_incidentEdge;
z.FindIncidentEdge(f, p, c, n, l, d);
r = parseInt(p.m_vertexCount);
g = p.m_vertices;
var p = g[n],
D;
D = n + 1 < r ? g[parseInt(n + 1)] : g[0];
n = z.s_localTangent;
n.Set(D.x - p.x, D.y - p.y);
n.Normalize();
g = z.s_localNormal;
g.x = n.y;
g.y = -n.x;
l = z.s_planePoint;
l.Set(0.5 * (p.x + D.x), 0.5 * (p.y + D.y));
j = z.s_tangent;
r = c.R;
j.x = r.col1.x * n.x + r.col2.x * n.y;
j.y = r.col1.y * n.x + r.col2.y * n.y;
var O = z.s_tangent2;
O.x = -j.x;
O.y = -j.y;
n = z.s_normal;
n.x = j.y;
n.y = -j.x;
var u = z.s_v11,
H = z.s_v12;
u.x = c.position.x + (r.col1.x * p.x + r.col2.x * p.y);
u.y = c.position.y + (r.col1.y * p.x + r.col2.y * p.y);
H.x = c.position.x + (r.col1.x * D.x + r.col2.x * D.y);
H.y = c.position.y + (r.col1.y * D.x + r.col2.y * D.y);
c = n.x * u.x + n.y * u.y;
r = j.x * H.x + j.y * H.y + m;
D = z.s_clipPoints1;
p = z.s_clipPoints2;
H = z.ClipSegmentToLine(D, f, O, -j.x * u.x - j.y * u.y + m);
if (!(2 > H) && (H = z.ClipSegmentToLine(p, D, j, r), !(2 > H))) {
b.m_localPlaneNormal.SetV(g);
b.m_localPoint.SetV(l);
for (l = g = 0; l < e.b2_maxManifoldPoints; ++l) f = p[l], n.x * f.v.x + n.y * f.v.y - c <= m && (j = b.m_points[g], r = d.R, O = f.v.x - d.position.x, u = f.v.y -
d.position.y, j.m_localPoint.x = O * r.col1.x + u * r.col1.y, j.m_localPoint.y = O * r.col2.x + u * r.col2.y, j.m_id.Set(f.id), j.m_id.features.flip = v, ++g);
b.m_pointCount = g
}
}
}
};
z.CollideCircles = function(b, c, d, e, l) {
b.m_pointCount = 0;
var g, f;
g = d.R;
f = c.m_p;
var p = d.position.x + (g.col1.x * f.x + g.col2.x * f.y);
d = d.position.y + (g.col1.y * f.x + g.col2.y * f.y);
g = l.R;
f = e.m_p;
p = l.position.x + (g.col1.x * f.x + g.col2.x * f.y) - p;
l = l.position.y + (g.col1.y * f.x + g.col2.y * f.y) - d;
g = c.m_radius + e.m_radius;
p * p + l * l > g * g || (b.m_type = K.e_circles, b.m_localPoint.SetV(c.m_p), b.m_localPlaneNormal.SetZero(), b.m_pointCount = 1, b.m_points[0].m_localPoint.SetV(e.m_p), b.m_points[0].m_id.key = 0)
};
z.CollidePolygonAndCircle = function(b, c, d, e, l) {
var g = b.m_pointCount = 0,
f = 0,
p, r;
r = l.R;
p = e.m_p;
var j = l.position.y + (r.col1.y * p.x + r.col2.y * p.y),
g = l.position.x + (r.col1.x * p.x + r.col2.x * p.y) - d.position.x,
f = j - d.position.y;
r = d.R;
d = g * r.col1.x + f * r.col1.y;
r = g * r.col2.x + f * r.col2.y;
var n = 0,
j = -Number.MAX_VALUE;
l = c.m_radius + e.m_radius;
var v = parseInt(c.m_vertexCount),
D = c.m_vertices;
c = c.m_normals;
for (var O = 0; O < v; ++O) {
p = D[O];
g = d - p.x;
f = r - p.y;
p = c[O];
g = p.x * g + p.y * f;
if (g > l) return;
g > j && (j = g, n = O)
}
g = parseInt(n);
f = parseInt(g + 1 < v ? g + 1 : 0);
p = D[g];
D = D[f];
if (j < Number.MIN_VALUE) b.m_pointCount = 1, b.m_type = K.e_faceA, b.m_localPlaneNormal.SetV(c[n]), b.m_localPoint.x = 0.5 * (p.x + D.x), b.m_localPoint.y = 0.5 * (p.y + D.y);
else if (j = (d - D.x) * (p.x - D.x) + (r - D.y) * (p.y - D.y), 0 >= (d - p.x) * (D.x - p.x) + (r - p.y) * (D.y - p.y)) {
if ((d - p.x) * (d - p.x) + (r - p.y) * (r - p.y) > l * l) return;
b.m_pointCount = 1;
b.m_type = K.e_faceA;
b.m_localPlaneNormal.x = d - p.x;
b.m_localPlaneNormal.y = r - p.y;
b.m_localPlaneNormal.Normalize();
b.m_localPoint.SetV(p)
} else if (0 >= j) {
if ((d - D.x) * (d - D.x) + (r - D.y) * (r - D.y) > l * l) return;
b.m_pointCount = 1;
b.m_type = K.e_faceA;
b.m_localPlaneNormal.x = d - D.x;
b.m_localPlaneNormal.y = r - D.y;
b.m_localPlaneNormal.Normalize();
b.m_localPoint.SetV(D)
} else {
n = 0.5 * (p.x + D.x);
p = 0.5 * (p.y + D.y);
j = (d - n) * c[g].x + (r - p) * c[g].y;
if (j > l) return;
b.m_pointCount = 1;
b.m_type = K.e_faceA;
b.m_localPlaneNormal.x = c[g].x;
b.m_localPlaneNormal.y = c[g].y;
b.m_localPlaneNormal.Normalize();
b.m_localPoint.Set(n, p)
}
b.m_points[0].m_localPoint.SetV(e.m_p);
b.m_points[0].m_id.key = 0
};
z.TestOverlap = function(b, c) {
var d = c.lowerBound,
e = b.upperBound,
l = d.x - e.x,
g = d.y - e.y,
d = b.lowerBound,
e = c.upperBound,
f = d.y - e.y;
return 0 < l || 0 < g || 0 < d.x - e.x || 0 < f ? !1 : !0
};
Box2D.postDefs.push(function() {
Box2D.Collision.b2Collision.s_incidentEdge = z.MakeClipPointVector();
Box2D.Collision.b2Collision.s_clipPoints1 = z.MakeClipPointVector();
Box2D.Collision.b2Collision.s_clipPoints2 = z.MakeClipPointVector();
Box2D.Collision.b2Collision.s_edgeAO = new Vector_a2j_Number(1);
Box2D.Collision.b2Collision.s_edgeBO = new Vector_a2j_Number(1);
Box2D.Collision.b2Collision.s_localTangent = new n;
Box2D.Collision.b2Collision.s_localNormal = new n;
Box2D.Collision.b2Collision.s_planePoint = new n;
Box2D.Collision.b2Collision.s_normal = new n;
Box2D.Collision.b2Collision.s_tangent = new n;
Box2D.Collision.b2Collision.s_tangent2 = new n;
Box2D.Collision.b2Collision.s_v11 = new n;
Box2D.Collision.b2Collision.s_v12 = new n;
Box2D.Collision.b2Collision.b2CollidePolyTempVec = new n;
Box2D.Collision.b2Collision.b2_nullFeature = 255
});
B.b2ContactID = function() {
this.features = new r
};
B.prototype.b2ContactID = function() {
this.features._m_id = this
};
B.prototype.Set = function(b) {
this.key = b._key
};
B.prototype.Copy = function() {
var b = new B;
b.key = this.key;
return b
};
Object.defineProperty(B.prototype, "key", {
enumerable: !1,
configurable: !0,
get: function() {
return this._key
}
});
Object.defineProperty(B.prototype, "key", {
enumerable: !1,
configurable: !0,
set: function(b) {
void 0 === b && (b = 0);
this._key = b;
this.features._referenceEdge = this._key & 255;
this.features._incidentEdge = (this._key & 65280) >> 8 & 255;
this.features._incidentVertex = (this._key & 16711680) >> 16 & 255;
this.features._flip = (this._key & 4278190080) >> 24 & 255
}
});
C.b2ContactPoint = function() {
this.position = new n;
this.velocity = new n;
this.normal = new n;
this.id = new B
};
G.b2Distance = function() {};
G.Distance = function(b, c, d) {
++G.b2_gjkCalls;
var l = d.proxyA,
g = d.proxyB,
p = d.transformA,
m = d.transformB,
r = G.s_simplex;
r.ReadCache(c, l, p, g, m);
var j = r.m_vertices,
v = G.s_saveA,
D = G.s_saveB,
O = 0;
r.GetClosestPoint().LengthSquared();
for (var u = 0, H, N = 0; 20 > N;) {
O = r.m_count;
for (u = 0; u < O; u++) v[u] = j[u].indexA, D[u] = j[u].indexB;
switch (r.m_count) {
case 1:
break;
case 2:
r.Solve2();
break;
case 3:
r.Solve3();
break;
default:
e.b2Assert(!1)
}
if (3 == r.m_count) break;
H = r.GetClosestPoint();
H.LengthSquared();
u = r.GetSearchDirection();
if (u.LengthSquared() < Number.MIN_VALUE * Number.MIN_VALUE) break;
H = j[r.m_count];
H.indexA = l.GetSupport(f.MulTMV(p.R, u.GetNegative()));
H.wA = f.MulX(p, l.GetVertex(H.indexA));
H.indexB = g.GetSupport(f.MulTMV(m.R, u));
H.wB = f.MulX(m, g.GetVertex(H.indexB));
H.w = f.SubtractVV(H.wB, H.wA);
++N;
++G.b2_gjkIters;
for (var V = !1, u = 0; u < O; u++)
if (H.indexA == v[u] && H.indexB == D[u]) {
V = !0;
break
}
if (V) break;
++r.m_count
}
G.b2_gjkMaxIters = f.Max(G.b2_gjkMaxIters, N);
r.GetWitnessPoints(b.pointA, b.pointB);
b.distance = f.SubtractVV(b.pointA, b.pointB).Length();
b.iterations = N;
r.WriteCache(c);
d.useRadii && (c = l.m_radius, g = g.m_radius, b.distance > c + g && b.distance > Number.MIN_VALUE ? (b.distance -= c + g, d = f.SubtractVV(b.pointB, b.pointA), d.Normalize(), b.pointA.x += c * d.x, b.pointA.y += c * d.y, b.pointB.x -= g * d.x, b.pointB.y -= g * d.y) : (H = new n, H.x = 0.5 * (b.pointA.x + b.pointB.x), H.y = 0.5 * (b.pointA.y + b.pointB.y), b.pointA.x = b.pointB.x = H.x, b.pointA.y = b.pointB.y = H.y, b.distance = 0))
};
Box2D.postDefs.push(function() {
Box2D.Collision.b2Distance.s_simplex = new v;
Box2D.Collision.b2Distance.s_saveA = new Vector_a2j_Number(3);
Box2D.Collision.b2Distance.s_saveB = new Vector_a2j_Number(3)
});
I.b2DistanceInput = function() {};
u.b2DistanceOutput = function() {
this.pointA = new n;
this.pointB = new n
};
L.b2DistanceProxy = function() {};
L.prototype.Set = function(l) {
switch (l.GetType()) {
case d.e_circleShape:
l = l instanceof b ? l : null;
this.m_vertices = new Vector(1, !0);
this.m_vertices[0] = l.m_p;
this.m_count = 1;
this.m_radius = l.m_radius;
break;
case d.e_polygonShape:
l = l instanceof c ? l : null;
this.m_vertices = l.m_vertices;
this.m_count = l.m_vertexCount;
this.m_radius = l.m_radius;
break;
default:
e.b2Assert(!1)
}
};
L.prototype.GetSupport = function(b) {
for (var c = 0, d = this.m_vertices[0].x * b.x + this.m_vertices[0].y * b.y, l = 1; l < this.m_count; ++l) {
var e = this.m_vertices[l].x * b.x + this.m_vertices[l].y * b.y;
e > d && (c = l, d = e)
}
return c
};
L.prototype.GetSupportVertex = function(b) {
for (var c = 0, d = this.m_vertices[0].x * b.x + this.m_vertices[0].y * b.y, l = 1; l < this.m_count; ++l) {
var e = this.m_vertices[l].x * b.x + this.m_vertices[l].y * b.y;
e > d && (c = l, d = e)
}
return this.m_vertices[c]
};
L.prototype.GetVertexCount = function() {
return this.m_count
};
L.prototype.GetVertex = function(b) {
void 0 === b && (b = 0);
e.b2Assert(0 <= b && b < this.m_count);
return this.m_vertices[b]
};
E.b2DynamicTree = function() {};
E.prototype.b2DynamicTree = function() {
this.m_freeList = this.m_root = null;
this.m_insertionCount = this.m_path = 0
};
E.prototype.CreateProxy = function(b, c) {
var d = this.AllocateNode(),
l = e.b2_aabbExtension,
g = e.b2_aabbExtension;
d.aabb.lowerBound.x = b.lowerBound.x - l;
d.aabb.lowerBound.y = b.lowerBound.y - g;
d.aabb.upperBound.x = b.upperBound.x + l;
d.aabb.upperBound.y = b.upperBound.y + g;
d.userData = c;
this.InsertLeaf(d);
return d
};
E.prototype.DestroyProxy = function(b) {
this.RemoveLeaf(b);
this.FreeNode(b)
};
E.prototype.MoveProxy = function(b, c, d) {
e.b2Assert(b.IsLeaf());
if (b.aabb.Contains(c)) return !1;
this.RemoveLeaf(b);
var l = e.b2_aabbExtension + e.b2_aabbMultiplier * (0 < d.x ? d.x : -d.x);
d = e.b2_aabbExtension + e.b2_aabbMultiplier * (0 < d.y ? d.y : -d.y);
b.aabb.lowerBound.x = c.lowerBound.x - l;
b.aabb.lowerBound.y = c.lowerBound.y - d;
b.aabb.upperBound.x = c.upperBound.x + l;
b.aabb.upperBound.y = c.upperBound.y + d;
this.InsertLeaf(b);
return !0
};
E.prototype.Rebalance = function(b) {
void 0 === b && (b = 0);
if (null != this.m_root)
for (var c = 0; c < b; c++) {
for (var d = this.m_root, l = 0; !1 == d.IsLeaf();) d = this.m_path >> l & 1 ? d.child2 : d.child1, l = l + 1 & 31;
++this.m_path;
this.RemoveLeaf(d);
this.InsertLeaf(d)
}
};
E.prototype.GetFatAABB = function(b) {
return b.aabb
};
E.prototype.GetUserData = function(b) {
return b.userData
};
E.prototype.Query = function(b, c) {
if (null != this.m_root) {
var d = new Vector,
l = 0;
for (d[l++] = this.m_root; 0 < l;) {
var e = d[--l];
if (e.aabb.TestOverlap(c))
if (e.IsLeaf()) {
if (!b(e)) break
} else d[l++] = e.child1, d[l++] = e.child2
}
}
};
E.prototype.RayCast = function(b, c) {
if (null != this.m_root) {
var d = c.p1,
l = c.p2,
e = f.SubtractVV(d, l);
e.Normalize();
var e = f.CrossFV(1, e),
p = f.AbsV(e),
m = c.maxFraction,
r = new g,
j = 0,
n = 0,
j = d.x + m * (l.x - d.x),
n = d.y + m * (l.y - d.y);
r.lowerBound.x = Math.min(d.x, j);
r.lowerBound.y = Math.min(d.y, n);
r.upperBound.x = Math.max(d.x, j);
r.upperBound.y = Math.max(d.y, n);
var v = new Vector,
D = 0;
for (v[D++] = this.m_root; 0 < D;)
if (m = v[--D], !1 != m.aabb.TestOverlap(r) && (j = m.aabb.GetCenter(), n = m.aabb.GetExtents(), !(0 < Math.abs(e.x * (d.x - j.x) + e.y * (d.y - j.y)) - p.x * n.x - p.y * n.y)))
if (m.IsLeaf()) {
j = new S;
j.p1 = c.p1;
j.p2 = c.p2;
j.maxFraction = c.maxFraction;
m = b(j, m);
if (0 == m) break;
0 < m && (j = d.x + m * (l.x - d.x), n = d.y + m * (l.y - d.y), r.lowerBound.x = Math.min(d.x, j), r.lowerBound.y = Math.min(d.y, n), r.upperBound.x = Math.max(d.x, j), r.upperBound.y = Math.max(d.y, n))
} else v[D++] = m.child1, v[D++] = m.child2
}
};
E.prototype.AllocateNode = function() {
if (this.m_freeList) {
var b = this.m_freeList;
this.m_freeList = b.parent;
b.parent = null;
b.child1 = null;
b.child2 = null;
return b
}
return new M
};
E.prototype.FreeNode = function(b) {
b.parent = this.m_freeList;
this.m_freeList = b
};
E.prototype.InsertLeaf = function(b) {
++this.m_insertionCount;
if (null == this.m_root) this.m_root = b, this.m_root.parent = null;
else {
var c = b.aabb.GetCenter(),
d = this.m_root;
if (!1 == d.IsLeaf()) {
do var l = d.child1,
d = d.child2,
d = Math.abs((l.aabb.lowerBound.x + l.aabb.upperBound.x) / 2 - c.x) + Math.abs((l.aabb.lowerBound.y + l.aabb.upperBound.y) / 2 - c.y) < Math.abs((d.aabb.lowerBound.x + d.aabb.upperBound.x) / 2 - c.x) + Math.abs((d.aabb.lowerBound.y + d.aabb.upperBound.y) / 2 - c.y) ? l : d; while (!1 == d.IsLeaf())
}
c = d.parent;
l = this.AllocateNode();
l.parent = c;
l.userData = null;
l.aabb.Combine(b.aabb, d.aabb);
if (c) {
d.parent.child1 == d ? c.child1 =
l : c.child2 = l;
l.child1 = d;
l.child2 = b;
d.parent = l;
b.parent = l;
do {
if (c.aabb.Contains(l.aabb)) break;
c.aabb.Combine(c.child1.aabb, c.child2.aabb);
l = c;
c = c.parent
} while (c)
} else l.child1 = d, l.child2 = b, d.parent = l, this.m_root = b.parent = l
}
};
E.prototype.RemoveLeaf = function(b) {
if (b == this.m_root) this.m_root = null;
else {
var c = b.parent,
d = c.parent;
b = c.child1 == b ? c.child2 : c.child1;
if (d) {
d.child1 == c ? d.child1 = b : d.child2 = b;
b.parent = d;
for (this.FreeNode(c); d;) {
c = d.aabb;
d.aabb = g.Combine(d.child1.aabb, d.child2.aabb);
if (c.Contains(d.aabb)) break;
d = d.parent
}
} else this.m_root = b, b.parent = null, this.FreeNode(c)
}
};
Q.b2DynamicTreeBroadPhase = function() {
this.m_tree = new E;
this.m_moveBuffer = new Vector;
this.m_pairBuffer = new Vector;
this.m_pairCount = 0
};
Q.prototype.CreateProxy = function(b, c) {
var d = this.m_tree.CreateProxy(b, c);
++this.m_proxyCount;
this.BufferMove(d);
return d
};
Q.prototype.DestroyProxy = function(b) {
this.UnBufferMove(b);
--this.m_proxyCount;
this.m_tree.DestroyProxy(b)
};
Q.prototype.MoveProxy = function(b, c, d) {
this.m_tree.MoveProxy(b, c, d) && this.BufferMove(b)
};
Q.prototype.TestOverlap = function(b, c) {
var d = this.m_tree.GetFatAABB(b),
l = this.m_tree.GetFatAABB(c);
return d.TestOverlap(l)
};
Q.prototype.GetUserData = function(b) {
return this.m_tree.GetUserData(b)
};
Q.prototype.GetFatAABB = function(b) {
return this.m_tree.GetFatAABB(b)
};
Q.prototype.GetProxyCount = function() {
return this.m_proxyCount
};
Q.prototype.UpdatePairs = function(b) {
for (var c = this, d = c.m_pairCount = 0, l, d = 0; d < c.m_moveBuffer.length; ++d) {
l = c.m_moveBuffer[d];
var e = c.m_tree.GetFatAABB(l);
c.m_tree.Query(function(b) {
if (b == l) return !0;
c.m_pairCount == c.m_pairBuffer.length && (c.m_pairBuffer[c.m_pairCount] = new R);
var d = c.m_pairBuffer[c.m_pairCount];
d.proxyA = b < l ? b : l;
d.proxyB = b >= l ? b : l;
++c.m_pairCount;
return !0
}, e)
}
for (d = c.m_moveBuffer.length = 0; d < c.m_pairCount;) {
var e = c.m_pairBuffer[d],
g = c.m_tree.GetUserData(e.proxyA),
f = c.m_tree.GetUserData(e.proxyB);
b(g, f);
for (++d; d < c.m_pairCount;) {
g = c.m_pairBuffer[d];
if (g.proxyA != e.proxyA || g.proxyB != e.proxyB) break;
++d
}
}
};
Q.prototype.Query = function(b, c) {
this.m_tree.Query(b, c)
};
Q.prototype.RayCast = function(b, c) {
this.m_tree.RayCast(b, c)
};
Q.prototype.Validate = function() {};
Q.prototype.Rebalance = function(b) {
void 0 === b && (b = 0);
this.m_tree.Rebalance(b)
};
Q.prototype.BufferMove = function(b) {
this.m_moveBuffer[this.m_moveBuffer.length] = b
};
Q.prototype.UnBufferMove = function(b) {
this.m_moveBuffer.splice(parseInt(this.m_moveBuffer.indexOf(b)), 1)
};
Q.prototype.ComparePairs = function() {
return 0
};
Q.__implements = {};
Q.__implements[O] = !0;
M.b2DynamicTreeNode = function() {
this.aabb = new g
};
M.prototype.IsLeaf = function() {
return null == this.child1
};
R.b2DynamicTreePair = function() {};
K.b2Manifold = function() {
this.m_pointCount = 0
};
K.prototype.b2Manifold = function() {
this.m_points = new Vector(e.b2_maxManifoldPoints);
for (var b = 0; b < e.b2_maxManifoldPoints; b++) this.m_points[b] = new X;
this.m_localPlaneNormal = new n;
this.m_localPoint = new n
};
K.prototype.Reset = function() {
for (var b = 0; b < e.b2_maxManifoldPoints; b++)(this.m_points[b] instanceof X ? this.m_points[b] : null).Reset();
this.m_localPlaneNormal.SetZero();
this.m_localPoint.SetZero();
this.m_pointCount = this.m_type = 0
};
K.prototype.Set = function(b) {
this.m_pointCount = b.m_pointCount;
for (var c = 0; c < e.b2_maxManifoldPoints; c++)(this.m_points[c] instanceof X ? this.m_points[c] : null).Set(b.m_points[c]);
this.m_localPlaneNormal.SetV(b.m_localPlaneNormal);
this.m_localPoint.SetV(b.m_localPoint);
this.m_type = b.m_type
};
K.prototype.Copy = function() {
var b = new K;
b.Set(this);
return b
};
Box2D.postDefs.push(function() {
Box2D.Collision.b2Manifold.e_circles = 1;
Box2D.Collision.b2Manifold.e_faceA = 2;
Box2D.Collision.b2Manifold.e_faceB = 4
});
X.b2ManifoldPoint = function() {
this.m_localPoint = new n;
this.m_id = new B
};
X.prototype.b2ManifoldPoint = function() {
this.Reset()
};
X.prototype.Reset = function() {
this.m_localPoint.SetZero();
this.m_tangentImpulse = this.m_normalImpulse = 0;
this.m_id.key = 0
};
X.prototype.Set = function(b) {
this.m_localPoint.SetV(b.m_localPoint);
this.m_normalImpulse = b.m_normalImpulse;
this.m_tangentImpulse = b.m_tangentImpulse;
this.m_id.Set(b.m_id)
};
P.b2Point = function() {
this.p = new n
};
P.prototype.Support = function() {
return this.p
};
P.prototype.GetFirstVertex = function() {
return this.p
};
S.b2RayCastInput = function() {
this.p1 = new n;
this.p2 = new n
};
S.prototype.b2RayCastInput = function(b, c, d) {
void 0 === b && (b = null);
void 0 === c && (c = null);
void 0 === d && (d = 1);
b && this.p1.SetV(b);
c && this.p2.SetV(c);
this.maxFraction = d
};
Z.b2RayCastOutput = function() {
this.normal = new n
};
U.b2Segment = function() {
this.p1 = new n;
this.p2 = new n
};
U.prototype.TestSegment = function(b, c, d, l) {
void 0 === l && (l = 0);
var e = d.p1,
g = d.p2.x - e.x,
f = d.p2.y - e.y;
d = this.p2.y - this.p1.y;
var p = -(this.p2.x - this.p1.x),
r = 100 * Number.MIN_VALUE,
j = -(g * d + f * p);
if (j > r) {
var n = e.x - this.p1.x,
v = e.y - this.p1.y,
e = n * d + v * p;
if (0 <= e && e <= l * j && (l = -g * v + f * n, -r * j <= l && l <= j * (1 + r))) return e /= j, l = Math.sqrt(d * d + p * p), b[0] = e, c.Set(d / l, p / l), !0
}
return !1
};
U.prototype.Extend = function(b) {
this.ExtendForward(b);
this.ExtendBackward(b)
};
U.prototype.ExtendForward = function(b) {
var c = this.p2.x - this.p1.x,
d = this.p2.y - this.p1.y;
b = Math.min(0 < c ? (b.upperBound.x - this.p1.x) / c : 0 > c ? (b.lowerBound.x - this.p1.x) / c : Number.POSITIVE_INFINITY, 0 < d ? (b.upperBound.y - this.p1.y) / d : 0 > d ? (b.lowerBound.y -
this.p1.y) / d : Number.POSITIVE_INFINITY);
this.p2.x = this.p1.x + c * b;
this.p2.y = this.p1.y + d * b
};
U.prototype.ExtendBackward = function(b) {
var c = -this.p2.x + this.p1.x,
d = -this.p2.y + this.p1.y;
b = Math.min(0 < c ? (b.upperBound.x - this.p2.x) / c : 0 > c ? (b.lowerBound.x - this.p2.x) / c : Number.POSITIVE_INFINITY, 0 < d ? (b.upperBound.y - this.p2.y) / d : 0 > d ? (b.lowerBound.y - this.p2.y) / d : Number.POSITIVE_INFINITY);
this.p1.x = this.p2.x + c * b;
this.p1.y = this.p2.y + d * b
};
p.b2SeparationFunction = function() {
this.m_localPoint = new n;
this.m_axis = new n
};
p.prototype.Initialize =
function(b, c, d, l, g) {
this.m_proxyA = c;
this.m_proxyB = l;
var r = parseInt(b.count);
e.b2Assert(0 < r && 3 > r);
var m, j, v, D, O = 0,
H = 0;
1 == r ? (this.m_type = p.e_points, m = this.m_proxyA.GetVertex(b.indexA[0]), j = this.m_proxyB.GetVertex(b.indexB[0]), r = m, b = d.R, c = d.position.x + (b.col1.x * r.x + b.col2.x * r.y), l = d.position.y + (b.col1.y * r.x + b.col2.y * r.y), r = j, b = g.R, v = g.position.x + (b.col1.x * r.x + b.col2.x * r.y), D = g.position.y + (b.col1.y * r.x + b.col2.y * r.y), this.m_axis.x = v - c, this.m_axis.y = D - l, this.m_axis.Normalize()) : (b.indexB[0] == b.indexB[1] ? (this.m_type = p.e_faceA, c = this.m_proxyA.GetVertex(b.indexA[0]), l = this.m_proxyA.GetVertex(b.indexA[1]), j = this.m_proxyB.GetVertex(b.indexB[0]), this.m_localPoint.x = 0.5 * (c.x + l.x), this.m_localPoint.y = 0.5 * (c.y + l.y), this.m_axis = f.CrossVF(f.SubtractVV(l, c), 1), this.m_axis.Normalize(), r = this.m_axis, b = d.R, O = b.col1.x * r.x + b.col2.x * r.y, H = b.col1.y * r.x + b.col2.y * r.y, r = this.m_localPoint, b = d.R, c = d.position.x + (b.col1.x * r.x + b.col2.x * r.y), l = d.position.y + (b.col1.y * r.x + b.col2.y * r.y), r = j, b = g.R, v = g.position.x + (b.col1.x * r.x +
b.col2.x * r.y), D = g.position.y + (b.col1.y * r.x + b.col2.y * r.y), O = (v - c) * O + (D - l) * H) : b.indexA[0] == b.indexA[0] ? (this.m_type = p.e_faceB, v = this.m_proxyB.GetVertex(b.indexB[0]), D = this.m_proxyB.GetVertex(b.indexB[1]), m = this.m_proxyA.GetVertex(b.indexA[0]), this.m_localPoint.x = 0.5 * (v.x + D.x), this.m_localPoint.y = 0.5 * (v.y + D.y), this.m_axis = f.CrossVF(f.SubtractVV(D, v), 1), this.m_axis.Normalize(), r = this.m_axis, b = g.R, O = b.col1.x * r.x + b.col2.x * r.y, H = b.col1.y * r.x + b.col2.y * r.y, r = this.m_localPoint, b = g.R, v = g.position.x + (b.col1.x * r.x + b.col2.x * r.y), D = g.position.y + (b.col1.y * r.x + b.col2.y * r.y), r = m, b = d.R, c = d.position.x + (b.col1.x * r.x + b.col2.x * r.y), l = d.position.y + (b.col1.y * r.x + b.col2.y * r.y), O = (c - v) * O + (l - D) * H) : (c = this.m_proxyA.GetVertex(b.indexA[0]), l = this.m_proxyA.GetVertex(b.indexA[1]), v = this.m_proxyB.GetVertex(b.indexB[0]), D = this.m_proxyB.GetVertex(b.indexB[1]), f.MulX(d, m), m = f.MulMV(d.R, f.SubtractVV(l, c)), f.MulX(g, j), O = f.MulMV(g.R, f.SubtractVV(D, v)), g = m.x * m.x + m.y * m.y, j = O.x * O.x + O.y * O.y, b = f.SubtractVV(O, m), d = m.x * b.x + m.y * b.y, b = O.x * b.x + O.y * b.y, m = m.x * O.x + m.y * O.y, H = g * j - m * m, O = 0, 0 != H && (O = f.Clamp((m * b - d * j) / H, 0, 1)), 0 > (m * O + b) / j && (O = f.Clamp((m - d) / g, 0, 1)), m = new n, m.x = c.x + O * (l.x - c.x), m.y = c.y + O * (l.y - c.y), j = new n, j.x = v.x + O * (D.x - v.x), j.y = v.y + O * (D.y - v.y), 0 == O || 1 == O ? (this.m_type = p.e_faceB, this.m_axis = f.CrossVF(f.SubtractVV(D, v), 1), this.m_axis.Normalize(), this.m_localPoint = j) : (this.m_type = p.e_faceA, this.m_axis = f.CrossVF(f.SubtractVV(l, c), 1), this.m_localPoint = m)), 0 > O && this.m_axis.NegativeSelf())
};
p.prototype.Evaluate = function(b, c) {
var d, l, g =
0;
switch (this.m_type) {
case p.e_points:
return d = f.MulTMV(b.R, this.m_axis), l = f.MulTMV(c.R, this.m_axis.GetNegative()), d = this.m_proxyA.GetSupportVertex(d), l = this.m_proxyB.GetSupportVertex(l), d = f.MulX(b, d), l = f.MulX(c, l), (l.x - d.x) * this.m_axis.x + (l.y - d.y) * this.m_axis.y;
case p.e_faceA:
return g = f.MulMV(b.R, this.m_axis), d = f.MulX(b, this.m_localPoint), l = f.MulTMV(c.R, g.GetNegative()), l = this.m_proxyB.GetSupportVertex(l), l = f.MulX(c, l), (l.x - d.x) * g.x + (l.y - d.y) * g.y;
case p.e_faceB:
return g = f.MulMV(c.R, this.m_axis), l = f.MulX(c, this.m_localPoint), d = f.MulTMV(b.R, g.GetNegative()), d = this.m_proxyA.GetSupportVertex(d), d = f.MulX(b, d), (d.x - l.x) * g.x + (d.y - l.y) * g.y;
default:
return e.b2Assert(!1), 0
}
};
Box2D.postDefs.push(function() {
Box2D.Collision.b2SeparationFunction.e_points = 1;
Box2D.Collision.b2SeparationFunction.e_faceA = 2;
Box2D.Collision.b2SeparationFunction.e_faceB = 4
});
v.b2Simplex = function() {
this.m_v1 = new D;
this.m_v2 = new D;
this.m_v3 = new D;
this.m_vertices = new Vector(3)
};
v.prototype.b2Simplex = function() {
this.m_vertices[0] = this.m_v1;
this.m_vertices[1] = this.m_v2;
this.m_vertices[2] = this.m_v3
};
v.prototype.ReadCache = function(b, c, d, l, g) {
e.b2Assert(0 <= b.count && 3 >= b.count);
var p, m;
this.m_count = b.count;
for (var r = this.m_vertices, j = 0; j < this.m_count; j++) {
var n = r[j];
n.indexA = b.indexA[j];
n.indexB = b.indexB[j];
p = c.GetVertex(n.indexA);
m = l.GetVertex(n.indexB);
n.wA = f.MulX(d, p);
n.wB = f.MulX(g, m);
n.w = f.SubtractVV(n.wB, n.wA);
n.a = 0
}
if (1 < this.m_count && (b = b.metric, p = this.GetMetric(), p < 0.5 * b || 2 * b < p || p < Number.MIN_VALUE)) this.m_count = 0;
0 == this.m_count && (n = r[0], n.indexA = 0, n.indexB = 0, p = c.GetVertex(0), m = l.GetVertex(0), n.wA = f.MulX(d, p), n.wB = f.MulX(g, m), n.w = f.SubtractVV(n.wB, n.wA), this.m_count = 1)
};
v.prototype.WriteCache = function(b) {
b.metric = this.GetMetric();
b.count = Box2D.parseUInt(this.m_count);
for (var c = this.m_vertices, d = 0; d < this.m_count; d++) b.indexA[d] = Box2D.parseUInt(c[d].indexA), b.indexB[d] = Box2D.parseUInt(c[d].indexB)
};
v.prototype.GetSearchDirection = function() {
switch (this.m_count) {
case 1:
return this.m_v1.w.GetNegative();
case 2:
var b = f.SubtractVV(this.m_v2.w, this.m_v1.w);
return 0 < f.CrossVV(b, this.m_v1.w.GetNegative()) ? f.CrossFV(1, b) : f.CrossVF(b, 1);
default:
return e.b2Assert(!1), new n
}
};
v.prototype.GetClosestPoint = function() {
switch (this.m_count) {
case 0:
return e.b2Assert(!1), new n;
case 1:
return this.m_v1.w;
case 2:
return new n(this.m_v1.a * this.m_v1.w.x + this.m_v2.a * this.m_v2.w.x, this.m_v1.a * this.m_v1.w.y + this.m_v2.a * this.m_v2.w.y);
default:
return e.b2Assert(!1), new n
}
};
v.prototype.GetWitnessPoints = function(b, c) {
switch (this.m_count) {
case 0:
e.b2Assert(!1);
break;
case 1:
b.SetV(this.m_v1.wA);
c.SetV(this.m_v1.wB);
break;
case 2:
b.x = this.m_v1.a * this.m_v1.wA.x + this.m_v2.a * this.m_v2.wA.x;
b.y = this.m_v1.a * this.m_v1.wA.y + this.m_v2.a * this.m_v2.wA.y;
c.x = this.m_v1.a * this.m_v1.wB.x + this.m_v2.a * this.m_v2.wB.x;
c.y = this.m_v1.a * this.m_v1.wB.y + this.m_v2.a * this.m_v2.wB.y;
break;
case 3:
c.x = b.x = this.m_v1.a * this.m_v1.wA.x + this.m_v2.a * this.m_v2.wA.x + this.m_v3.a * this.m_v3.wA.x;
c.y = b.y = this.m_v1.a * this.m_v1.wA.y + this.m_v2.a * this.m_v2.wA.y + this.m_v3.a * this.m_v3.wA.y;
break;
default:
e.b2Assert(!1)
}
};
v.prototype.GetMetric = function() {
switch (this.m_count) {
case 0:
return e.b2Assert(!1), 0;
case 1:
return 0;
case 2:
return f.SubtractVV(this.m_v1.w, this.m_v2.w).Length();
case 3:
return f.CrossVV(f.SubtractVV(this.m_v2.w, this.m_v1.w), f.SubtractVV(this.m_v3.w, this.m_v1.w));
default:
return e.b2Assert(!1), 0
}
};
v.prototype.Solve2 = function() {
var b = this.m_v1.w,
c = this.m_v2.w,
d = f.SubtractVV(c, b),
b = -(b.x * d.x + b.y * d.y);
0 >= b ? this.m_count = this.m_v1.a = 1 : (c = c.x * d.x + c.y * d.y, 0 >= c ? (this.m_count = this.m_v2.a = 1, this.m_v1.Set(this.m_v2)) : (d = 1 / (c + b), this.m_v1.a = c * d, this.m_v2.a = b * d, this.m_count = 2))
};
v.prototype.Solve3 = function() {
var b = this.m_v1.w,
c = this.m_v2.w,
d = this.m_v3.w,
l = f.SubtractVV(c, b),
e = f.Dot(b, l),
g = f.Dot(c, l),
e = -e,
p = f.SubtractVV(d, b),
r = f.Dot(b, p),
j = f.Dot(d, p),
r = -r,
n = f.SubtractVV(d, c),
v = f.Dot(c, n),
n = f.Dot(d, n),
v = -v,
p = f.CrossVV(l, p),
l = p * f.CrossVV(c, d),
d = p * f.CrossVV(d, b),
b = p * f.CrossVV(b, c);
0 >= e && 0 >= r ? this.m_count = this.m_v1.a = 1 : 0 < g && 0 < e && 0 >= b ? (j = 1 / (g + e), this.m_v1.a = g * j, this.m_v2.a = e * j, this.m_count = 2) : 0 < j && 0 < r && 0 >= d ? (g = 1 / (j + r), this.m_v1.a = j * g, this.m_v3.a = r * g, this.m_count = 2, this.m_v2.Set(this.m_v3)) : 0 >= g && 0 >= v ? (this.m_count = this.m_v2.a = 1, this.m_v1.Set(this.m_v2)) : 0 >= j && 0 >= n ? (this.m_count = this.m_v3.a = 1, this.m_v1.Set(this.m_v3)) : 0 < n && 0 < v && 0 >= l ? (g = 1 / (n + v), this.m_v2.a = n * g, this.m_v3.a = v * g, this.m_count = 2, this.m_v1.Set(this.m_v3)) : (g = 1 / (l + d + b), this.m_v1.a = l * g, this.m_v2.a = d * g, this.m_v3.a = b * g, this.m_count = 3)
};
H.b2SimplexCache = function() {
this.indexA = new Vector_a2j_Number(3);
this.indexB = new Vector_a2j_Number(3)
};
D.b2SimplexVertex = function() {};
D.prototype.Set = function(b) {
this.wA.SetV(b.wA);
this.wB.SetV(b.wB);
this.w.SetV(b.w);
this.a = b.a;
this.indexA = b.indexA;
this.indexB = b.indexB
};
N.b2TimeOfImpact = function() {};
N.TimeOfImpact = function(b) {
++N.b2_toiCalls;
var c = b.proxyA,
d = b.proxyB,
l = b.sweepA,
g = b.sweepB;
e.b2Assert(l.t0 == g.t0);
e.b2Assert(1 - l.t0 > Number.MIN_VALUE);
var p = c.m_radius + d.m_radius;
b = b.tolerance;
var r = 0,
j = 0,
n = 0;
N.s_cache.count = 0;
for (N.s_distanceInput.useRadii = !1;;) {
l.GetTransform(N.s_xfA, r);
g.GetTransform(N.s_xfB, r);
N.s_distanceInput.proxyA = c;
N.s_distanceInput.proxyB = d;
N.s_distanceInput.transformA = N.s_xfA;
N.s_distanceInput.transformB = N.s_xfB;
G.Distance(N.s_distanceOutput, N.s_cache, N.s_distanceInput);
if (0 >= N.s_distanceOutput.distance) {
r = 1;
break
}
N.s_fcn.Initialize(N.s_cache, c, N.s_xfA, d, N.s_xfB);
var v = N.s_fcn.Evaluate(N.s_xfA, N.s_xfB);
if (0 >= v) {
r = 1;
break
}
0 == j && (n = v > p ? f.Max(p - b, 0.75 * p) : f.Max(v - b, 0.02 * p));
if (v - n < 0.5 * b) {
if (0 == j) {
r = 1;
break
}
break
}
var D = r,
O = r,
H = 1;
l.GetTransform(N.s_xfA, H);
g.GetTransform(N.s_xfB, H);
var u = N.s_fcn.Evaluate(N.s_xfA, N.s_xfB);
if (u >= n) {
r = 1;
break
}
for (var V = 0;;) {
var J = 0,
J = V & 1 ? O + (n - v) * (H - O) / (u - v) : 0.5 * (O + H);
l.GetTransform(N.s_xfA, J);
g.GetTransform(N.s_xfB, J);
var q = N.s_fcn.Evaluate(N.s_xfA, N.s_xfB);
if (f.Abs(q - n) < 0.025 * b) {
D = J;
break
}
q > n ? (O = J, v = q) : (H = J, u = q);
++V;
++N.b2_toiRootIters;
if (50 == V) break
}
N.b2_toiMaxRootIters = f.Max(N.b2_toiMaxRootIters, V);
if (D < (1 + 100 * Number.MIN_VALUE) * r) break;
r = D;
j++;
++N.b2_toiIters;
if (1E3 == j) break
}
N.b2_toiMaxIters = f.Max(N.b2_toiMaxIters, j);
return r
};
Box2D.postDefs.push(function() {
Box2D.Collision.b2TimeOfImpact.b2_toiCalls =
0;
Box2D.Collision.b2TimeOfImpact.b2_toiIters = 0;
Box2D.Collision.b2TimeOfImpact.b2_toiMaxIters = 0;
Box2D.Collision.b2TimeOfImpact.b2_toiRootIters = 0;
Box2D.Collision.b2TimeOfImpact.b2_toiMaxRootIters = 0;
Box2D.Collision.b2TimeOfImpact.s_cache = new H;
Box2D.Collision.b2TimeOfImpact.s_distanceInput = new I;
Box2D.Collision.b2TimeOfImpact.s_xfA = new q;
Box2D.Collision.b2TimeOfImpact.s_xfB = new q;
Box2D.Collision.b2TimeOfImpact.s_fcn = new p;
Box2D.Collision.b2TimeOfImpact.s_distanceOutput = new u
});
J.b2TOIInput = function() {
this.proxyA = new L;
this.proxyB = new L;
this.sweepA = new j;
this.sweepB = new j
};
V.b2WorldManifold = function() {
this.m_normal = new n
};
V.prototype.b2WorldManifold = function() {
this.m_points = new Vector(e.b2_maxManifoldPoints);
for (var b = 0; b < e.b2_maxManifoldPoints; b++) this.m_points[b] = new n
};
V.prototype.Initialize = function(b, c, d, l, e) {
void 0 === d && (d = 0);
void 0 === e && (e = 0);
if (0 != b.m_pointCount) {
var g = 0,
f, p, r = 0,
j = 0,
n = 0,
v = 0,
D = 0;
switch (b.m_type) {
case K.e_circles:
p = c.R;
f = b.m_localPoint;
g = c.position.x + p.col1.x * f.x + p.col2.x * f.y;
c = c.position.y +
p.col1.y * f.x + p.col2.y * f.y;
p = l.R;
f = b.m_points[0].m_localPoint;
b = l.position.x + p.col1.x * f.x + p.col2.x * f.y;
l = l.position.y + p.col1.y * f.x + p.col2.y * f.y;
f = b - g;
p = l - c;
r = f * f + p * p;
r > Number.MIN_VALUE * Number.MIN_VALUE ? (r = Math.sqrt(r), this.m_normal.x = f / r, this.m_normal.y = p / r) : (this.m_normal.x = 1, this.m_normal.y = 0);
f = c + d * this.m_normal.y;
l -= e * this.m_normal.y;
this.m_points[0].x = 0.5 * (g + d * this.m_normal.x + (b - e * this.m_normal.x));
this.m_points[0].y = 0.5 * (f + l);
break;
case K.e_faceA:
p = c.R;
f = b.m_localPlaneNormal;
r = p.col1.x * f.x + p.col2.x * f.y;
j = p.col1.y * f.x + p.col2.y * f.y;
p = c.R;
f = b.m_localPoint;
n = c.position.x + p.col1.x * f.x + p.col2.x * f.y;
v = c.position.y + p.col1.y * f.x + p.col2.y * f.y;
this.m_normal.x = r;
this.m_normal.y = j;
for (g = 0; g < b.m_pointCount; g++) p = l.R, f = b.m_points[g].m_localPoint, D = l.position.x + p.col1.x * f.x + p.col2.x * f.y, f = l.position.y + p.col1.y * f.x + p.col2.y * f.y, this.m_points[g].x = D + 0.5 * (d - (D - n) * r - (f - v) * j - e) * r, this.m_points[g].y = f + 0.5 * (d - (D - n) * r - (f - v) * j - e) * j;
break;
case K.e_faceB:
p = l.R;
f = b.m_localPlaneNormal;
r = p.col1.x * f.x + p.col2.x * f.y;
j = p.col1.y * f.x + p.col2.y * f.y;
p = l.R;
f = b.m_localPoint;
n = l.position.x + p.col1.x * f.x + p.col2.x * f.y;
v = l.position.y + p.col1.y * f.x + p.col2.y * f.y;
this.m_normal.x = -r;
this.m_normal.y = -j;
for (g = 0; g < b.m_pointCount; g++) p = c.R, f = b.m_points[g].m_localPoint, D = c.position.x + p.col1.x * f.x + p.col2.x * f.y, f = c.position.y + p.col1.y * f.x + p.col2.y * f.y, this.m_points[g].x = D + 0.5 * (e - (D - n) * r - (f - v) * j - d) * r, this.m_points[g].y = f + 0.5 * (e - (D - n) * r - (f - v) * j - d) * j
}
}
};
l.ClipVertex = function() {
this.v = new n;
this.id = new B
};
l.prototype.Set = function(b) {
this.v.SetV(b.v);
this.id.Set(b.id)
};
r.Features = function() {};
Object.defineProperty(r.prototype, "referenceEdge", {
enumerable: !1,
configurable: !0,
get: function() {
return this._referenceEdge
}
});
Object.defineProperty(r.prototype, "referenceEdge", {
enumerable: !1,
configurable: !0,
set: function(b) {
void 0 === b && (b = 0);
this._referenceEdge = b;
this._m_id._key = this._m_id._key & 4294967040 | this._referenceEdge & 255
}
});
Object.defineProperty(r.prototype, "incidentEdge", {
enumerable: !1,
configurable: !0,
get: function() {
return this._incidentEdge
}
});
Object.defineProperty(r.prototype, "incidentEdge", {
enumerable: !1,
configurable: !0,
set: function(b) {
void 0 === b && (b = 0);
this._incidentEdge = b;
this._m_id._key = this._m_id._key & 4294902015 | this._incidentEdge << 8 & 65280
}
});
Object.defineProperty(r.prototype, "incidentVertex", {
enumerable: !1,
configurable: !0,
get: function() {
return this._incidentVertex
}
});
Object.defineProperty(r.prototype, "incidentVertex", {
enumerable: !1,
configurable: !0,
set: function(b) {
void 0 === b && (b = 0);
this._incidentVertex = b;
this._m_id._key = this._m_id._key & 4278255615 | this._incidentVertex << 16 & 16711680
}
});
Object.defineProperty(r.prototype, "flip", {
enumerable: !1,
configurable: !0,
get: function() {
return this._flip
}
});
Object.defineProperty(r.prototype, "flip", {
enumerable: !1,
configurable: !0,
set: function(b) {
void 0 === b && (b = 0);
this._flip = b;
this._m_id._key = this._m_id._key & 16777215 | this._flip << 24 & 4278190080
}
})
})();
(function() {
var b = Box2D.Common.b2Settings,
c = Box2D.Collision.Shapes.b2CircleShape,
d = Box2D.Collision.Shapes.b2EdgeChainDef,
e = Box2D.Collision.Shapes.b2EdgeShape,
f = Box2D.Collision.Shapes.b2MassData,
j = Box2D.Collision.Shapes.b2PolygonShape,
q = Box2D.Collision.Shapes.b2Shape,
n = Box2D.Common.Math.b2Mat22,
g = Box2D.Common.Math.b2Math,
y = Box2D.Common.Math.b2Transform,
A = Box2D.Common.Math.b2Vec2,
z = Box2D.Collision.b2Distance,
B = Box2D.Collision.b2DistanceInput,
C = Box2D.Collision.b2DistanceOutput,
G = Box2D.Collision.b2DistanceProxy,
I = Box2D.Collision.b2SimplexCache;
Box2D.inherit(c, Box2D.Collision.Shapes.b2Shape);
c.prototype.__super = Box2D.Collision.Shapes.b2Shape.prototype;
c.b2CircleShape = function() {
Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this, arguments);
this.m_p = new A
};
c.prototype.Copy = function() {
var b = new c;
b.Set(this);
return b
};
c.prototype.Set = function(b) {
this.__super.Set.call(this, b);
Box2D.is(b, c) && this.m_p.SetV((b instanceof c ? b : null).m_p)
};
c.prototype.TestPoint = function(b, c) {
var d = b.R,
e = b.position.x + (d.col1.x * this.m_p.x +
d.col2.x * this.m_p.y),
d = b.position.y + (d.col1.y * this.m_p.x + d.col2.y * this.m_p.y),
e = c.x - e,
d = c.y - d;
return e * e + d * d <= this.m_radius * this.m_radius
};
c.prototype.RayCast = function(b, c, d) {
var e = d.R,
g = c.p1.x - (d.position.x + (e.col1.x * this.m_p.x + e.col2.x * this.m_p.y));
d = c.p1.y - (d.position.y + (e.col1.y * this.m_p.x + e.col2.y * this.m_p.y));
var e = c.p2.x - c.p1.x,
f = c.p2.y - c.p1.y,
j = g * e + d * f,
n = e * e + f * f,
q = j * j - n * (g * g + d * d - this.m_radius * this.m_radius);
if (0 > q || n < Number.MIN_VALUE) return !1;
j = -(j + Math.sqrt(q));
return 0 <= j && j <= c.maxFraction * n ? (j /= n, b.fraction = j, b.normal.x = g + j * e, b.normal.y = d + j * f, b.normal.Normalize(), !0) : !1
};
c.prototype.ComputeAABB = function(b, c) {
var d = c.R,
e = c.position.x + (d.col1.x * this.m_p.x + d.col2.x * this.m_p.y),
d = c.position.y + (d.col1.y * this.m_p.x + d.col2.y * this.m_p.y);
b.lowerBound.Set(e - this.m_radius, d - this.m_radius);
b.upperBound.Set(e + this.m_radius, d + this.m_radius)
};
c.prototype.ComputeMass = function(c, d) {
void 0 === d && (d = 0);
c.mass = d * b.b2_pi * this.m_radius * this.m_radius;
c.center.SetV(this.m_p);
c.I = c.mass * (0.5 * this.m_radius * this.m_radius + (this.m_p.x * this.m_p.x + this.m_p.y * this.m_p.y))
};
c.prototype.ComputeSubmergedArea = function(b, c, d, e) {
void 0 === c && (c = 0);
d = g.MulX(d, this.m_p);
var f = -(g.Dot(b, d) - c);
if (f < -this.m_radius + Number.MIN_VALUE) return 0;
if (f > this.m_radius) return e.SetV(d), Math.PI * this.m_radius * this.m_radius;
c = this.m_radius * this.m_radius;
var j = f * f,
f = c * (Math.asin(f / this.m_radius) + Math.PI / 2) + f * Math.sqrt(c - j);
c = -2 / 3 * Math.pow(c - j, 1.5) / f;
e.x = d.x + b.x * c;
e.y = d.y + b.y * c;
return f
};
c.prototype.GetLocalPosition = function() {
return this.m_p
};
c.prototype.SetLocalPosition = function(b) {
this.m_p.SetV(b)
};
c.prototype.GetRadius = function() {
return this.m_radius
};
c.prototype.SetRadius = function(b) {
void 0 === b && (b = 0);
this.m_radius = b
};
c.prototype.b2CircleShape = function(b) {
void 0 === b && (b = 0);
this.__super.b2Shape.call(this);
this.m_type = q.e_circleShape;
this.m_radius = b
};
d.b2EdgeChainDef = function() {};
d.prototype.b2EdgeChainDef = function() {
this.vertexCount = 0;
this.isALoop = !0;
this.vertices = []
};
Box2D.inherit(e, Box2D.Collision.Shapes.b2Shape);
e.prototype.__super = Box2D.Collision.Shapes.b2Shape.prototype;
e.b2EdgeShape = function() {
Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this, arguments);
this.s_supportVec = new A;
this.m_v1 = new A;
this.m_v2 = new A;
this.m_coreV1 = new A;
this.m_coreV2 = new A;
this.m_normal = new A;
this.m_direction = new A;
this.m_cornerDir1 = new A;
this.m_cornerDir2 = new A
};
e.prototype.TestPoint = function() {
return !1
};
e.prototype.RayCast = function(b, c, d) {
var e, g = c.p2.x - c.p1.x,
f = c.p2.y - c.p1.y;
e = d.R;
var j = d.position.x + (e.col1.x * this.m_v1.x + e.col2.x * this.m_v1.y),
n = d.position.y + (e.col1.y * this.m_v1.x + e.col2.y * this.m_v1.y),
q = d.position.y + (e.col1.y * this.m_v2.x + e.col2.y * this.m_v2.y) - n;
d = -(d.position.x + (e.col1.x * this.m_v2.x + e.col2.x * this.m_v2.y) - j);
e = 100 * Number.MIN_VALUE;
var y = -(g * q + f * d);
if (y > e) {
var j = c.p1.x - j,
B = c.p1.y - n,
n = j * q + B * d;
if (0 <= n && n <= c.maxFraction * y && (c = -g * B + f * j, -e * y <= c && c <= y * (1 + e))) return b.fraction = n / y, c = Math.sqrt(q * q + d * d), b.normal.x = q / c, b.normal.y = d / c, !0
}
return !1
};
e.prototype.ComputeAABB = function(b, c) {
var d = c.R,
e = c.position.x + (d.col1.x * this.m_v1.x +
d.col2.x * this.m_v1.y),
g = c.position.y + (d.col1.y * this.m_v1.x + d.col2.y * this.m_v1.y),
f = c.position.x + (d.col1.x * this.m_v2.x + d.col2.x * this.m_v2.y),
d = c.position.y + (d.col1.y * this.m_v2.x + d.col2.y * this.m_v2.y);
e < f ? (b.lowerBound.x = e, b.upperBound.x = f) : (b.lowerBound.x = f, b.upperBound.x = e);
g < d ? (b.lowerBound.y = g, b.upperBound.y = d) : (b.lowerBound.y = d, b.upperBound.y = g)
};
e.prototype.ComputeMass = function(b) {
b.mass = 0;
b.center.SetV(this.m_v1);
b.I = 0
};
e.prototype.ComputeSubmergedArea = function(b, c, d, e) {
void 0 === c && (c = 0);
var f = new A(b.x * c, b.y * c),
j = g.MulX(d, this.m_v1);
d = g.MulX(d, this.m_v2);
var n = g.Dot(b, j) - c;
b = g.Dot(b, d) - c;
if (0 < n) {
if (0 < b) return 0;
j.x = -b / (n - b) * j.x + n / (n - b) * d.x;
j.y = -b / (n - b) * j.y + n / (n - b) * d.y
} else 0 < b && (d.x = -b / (n - b) * j.x + n / (n - b) * d.x, d.y = -b / (n - b) * j.y + n / (n - b) * d.y);
e.x = (f.x + j.x + d.x) / 3;
e.y = (f.y + j.y + d.y) / 3;
return 0.5 * ((j.x - f.x) * (d.y - f.y) - (j.y - f.y) * (d.x - f.x))
};
e.prototype.GetLength = function() {
return this.m_length
};
e.prototype.GetVertex1 = function() {
return this.m_v1
};
e.prototype.GetVertex2 = function() {
return this.m_v2
};
e.prototype.GetCoreVertex1 = function() {
return this.m_coreV1
};
e.prototype.GetCoreVertex2 = function() {
return this.m_coreV2
};
e.prototype.GetNormalVector = function() {
return this.m_normal
};
e.prototype.GetDirectionVector = function() {
return this.m_direction
};
e.prototype.GetCorner1Vector = function() {
return this.m_cornerDir1
};
e.prototype.GetCorner2Vector = function() {
return this.m_cornerDir2
};
e.prototype.Corner1IsConvex = function() {
return this.m_cornerConvex1
};
e.prototype.Corner2IsConvex = function() {
return this.m_cornerConvex2
};
e.prototype.GetFirstVertex = function(b) {
var c = b.R;
return new A(b.position.x + (c.col1.x * this.m_coreV1.x + c.col2.x * this.m_coreV1.y), b.position.y + (c.col1.y * this.m_coreV1.x + c.col2.y * this.m_coreV1.y))
};
e.prototype.GetNextEdge = function() {
return this.m_nextEdge
};
e.prototype.GetPrevEdge = function() {
return this.m_prevEdge
};
e.prototype.Support = function(b, c, d) {
void 0 === c && (c = 0);
void 0 === d && (d = 0);
var e = b.R,
g = b.position.x + (e.col1.x * this.m_coreV1.x + e.col2.x * this.m_coreV1.y),
f = b.position.y + (e.col1.y * this.m_coreV1.x +
e.col2.y * this.m_coreV1.y),
j = b.position.x + (e.col1.x * this.m_coreV2.x + e.col2.x * this.m_coreV2.y);
b = b.position.y + (e.col1.y * this.m_coreV2.x + e.col2.y * this.m_coreV2.y);
g * c + f * d > j * c + b * d ? (this.s_supportVec.x = g, this.s_supportVec.y = f) : (this.s_supportVec.x = j, this.s_supportVec.y = b);
return this.s_supportVec
};
e.prototype.b2EdgeShape = function(c, d) {
this.__super.b2Shape.call(this);
this.m_type = q.e_edgeShape;
this.m_nextEdge = this.m_prevEdge = null;
this.m_v1 = c;
this.m_v2 = d;
this.m_direction.Set(this.m_v2.x - this.m_v1.x, this.m_v2.y -
this.m_v1.y);
this.m_length = this.m_direction.Normalize();
this.m_normal.Set(this.m_direction.y, -this.m_direction.x);
this.m_coreV1.Set(-b.b2_toiSlop * (this.m_normal.x - this.m_direction.x) + this.m_v1.x, -b.b2_toiSlop * (this.m_normal.y - this.m_direction.y) + this.m_v1.y);
this.m_coreV2.Set(-b.b2_toiSlop * (this.m_normal.x + this.m_direction.x) + this.m_v2.x, -b.b2_toiSlop * (this.m_normal.y + this.m_direction.y) + this.m_v2.y);
this.m_cornerDir1 = this.m_normal;
this.m_cornerDir2.Set(-this.m_normal.x, -this.m_normal.y)
};
e.prototype.SetPrevEdge = function(b, c, d, e) {
this.m_prevEdge = b;
this.m_coreV1 = c;
this.m_cornerDir1 = d;
this.m_cornerConvex1 = e
};
e.prototype.SetNextEdge = function(b, c, d, e) {
this.m_nextEdge = b;
this.m_coreV2 = c;
this.m_cornerDir2 = d;
this.m_cornerConvex2 = e
};
f.b2MassData = function() {
this.mass = 0;
this.center = new A(0, 0);
this.I = 0
};
Box2D.inherit(j, Box2D.Collision.Shapes.b2Shape);
j.prototype.__super = Box2D.Collision.Shapes.b2Shape.prototype;
j.b2PolygonShape = function() {
Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this, arguments)
};
j.prototype.Copy = function() {
var b = new j;
b.Set(this);
return b
};
j.prototype.Set = function(b) {
this.__super.Set.call(this, b);
if (Box2D.is(b, j)) {
b = b instanceof j ? b : null;
this.m_centroid.SetV(b.m_centroid);
this.m_vertexCount = b.m_vertexCount;
this.Reserve(this.m_vertexCount);
for (var c = 0; c < this.m_vertexCount; c++) this.m_vertices[c].SetV(b.m_vertices[c]), this.m_normals[c].SetV(b.m_normals[c])
}
};
j.prototype.SetAsArray = function(b, c) {
void 0 === c && (c = 0);
for (var d = new Vector, e = 0, g, e = 0; e < b.length; ++e) g = b[e], d.push(g);
this.SetAsVector(d, c)
};
j.AsArray = function(b, c) {
void 0 === c && (c = 0);
var d = new j;
d.SetAsArray(b, c);
return d
};
j.prototype.SetAsVector = function(c, d) {
void 0 === d && (d = 0);
0 == d && (d = c.length);
b.b2Assert(2 <= d);
this.m_vertexCount = d;
this.Reserve(d);
for (var e = 0, e = 0; e < this.m_vertexCount; e++) this.m_vertices[e].SetV(c[e]);
for (e = 0; e < this.m_vertexCount; ++e) {
var f = parseInt(e),
n = parseInt(e + 1 < this.m_vertexCount ? e + 1 : 0),
f = g.SubtractVV(this.m_vertices[n], this.m_vertices[f]);
b.b2Assert(f.LengthSquared() > Number.MIN_VALUE);
this.m_normals[e].SetV(g.CrossVF(f, 1));
this.m_normals[e].Normalize()
}
this.m_centroid = j.ComputeCentroid(this.m_vertices, this.m_vertexCount)
};
j.AsVector = function(b, c) {
void 0 === c && (c = 0);
var d = new j;
d.SetAsVector(b, c);
return d
};
j.prototype.SetAsBox = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
this.m_vertexCount = 4;
this.Reserve(4);
this.m_vertices[0].Set(-b, -c);
this.m_vertices[1].Set(b, -c);
this.m_vertices[2].Set(b, c);
this.m_vertices[3].Set(-b, c);
this.m_normals[0].Set(0, -1);
this.m_normals[1].Set(1, 0);
this.m_normals[2].Set(0, 1);
this.m_normals[3].Set(-1, 0);
this.m_centroid.SetZero()
};
j.AsBox = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
var d = new j;
d.SetAsBox(b, c);
return d
};
j.prototype.SetAsOrientedBox = function(b, c, d, e) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
void 0 === d && (d = null);
void 0 === e && (e = 0);
this.m_vertexCount = 4;
this.Reserve(4);
this.m_vertices[0].Set(-b, -c);
this.m_vertices[1].Set(b, -c);
this.m_vertices[2].Set(b, c);
this.m_vertices[3].Set(-b, c);
this.m_normals[0].Set(0, -1);
this.m_normals[1].Set(1, 0);
this.m_normals[2].Set(0, 1);
this.m_normals[3].Set(-1, 0);
this.m_centroid = d;
b = new y;
b.position = d;
b.R.Set(e);
for (d = 0; d < this.m_vertexCount; ++d) this.m_vertices[d] = g.MulX(b, this.m_vertices[d]), this.m_normals[d] = g.MulMV(b.R, this.m_normals[d])
};
j.AsOrientedBox = function(b, c, d, e) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
void 0 === d && (d = null);
void 0 === e && (e = 0);
var g = new j;
g.SetAsOrientedBox(b, c, d, e);
return g
};
j.prototype.SetAsEdge = function(b, c) {
this.m_vertexCount = 2;
this.Reserve(2);
this.m_vertices[0].SetV(b);
this.m_vertices[1].SetV(c);
this.m_centroid.x = 0.5 * (b.x + c.x);
this.m_centroid.y = 0.5 * (b.y + c.y);
this.m_normals[0] = g.CrossVF(g.SubtractVV(c, b), 1);
this.m_normals[0].Normalize();
this.m_normals[1].x = -this.m_normals[0].x;
this.m_normals[1].y = -this.m_normals[0].y
};
j.AsEdge = function(b, c) {
var d = new j;
d.SetAsEdge(b, c);
return d
};
j.prototype.TestPoint = function(b, c) {
var d;
d = b.R;
for (var e = c.x - b.position.x, g = c.y - b.position.y, f = e * d.col1.x + g * d.col1.y, j = e * d.col2.x + g * d.col2.y, n = 0; n < this.m_vertexCount; ++n)
if (d = this.m_vertices[n], e = f - d.x, g = j - d.y, d = this.m_normals[n], 0 < d.x * e + d.y * g) return !1;
return !0
};
j.prototype.RayCast = function(b, c, d) {
var e = 0,
g = c.maxFraction,
f = 0,
j = 0,
n, q, f = c.p1.x - d.position.x,
j = c.p1.y - d.position.y;
n = d.R;
var y = f * n.col1.x + j * n.col1.y,
B = f * n.col2.x + j * n.col2.y,
f = c.p2.x - d.position.x,
j = c.p2.y - d.position.y;
n = d.R;
c = f * n.col1.x + j * n.col1.y - y;
n = f * n.col2.x + j * n.col2.y - B;
for (var z = -1, p = 0; p < this.m_vertexCount; ++p) {
q = this.m_vertices[p];
f = q.x - y;
j = q.y - B;
q = this.m_normals[p];
f = q.x * f + q.y * j;
j = q.x * c + q.y * n;
if (0 == j) {
if (0 > f) return !1
} else 0 > j && f < e * j ? (e = f / j, z = p) : 0 < j && f < g * j && (g = f / j);
if (g < e - Number.MIN_VALUE) return !1
}
return 0 <= z ? (b.fraction = e, n = d.R, q = this.m_normals[z], b.normal.x = n.col1.x * q.x + n.col2.x * q.y, b.normal.y = n.col1.y * q.x + n.col2.y * q.y, !0) : !1
};
j.prototype.ComputeAABB = function(b, c) {
for (var d = c.R, e = this.m_vertices[0], g = c.position.x + (d.col1.x * e.x + d.col2.x * e.y), f = c.position.y + (d.col1.y * e.x + d.col2.y * e.y), j = g, n = f, q = 1; q < this.m_vertexCount; ++q) var e = this.m_vertices[q],
y = c.position.x + (d.col1.x * e.x + d.col2.x * e.y),
e = c.position.y + (d.col1.y * e.x + d.col2.y * e.y),
g = g < y ? g : y,
f = f < e ? f : e,
j = j > y ? j : y,
n = n > e ? n : e;
b.lowerBound.x = g - this.m_radius;
b.lowerBound.y = f - this.m_radius;
b.upperBound.x = j + this.m_radius;
b.upperBound.y = n + this.m_radius
};
j.prototype.ComputeMass = function(b, c) {
void 0 === c && (c = 0);
if (2 == this.m_vertexCount) b.center.x = 0.5 * (this.m_vertices[0].x + this.m_vertices[1].x), b.center.y = 0.5 * (this.m_vertices[0].y + this.m_vertices[1].y), b.mass = 0, b.I = 0;
else {
for (var d = 0, e = 0, g = 0, f = 0, j = 1 / 3, n = 0; n < this.m_vertexCount; ++n) var q = this.m_vertices[n],
y = n + 1 < this.m_vertexCount ? this.m_vertices[parseInt(n + 1)] : this.m_vertices[0],
B = q.x - 0,
z = q.y - 0,
p = y.x - 0,
v = y.y -
0,
H = B * v - z * p,
D = 0.5 * H,
g = g + D,
d = d + D * j * (0 + q.x + y.x),
e = e + D * j * (0 + q.y + y.y),
q = B,
f = f + H * (j * (0.25 * (q * q + p * q + p * p) + (0 * q + 0 * p)) + 0 + (j * (0.25 * (z * z + v * z + v * v) + (0 * z + 0 * v)) + 0));
b.mass = c * g;
b.center.Set(d * (1 / g), e * (1 / g));
b.I = c * f
}
};
j.prototype.ComputeSubmergedArea = function(b, c, d, e) {
void 0 === c && (c = 0);
var j = g.MulTMV(d.R, b),
n = c - g.Dot(b, d.position),
q = new Vector_a2j_Number,
y = 0,
B = -1;
c = -1;
var z = !1;
for (b = b = 0; b < this.m_vertexCount; ++b) {
q[b] = g.Dot(j, this.m_vertices[b]) - n;
var C = q[b] < -Number.MIN_VALUE;
0 < b && (C ? z || (B = b - 1, y++) : z && (c = b - 1, y++));
z = C
}
switch (y) {
case 0:
return z ? (b = new f, this.ComputeMass(b, 1), e.SetV(g.MulX(d, b.center)), b.mass) : 0;
case 1:
-1 == B ? B = this.m_vertexCount - 1 : c = this.m_vertexCount - 1
}
b = parseInt((B + 1) % this.m_vertexCount);
j = parseInt((c + 1) % this.m_vertexCount);
n = (0 - q[B]) / (q[b] - q[B]);
q = (0 - q[c]) / (q[j] - q[c]);
B = new A(this.m_vertices[B].x * (1 - n) + this.m_vertices[b].x * n, this.m_vertices[B].y * (1 - n) + this.m_vertices[b].y * n);
c = new A(this.m_vertices[c].x * (1 - q) + this.m_vertices[j].x * q, this.m_vertices[c].y * (1 - q) + this.m_vertices[j].y * q);
q = 0;
n =
new A;
for (y = this.m_vertices[b]; b != j;) b = (b + 1) % this.m_vertexCount, z = b == j ? c : this.m_vertices[b], C = 0.5 * ((y.x - B.x) * (z.y - B.y) - (y.y - B.y) * (z.x - B.x)), q += C, n.x += C * (B.x + y.x + z.x) / 3, n.y += C * (B.y + y.y + z.y) / 3, y = z;
n.Multiply(1 / q);
e.SetV(g.MulX(d, n));
return q
};
j.prototype.GetVertexCount = function() {
return this.m_vertexCount
};
j.prototype.GetVertices = function() {
return this.m_vertices
};
j.prototype.GetNormals = function() {
return this.m_normals
};
j.prototype.GetSupport = function(b) {
for (var c = 0, d = this.m_vertices[0].x * b.x + this.m_vertices[0].y *
b.y, e = 1; e < this.m_vertexCount; ++e) {
var g = this.m_vertices[e].x * b.x + this.m_vertices[e].y * b.y;
g > d && (c = e, d = g)
}
return c
};
j.prototype.GetSupportVertex = function(b) {
for (var c = 0, d = this.m_vertices[0].x * b.x + this.m_vertices[0].y * b.y, e = 1; e < this.m_vertexCount; ++e) {
var g = this.m_vertices[e].x * b.x + this.m_vertices[e].y * b.y;
g > d && (c = e, d = g)
}
return this.m_vertices[c]
};
j.prototype.Validate = function() {
return !1
};
j.prototype.b2PolygonShape = function() {
this.__super.b2Shape.call(this);
this.m_type = q.e_polygonShape;
this.m_centroid = new A;
this.m_vertices = new Vector;
this.m_normals = new Vector
};
j.prototype.Reserve = function(b) {
void 0 === b && (b = 0);
for (var c = parseInt(this.m_vertices.length); c < b; c++) this.m_vertices[c] = new A, this.m_normals[c] = new A
};
j.ComputeCentroid = function(b, c) {
void 0 === c && (c = 0);
for (var d = new A, e = 0, g = 1 / 3, f = 0; f < c; ++f) {
var j = b[f],
n = f + 1 < c ? b[parseInt(f + 1)] : b[0],
q = 0.5 * ((j.x - 0) * (n.y - 0) - (j.y - 0) * (n.x - 0)),
e = e + q;
d.x += q * g * (0 + j.x + n.x);
d.y += q * g * (0 + j.y + n.y)
}
d.x *= 1 / e;
d.y *= 1 / e;
return d
};
j.ComputeOBB = function(b, c, d) {
void 0 === d && (d = 0);
for (var e = 0, g = new Vector(d + 1), e = 0; e < d; ++e) g[e] = c[e];
g[d] = g[0];
c = Number.MAX_VALUE;
for (e = 1; e <= d; ++e) {
for (var f = g[parseInt(e - 1)], j = g[e].x - f.x, n = g[e].y - f.y, q = Math.sqrt(j * j + n * n), j = j / q, n = n / q, y = -n, B = j, z = q = Number.MAX_VALUE, p = -Number.MAX_VALUE, v = -Number.MAX_VALUE, H = 0; H < d; ++H) {
var D = g[H].x - f.x,
N = g[H].y - f.y,
J = j * D + n * N,
D = y * D + B * N;
J < q && (q = J);
D < z && (z = D);
J > p && (p = J);
D > v && (v = D)
}
H = (p - q) * (v - z);
H < 0.95 * c && (c = H, b.R.col1.x = j, b.R.col1.y = n, b.R.col2.x = y, b.R.col2.y = B, j = 0.5 * (q + p), n = 0.5 * (z + v), y = b.R, b.center.x = f.x + (y.col1.x * j + y.col2.x * n), b.center.y = f.y + (y.col1.y * j + y.col2.y * n), b.extents.x = 0.5 * (p - q), b.extents.y = 0.5 * (v - z))
}
};
Box2D.postDefs.push(function() {
Box2D.Collision.Shapes.b2PolygonShape.s_mat = new n
});
q.b2Shape = function() {};
q.prototype.Copy = function() {
return null
};
q.prototype.Set = function(b) {
this.m_radius = b.m_radius
};
q.prototype.GetType = function() {
return this.m_type
};
q.prototype.TestPoint = function() {
return !1
};
q.prototype.RayCast = function() {
return !1
};
q.prototype.ComputeAABB = function() {};
q.prototype.ComputeMass = function() {};
q.prototype.ComputeSubmergedArea = function() {
return 0
};
q.TestOverlap = function(b, c, d, e) {
var g = new B;
g.proxyA = new G;
g.proxyA.Set(b);
g.proxyB = new G;
g.proxyB.Set(d);
g.transformA = c;
g.transformB = e;
g.useRadii = !0;
b = new I;
b.count = 0;
c = new C;
z.Distance(c, b, g);
return c.distance < 10 * Number.MIN_VALUE
};
q.prototype.b2Shape = function() {
this.m_type = q.e_unknownShape;
this.m_radius = b.b2_linearSlop
};
Box2D.postDefs.push(function() {
Box2D.Collision.Shapes.b2Shape.e_unknownShape = -1;
Box2D.Collision.Shapes.b2Shape.e_circleShape = 0;
Box2D.Collision.Shapes.b2Shape.e_polygonShape = 1;
Box2D.Collision.Shapes.b2Shape.e_edgeShape = 2;
Box2D.Collision.Shapes.b2Shape.e_shapeTypeCount = 3;
Box2D.Collision.Shapes.b2Shape.e_hitCollide = 1;
Box2D.Collision.Shapes.b2Shape.e_missCollide = 0;
Box2D.Collision.Shapes.b2Shape.e_startsInsideCollide = -1
})
})();
(function() {
var b = Box2D.Common.b2Color,
c = Box2D.Common.b2Settings,
d = Box2D.Common.Math.b2Math;
b.b2Color = function() {
this._b = this._g = this._r = 0
};
b.prototype.b2Color = function(b, c, j) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
void 0 === j && (j = 0);
this._r = Box2D.parseUInt(255 * d.Clamp(b, 0, 1));
this._g = Box2D.parseUInt(255 * d.Clamp(c, 0, 1));
this._b = Box2D.parseUInt(255 * d.Clamp(j, 0, 1))
};
b.prototype.Set = function(b, c, j) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
void 0 === j && (j = 0);
this._r = Box2D.parseUInt(255 * d.Clamp(b, 0, 1));
this._g = Box2D.parseUInt(255 * d.Clamp(c, 0, 1));
this._b = Box2D.parseUInt(255 * d.Clamp(j, 0, 1))
};
Object.defineProperty(b.prototype, "r", {
enumerable: !1,
configurable: !0,
set: function(b) {
void 0 === b && (b = 0);
this._r = Box2D.parseUInt(255 * d.Clamp(b, 0, 1))
}
});
Object.defineProperty(b.prototype, "g", {
enumerable: !1,
configurable: !0,
set: function(b) {
void 0 === b && (b = 0);
this._g = Box2D.parseUInt(255 * d.Clamp(b, 0, 1))
}
});
Object.defineProperty(b.prototype, "b", {
enumerable: !1,
configurable: !0,
set: function(b) {
void 0 === b && (b = 0);
this._b = Box2D.parseUInt(255 * d.Clamp(b, 0, 1))
}
});
Object.defineProperty(b.prototype, "color", {
enumerable: !1,
configurable: !0,
get: function() {
return this._r << 16 | this._g << 8 | this._b
}
});
c.b2Settings = function() {};
c.b2MixFriction = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
return Math.sqrt(b * c)
};
c.b2MixRestitution = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
return b > c ? b : c
};
c.b2Assert = function(b) {
if (!b) throw "Assertion Failed";
};
Box2D.postDefs.push(function() {
Box2D.Common.b2Settings.VERSION = "2.1alpha";
Box2D.Common.b2Settings.USHRT_MAX = 65535;
Box2D.Common.b2Settings.b2_pi = Math.PI;
Box2D.Common.b2Settings.b2_maxManifoldPoints = 2;
Box2D.Common.b2Settings.b2_aabbExtension = 0.1;
Box2D.Common.b2Settings.b2_aabbMultiplier = 2;
Box2D.Common.b2Settings.b2_polygonRadius = 2 * c.b2_linearSlop;
Box2D.Common.b2Settings.b2_linearSlop = 0.0050;
Box2D.Common.b2Settings.b2_angularSlop = 2 / 180 * c.b2_pi;
Box2D.Common.b2Settings.b2_toiSlop = 8 * c.b2_linearSlop;
Box2D.Common.b2Settings.b2_maxTOIContactsPerIsland = 32;
Box2D.Common.b2Settings.b2_maxTOIJointsPerIsland = 32;
Box2D.Common.b2Settings.b2_velocityThreshold = 1;
Box2D.Common.b2Settings.b2_maxLinearCorrection = 0.2;
Box2D.Common.b2Settings.b2_maxAngularCorrection = 8 / 180 * c.b2_pi;
Box2D.Common.b2Settings.b2_maxTranslation = 2;
Box2D.Common.b2Settings.b2_maxTranslationSquared = c.b2_maxTranslation * c.b2_maxTranslation;
Box2D.Common.b2Settings.b2_maxRotation = 0.5 * c.b2_pi;
Box2D.Common.b2Settings.b2_maxRotationSquared = c.b2_maxRotation * c.b2_maxRotation;
Box2D.Common.b2Settings.b2_contactBaumgarte = 0.2;
Box2D.Common.b2Settings.b2_timeToSleep = 0.5;
Box2D.Common.b2Settings.b2_linearSleepTolerance = 0.01;
Box2D.Common.b2Settings.b2_angularSleepTolerance = 2 / 180 * c.b2_pi
})
})();
(function() {
var b = Box2D.Common.Math.b2Mat22,
c = Box2D.Common.Math.b2Mat33,
d = Box2D.Common.Math.b2Math,
e = Box2D.Common.Math.b2Sweep,
f = Box2D.Common.Math.b2Transform,
j = Box2D.Common.Math.b2Vec2,
q = Box2D.Common.Math.b2Vec3;
b.b2Mat22 = function() {
this.col1 = new j;
this.col2 = new j
};
b.prototype.b2Mat22 = function() {
this.SetIdentity()
};
b.FromAngle = function(c) {
void 0 === c && (c = 0);
var d = new b;
d.Set(c);
return d
};
b.FromVV = function(c, d) {
var e = new b;
e.SetVV(c, d);
return e
};
b.prototype.Set = function(b) {
void 0 === b && (b = 0);
var c = Math.cos(b);
b = Math.sin(b);
this.col1.x = c;
this.col2.x = -b;
this.col1.y = b;
this.col2.y = c
};
b.prototype.SetVV = function(b, c) {
this.col1.SetV(b);
this.col2.SetV(c)
};
b.prototype.Copy = function() {
var c = new b;
c.SetM(this);
return c
};
b.prototype.SetM = function(b) {
this.col1.SetV(b.col1);
this.col2.SetV(b.col2)
};
b.prototype.AddM = function(b) {
this.col1.x += b.col1.x;
this.col1.y += b.col1.y;
this.col2.x += b.col2.x;
this.col2.y += b.col2.y
};
b.prototype.SetIdentity = function() {
this.col1.x = 1;
this.col2.x = 0;
this.col1.y = 0;
this.col2.y = 1
};
b.prototype.SetZero = function() {
this.col1.x = 0;
this.col2.x = 0;
this.col1.y = 0;
this.col2.y = 0
};
b.prototype.GetAngle = function() {
return Math.atan2(this.col1.y, this.col1.x)
};
b.prototype.GetInverse = function(b) {
var c = this.col1.x,
d = this.col2.x,
e = this.col1.y,
f = this.col2.y,
j = c * f - d * e;
0 != j && (j = 1 / j);
b.col1.x = j * f;
b.col2.x = -j * d;
b.col1.y = -j * e;
b.col2.y = j * c;
return b
};
b.prototype.Solve = function(b, c, d) {
void 0 === c && (c = 0);
void 0 === d && (d = 0);
var e = this.col1.x,
f = this.col2.x,
j = this.col1.y,
q = this.col2.y,
G = e * q - f * j;
0 != G && (G = 1 / G);
b.x = G * (q * c - f * d);
b.y = G * (e * d - j * c);
return b
};
b.prototype.Abs = function() {
this.col1.Abs();
this.col2.Abs()
};
c.b2Mat33 = function() {
this.col1 = new q;
this.col2 = new q;
this.col3 = new q
};
c.prototype.b2Mat33 = function(b, c, d) {
void 0 === b && (b = null);
void 0 === c && (c = null);
void 0 === d && (d = null);
!b && !c && !d ? (this.col1.SetZero(), this.col2.SetZero(), this.col3.SetZero()) : (this.col1.SetV(b), this.col2.SetV(c), this.col3.SetV(d))
};
c.prototype.SetVVV = function(b, c, d) {
this.col1.SetV(b);
this.col2.SetV(c);
this.col3.SetV(d)
};
c.prototype.Copy = function() {
return new c(this.col1, this.col2, this.col3)
};
c.prototype.SetM = function(b) {
this.col1.SetV(b.col1);
this.col2.SetV(b.col2);
this.col3.SetV(b.col3)
};
c.prototype.AddM = function(b) {
this.col1.x += b.col1.x;
this.col1.y += b.col1.y;
this.col1.z += b.col1.z;
this.col2.x += b.col2.x;
this.col2.y += b.col2.y;
this.col2.z += b.col2.z;
this.col3.x += b.col3.x;
this.col3.y += b.col3.y;
this.col3.z += b.col3.z
};
c.prototype.SetIdentity = function() {
this.col1.x = 1;
this.col2.x = 0;
this.col3.x = 0;
this.col1.y = 0;
this.col2.y = 1;
this.col3.y = 0;
this.col1.z = 0;
this.col2.z = 0;
this.col3.z = 1
};
c.prototype.SetZero = function() {
this.col1.x = 0;
this.col2.x = 0;
this.col3.x = 0;
this.col1.y = 0;
this.col2.y = 0;
this.col3.y = 0;
this.col1.z = 0;
this.col2.z = 0;
this.col3.z = 0
};
c.prototype.Solve22 = function(b, c, d) {
void 0 === c && (c = 0);
void 0 === d && (d = 0);
var e = this.col1.x,
f = this.col2.x,
j = this.col1.y,
q = this.col2.y,
G = e * q - f * j;
0 != G && (G = 1 / G);
b.x = G * (q * c - f * d);
b.y = G * (e * d - j * c);
return b
};
c.prototype.Solve33 = function(b, c, d, e) {
void 0 === c && (c = 0);
void 0 === d && (d = 0);
void 0 === e && (e = 0);
var f = this.col1.x,
j = this.col1.y,
q = this.col1.z,
G = this.col2.x,
I = this.col2.y,
u = this.col2.z,
L = this.col3.x,
E = this.col3.y,
Q = this.col3.z,
M = f * (I * Q - u * E) + j * (u * L - G * Q) + q * (G * E - I * L);
0 != M && (M = 1 / M);
b.x = M * (c * (I * Q - u * E) + d * (u * L - G * Q) + e * (G * E - I * L));
b.y = M * (f * (d * Q - e * E) + j * (e * L - c * Q) + q * (c * E - d * L));
b.z = M * (f * (I * e - u * d) + j * (u * c - G * e) + q * (G * d - I * c));
return b
};
d.b2Math = function() {};
d.IsValid = function(b) {
void 0 === b && (b = 0);
return isFinite(b)
};
d.Dot = function(b, c) {
return b.x * c.x + b.y * c.y
};
d.CrossVV = function(b, c) {
return b.x * c.y - b.y * c.x
};
d.CrossVF = function(b, c) {
void 0 === c && (c = 0);
return new j(c * b.y, -c * b.x)
};
d.CrossFV = function(b, c) {
void 0 === b && (b = 0);
return new j(-b * c.y, b * c.x)
};
d.MulMV = function(b, c) {
return new j(b.col1.x * c.x + b.col2.x * c.y, b.col1.y * c.x + b.col2.y * c.y)
};
d.MulTMV = function(b, c) {
return new j(d.Dot(c, b.col1), d.Dot(c, b.col2))
};
d.MulX = function(b, c) {
var e = d.MulMV(b.R, c);
e.x += b.position.x;
e.y += b.position.y;
return e
};
d.MulXT = function(b, c) {
var e = d.SubtractVV(c, b.position),
f = e.x * b.R.col1.x + e.y * b.R.col1.y;
e.y = e.x * b.R.col2.x + e.y * b.R.col2.y;
e.x = f;
return e
};
d.AddVV = function(b, c) {
return new j(b.x + c.x, b.y + c.y)
};
d.SubtractVV = function(b, c) {
return new j(b.x - c.x, b.y - c.y)
};
d.Distance = function(b, c) {
var d = b.x - c.x,
e = b.y - c.y;
return Math.sqrt(d * d + e * e)
};
d.DistanceSquared = function(b, c) {
var d = b.x - c.x,
e = b.y - c.y;
return d * d + e * e
};
d.MulFV = function(b, c) {
void 0 === b && (b = 0);
return new j(b * c.x, b * c.y)
};
d.AddMM = function(c, e) {
return b.FromVV(d.AddVV(c.col1, e.col1), d.AddVV(c.col2, e.col2))
};
d.MulMM = function(c, e) {
return b.FromVV(d.MulMV(c, e.col1), d.MulMV(c, e.col2))
};
d.MulTMM = function(c, e) {
var f = new j(d.Dot(c.col1, e.col1), d.Dot(c.col2, e.col1)),
q = new j(d.Dot(c.col1, e.col2), d.Dot(c.col2, e.col2));
return b.FromVV(f, q)
};
d.Abs = function(b) {
void 0 === b && (b = 0);
return 0 < b ? b : -b
};
d.AbsV = function(b) {
return new j(d.Abs(b.x), d.Abs(b.y))
};
d.AbsM = function(c) {
return b.FromVV(d.AbsV(c.col1), d.AbsV(c.col2))
};
d.Min = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
return b < c ? b : c
};
d.MinV = function(b, c) {
return new j(d.Min(b.x, c.x), d.Min(b.y, c.y))
};
d.Max = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
return b > c ? b : c
};
d.MaxV = function(b, c) {
return new j(d.Max(b.x, c.x), d.Max(b.y, c.y))
};
d.Clamp = function(b, c, d) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
void 0 === d && (d = 0);
return b < c ? c : b > d ? d : b
};
d.ClampV = function(b, c, e) {
return d.MaxV(c, d.MinV(b, e))
};
d.Swap = function(b, c) {
var d = b[0];
b[0] = c[0];
c[0] = d
};
d.Random = function() {
return 2 * Math.random() - 1
};
d.RandomRange = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
var d = Math.random();
return (c - b) * d + b
};
d.NextPowerOfTwo = function(b) {
void 0 === b && (b = 0);
b |= b >> 1 & 2147483647;
b |= b >> 2 & 1073741823;
b |= b >> 4 & 268435455;
b |= b >> 8 & 16777215;
return (b | b >> 16 & 65535) + 1
};
d.IsPowerOfTwo = function(b) {
void 0 === b && (b = 0);
return 0 < b && 0 == (b & b - 1)
};
Box2D.postDefs.push(function() {
Box2D.Common.Math.b2Math.b2Vec2_zero = new j(0, 0);
Box2D.Common.Math.b2Math.b2Mat22_identity = b.FromVV(new j(1, 0), new j(0, 1));
Box2D.Common.Math.b2Math.b2Transform_identity = new f(d.b2Vec2_zero, d.b2Mat22_identity)
});
e.b2Sweep = function() {
this.localCenter = new j;
this.c0 = new j;
this.c = new j
};
e.prototype.Set = function(b) {
this.localCenter.SetV(b.localCenter);
this.c0.SetV(b.c0);
this.c.SetV(b.c);
this.a0 = b.a0;
this.a = b.a;
this.t0 = b.t0
};
e.prototype.Copy = function() {
var b = new e;
b.localCenter.SetV(this.localCenter);
b.c0.SetV(this.c0);
b.c.SetV(this.c);
b.a0 = this.a0;
b.a = this.a;
b.t0 = this.t0;
return b
};
e.prototype.GetTransform = function(b, c) {
void 0 === c && (c = 0);
b.position.x = (1 - c) * this.c0.x + c * this.c.x;
b.position.y = (1 - c) * this.c0.y + c * this.c.y;
b.R.Set((1 - c) * this.a0 + c * this.a);
var d = b.R;
b.position.x -= d.col1.x * this.localCenter.x + d.col2.x * this.localCenter.y;
b.position.y -= d.col1.y * this.localCenter.x + d.col2.y * this.localCenter.y
};
e.prototype.Advance = function(b) {
void 0 === b && (b = 0);
if (this.t0 < b && 1 - this.t0 > Number.MIN_VALUE) {
var c = (b - this.t0) / (1 - this.t0);
this.c0.x = (1 - c) * this.c0.x + c * this.c.x;
this.c0.y = (1 - c) * this.c0.y + c * this.c.y;
this.a0 = (1 - c) * this.a0 + c * this.a;
this.t0 = b
}
};
f.b2Transform = function() {
this.position = new j;
this.R = new b
};
f.prototype.b2Transform = function(b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
b && (this.position.SetV(b), this.R.SetM(c))
};
f.prototype.Initialize = function(b,
c) {
this.position.SetV(b);
this.R.SetM(c)
};
f.prototype.SetIdentity = function() {
this.position.SetZero();
this.R.SetIdentity()
};
f.prototype.Set = function(b) {
this.position.SetV(b.position);
this.R.SetM(b.R)
};
f.prototype.GetAngle = function() {
return Math.atan2(this.R.col1.y, this.R.col1.x)
};
j.b2Vec2 = function() {};
j.prototype.b2Vec2 = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
this.x = b;
this.y = c
};
j.prototype.SetZero = function() {
this.y = this.x = 0
};
j.prototype.Set = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
this.x = b;
this.y = c
};
j.prototype.SetV = function(b) {
this.x = b.x;
this.y = b.y
};
j.prototype.GetNegative = function() {
return new j(-this.x, -this.y)
};
j.prototype.NegativeSelf = function() {
this.x = -this.x;
this.y = -this.y
};
j.Make = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
return new j(b, c)
};
j.prototype.Copy = function() {
return new j(this.x, this.y)
};
j.prototype.Add = function(b) {
this.x += b.x;
this.y += b.y
};
j.prototype.Subtract = function(b) {
this.x -= b.x;
this.y -= b.y
};
j.prototype.Multiply = function(b) {
void 0 === b && (b = 0);
this.x *= b;
this.y *= b
};
j.prototype.MulM = function(b) {
var c = this.x;
this.x = b.col1.x * c + b.col2.x * this.y;
this.y = b.col1.y * c + b.col2.y * this.y
};
j.prototype.MulTM = function(b) {
var c = d.Dot(this, b.col1);
this.y = d.Dot(this, b.col2);
this.x = c
};
j.prototype.CrossVF = function(b) {
void 0 === b && (b = 0);
var c = this.x;
this.x = b * this.y;
this.y = -b * c
};
j.prototype.CrossFV = function(b) {
void 0 === b && (b = 0);
var c = this.x;
this.x = -b * this.y;
this.y = b * c
};
j.prototype.MinV = function(b) {
this.x = this.x < b.x ? this.x : b.x;
this.y = this.y < b.y ? this.y : b.y
};
j.prototype.MaxV = function(b) {
this.x = this.x > b.x ? this.x : b.x;
this.y = this.y > b.y ? this.y : b.y
};
j.prototype.Abs = function() {
0 > this.x && (this.x = -this.x);
0 > this.y && (this.y = -this.y)
};
j.prototype.Length = function() {
return Math.sqrt(this.x * this.x + this.y * this.y)
};
j.prototype.LengthSquared = function() {
return this.x * this.x + this.y * this.y
};
j.prototype.Normalize = function() {
var b = Math.sqrt(this.x * this.x + this.y * this.y);
if (b < Number.MIN_VALUE) return 0;
var c = 1 / b;
this.x *= c;
this.y *= c;
return b
};
j.prototype.IsValid = function() {
return d.IsValid(this.x) && d.IsValid(this.y)
};
q.b2Vec3 = function() {};
q.prototype.b2Vec3 = function(b, c, d) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
void 0 === d && (d = 0);
this.x = b;
this.y = c;
this.z = d
};
q.prototype.SetZero = function() {
this.x = this.y = this.z = 0
};
q.prototype.Set = function(b, c, d) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
void 0 === d && (d = 0);
this.x = b;
this.y = c;
this.z = d
};
q.prototype.SetV = function(b) {
this.x = b.x;
this.y = b.y;
this.z = b.z
};
q.prototype.GetNegative = function() {
return new q(-this.x, -this.y, -this.z)
};
q.prototype.NegativeSelf = function() {
this.x = -this.x;
this.y = -this.y;
this.z = -this.z
};
q.prototype.Copy = function() {
return new q(this.x, this.y, this.z)
};
q.prototype.Add = function(b) {
this.x += b.x;
this.y += b.y;
this.z += b.z
};
q.prototype.Subtract = function(b) {
this.x -= b.x;
this.y -= b.y;
this.z -= b.z
};
q.prototype.Multiply = function(b) {
void 0 === b && (b = 0);
this.x *= b;
this.y *= b;
this.z *= b
}
})();
(function() {
var b = Box2D.Common.Math.b2Math,
c = Box2D.Common.Math.b2Sweep,
d = Box2D.Common.Math.b2Transform,
e = Box2D.Common.Math.b2Vec2,
f = Box2D.Common.b2Color,
j = Box2D.Common.b2Settings,
q = Box2D.Collision.b2AABB,
n = Box2D.Collision.b2ContactPoint,
g = Box2D.Collision.b2DynamicTreeBroadPhase,
y = Box2D.Collision.b2RayCastInput,
A = Box2D.Collision.b2RayCastOutput,
z = Box2D.Collision.Shapes.b2CircleShape,
B = Box2D.Collision.Shapes.b2EdgeShape,
C = Box2D.Collision.Shapes.b2MassData,
G = Box2D.Collision.Shapes.b2PolygonShape,
I = Box2D.Collision.Shapes.b2Shape,
u = Box2D.Dynamics.b2Body,
L = Box2D.Dynamics.b2BodyDef,
E = Box2D.Dynamics.b2ContactFilter,
Q = Box2D.Dynamics.b2ContactImpulse,
M = Box2D.Dynamics.b2ContactListener,
R = Box2D.Dynamics.b2ContactManager,
K = Box2D.Dynamics.b2DebugDraw,
X = Box2D.Dynamics.b2DestructionListener,
P = Box2D.Dynamics.b2FilterData,
S = Box2D.Dynamics.b2Fixture,
Z = Box2D.Dynamics.b2FixtureDef,
U = Box2D.Dynamics.b2Island,
p = Box2D.Dynamics.b2TimeStep,
v = Box2D.Dynamics.b2World,
H = Box2D.Dynamics.Contacts.b2Contact,
D = Box2D.Dynamics.Contacts.b2ContactFactory,
N = Box2D.Dynamics.Contacts.b2ContactSolver,
J = Box2D.Dynamics.Joints.b2Joint,
V = Box2D.Dynamics.Joints.b2PulleyJoint;
u.b2Body = function() {
this.m_xf = new d;
this.m_sweep = new c;
this.m_linearVelocity = new e;
this.m_force = new e
};
u.prototype.connectEdges = function(c, d, e) {
void 0 === e && (e = 0);
var f = Math.atan2(d.GetDirectionVector().y, d.GetDirectionVector().x);
e = b.MulFV(Math.tan(0.5 * (f - e)), d.GetDirectionVector());
e = b.SubtractVV(e, d.GetNormalVector());
e = b.MulFV(j.b2_toiSlop, e);
e = b.AddVV(e, d.GetVertex1());
var g = b.AddVV(c.GetDirectionVector(), d.GetDirectionVector());
g.Normalize();
var p = 0 < b.Dot(c.GetDirectionVector(), d.GetNormalVector());
c.SetNextEdge(d, e, g, p);
d.SetPrevEdge(c, e, g, p);
return f
};
u.prototype.CreateFixture = function(b) {
if (!0 == this.m_world.IsLocked()) return null;
var c = new S;
c.Create(this, this.m_xf, b);
this.m_flags & u.e_activeFlag && c.CreateProxy(this.m_world.m_contactManager.m_broadPhase, this.m_xf);
c.m_next = this.m_fixtureList;
this.m_fixtureList = c;
++this.m_fixtureCount;
c.m_body = this;
0 < c.m_density && this.ResetMassData();
this.m_world.m_flags |= v.e_newFixture;
return c
};
u.prototype.CreateFixture2 = function(b, c) {
void 0 === c && (c = 0);
var d = new Z;
d.shape = b;
d.density = c;
return this.CreateFixture(d)
};
u.prototype.DestroyFixture = function(b) {
if (!0 != this.m_world.IsLocked()) {
for (var c = this.m_fixtureList, d = null; null != c;) {
if (c == b) {
d ? d.m_next = b.m_next : this.m_fixtureList = b.m_next;
break
}
d = c;
c = c.m_next
}
for (c = this.m_contactList; c;) {
var d = c.contact,
c = c.next,
e = d.GetFixtureA(),
f = d.GetFixtureB();
(b == e || b == f) && this.m_world.m_contactManager.Destroy(d)
}
this.m_flags & u.e_activeFlag && b.DestroyProxy(this.m_world.m_contactManager.m_broadPhase);
b.Destroy();
b.m_body = null;
b.m_next = null;
--this.m_fixtureCount;
this.ResetMassData()
}
};
u.prototype.SetPositionAndAngle = function(b, c) {
void 0 === c && (c = 0);
var d;
if (!0 != this.m_world.IsLocked()) {
this.m_xf.R.Set(c);
this.m_xf.position.SetV(b);
d = this.m_xf.R;
var e = this.m_sweep.localCenter;
this.m_sweep.c.x = d.col1.x * e.x + d.col2.x * e.y;
this.m_sweep.c.y = d.col1.y * e.x + d.col2.y * e.y;
this.m_sweep.c.x += this.m_xf.position.x;
this.m_sweep.c.y += this.m_xf.position.y;
this.m_sweep.c0.SetV(this.m_sweep.c);
this.m_sweep.a0 = this.m_sweep.a = c;
e = this.m_world.m_contactManager.m_broadPhase;
for (d = this.m_fixtureList; d; d = d.m_next) d.Synchronize(e, this.m_xf, this.m_xf);
this.m_world.m_contactManager.FindNewContacts()
}
};
u.prototype.SetTransform = function(b) {
this.SetPositionAndAngle(b.position, b.GetAngle())
};
u.prototype.GetTransform = function() {
return this.m_xf
};
u.prototype.GetPosition = function() {
return this.m_xf.position
};
u.prototype.SetPosition = function(b) {
this.SetPositionAndAngle(b, this.GetAngle())
};
u.prototype.GetAngle = function() {
return this.m_sweep.a
};
u.prototype.SetAngle = function(b) {
void 0 === b && (b = 0);
this.SetPositionAndAngle(this.GetPosition(), b)
};
u.prototype.GetWorldCenter = function() {
return this.m_sweep.c
};
u.prototype.GetLocalCenter = function() {
return this.m_sweep.localCenter
};
u.prototype.SetLinearVelocity = function(b) {
this.m_type != u.b2_staticBody && this.m_linearVelocity.SetV(b)
};
u.prototype.GetLinearVelocity = function() {
return this.m_linearVelocity
};
u.prototype.SetAngularVelocity = function(b) {
void 0 === b && (b = 0);
this.m_type != u.b2_staticBody && (this.m_angularVelocity = b)
};
u.prototype.GetAngularVelocity = function() {
return this.m_angularVelocity
};
u.prototype.GetDefinition = function() {
var b = new L;
b.type = this.GetType();
b.allowSleep = (this.m_flags & u.e_allowSleepFlag) == u.e_allowSleepFlag;
b.angle = this.GetAngle();
b.angularDamping = this.m_angularDamping;
b.angularVelocity = this.m_angularVelocity;
b.fixedRotation = (this.m_flags & u.e_fixedRotationFlag) == u.e_fixedRotationFlag;
b.bullet = (this.m_flags & u.e_bulletFlag) == u.e_bulletFlag;
b.awake = (this.m_flags & u.e_awakeFlag) == u.e_awakeFlag;
b.linearDamping = this.m_linearDamping;
b.linearVelocity.SetV(this.GetLinearVelocity());
b.position = this.GetPosition();
b.userData = this.GetUserData();
return b
};
u.prototype.ApplyForce = function(b, c) {
this.m_type == u.b2_dynamicBody && (!1 == this.IsAwake() && this.SetAwake(!0), this.m_force.x += b.x, this.m_force.y += b.y, this.m_torque += (c.x - this.m_sweep.c.x) * b.y - (c.y - this.m_sweep.c.y) * b.x)
};
u.prototype.ApplyTorque = function(b) {
void 0 === b && (b = 0);
this.m_type == u.b2_dynamicBody && (!1 == this.IsAwake() && this.SetAwake(!0), this.m_torque += b)
};
u.prototype.ApplyImpulse = function(b, c) {
this.m_type == u.b2_dynamicBody && (!1 == this.IsAwake() && this.SetAwake(!0), this.m_linearVelocity.x += this.m_invMass * b.x, this.m_linearVelocity.y += this.m_invMass * b.y, this.m_angularVelocity += this.m_invI * ((c.x - this.m_sweep.c.x) * b.y - (c.y - this.m_sweep.c.y) * b.x))
};
u.prototype.Split = function(c) {
for (var d = this.GetLinearVelocity().Copy(), e = this.GetAngularVelocity(), f = this.GetWorldCenter(), g = this.m_world.CreateBody(this.GetDefinition()), p, j = this.m_fixtureList; j;)
if (c(j)) {
var v = j.m_next;
p ? p.m_next = v : this.m_fixtureList = v;
this.m_fixtureCount--;
j.m_next = g.m_fixtureList;
g.m_fixtureList = j;
g.m_fixtureCount++;
j.m_body = g;
j = v
} else p = j, j = j.m_next;
this.ResetMassData();
g.ResetMassData();
p = this.GetWorldCenter();
c = g.GetWorldCenter();
p = b.AddVV(d, b.CrossFV(e, b.SubtractVV(p, f)));
d = b.AddVV(d, b.CrossFV(e, b.SubtractVV(c, f)));
this.SetLinearVelocity(p);
g.SetLinearVelocity(d);
this.SetAngularVelocity(e);
g.SetAngularVelocity(e);
this.SynchronizeFixtures();
g.SynchronizeFixtures();
return g
};
u.prototype.Merge = function(b) {
var c;
for (c = b.m_fixtureList; c;) {
var d = c.m_next;
b.m_fixtureCount--;
c.m_next = this.m_fixtureList;
this.m_fixtureList = c;
this.m_fixtureCount++;
c.m_body = f;
c = d
}
e.m_fixtureCount = 0;
var e = this,
f = b;
e.GetWorldCenter();
f.GetWorldCenter();
e.GetLinearVelocity().Copy();
f.GetLinearVelocity().Copy();
e.GetAngularVelocity();
f.GetAngularVelocity();
e.ResetMassData();
this.SynchronizeFixtures()
};
u.prototype.GetMass = function() {
return this.m_mass
};
u.prototype.GetInertia = function() {
return this.m_I
};
u.prototype.GetMassData = function(b) {
b.mass = this.m_mass;
b.I = this.m_I;
b.center.SetV(this.m_sweep.localCenter)
};
u.prototype.SetMassData = function(c) {
j.b2Assert(!1 == this.m_world.IsLocked());
if (!0 != this.m_world.IsLocked() && this.m_type == u.b2_dynamicBody) {
this.m_invI = this.m_I = this.m_invMass = 0;
this.m_mass = c.mass;
0 >= this.m_mass && (this.m_mass = 1);
this.m_invMass = 1 / this.m_mass;
0 < c.I && 0 == (this.m_flags & u.e_fixedRotationFlag) && (this.m_I = c.I - this.m_mass * (c.center.x * c.center.x + c.center.y * c.center.y), this.m_invI = 1 / this.m_I);
var d = this.m_sweep.c.Copy();
this.m_sweep.localCenter.SetV(c.center);
this.m_sweep.c0.SetV(b.MulX(this.m_xf, this.m_sweep.localCenter));
this.m_sweep.c.SetV(this.m_sweep.c0);
this.m_linearVelocity.x += this.m_angularVelocity * -(this.m_sweep.c.y - d.y);
this.m_linearVelocity.y += this.m_angularVelocity * +(this.m_sweep.c.x - d.x)
}
};
u.prototype.ResetMassData = function() {
this.m_invI = this.m_I = this.m_invMass = this.m_mass = 0;
this.m_sweep.localCenter.SetZero();
if (!(this.m_type == u.b2_staticBody || this.m_type == u.b2_kinematicBody)) {
for (var c = e.Make(0, 0), d = this.m_fixtureList; d; d = d.m_next)
if (0 != d.m_density) {
var f = d.GetMassData();
this.m_mass += f.mass;
c.x += f.center.x * f.mass;
c.y += f.center.y * f.mass;
this.m_I += f.I
}
0 < this.m_mass ? (this.m_invMass = 1 / this.m_mass, c.x *= this.m_invMass, c.y *= this.m_invMass) : this.m_invMass = this.m_mass = 1;
0 < this.m_I && 0 == (this.m_flags & u.e_fixedRotationFlag) ? (this.m_I -= this.m_mass * (c.x * c.x + c.y * c.y), this.m_I *= this.m_inertiaScale, j.b2Assert(0 < this.m_I), this.m_invI = 1 /
this.m_I) : this.m_invI = this.m_I = 0;
d = this.m_sweep.c.Copy();
this.m_sweep.localCenter.SetV(c);
this.m_sweep.c0.SetV(b.MulX(this.m_xf, this.m_sweep.localCenter));
this.m_sweep.c.SetV(this.m_sweep.c0);
this.m_linearVelocity.x += this.m_angularVelocity * -(this.m_sweep.c.y - d.y);
this.m_linearVelocity.y += this.m_angularVelocity * +(this.m_sweep.c.x - d.x)
}
};
u.prototype.GetWorldPoint = function(b) {
var c = this.m_xf.R;
b = new e(c.col1.x * b.x + c.col2.x * b.y, c.col1.y * b.x + c.col2.y * b.y);
b.x += this.m_xf.position.x;
b.y += this.m_xf.position.y;
return b
};
u.prototype.GetWorldVector = function(c) {
return b.MulMV(this.m_xf.R, c)
};
u.prototype.GetLocalPoint = function(c) {
return b.MulXT(this.m_xf, c)
};
u.prototype.GetLocalVector = function(c) {
return b.MulTMV(this.m_xf.R, c)
};
u.prototype.GetLinearVelocityFromWorldPoint = function(b) {
return new e(this.m_linearVelocity.x - this.m_angularVelocity * (b.y - this.m_sweep.c.y), this.m_linearVelocity.y + this.m_angularVelocity * (b.x - this.m_sweep.c.x))
};
u.prototype.GetLinearVelocityFromLocalPoint = function(b) {
var c = this.m_xf.R;
b = new e(c.col1.x * b.x + c.col2.x * b.y, c.col1.y * b.x + c.col2.y * b.y);
b.x += this.m_xf.position.x;
b.y += this.m_xf.position.y;
return new e(this.m_linearVelocity.x - this.m_angularVelocity * (b.y - this.m_sweep.c.y), this.m_linearVelocity.y + this.m_angularVelocity * (b.x - this.m_sweep.c.x))
};
u.prototype.GetLinearDamping = function() {
return this.m_linearDamping
};
u.prototype.SetLinearDamping = function(b) {
void 0 === b && (b = 0);
this.m_linearDamping = b
};
u.prototype.GetAngularDamping = function() {
return this.m_angularDamping
};
u.prototype.SetAngularDamping = function(b) {
void 0 === b && (b = 0);
this.m_angularDamping = b
};
u.prototype.SetType = function(b) {
void 0 === b && (b = 0);
if (this.m_type != b) {
this.m_type = b;
this.ResetMassData();
this.m_type == u.b2_staticBody && (this.m_linearVelocity.SetZero(), this.m_angularVelocity = 0);
this.SetAwake(!0);
this.m_force.SetZero();
this.m_torque = 0;
for (b = this.m_contactList; b; b = b.next) b.contact.FlagForFiltering()
}
};
u.prototype.GetType = function() {
return this.m_type
};
u.prototype.SetBullet = function(b) {
this.m_flags = b ? this.m_flags | u.e_bulletFlag : this.m_flags & ~u.e_bulletFlag
};
u.prototype.IsBullet = function() {
return (this.m_flags & u.e_bulletFlag) == u.e_bulletFlag
};
u.prototype.SetSleepingAllowed = function(b) {
b ? this.m_flags |= u.e_allowSleepFlag : (this.m_flags &= ~u.e_allowSleepFlag, this.SetAwake(!0))
};
u.prototype.SetAwake = function(b) {
b ? (this.m_flags |= u.e_awakeFlag, this.m_sleepTime = 0) : (this.m_flags &= ~u.e_awakeFlag, this.m_sleepTime = 0, this.m_linearVelocity.SetZero(), this.m_angularVelocity = 0, this.m_force.SetZero(), this.m_torque = 0)
};
u.prototype.IsAwake = function() {
return (this.m_flags & u.e_awakeFlag) == u.e_awakeFlag
};
u.prototype.SetFixedRotation = function(b) {
this.m_flags = b ? this.m_flags | u.e_fixedRotationFlag : this.m_flags & ~u.e_fixedRotationFlag;
this.ResetMassData()
};
u.prototype.IsFixedRotation = function() {
return (this.m_flags & u.e_fixedRotationFlag) == u.e_fixedRotationFlag
};
u.prototype.SetActive = function(b) {
if (b != this.IsActive()) {
var c;
if (b) {
this.m_flags |= u.e_activeFlag;
b = this.m_world.m_contactManager.m_broadPhase;
for (c = this.m_fixtureList; c; c = c.m_next) c.CreateProxy(b, this.m_xf)
} else {
this.m_flags &= ~u.e_activeFlag;
b = this.m_world.m_contactManager.m_broadPhase;
for (c = this.m_fixtureList; c; c = c.m_next) c.DestroyProxy(b);
for (b = this.m_contactList; b;) c = b, b = b.next, this.m_world.m_contactManager.Destroy(c.contact);
this.m_contactList = null
}
}
};
u.prototype.IsActive = function() {
return (this.m_flags & u.e_activeFlag) == u.e_activeFlag
};
u.prototype.IsSleepingAllowed = function() {
return (this.m_flags & u.e_allowSleepFlag) == u.e_allowSleepFlag
};
u.prototype.GetFixtureList = function() {
return this.m_fixtureList
};
u.prototype.GetJointList = function() {
return this.m_jointList
};
u.prototype.GetControllerList = function() {
return this.m_controllerList
};
u.prototype.GetContactList = function() {
return this.m_contactList
};
u.prototype.GetNext = function() {
return this.m_next
};
u.prototype.GetUserData = function() {
return this.m_userData
};
u.prototype.SetUserData = function(b) {
this.m_userData = b
};
u.prototype.GetWorld = function() {
return this.m_world
};
u.prototype.b2Body = function(b, c) {
this.m_flags = 0;
b.bullet && (this.m_flags |= u.e_bulletFlag);
b.fixedRotation && (this.m_flags |= u.e_fixedRotationFlag);
b.allowSleep && (this.m_flags |= u.e_allowSleepFlag);
b.awake && (this.m_flags |= u.e_awakeFlag);
b.active && (this.m_flags |= u.e_activeFlag);
this.m_world = c;
this.m_xf.position.SetV(b.position);
this.m_xf.R.Set(b.angle);
this.m_sweep.localCenter.SetZero();
this.m_sweep.t0 = 1;
this.m_sweep.a0 = this.m_sweep.a = b.angle;
var d = this.m_xf.R,
e = this.m_sweep.localCenter;
this.m_sweep.c.x = d.col1.x * e.x + d.col2.x * e.y;
this.m_sweep.c.y = d.col1.y * e.x + d.col2.y * e.y;
this.m_sweep.c.x += this.m_xf.position.x;
this.m_sweep.c.y += this.m_xf.position.y;
this.m_sweep.c0.SetV(this.m_sweep.c);
this.m_contactList = this.m_controllerList = this.m_jointList = null;
this.m_controllerCount = 0;
this.m_next = this.m_prev = null;
this.m_linearVelocity.SetV(b.linearVelocity);
this.m_angularVelocity = b.angularVelocity;
this.m_linearDamping = b.linearDamping;
this.m_angularDamping = b.angularDamping;
this.m_force.Set(0, 0);
this.m_sleepTime = this.m_torque = 0;
this.m_type = b.type;
this.m_invMass = this.m_type == u.b2_dynamicBody ? this.m_mass = 1 : this.m_mass = 0;
this.m_invI = this.m_I = 0;
this.m_inertiaScale = b.inertiaScale;
this.m_userData = b.userData;
this.m_fixtureList = null;
this.m_fixtureCount = 0
};
u.prototype.SynchronizeFixtures = function() {
var b = u.s_xf1;
b.R.Set(this.m_sweep.a0);
var c = b.R,
d = this.m_sweep.localCenter;
b.position.x = this.m_sweep.c0.x - (c.col1.x * d.x + c.col2.x * d.y);
b.position.y = this.m_sweep.c0.y - (c.col1.y * d.x + c.col2.y * d.y);
d = this.m_world.m_contactManager.m_broadPhase;
for (c = this.m_fixtureList; c; c = c.m_next) c.Synchronize(d, b, this.m_xf)
};
u.prototype.SynchronizeTransform = function() {
this.m_xf.R.Set(this.m_sweep.a);
var b = this.m_xf.R,
c = this.m_sweep.localCenter;
this.m_xf.position.x = this.m_sweep.c.x - (b.col1.x * c.x + b.col2.x * c.y);
this.m_xf.position.y = this.m_sweep.c.y - (b.col1.y * c.x + b.col2.y * c.y)
};
u.prototype.ShouldCollide = function(b) {
if (this.m_type != u.b2_dynamicBody && b.m_type != u.b2_dynamicBody) return !1;
for (var c = this.m_jointList; c; c = c.next)
if (c.other == b && !1 == c.joint.m_collideConnected) return !1;
return !0
};
u.prototype.Advance = function(b) {
void 0 === b && (b = 0);
this.m_sweep.Advance(b);
this.m_sweep.c.SetV(this.m_sweep.c0);
this.m_sweep.a = this.m_sweep.a0;
this.SynchronizeTransform()
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.b2Body.s_xf1 = new d;
Box2D.Dynamics.b2Body.e_islandFlag = 1;
Box2D.Dynamics.b2Body.e_awakeFlag = 2;
Box2D.Dynamics.b2Body.e_allowSleepFlag = 4;
Box2D.Dynamics.b2Body.e_bulletFlag = 8;
Box2D.Dynamics.b2Body.e_fixedRotationFlag = 16;
Box2D.Dynamics.b2Body.e_activeFlag = 32;
Box2D.Dynamics.b2Body.b2_staticBody = 0;
Box2D.Dynamics.b2Body.b2_kinematicBody = 1;
Box2D.Dynamics.b2Body.b2_dynamicBody = 2
});
L.b2BodyDef = function() {
this.position = new e;
this.linearVelocity = new e
};
L.prototype.b2BodyDef = function() {
this.userData = null;
this.position.Set(0, 0);
this.angle = 0;
this.linearVelocity.Set(0, 0);
this.angularDamping = this.linearDamping = this.angularVelocity = 0;
this.awake = this.allowSleep = !0;
this.bullet = this.fixedRotation = !1;
this.type = u.b2_staticBody;
this.active = !0;
this.inertiaScale = 1
};
E.b2ContactFilter = function() {};
E.prototype.ShouldCollide = function(b, c) {
var d = b.GetFilterData(),
e = c.GetFilterData();
return d.groupIndex == e.groupIndex && 0 != d.groupIndex ? 0 < d.groupIndex : 0 != (d.maskBits & e.categoryBits) && 0 != (d.categoryBits & e.maskBits)
};
E.prototype.RayCollide = function(b, c) {
return !b ? !0 : this.ShouldCollide(b instanceof S ? b : null, c)
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.b2ContactFilter.b2_defaultFilter = new E
});
Q.b2ContactImpulse = function() {
this.normalImpulses = new Vector_a2j_Number(j.b2_maxManifoldPoints);
this.tangentImpulses = new Vector_a2j_Number(j.b2_maxManifoldPoints)
};
M.b2ContactListener = function() {};
M.prototype.BeginContact = function() {};
M.prototype.EndContact = function() {};
M.prototype.PreSolve = function() {};
M.prototype.PostSolve = function() {};
Box2D.postDefs.push(function() {
Box2D.Dynamics.b2ContactListener.b2_defaultListener = new M
});
R.b2ContactManager = function() {};
R.prototype.b2ContactManager = function() {
this.m_world = null;
this.m_contactCount = 0;
this.m_contactFilter = E.b2_defaultFilter;
this.m_contactListener = M.b2_defaultListener;
this.m_contactFactory = new D(this.m_allocator);
this.m_broadPhase = new g
};
R.prototype.AddPair = function(b, c) {
var d = b instanceof S ? b : null,
e = c instanceof S ? c : null,
f = d.GetBody(),
g = e.GetBody();
if (f != g) {
for (var p = g.GetContactList(); p;) {
if (p.other == f) {
var j = p.contact.GetFixtureA(),
v = p.contact.GetFixtureB();
if (j == d && v == e || j == e && v == d) return
}
p = p.next
}!1 != g.ShouldCollide(f) && !1 != this.m_contactFilter.ShouldCollide(d, e) && (p = this.m_contactFactory.Create(d, e), d = p.GetFixtureA(), e = p.GetFixtureB(), f = d.m_body, g = e.m_body, p.m_prev = null, p.m_next = this.m_world.m_contactList, null != this.m_world.m_contactList && (this.m_world.m_contactList.m_prev = p), this.m_world.m_contactList =
p, p.m_nodeA.contact = p, p.m_nodeA.other = g, p.m_nodeA.prev = null, p.m_nodeA.next = f.m_contactList, null != f.m_contactList && (f.m_contactList.prev = p.m_nodeA), f.m_contactList = p.m_nodeA, p.m_nodeB.contact = p, p.m_nodeB.other = f, p.m_nodeB.prev = null, p.m_nodeB.next = g.m_contactList, null != g.m_contactList && (g.m_contactList.prev = p.m_nodeB), g.m_contactList = p.m_nodeB, ++this.m_world.m_contactCount)
}
};
R.prototype.FindNewContacts = function() {
this.m_broadPhase.UpdatePairs(Box2D.generateCallback(this, this.AddPair))
};
R.prototype.Destroy =
function(b) {
var c = b.GetFixtureA(),
d = b.GetFixtureB(),
c = c.GetBody(),
d = d.GetBody();
b.IsTouching() && this.m_contactListener.EndContact(b);
b.m_prev && (b.m_prev.m_next = b.m_next);
b.m_next && (b.m_next.m_prev = b.m_prev);
b == this.m_world.m_contactList && (this.m_world.m_contactList = b.m_next);
b.m_nodeA.prev && (b.m_nodeA.prev.next = b.m_nodeA.next);
b.m_nodeA.next && (b.m_nodeA.next.prev = b.m_nodeA.prev);
b.m_nodeA == c.m_contactList && (c.m_contactList = b.m_nodeA.next);
b.m_nodeB.prev && (b.m_nodeB.prev.next = b.m_nodeB.next);
b.m_nodeB.next &&
(b.m_nodeB.next.prev = b.m_nodeB.prev);
b.m_nodeB == d.m_contactList && (d.m_contactList = b.m_nodeB.next);
this.m_contactFactory.Destroy(b);
--this.m_contactCount
};
R.prototype.Collide = function() {
for (var b = this.m_world.m_contactList; b;) {
var c = b.GetFixtureA(),
d = b.GetFixtureB(),
e = c.GetBody(),
f = d.GetBody();
if (!1 == e.IsAwake() && !1 == f.IsAwake()) b = b.GetNext();
else {
if (b.m_flags & H.e_filterFlag) {
if (!1 == f.ShouldCollide(e)) {
c = b;
b = c.GetNext();
this.Destroy(c);
continue
}
if (!1 == this.m_contactFilter.ShouldCollide(c, d)) {
c = b;
b =
c.GetNext();
this.Destroy(c);
continue
}
b.m_flags &= ~H.e_filterFlag
}!1 == this.m_broadPhase.TestOverlap(c.m_proxy, d.m_proxy) ? (c = b, b = c.GetNext(), this.Destroy(c)) : (b.Update(this.m_contactListener), b = b.GetNext())
}
}
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.b2ContactManager.s_evalCP = new n
});
K.b2DebugDraw = function() {};
K.prototype.b2DebugDraw = function() {};
K.prototype.SetFlags = function() {};
K.prototype.GetFlags = function() {};
K.prototype.AppendFlags = function() {};
K.prototype.ClearFlags = function() {};
K.prototype.SetSprite =
function() {};
K.prototype.GetSprite = function() {};
K.prototype.SetDrawScale = function() {};
K.prototype.GetDrawScale = function() {};
K.prototype.SetLineThickness = function() {};
K.prototype.GetLineThickness = function() {};
K.prototype.SetAlpha = function() {};
K.prototype.GetAlpha = function() {};
K.prototype.SetFillAlpha = function() {};
K.prototype.GetFillAlpha = function() {};
K.prototype.SetXFormScale = function() {};
K.prototype.GetXFormScale = function() {};
K.prototype.DrawPolygon = function() {};
K.prototype.DrawSolidPolygon = function() {};
K.prototype.DrawCircle = function() {};
K.prototype.DrawSolidCircle = function() {};
K.prototype.DrawSegment = function() {};
K.prototype.DrawTransform = function() {};
Box2D.postDefs.push(function() {
Box2D.Dynamics.b2DebugDraw.e_shapeBit = 1;
Box2D.Dynamics.b2DebugDraw.e_jointBit = 2;
Box2D.Dynamics.b2DebugDraw.e_aabbBit = 4;
Box2D.Dynamics.b2DebugDraw.e_pairBit = 8;
Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit = 16;
Box2D.Dynamics.b2DebugDraw.e_controllerBit = 32
});
X.b2DestructionListener = function() {};
X.prototype.SayGoodbyeJoint =
function() {};
X.prototype.SayGoodbyeFixture = function() {};
P.b2FilterData = function() {
this.categoryBits = 1;
this.maskBits = 65535;
this.groupIndex = 0
};
P.prototype.Copy = function() {
var b = new P;
b.categoryBits = this.categoryBits;
b.maskBits = this.maskBits;
b.groupIndex = this.groupIndex;
return b
};
S.b2Fixture = function() {
this.m_filter = new P
};
S.prototype.GetType = function() {
return this.m_shape.GetType()
};
S.prototype.GetShape = function() {
return this.m_shape
};
S.prototype.SetSensor = function(b) {
if (this.m_isSensor != b && (this.m_isSensor =
b, null != this.m_body))
for (b = this.m_body.GetContactList(); b;) {
var c = b.contact,
d = c.GetFixtureA(),
e = c.GetFixtureB();
if (d == this || e == this) c.SetSensor(d.IsSensor() || e.IsSensor());
b = b.next
}
};
S.prototype.IsSensor = function() {
return this.m_isSensor
};
S.prototype.SetFilterData = function(b) {
this.m_filter = b.Copy();
if (!this.m_body)
for (b = this.m_body.GetContactList(); b;) {
var c = b.contact,
d = c.GetFixtureA(),
e = c.GetFixtureB();
(d == this || e == this) && c.FlagForFiltering();
b = b.next
}
};
S.prototype.GetFilterData = function() {
return this.m_filter.Copy()
};
S.prototype.GetBody = function() {
return this.m_body
};
S.prototype.GetNext = function() {
return this.m_next
};
S.prototype.GetUserData = function() {
return this.m_userData
};
S.prototype.SetUserData = function(b) {
this.m_userData = b
};
S.prototype.TestPoint = function(b) {
return this.m_shape.TestPoint(this.m_body.GetTransform(), b)
};
S.prototype.RayCast = function(b, c) {
return this.m_shape.RayCast(b, c, this.m_body.GetTransform())
};
S.prototype.GetMassData = function(b) {
void 0 === b && (b = null);
null == b && (b = new C);
this.m_shape.ComputeMass(b,
this.m_density);
return b
};
S.prototype.SetDensity = function(b) {
void 0 === b && (b = 0);
this.m_density = b
};
S.prototype.GetDensity = function() {
return this.m_density
};
S.prototype.GetFriction = function() {
return this.m_friction
};
S.prototype.SetFriction = function(b) {
void 0 === b && (b = 0);
this.m_friction = b
};
S.prototype.GetRestitution = function() {
return this.m_restitution
};
S.prototype.SetRestitution = function(b) {
void 0 === b && (b = 0);
this.m_restitution = b
};
S.prototype.GetAABB = function() {
return this.m_aabb
};
S.prototype.b2Fixture =
function() {
this.m_aabb = new q;
this.m_shape = this.m_next = this.m_body = this.m_userData = null;
this.m_restitution = this.m_friction = this.m_density = 0
};
S.prototype.Create = function(b, c, d) {
this.m_userData = d.userData;
this.m_friction = d.friction;
this.m_restitution = d.restitution;
this.m_body = b;
this.m_next = null;
this.m_filter = d.filter.Copy();
this.m_isSensor = d.isSensor;
this.m_shape = d.shape.Copy();
this.m_density = d.density
};
S.prototype.Destroy = function() {
this.m_shape = null
};
S.prototype.CreateProxy = function(b, c) {
this.m_shape.ComputeAABB(this.m_aabb,
c);
this.m_proxy = b.CreateProxy(this.m_aabb, this)
};
S.prototype.DestroyProxy = function(b) {
null != this.m_proxy && (b.DestroyProxy(this.m_proxy), this.m_proxy = null)
};
S.prototype.Synchronize = function(c, d, e) {
if (this.m_proxy) {
var f = new q,
g = new q;
this.m_shape.ComputeAABB(f, d);
this.m_shape.ComputeAABB(g, e);
this.m_aabb.Combine(f, g);
d = b.SubtractVV(e.position, d.position);
c.MoveProxy(this.m_proxy, this.m_aabb, d)
}
};
Z.b2FixtureDef = function() {
this.filter = new P
};
Z.prototype.b2FixtureDef = function() {
this.userData = this.shape =
null;
this.friction = 0.2;
this.density = this.restitution = 0;
this.filter.categoryBits = 1;
this.filter.maskBits = 65535;
this.filter.groupIndex = 0;
this.isSensor = !1
};
U.b2Island = function() {};
U.prototype.b2Island = function() {
this.m_bodies = new Vector;
this.m_contacts = new Vector;
this.m_joints = new Vector
};
U.prototype.Initialize = function(b, c, d, e, f, g) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
void 0 === d && (d = 0);
var p = 0;
this.m_bodyCapacity = b;
this.m_contactCapacity = c;
this.m_jointCapacity = d;
this.m_jointCount = this.m_contactCount =
this.m_bodyCount = 0;
this.m_allocator = e;
this.m_listener = f;
this.m_contactSolver = g;
for (p = this.m_bodies.length; p < b; p++) this.m_bodies[p] = null;
for (p = this.m_contacts.length; p < c; p++) this.m_contacts[p] = null;
for (p = this.m_joints.length; p < d; p++) this.m_joints[p] = null
};
U.prototype.Clear = function() {
this.m_jointCount = this.m_contactCount = this.m_bodyCount = 0
};
U.prototype.Solve = function(c, d, e) {
for (var f = 0, p = 0, g, f = 0; f < this.m_bodyCount; ++f) p = this.m_bodies[f], p.GetType() == u.b2_dynamicBody && (p.m_linearVelocity.x += c.dt * (d.x +
p.m_invMass * p.m_force.x), p.m_linearVelocity.y += c.dt * (d.y + p.m_invMass * p.m_force.y), p.m_angularVelocity += c.dt * p.m_invI * p.m_torque, p.m_linearVelocity.Multiply(b.Clamp(1 - c.dt * p.m_linearDamping, 0, 1)), p.m_angularVelocity *= b.Clamp(1 - c.dt * p.m_angularDamping, 0, 1));
this.m_contactSolver.Initialize(c, this.m_contacts, this.m_contactCount, this.m_allocator);
d = this.m_contactSolver;
d.InitVelocityConstraints(c);
for (f = 0; f < this.m_jointCount; ++f) g = this.m_joints[f], g.InitVelocityConstraints(c);
for (f = 0; f < c.velocityIterations; ++f) {
for (p =
0; p < this.m_jointCount; ++p) g = this.m_joints[p], g.SolveVelocityConstraints(c);
d.SolveVelocityConstraints()
}
for (f = 0; f < this.m_jointCount; ++f) g = this.m_joints[f], g.FinalizeVelocityConstraints();
d.FinalizeVelocityConstraints();
for (f = 0; f < this.m_bodyCount; ++f)
if (p = this.m_bodies[f], p.GetType() != u.b2_staticBody) {
var v = c.dt * p.m_linearVelocity.x,
D = c.dt * p.m_linearVelocity.y;
v * v + D * D > j.b2_maxTranslationSquared && (p.m_linearVelocity.Normalize(), p.m_linearVelocity.x *= j.b2_maxTranslation * c.inv_dt, p.m_linearVelocity.y *=
j.b2_maxTranslation * c.inv_dt);
v = c.dt * p.m_angularVelocity;
v * v > j.b2_maxRotationSquared && (p.m_angularVelocity = 0 > p.m_angularVelocity ? -j.b2_maxRotation * c.inv_dt : j.b2_maxRotation * c.inv_dt);
p.m_sweep.c0.SetV(p.m_sweep.c);
p.m_sweep.a0 = p.m_sweep.a;
p.m_sweep.c.x += c.dt * p.m_linearVelocity.x;
p.m_sweep.c.y += c.dt * p.m_linearVelocity.y;
p.m_sweep.a += c.dt * p.m_angularVelocity;
p.SynchronizeTransform()
}
for (f = 0; f < c.positionIterations; ++f) {
v = d.SolvePositionConstraints(j.b2_contactBaumgarte);
D = !0;
for (p = 0; p < this.m_jointCount; ++p) g =
this.m_joints[p], g = g.SolvePositionConstraints(j.b2_contactBaumgarte), D = D && g;
if (v && D) break
}
this.Report(d.m_constraints);
if (e) {
e = Number.MAX_VALUE;
d = j.b2_linearSleepTolerance * j.b2_linearSleepTolerance;
v = j.b2_angularSleepTolerance * j.b2_angularSleepTolerance;
for (f = 0; f < this.m_bodyCount; ++f) p = this.m_bodies[f], p.GetType() != u.b2_staticBody && (0 == (p.m_flags & u.e_allowSleepFlag) && (e = p.m_sleepTime = 0), 0 == (p.m_flags & u.e_allowSleepFlag) || p.m_angularVelocity * p.m_angularVelocity > v || b.Dot(p.m_linearVelocity, p.m_linearVelocity) >
d ? e = p.m_sleepTime = 0 : (p.m_sleepTime += c.dt, e = b.Min(e, p.m_sleepTime)));
if (e >= j.b2_timeToSleep)
for (f = 0; f < this.m_bodyCount; ++f) p = this.m_bodies[f], p.SetAwake(!1)
}
};
U.prototype.SolveTOI = function(b) {
var c = 0,
d = 0;
this.m_contactSolver.Initialize(b, this.m_contacts, this.m_contactCount, this.m_allocator);
for (var e = this.m_contactSolver, c = 0; c < this.m_jointCount; ++c) this.m_joints[c].InitVelocityConstraints(b);
for (c = 0; c < b.velocityIterations; ++c) {
e.SolveVelocityConstraints();
for (d = 0; d < this.m_jointCount; ++d) this.m_joints[d].SolveVelocityConstraints(b)
}
for (c =
0; c < this.m_bodyCount; ++c)
if (d = this.m_bodies[c], d.GetType() != u.b2_staticBody) {
var f = b.dt * d.m_linearVelocity.x,
p = b.dt * d.m_linearVelocity.y;
f * f + p * p > j.b2_maxTranslationSquared && (d.m_linearVelocity.Normalize(), d.m_linearVelocity.x *= j.b2_maxTranslation * b.inv_dt, d.m_linearVelocity.y *= j.b2_maxTranslation * b.inv_dt);
f = b.dt * d.m_angularVelocity;
f * f > j.b2_maxRotationSquared && (d.m_angularVelocity = 0 > d.m_angularVelocity ? -j.b2_maxRotation * b.inv_dt : j.b2_maxRotation * b.inv_dt);
d.m_sweep.c0.SetV(d.m_sweep.c);
d.m_sweep.a0 =
d.m_sweep.a;
d.m_sweep.c.x += b.dt * d.m_linearVelocity.x;
d.m_sweep.c.y += b.dt * d.m_linearVelocity.y;
d.m_sweep.a += b.dt * d.m_angularVelocity;
d.SynchronizeTransform()
}
for (c = 0; c < b.positionIterations; ++c) {
f = e.SolvePositionConstraints(0.75);
p = !0;
for (d = 0; d < this.m_jointCount; ++d) var g = this.m_joints[d].SolvePositionConstraints(j.b2_contactBaumgarte),
p = p && g;
if (f && p) break
}
this.Report(e.m_constraints)
};
U.prototype.Report = function(b) {
if (null != this.m_listener)
for (var c = 0; c < this.m_contactCount; ++c) {
for (var d = this.m_contacts[c],
e = b[c], f = 0; f < e.pointCount; ++f) U.s_impulse.normalImpulses[f] = e.points[f].normalImpulse, U.s_impulse.tangentImpulses[f] = e.points[f].tangentImpulse;
this.m_listener.PostSolve(d, U.s_impulse)
}
};
U.prototype.AddBody = function(b) {
b.m_islandIndex = this.m_bodyCount;
this.m_bodies[this.m_bodyCount++] = b
};
U.prototype.AddContact = function(b) {
this.m_contacts[this.m_contactCount++] = b
};
U.prototype.AddJoint = function(b) {
this.m_joints[this.m_jointCount++] = b
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.b2Island.s_impulse =
new Q
});
p.b2TimeStep = function() {};
p.prototype.Set = function(b) {
this.dt = b.dt;
this.inv_dt = b.inv_dt;
this.positionIterations = b.positionIterations;
this.velocityIterations = b.velocityIterations;
this.warmStarting = b.warmStarting
};
v.b2World = function() {
this.s_stack = new Vector;
this.m_contactManager = new R;
this.m_contactSolver = new N;
this.m_island = new U
};
v.prototype.b2World = function(b, c) {
this.m_controllerList = this.m_jointList = this.m_contactList = this.m_bodyList = this.m_debugDraw = this.m_destructionListener = null;
this.m_controllerCount =
this.m_jointCount = this.m_contactCount = this.m_bodyCount = 0;
v.m_warmStarting = !0;
v.m_continuousPhysics = !0;
this.m_allowSleep = c;
this.m_gravity = b;
this.m_inv_dt0 = 0;
this.m_contactManager.m_world = this;
this.m_groundBody = this.CreateBody(new L)
};
v.prototype.SetDestructionListener = function(b) {
this.m_destructionListener = b
};
v.prototype.SetContactFilter = function(b) {
this.m_contactManager.m_contactFilter = b
};
v.prototype.SetContactListener = function(b) {
this.m_contactManager.m_contactListener = b
};
v.prototype.SetDebugDraw =
function(b) {
this.m_debugDraw = b
};
v.prototype.SetBroadPhase = function(b) {
var c = this.m_contactManager.m_broadPhase;
this.m_contactManager.m_broadPhase = b;
for (var d = this.m_bodyList; d; d = d.m_next)
for (var e = d.m_fixtureList; e; e = e.m_next) e.m_proxy = b.CreateProxy(c.GetFatAABB(e.m_proxy), e)
};
v.prototype.Validate = function() {
this.m_contactManager.m_broadPhase.Validate()
};
v.prototype.GetProxyCount = function() {
return this.m_contactManager.m_broadPhase.GetProxyCount()
};
v.prototype.CreateBody = function(b) {
if (!0 == this.IsLocked()) return null;
b = new u(b, this);
b.m_prev = null;
if (b.m_next = this.m_bodyList) this.m_bodyList.m_prev = b;
this.m_bodyList = b;
++this.m_bodyCount;
return b
};
v.prototype.DestroyBody = function(b) {
if (!0 != this.IsLocked()) {
for (var c = b.m_jointList; c;) {
var d = c,
c = c.next;
this.m_destructionListener && this.m_destructionListener.SayGoodbyeJoint(d.joint);
this.DestroyJoint(d.joint)
}
for (c = b.m_controllerList; c;) d = c, c = c.nextController, d.controller.RemoveBody(b);
for (c = b.m_contactList; c;) d = c, c = c.next, this.m_contactManager.Destroy(d.contact);
b.m_contactList =
null;
for (c = b.m_fixtureList; c;) d = c, c = c.m_next, this.m_destructionListener && this.m_destructionListener.SayGoodbyeFixture(d), d.DestroyProxy(this.m_contactManager.m_broadPhase), d.Destroy();
b.m_fixtureList = null;
b.m_fixtureCount = 0;
b.m_prev && (b.m_prev.m_next = b.m_next);
b.m_next && (b.m_next.m_prev = b.m_prev);
b == this.m_bodyList && (this.m_bodyList = b.m_next);
--this.m_bodyCount
}
};
v.prototype.CreateJoint = function(b) {
var c = J.Create(b, null);
c.m_prev = null;
if (c.m_next = this.m_jointList) this.m_jointList.m_prev = c;
this.m_jointList =
c;
++this.m_jointCount;
c.m_edgeA.joint = c;
c.m_edgeA.other = c.m_bodyB;
c.m_edgeA.prev = null;
if (c.m_edgeA.next = c.m_bodyA.m_jointList) c.m_bodyA.m_jointList.prev = c.m_edgeA;
c.m_bodyA.m_jointList = c.m_edgeA;
c.m_edgeB.joint = c;
c.m_edgeB.other = c.m_bodyA;
c.m_edgeB.prev = null;
if (c.m_edgeB.next = c.m_bodyB.m_jointList) c.m_bodyB.m_jointList.prev = c.m_edgeB;
c.m_bodyB.m_jointList = c.m_edgeB;
var d = b.bodyA,
e = b.bodyB;
if (!1 == b.collideConnected)
for (b = e.GetContactList(); b;) b.other == d && b.contact.FlagForFiltering(), b = b.next;
return c
};
v.prototype.DestroyJoint = function(b) {
var c = b.m_collideConnected;
b.m_prev && (b.m_prev.m_next = b.m_next);
b.m_next && (b.m_next.m_prev = b.m_prev);
b == this.m_jointList && (this.m_jointList = b.m_next);
var d = b.m_bodyA,
e = b.m_bodyB;
d.SetAwake(!0);
e.SetAwake(!0);
b.m_edgeA.prev && (b.m_edgeA.prev.next = b.m_edgeA.next);
b.m_edgeA.next && (b.m_edgeA.next.prev = b.m_edgeA.prev);
b.m_edgeA == d.m_jointList && (d.m_jointList = b.m_edgeA.next);
b.m_edgeA.prev = null;
b.m_edgeA.next = null;
b.m_edgeB.prev && (b.m_edgeB.prev.next = b.m_edgeB.next);
b.m_edgeB.next && (b.m_edgeB.next.prev = b.m_edgeB.prev);
b.m_edgeB == e.m_jointList && (e.m_jointList = b.m_edgeB.next);
b.m_edgeB.prev = null;
b.m_edgeB.next = null;
J.Destroy(b, null);
--this.m_jointCount;
if (!1 == c)
for (b = e.GetContactList(); b;) b.other == d && b.contact.FlagForFiltering(), b = b.next
};
v.prototype.AddController = function(b) {
b.m_next = this.m_controllerList;
b.m_prev = null;
this.m_controllerList = b;
b.m_world = this;
this.m_controllerCount++;
return b
};
v.prototype.RemoveController = function(b) {
b.m_prev && (b.m_prev.m_next =
b.m_next);
b.m_next && (b.m_next.m_prev = b.m_prev);
this.m_controllerList == b && (this.m_controllerList = b.m_next);
this.m_controllerCount--
};
v.prototype.CreateController = function(b) {
if (b.m_world != this) throw Error("Controller can only be a member of one world");
b.m_next = this.m_controllerList;
b.m_prev = null;
this.m_controllerList && (this.m_controllerList.m_prev = b);
this.m_controllerList = b;
++this.m_controllerCount;
b.m_world = this;
return b
};
v.prototype.DestroyController = function(b) {
b.Clear();
b.m_next && (b.m_next.m_prev =
b.m_prev);
b.m_prev && (b.m_prev.m_next = b.m_next);
b == this.m_controllerList && (this.m_controllerList = b.m_next);
--this.m_controllerCount
};
v.prototype.SetWarmStarting = function(b) {
v.m_warmStarting = b
};
v.prototype.SetContinuousPhysics = function(b) {
v.m_continuousPhysics = b
};
v.prototype.GetBodyCount = function() {
return this.m_bodyCount
};
v.prototype.GetJointCount = function() {
return this.m_jointCount
};
v.prototype.GetContactCount = function() {
return this.m_contactCount
};
v.prototype.SetGravity = function(b) {
this.m_gravity =
b
};
v.prototype.GetGravity = function() {
return this.m_gravity
};
v.prototype.GetGroundBody = function() {
return this.m_groundBody
};
v.prototype.Step = function(b, c, d) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
void 0 === d && (d = 0);
this.m_flags & v.e_newFixture && (this.m_contactManager.FindNewContacts(), this.m_flags &= ~v.e_newFixture);
this.m_flags |= v.e_locked;
var e = v.s_timestep2;
e.dt = b;
e.velocityIterations = c;
e.positionIterations = d;
e.inv_dt = 0 < b ? 1 / b : 0;
e.dtRatio = this.m_inv_dt0 * b;
e.warmStarting = v.m_warmStarting;
this.m_contactManager.Collide();
0 < e.dt && this.Solve(e);
v.m_continuousPhysics && 0 < e.dt && this.SolveTOI(e);
0 < e.dt && (this.m_inv_dt0 = e.inv_dt);
this.m_flags &= ~v.e_locked
};
v.prototype.ClearForces = function() {
for (var b = this.m_bodyList; b; b = b.m_next) b.m_force.SetZero(), b.m_torque = 0
};
v.prototype.DrawDebugData = function() {
if (null != this.m_debugDraw) {
this.m_debugDraw.m_sprite.graphics.clear();
var b = this.m_debugDraw.GetFlags(),
c, d, p;
new e;
new e;
new e;
var g;
new q;
new q;
new e;
new e;
new e;
new e;
var j = new f(0, 0, 0);
if (b & K.e_shapeBit)
for (c = this.m_bodyList; c; c =
c.m_next) {
g = c.m_xf;
for (d = c.GetFixtureList(); d; d = d.m_next) p = d.GetShape(), !1 == c.IsActive() ? j.Set(0.5, 0.5, 0.3) : c.GetType() == u.b2_staticBody ? j.Set(0.5, 0.9, 0.5) : c.GetType() == u.b2_kinematicBody ? j.Set(0.5, 0.5, 0.9) : !1 == c.IsAwake() ? j.Set(0.6, 0.6, 0.6) : j.Set(0.9, 0.7, 0.7), this.DrawShape(p, g, j)
}
if (b & K.e_jointBit)
for (c = this.m_jointList; c; c = c.m_next) this.DrawJoint(c);
if (b & K.e_controllerBit)
for (c = this.m_controllerList; c; c = c.m_next) c.Draw(this.m_debugDraw);
if (b & K.e_pairBit) {
j.Set(0.3, 0.9, 0.9);
for (c = this.m_contactManager.m_contactList; c; c =
c.GetNext()) p = c.GetFixtureA(), d = c.GetFixtureB(), p = p.GetAABB().GetCenter(), d = d.GetAABB().GetCenter(), this.m_debugDraw.DrawSegment(p, d, j)
}
if (b & K.e_aabbBit) {
p = this.m_contactManager.m_broadPhase;
g = [new e, new e, new e, new e];
for (c = this.m_bodyList; c; c = c.GetNext())
if (!1 != c.IsActive())
for (d = c.GetFixtureList(); d; d = d.GetNext()) {
var D = p.GetFatAABB(d.m_proxy);
g[0].Set(D.lowerBound.x, D.lowerBound.y);
g[1].Set(D.upperBound.x, D.lowerBound.y);
g[2].Set(D.upperBound.x, D.upperBound.y);
g[3].Set(D.lowerBound.x, D.upperBound.y);
this.m_debugDraw.DrawPolygon(g, 4, j)
}
}
if (b & K.e_centerOfMassBit)
for (c = this.m_bodyList; c; c = c.m_next) g = v.s_xf, g.R = c.m_xf.R, g.position = c.GetWorldCenter(), this.m_debugDraw.DrawTransform(g)
}
};
v.prototype.QueryAABB = function(b, c) {
var d = this.m_contactManager.m_broadPhase;
d.Query(function(c) {
return b(d.GetUserData(c))
}, c)
};
v.prototype.QueryShape = function(b, c, e) {
void 0 === e && (e = null);
null == e && (e = new d, e.SetIdentity());
var f = this.m_contactManager.m_broadPhase,
p = new q;
c.ComputeAABB(p, e);
f.Query(function(d) {
d = f.GetUserData(d) instanceof
S ? f.GetUserData(d) : null;
return I.TestOverlap(c, e, d.GetShape(), d.GetBody().GetTransform()) ? b(d) : !0
}, p)
};
v.prototype.QueryPoint = function(b, c) {
var d = this.m_contactManager.m_broadPhase,
e = new q;
e.lowerBound.Set(c.x - j.b2_linearSlop, c.y - j.b2_linearSlop);
e.upperBound.Set(c.x + j.b2_linearSlop, c.y + j.b2_linearSlop);
d.Query(function(e) {
e = d.GetUserData(e) instanceof S ? d.GetUserData(e) : null;
return e.TestPoint(c) ? b(e) : !0
}, e)
};
v.prototype.RayCast = function(b, c, d) {
var f = this.m_contactManager.m_broadPhase,
p = new A,
g = new y(c,
d);
f.RayCast(function(g, j) {
var v = f.GetUserData(j),
v = v instanceof S ? v : null;
if (v.RayCast(p, g)) {
var m = p.fraction,
D = new e((1 - m) * c.x + m * d.x, (1 - m) * c.y + m * d.y);
return b(v, D, p.normal, m)
}
return g.maxFraction
}, g)
};
v.prototype.RayCastOne = function(b, c) {
var d;
this.RayCast(function(b, c, e, f) {
void 0 === f && (f = 0);
d = b;
return f
}, b, c);
return d
};
v.prototype.RayCastAll = function(b, c) {
var d = new Vector;
this.RayCast(function(b) {
d[d.length] = b;
return 1
}, b, c);
return d
};
v.prototype.GetBodyList = function() {
return this.m_bodyList
};
v.prototype.GetJointList =
function() {
return this.m_jointList
};
v.prototype.GetContactList = function() {
return this.m_contactList
};
v.prototype.IsLocked = function() {
return 0 < (this.m_flags & v.e_locked)
};
v.prototype.Solve = function(b) {
for (var c, d = this.m_controllerList; d; d = d.m_next) d.Step(b);
d = this.m_island;
d.Initialize(this.m_bodyCount, this.m_contactCount, this.m_jointCount, null, this.m_contactManager.m_contactListener, this.m_contactSolver);
for (c = this.m_bodyList; c; c = c.m_next) c.m_flags &= ~u.e_islandFlag;
for (var e = this.m_contactList; e; e =
e.m_next) e.m_flags &= ~H.e_islandFlag;
for (e = this.m_jointList; e; e = e.m_next) e.m_islandFlag = !1;
parseInt(this.m_bodyCount);
for (var e = this.s_stack, f = this.m_bodyList; f; f = f.m_next)
if (!(f.m_flags & u.e_islandFlag) && !(!1 == f.IsAwake() || !1 == f.IsActive()) && f.GetType() != u.b2_staticBody) {
d.Clear();
var p = 0;
e[p++] = f;
for (f.m_flags |= u.e_islandFlag; 0 < p;)
if (c = e[--p], d.AddBody(c), !1 == c.IsAwake() && c.SetAwake(!0), c.GetType() != u.b2_staticBody) {
for (var g, j = c.m_contactList; j; j = j.next)
if (!(j.contact.m_flags & H.e_islandFlag) && !(!0 ==
j.contact.IsSensor() || !1 == j.contact.IsEnabled() || !1 == j.contact.IsTouching())) d.AddContact(j.contact), j.contact.m_flags |= H.e_islandFlag, g = j.other, g.m_flags & u.e_islandFlag || (e[p++] = g, g.m_flags |= u.e_islandFlag);
for (c = c.m_jointList; c; c = c.next) !0 != c.joint.m_islandFlag && (g = c.other, !1 != g.IsActive() && (d.AddJoint(c.joint), c.joint.m_islandFlag = !0, g.m_flags & u.e_islandFlag || (e[p++] = g, g.m_flags |= u.e_islandFlag)))
}
d.Solve(b, this.m_gravity, this.m_allowSleep);
for (p = 0; p < d.m_bodyCount; ++p) c = d.m_bodies[p], c.GetType() ==
u.b2_staticBody && (c.m_flags &= ~u.e_islandFlag)
}
for (p = 0; p < e.length && e[p]; ++p) e[p] = null;
for (c = this.m_bodyList; c; c = c.m_next) !1 == c.IsAwake() || !1 == c.IsActive() || c.GetType() != u.b2_staticBody && c.SynchronizeFixtures();
this.m_contactManager.FindNewContacts()
};
v.prototype.SolveTOI = function(b) {
var c, d, e, f = this.m_island;
f.Initialize(this.m_bodyCount, j.b2_maxTOIContactsPerIsland, j.b2_maxTOIJointsPerIsland, null, this.m_contactManager.m_contactListener, this.m_contactSolver);
var p = v.s_queue;
for (c = this.m_bodyList; c; c =
c.m_next) c.m_flags &= ~u.e_islandFlag, c.m_sweep.t0 = 0;
for (e = this.m_contactList; e; e = e.m_next) e.m_flags &= ~(H.e_toiFlag | H.e_islandFlag);
for (e = this.m_jointList; e; e = e.m_next) e.m_islandFlag = !1;
for (;;) {
var g = null,
D = 1;
for (e = this.m_contactList; e; e = e.m_next)
if (!(!0 == e.IsSensor() || !1 == e.IsEnabled() || !1 == e.IsContinuous())) {
if (e.m_flags & H.e_toiFlag) c = e.m_toi;
else {
c = e.m_fixtureA;
d = e.m_fixtureB;
c = c.m_body;
d = d.m_body;
if ((c.GetType() != u.b2_dynamicBody || !1 == c.IsAwake()) && (d.GetType() != u.b2_dynamicBody || !1 == d.IsAwake())) continue;
var n = c.m_sweep.t0;
c.m_sweep.t0 < d.m_sweep.t0 ? (n = d.m_sweep.t0, c.m_sweep.Advance(n)) : d.m_sweep.t0 < c.m_sweep.t0 && (n = c.m_sweep.t0, d.m_sweep.Advance(n));
c = e.ComputeTOI(c.m_sweep, d.m_sweep);
j.b2Assert(0 <= c && 1 >= c);
0 < c && 1 > c && (c = (1 - c) * n + c, 1 < c && (c = 1));
e.m_toi = c;
e.m_flags |= H.e_toiFlag
}
Number.MIN_VALUE < c && c < D && (g = e, D = c)
}
if (null == g || 1 - 100 * Number.MIN_VALUE < D) break;
c = g.m_fixtureA;
d = g.m_fixtureB;
c = c.m_body;
d = d.m_body;
v.s_backupA.Set(c.m_sweep);
v.s_backupB.Set(d.m_sweep);
c.Advance(D);
d.Advance(D);
g.Update(this.m_contactManager.m_contactListener);
g.m_flags &= ~H.e_toiFlag;
if (!0 == g.IsSensor() || !1 == g.IsEnabled()) c.m_sweep.Set(v.s_backupA), d.m_sweep.Set(v.s_backupB), c.SynchronizeTransform(), d.SynchronizeTransform();
else if (!1 != g.IsTouching()) {
c.GetType() != u.b2_dynamicBody && (c = d);
f.Clear();
g = e = 0;
p[e + g++] = c;
for (c.m_flags |= u.e_islandFlag; 0 < g;)
if (c = p[e++], --g, f.AddBody(c), !1 == c.IsAwake() && c.SetAwake(!0), c.GetType() == u.b2_dynamicBody) {
for (d = c.m_contactList; d && f.m_contactCount != f.m_contactCapacity; d = d.next)
if (!(d.contact.m_flags & H.e_islandFlag) && !(!0 ==
d.contact.IsSensor() || !1 == d.contact.IsEnabled() || !1 == d.contact.IsTouching())) f.AddContact(d.contact), d.contact.m_flags |= H.e_islandFlag, n = d.other, n.m_flags & u.e_islandFlag || (n.GetType() != u.b2_staticBody && (n.Advance(D), n.SetAwake(!0)), p[e + g] = n, ++g, n.m_flags |= u.e_islandFlag);
for (c = c.m_jointList; c; c = c.next) f.m_jointCount != f.m_jointCapacity && !0 != c.joint.m_islandFlag && (n = c.other, !1 != n.IsActive() && (f.AddJoint(c.joint), c.joint.m_islandFlag = !0, n.m_flags & u.e_islandFlag || (n.GetType() != u.b2_staticBody && (n.Advance(D),
n.SetAwake(!0)), p[e + g] = n, ++g, n.m_flags |= u.e_islandFlag)))
}
e = v.s_timestep;
e.warmStarting = !1;
e.dt = (1 - D) * b.dt;
e.inv_dt = 1 / e.dt;
e.dtRatio = 0;
e.velocityIterations = b.velocityIterations;
e.positionIterations = b.positionIterations;
f.SolveTOI(e);
for (D = D = 0; D < f.m_bodyCount; ++D)
if (c = f.m_bodies[D], c.m_flags &= ~u.e_islandFlag, !1 != c.IsAwake() && c.GetType() == u.b2_dynamicBody) {
c.SynchronizeFixtures();
for (d = c.m_contactList; d; d = d.next) d.contact.m_flags &= ~H.e_toiFlag
}
for (D = 0; D < f.m_contactCount; ++D) e = f.m_contacts[D], e.m_flags &=
~(H.e_toiFlag | H.e_islandFlag);
for (D = 0; D < f.m_jointCount; ++D) e = f.m_joints[D], e.m_islandFlag = !1;
this.m_contactManager.FindNewContacts()
}
}
};
v.prototype.DrawJoint = function(b) {
var c = b.GetBodyA(),
d = b.GetBodyB(),
e = c.m_xf.position,
f = d.m_xf.position,
p = b.GetAnchorA(),
g = b.GetAnchorB(),
j = v.s_jointColor;
switch (b.m_type) {
case J.e_distanceJoint:
this.m_debugDraw.DrawSegment(p, g, j);
break;
case J.e_pulleyJoint:
c = b instanceof V ? b : null;
b = c.GetGroundAnchorA();
c = c.GetGroundAnchorB();
this.m_debugDraw.DrawSegment(b, p, j);
this.m_debugDraw.DrawSegment(c,
g, j);
this.m_debugDraw.DrawSegment(b, c, j);
break;
case J.e_mouseJoint:
this.m_debugDraw.DrawSegment(p, g, j);
break;
default:
c != this.m_groundBody && this.m_debugDraw.DrawSegment(e, p, j), this.m_debugDraw.DrawSegment(p, g, j), d != this.m_groundBody && this.m_debugDraw.DrawSegment(f, g, j)
}
};
v.prototype.DrawShape = function(c, d, e) {
switch (c.m_type) {
case I.e_circleShape:
var f = c instanceof z ? c : null;
this.m_debugDraw.DrawSolidCircle(b.MulX(d, f.m_p), f.m_radius, d.R.col1, e);
break;
case I.e_polygonShape:
f = c instanceof G ? c : null;
c =
parseInt(f.GetVertexCount());
for (var p = f.GetVertices(), g = new Vector(c), f = 0; f < c; ++f) g[f] = b.MulX(d, p[f]);
this.m_debugDraw.DrawSolidPolygon(g, c, e);
break;
case I.e_edgeShape:
f = c instanceof B ? c : null, this.m_debugDraw.DrawSegment(b.MulX(d, f.GetVertex1()), b.MulX(d, f.GetVertex2()), e)
}
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.b2World.s_timestep2 = new p;
Box2D.Dynamics.b2World.s_xf = new d;
Box2D.Dynamics.b2World.s_backupA = new c;
Box2D.Dynamics.b2World.s_backupB = new c;
Box2D.Dynamics.b2World.s_timestep = new p;
Box2D.Dynamics.b2World.s_queue = new Vector;
Box2D.Dynamics.b2World.s_jointColor = new f(0.5, 0.8, 0.8);
Box2D.Dynamics.b2World.e_newFixture = 1;
Box2D.Dynamics.b2World.e_locked = 2
})
})();
(function() {
var b = Box2D.Collision.Shapes.b2CircleShape,
c = Box2D.Collision.Shapes.b2EdgeShape,
d = Box2D.Collision.Shapes.b2PolygonShape,
e = Box2D.Collision.Shapes.b2Shape,
f = Box2D.Dynamics.Contacts.b2CircleContact,
j = Box2D.Dynamics.Contacts.b2Contact,
q = Box2D.Dynamics.Contacts.b2ContactConstraint,
n = Box2D.Dynamics.Contacts.b2ContactConstraintPoint,
g = Box2D.Dynamics.Contacts.b2ContactEdge,
y = Box2D.Dynamics.Contacts.b2ContactFactory,
A = Box2D.Dynamics.Contacts.b2ContactRegister,
z = Box2D.Dynamics.Contacts.b2ContactResult,
B = Box2D.Dynamics.Contacts.b2ContactSolver,
C = Box2D.Dynamics.Contacts.b2EdgeAndCircleContact,
G = Box2D.Dynamics.Contacts.b2NullContact,
I = Box2D.Dynamics.Contacts.b2PolyAndCircleContact,
u = Box2D.Dynamics.Contacts.b2PolyAndEdgeContact,
L = Box2D.Dynamics.Contacts.b2PolygonContact,
E = Box2D.Dynamics.Contacts.b2PositionSolverManifold,
Q = Box2D.Dynamics.b2Body,
M = Box2D.Dynamics.b2TimeStep,
R = Box2D.Common.b2Settings,
K = Box2D.Common.Math.b2Mat22,
X = Box2D.Common.Math.b2Math,
P = Box2D.Common.Math.b2Vec2,
S = Box2D.Collision.b2Collision,
Z = Box2D.Collision.b2ContactID,
U = Box2D.Collision.b2Manifold,
p = Box2D.Collision.b2TimeOfImpact,
v = Box2D.Collision.b2TOIInput,
H = Box2D.Collision.b2WorldManifold;
Box2D.inherit(f, Box2D.Dynamics.Contacts.b2Contact);
f.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;
f.b2CircleContact = function() {
Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments)
};
f.Create = function() {
return new f
};
f.Destroy = function() {};
f.prototype.Reset = function(b, c) {
this.__super.Reset.call(this, b, c)
};
f.prototype.Evaluate =
function() {
var c = this.m_fixtureA.GetBody(),
d = this.m_fixtureB.GetBody();
S.CollideCircles(this.m_manifold, this.m_fixtureA.GetShape() instanceof b ? this.m_fixtureA.GetShape() : null, c.m_xf, this.m_fixtureB.GetShape() instanceof b ? this.m_fixtureB.GetShape() : null, d.m_xf)
};
j.b2Contact = function() {
this.m_nodeA = new g;
this.m_nodeB = new g;
this.m_manifold = new U;
this.m_oldManifold = new U
};
j.prototype.GetManifold = function() {
return this.m_manifold
};
j.prototype.GetWorldManifold = function(b) {
var c = this.m_fixtureA.GetBody(),
d = this.m_fixtureB.GetBody(),
e = this.m_fixtureA.GetShape(),
f = this.m_fixtureB.GetShape();
b.Initialize(this.m_manifold, c.GetTransform(), e.m_radius, d.GetTransform(), f.m_radius)
};
j.prototype.IsTouching = function() {
return (this.m_flags & j.e_touchingFlag) == j.e_touchingFlag
};
j.prototype.IsContinuous = function() {
return (this.m_flags & j.e_continuousFlag) == j.e_continuousFlag
};
j.prototype.SetSensor = function(b) {
this.m_flags = b ? this.m_flags | j.e_sensorFlag : this.m_flags & ~j.e_sensorFlag
};
j.prototype.IsSensor = function() {
return (this.m_flags &
j.e_sensorFlag) == j.e_sensorFlag
};
j.prototype.SetEnabled = function(b) {
this.m_flags = b ? this.m_flags | j.e_enabledFlag : this.m_flags & ~j.e_enabledFlag
};
j.prototype.IsEnabled = function() {
return (this.m_flags & j.e_enabledFlag) == j.e_enabledFlag
};
j.prototype.GetNext = function() {
return this.m_next
};
j.prototype.GetFixtureA = function() {
return this.m_fixtureA
};
j.prototype.GetFixtureB = function() {
return this.m_fixtureB
};
j.prototype.FlagForFiltering = function() {
this.m_flags |= j.e_filterFlag
};
j.prototype.b2Contact = function() {};
j.prototype.Reset = function(b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
this.m_flags = j.e_enabledFlag;
if (!b || !c) this.m_fixtureB = this.m_fixtureA = null;
else {
if (b.IsSensor() || c.IsSensor()) this.m_flags |= j.e_sensorFlag;
var d = b.GetBody(),
e = c.GetBody();
if (d.GetType() != Q.b2_dynamicBody || d.IsBullet() || e.GetType() != Q.b2_dynamicBody || e.IsBullet()) this.m_flags |= j.e_continuousFlag;
this.m_fixtureA = b;
this.m_fixtureB = c;
this.m_manifold.m_pointCount = 0;
this.m_next = this.m_prev = null;
this.m_nodeA.contact = null;
this.m_nodeA.prev =
null;
this.m_nodeA.next = null;
this.m_nodeA.other = null;
this.m_nodeB.contact = null;
this.m_nodeB.prev = null;
this.m_nodeB.next = null;
this.m_nodeB.other = null
}
};
j.prototype.Update = function(b) {
var c = this.m_oldManifold;
this.m_oldManifold = this.m_manifold;
this.m_manifold = c;
this.m_flags |= j.e_enabledFlag;
var d = !1,
c = (this.m_flags & j.e_touchingFlag) == j.e_touchingFlag,
f = this.m_fixtureA.m_body,
p = this.m_fixtureB.m_body,
g = this.m_fixtureA.m_aabb.TestOverlap(this.m_fixtureB.m_aabb);
if (this.m_flags & j.e_sensorFlag) g && (d = this.m_fixtureA.GetShape(),
g = this.m_fixtureB.GetShape(), f = f.GetTransform(), p = p.GetTransform(), d = e.TestOverlap(d, f, g, p)), this.m_manifold.m_pointCount = 0;
else {
this.m_flags = f.GetType() != Q.b2_dynamicBody || f.IsBullet() || p.GetType() != Q.b2_dynamicBody || p.IsBullet() ? this.m_flags | j.e_continuousFlag : this.m_flags & ~j.e_continuousFlag;
if (g) {
this.Evaluate();
d = 0 < this.m_manifold.m_pointCount;
for (g = 0; g < this.m_manifold.m_pointCount; ++g) {
var v = this.m_manifold.m_points[g];
v.m_normalImpulse = 0;
v.m_tangentImpulse = 0;
for (var n = v.m_id, H = 0; H < this.m_oldManifold.m_pointCount; ++H) {
var q =
this.m_oldManifold.m_points[H];
if (q.m_id.key == n.key) {
v.m_normalImpulse = q.m_normalImpulse;
v.m_tangentImpulse = q.m_tangentImpulse;
break
}
}
}
} else this.m_manifold.m_pointCount = 0;
d != c && (f.SetAwake(!0), p.SetAwake(!0))
}
this.m_flags = d ? this.m_flags | j.e_touchingFlag : this.m_flags & ~j.e_touchingFlag;
!1 == c && !0 == d && b.BeginContact(this);
!0 == c && !1 == d && b.EndContact(this);
0 == (this.m_flags & j.e_sensorFlag) && b.PreSolve(this, this.m_oldManifold)
};
j.prototype.Evaluate = function() {};
j.prototype.ComputeTOI = function(b, c) {
j.s_input.proxyA.Set(this.m_fixtureA.GetShape());
j.s_input.proxyB.Set(this.m_fixtureB.GetShape());
j.s_input.sweepA = b;
j.s_input.sweepB = c;
j.s_input.tolerance = R.b2_linearSlop;
return p.TimeOfImpact(j.s_input)
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.Contacts.b2Contact.e_sensorFlag = 1;
Box2D.Dynamics.Contacts.b2Contact.e_continuousFlag = 2;
Box2D.Dynamics.Contacts.b2Contact.e_islandFlag = 4;
Box2D.Dynamics.Contacts.b2Contact.e_toiFlag = 8;
Box2D.Dynamics.Contacts.b2Contact.e_touchingFlag = 16;
Box2D.Dynamics.Contacts.b2Contact.e_enabledFlag = 32;
Box2D.Dynamics.Contacts.b2Contact.e_filterFlag =
64;
Box2D.Dynamics.Contacts.b2Contact.s_input = new v
});
q.b2ContactConstraint = function() {
this.localPlaneNormal = new P;
this.localPoint = new P;
this.normal = new P;
this.normalMass = new K;
this.K = new K
};
q.prototype.b2ContactConstraint = function() {
this.points = new Vector(R.b2_maxManifoldPoints);
for (var b = 0; b < R.b2_maxManifoldPoints; b++) this.points[b] = new n
};
n.b2ContactConstraintPoint = function() {
this.localPoint = new P;
this.rA = new P;
this.rB = new P
};
g.b2ContactEdge = function() {};
y.b2ContactFactory = function() {};
y.prototype.b2ContactFactory =
function(b) {
this.m_allocator = b;
this.InitializeRegisters()
};
y.prototype.AddType = function(b, c, d, e) {
void 0 === d && (d = 0);
void 0 === e && (e = 0);
this.m_registers[d][e].createFcn = b;
this.m_registers[d][e].destroyFcn = c;
this.m_registers[d][e].primary = !0;
d != e && (this.m_registers[e][d].createFcn = b, this.m_registers[e][d].destroyFcn = c, this.m_registers[e][d].primary = !1)
};
y.prototype.InitializeRegisters = function() {
this.m_registers = new Vector(e.e_shapeTypeCount);
for (var b = 0; b < e.e_shapeTypeCount; b++) {
this.m_registers[b] =
new Vector(e.e_shapeTypeCount);
for (var c = 0; c < e.e_shapeTypeCount; c++) this.m_registers[b][c] = new A
}
this.AddType(f.Create, f.Destroy, e.e_circleShape, e.e_circleShape);
this.AddType(I.Create, I.Destroy, e.e_polygonShape, e.e_circleShape);
this.AddType(L.Create, L.Destroy, e.e_polygonShape, e.e_polygonShape);
this.AddType(C.Create, C.Destroy, e.e_edgeShape, e.e_circleShape);
this.AddType(u.Create, u.Destroy, e.e_polygonShape, e.e_edgeShape)
};
y.prototype.Create = function(b, c) {
var d = parseInt(b.GetType()),
e = parseInt(c.GetType()),
d = this.m_registers[d][e];
if (d.pool) return e = d.pool, d.pool = e.m_next, d.poolCount--, e.Reset(b, c), e;
e = d.createFcn;
return null != e ? (d.primary ? (e = e(this.m_allocator), e.Reset(b, c)) : (e = e(this.m_allocator), e.Reset(c, b)), e) : null
};
y.prototype.Destroy = function(b) {
0 < b.m_manifold.m_pointCount && (b.m_fixtureA.m_body.SetAwake(!0), b.m_fixtureB.m_body.SetAwake(!0));
var c = parseInt(b.m_fixtureA.GetType()),
d = parseInt(b.m_fixtureB.GetType()),
c = this.m_registers[c][d];
c.poolCount++;
b.m_next = c.pool;
c.pool = b;
c = c.destroyFcn;
c(b, this.m_allocator)
};
A.b2ContactRegister = function() {};
z.b2ContactResult = function() {
this.position = new P;
this.normal = new P;
this.id = new Z
};
B.b2ContactSolver = function() {
this.m_step = new M;
this.m_constraints = new Vector
};
B.prototype.b2ContactSolver = function() {};
B.prototype.Initialize = function(b, c, d, e) {
void 0 === d && (d = 0);
var f;
this.m_step.Set(b);
this.m_allocator = e;
for (this.m_constraintCount = d; this.m_constraints.length < this.m_constraintCount;) this.m_constraints[this.m_constraints.length] = new q;
for (b = 0; b <
d; ++b) {
f = c[b];
e = f.m_fixtureA;
var p = f.m_fixtureB,
g = e.m_shape.m_radius,
j = p.m_shape.m_radius,
v = e.m_body,
n = p.m_body,
H = f.GetManifold(),
u = R.b2MixFriction(e.GetFriction(), p.GetFriction()),
z = R.b2MixRestitution(e.GetRestitution(), p.GetRestitution()),
m = v.m_linearVelocity.x,
y = v.m_linearVelocity.y,
C = n.m_linearVelocity.x,
A = n.m_linearVelocity.y,
E = v.m_angularVelocity,
I = n.m_angularVelocity;
R.b2Assert(0 < H.m_pointCount);
B.s_worldManifold.Initialize(H, v.m_xf, g, n.m_xf, j);
p = B.s_worldManifold.m_normal.x;
f = B.s_worldManifold.m_normal.y;
e = this.m_constraints[b];
e.bodyA = v;
e.bodyB = n;
e.manifold = H;
e.normal.x = p;
e.normal.y = f;
e.pointCount = H.m_pointCount;
e.friction = u;
e.restitution = z;
e.localPlaneNormal.x = H.m_localPlaneNormal.x;
e.localPlaneNormal.y = H.m_localPlaneNormal.y;
e.localPoint.x = H.m_localPoint.x;
e.localPoint.y = H.m_localPoint.y;
e.radius = g + j;
e.type = H.m_type;
for (g = 0; g < e.pointCount; ++g) {
u = H.m_points[g];
j = e.points[g];
j.normalImpulse = u.m_normalImpulse;
j.tangentImpulse = u.m_tangentImpulse;
j.localPoint.SetV(u.m_localPoint);
var u = j.rA.x = B.s_worldManifold.m_points[g].x -
v.m_sweep.c.x,
z = j.rA.y = B.s_worldManifold.m_points[g].y - v.m_sweep.c.y,
G = j.rB.x = B.s_worldManifold.m_points[g].x - n.m_sweep.c.x,
L = j.rB.y = B.s_worldManifold.m_points[g].y - n.m_sweep.c.y,
K = u * f - z * p,
M = G * f - L * p,
K = K * K,
M = M * M;
j.normalMass = 1 / (v.m_invMass + n.m_invMass + v.m_invI * K + n.m_invI * M);
var Q = v.m_mass * v.m_invMass + n.m_mass * n.m_invMass,
Q = Q + (v.m_mass * v.m_invI * K + n.m_mass * n.m_invI * M);
j.equalizedMass = 1 / Q;
M = f;
Q = -p;
K = u * Q - z * M;
M = G * Q - L * M;
K *= K;
M *= M;
j.tangentMass = 1 / (v.m_invMass + n.m_invMass + v.m_invI * K + n.m_invI * M);
j.velocityBias =
0;
u = e.normal.x * (C + -I * L - m - -E * z) + e.normal.y * (A + I * G - y - E * u);
u < -R.b2_velocityThreshold && (j.velocityBias += -e.restitution * u)
}
2 == e.pointCount && (A = e.points[0], C = e.points[1], H = v.m_invMass, v = v.m_invI, m = n.m_invMass, n = n.m_invI, y = A.rA.x * f - A.rA.y * p, A = A.rB.x * f - A.rB.y * p, E = C.rA.x * f - C.rA.y * p, C = C.rB.x * f - C.rB.y * p, p = H + m + v * y * y + n * A * A, f = H + m + v * E * E + n * C * C, n = H + m + v * y * E + n * A * C, p * p < 100 * (p * f - n * n) ? (e.K.col1.Set(p, n), e.K.col2.Set(n, f), e.K.GetInverse(e.normalMass)) : e.pointCount = 1)
}
};
B.prototype.InitVelocityConstraints = function(b) {
for (var c =
0; c < this.m_constraintCount; ++c) {
var d = this.m_constraints[c],
e = d.bodyA,
f = d.bodyB,
p = e.m_invMass,
g = e.m_invI,
j = f.m_invMass,
v = f.m_invI,
n = d.normal.x,
H = d.normal.y,
q = H,
u = -n,
m = 0,
B = 0;
if (b.warmStarting) {
B = d.pointCount;
for (m = 0; m < B; ++m) {
var z = d.points[m];
z.normalImpulse *= b.dtRatio;
z.tangentImpulse *= b.dtRatio;
var C = z.normalImpulse * n + z.tangentImpulse * q,
y = z.normalImpulse * H + z.tangentImpulse * u;
e.m_angularVelocity -= g * (z.rA.x * y - z.rA.y * C);
e.m_linearVelocity.x -= p * C;
e.m_linearVelocity.y -= p * y;
f.m_angularVelocity += v * (z.rB.x *
y - z.rB.y * C);
f.m_linearVelocity.x += j * C;
f.m_linearVelocity.y += j * y
}
} else {
B = d.pointCount;
for (m = 0; m < B; ++m) e = d.points[m], e.normalImpulse = 0, e.tangentImpulse = 0
}
}
};
B.prototype.SolveVelocityConstraints = function() {
for (var b = 0, c, d = 0, e = 0, f = 0, p = 0, g = 0, j = 0, v = 0, n, H = 0; H < this.m_constraintCount; ++H) {
var f = this.m_constraints[H],
q = f.bodyA,
u = f.bodyB,
m = q.m_angularVelocity,
z = u.m_angularVelocity,
B = q.m_linearVelocity,
C = u.m_linearVelocity,
y = q.m_invMass,
A = q.m_invI,
E = u.m_invMass,
I = u.m_invI,
j = f.normal.x,
G = v = f.normal.y;
n = -j;
g = f.friction;
for (b = 0; b < f.pointCount; b++) c = f.points[b], d = C.x - z * c.rB.y - B.x + m * c.rA.y, e = C.y + z * c.rB.x - B.y - m * c.rA.x, d = d * G + e * n, d = c.tangentMass * -d, e = g * c.normalImpulse, e = X.Clamp(c.tangentImpulse + d, -e, e), d = e - c.tangentImpulse, p = d * G, d *= n, B.x -= y * p, B.y -= y * d, m -= A * (c.rA.x * d - c.rA.y * p), C.x += E * p, C.y += E * d, z += I * (c.rB.x * d - c.rB.y * p), c.tangentImpulse = e;
parseInt(f.pointCount);
if (1 == f.pointCount) c = f.points[0], d = C.x + -z * c.rB.y - B.x - -m * c.rA.y, e = C.y + z * c.rB.x - B.y - m * c.rA.x, f = d * j + e * v, d = -c.normalMass * (f - c.velocityBias), e = c.normalImpulse + d, e = 0 <
e ? e : 0, d = e - c.normalImpulse, p = d * j, d *= v, B.x -= y * p, B.y -= y * d, m -= A * (c.rA.x * d - c.rA.y * p), C.x += E * p, C.y += E * d, z += I * (c.rB.x * d - c.rB.y * p), c.normalImpulse = e;
else {
c = f.points[0];
var b = f.points[1],
d = c.normalImpulse,
g = b.normalImpulse,
L = (C.x - z * c.rB.y - B.x + m * c.rA.y) * j + (C.y + z * c.rB.x - B.y - m * c.rA.x) * v,
K = (C.x - z * b.rB.y - B.x + m * b.rA.y) * j + (C.y + z * b.rB.x - B.y - m * b.rA.x) * v,
e = L - c.velocityBias,
p = K - b.velocityBias;
n = f.K;
e -= n.col1.x * d + n.col2.x * g;
for (p -= n.col1.y * d + n.col2.y * g;;) {
n = f.normalMass;
G = -(n.col1.x * e + n.col2.x * p);
n = -(n.col1.y * e + n.col2.y *
p);
if (0 <= G && 0 <= n) {
d = G - d;
g = n - g;
f = d * j;
d *= v;
j *= g;
v *= g;
B.x -= y * (f + j);
B.y -= y * (d + v);
m -= A * (c.rA.x * d - c.rA.y * f + b.rA.x * v - b.rA.y * j);
C.x += E * (f + j);
C.y += E * (d + v);
z += I * (c.rB.x * d - c.rB.y * f + b.rB.x * v - b.rB.y * j);
c.normalImpulse = G;
b.normalImpulse = n;
break
}
G = -c.normalMass * e;
n = 0;
K = f.K.col1.y * G + p;
if (0 <= G && 0 <= K) {
d = G - d;
g = n - g;
f = d * j;
d *= v;
j *= g;
v *= g;
B.x -= y * (f + j);
B.y -= y * (d + v);
m -= A * (c.rA.x * d - c.rA.y * f + b.rA.x * v - b.rA.y * j);
C.x += E * (f + j);
C.y += E * (d + v);
z += I * (c.rB.x * d - c.rB.y * f + b.rB.x * v - b.rB.y * j);
c.normalImpulse = G;
b.normalImpulse = n;
break
}
G = 0;
n = -b.normalMass * p;
L = f.K.col2.x * n + e;
if (0 <= n && 0 <= L) {
d = G - d;
g = n - g;
f = d * j;
d *= v;
j *= g;
v *= g;
B.x -= y * (f + j);
B.y -= y * (d + v);
m -= A * (c.rA.x * d - c.rA.y * f + b.rA.x * v - b.rA.y * j);
C.x += E * (f + j);
C.y += E * (d + v);
z += I * (c.rB.x * d - c.rB.y * f + b.rB.x * v - b.rB.y * j);
c.normalImpulse = G;
b.normalImpulse = n;
break
}
n = G = 0;
L = e;
K = p;
if (0 <= L && 0 <= K) {
d = G - d;
g = n - g;
f = d * j;
d *= v;
j *= g;
v *= g;
B.x -= y * (f + j);
B.y -= y * (d + v);
m -= A * (c.rA.x * d - c.rA.y * f + b.rA.x * v - b.rA.y * j);
C.x += E * (f + j);
C.y += E * (d + v);
z += I * (c.rB.x * d - c.rB.y * f + b.rB.x * v - b.rB.y * j);
c.normalImpulse = G;
b.normalImpulse = n;
break
}
break
}
}
q.m_angularVelocity =
m;
u.m_angularVelocity = z
}
};
B.prototype.FinalizeVelocityConstraints = function() {
for (var b = 0; b < this.m_constraintCount; ++b)
for (var c = this.m_constraints[b], d = c.manifold, e = 0; e < c.pointCount; ++e) {
var f = d.m_points[e],
p = c.points[e];
f.m_normalImpulse = p.normalImpulse;
f.m_tangentImpulse = p.tangentImpulse
}
};
B.prototype.SolvePositionConstraints = function(b) {
void 0 === b && (b = 0);
for (var c = 0, d = 0; d < this.m_constraintCount; d++) {
var e = this.m_constraints[d],
f = e.bodyA,
p = e.bodyB,
g = f.m_mass * f.m_invMass,
j = f.m_mass * f.m_invI,
v = p.m_mass *
p.m_invMass,
n = p.m_mass * p.m_invI;
B.s_psm.Initialize(e);
for (var H = B.s_psm.m_normal, q = 0; q < e.pointCount; q++) {
var u = e.points[q],
m = B.s_psm.m_points[q],
z = B.s_psm.m_separations[q],
C = m.x - f.m_sweep.c.x,
y = m.y - f.m_sweep.c.y,
A = m.x - p.m_sweep.c.x,
m = m.y - p.m_sweep.c.y,
c = c < z ? c : z,
z = X.Clamp(b * (z + R.b2_linearSlop), -R.b2_maxLinearCorrection, 0),
z = -u.equalizedMass * z,
u = z * H.x,
z = z * H.y;
f.m_sweep.c.x -= g * u;
f.m_sweep.c.y -= g * z;
f.m_sweep.a -= j * (C * z - y * u);
f.SynchronizeTransform();
p.m_sweep.c.x += v * u;
p.m_sweep.c.y += v * z;
p.m_sweep.a += n *
(A * z - m * u);
p.SynchronizeTransform()
}
}
return c > -1.5 * R.b2_linearSlop
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.Contacts.b2ContactSolver.s_worldManifold = new H;
Box2D.Dynamics.Contacts.b2ContactSolver.s_psm = new E
});
Box2D.inherit(C, Box2D.Dynamics.Contacts.b2Contact);
C.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;
C.b2EdgeAndCircleContact = function() {
Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments)
};
C.Create = function() {
return new C
};
C.Destroy = function() {};
C.prototype.Reset =
function(b, c) {
this.__super.Reset.call(this, b, c)
};
C.prototype.Evaluate = function() {
var d = this.m_fixtureA.GetBody(),
e = this.m_fixtureB.GetBody();
this.b2CollideEdgeAndCircle(this.m_manifold, this.m_fixtureA.GetShape() instanceof c ? this.m_fixtureA.GetShape() : null, d.m_xf, this.m_fixtureB.GetShape() instanceof b ? this.m_fixtureB.GetShape() : null, e.m_xf)
};
C.prototype.b2CollideEdgeAndCircle = function() {};
Box2D.inherit(G, Box2D.Dynamics.Contacts.b2Contact);
G.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;
G.b2NullContact = function() {
Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments)
};
G.prototype.b2NullContact = function() {
this.__super.b2Contact.call(this)
};
G.prototype.Evaluate = function() {};
Box2D.inherit(I, Box2D.Dynamics.Contacts.b2Contact);
I.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;
I.b2PolyAndCircleContact = function() {
Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments)
};
I.Create = function() {
return new I
};
I.Destroy = function() {};
I.prototype.Reset = function(b,
c) {
this.__super.Reset.call(this, b, c);
R.b2Assert(b.GetType() == e.e_polygonShape);
R.b2Assert(c.GetType() == e.e_circleShape)
};
I.prototype.Evaluate = function() {
var c = this.m_fixtureA.m_body,
e = this.m_fixtureB.m_body;
S.CollidePolygonAndCircle(this.m_manifold, this.m_fixtureA.GetShape() instanceof d ? this.m_fixtureA.GetShape() : null, c.m_xf, this.m_fixtureB.GetShape() instanceof b ? this.m_fixtureB.GetShape() : null, e.m_xf)
};
Box2D.inherit(u, Box2D.Dynamics.Contacts.b2Contact);
u.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;
u.b2PolyAndEdgeContact = function() {
Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments)
};
u.Create = function() {
return new u
};
u.Destroy = function() {};
u.prototype.Reset = function(b, c) {
this.__super.Reset.call(this, b, c);
R.b2Assert(b.GetType() == e.e_polygonShape);
R.b2Assert(c.GetType() == e.e_edgeShape)
};
u.prototype.Evaluate = function() {
var b = this.m_fixtureA.GetBody(),
e = this.m_fixtureB.GetBody();
this.b2CollidePolyAndEdge(this.m_manifold, this.m_fixtureA.GetShape() instanceof d ? this.m_fixtureA.GetShape() :
null, b.m_xf, this.m_fixtureB.GetShape() instanceof c ? this.m_fixtureB.GetShape() : null, e.m_xf)
};
u.prototype.b2CollidePolyAndEdge = function() {};
Box2D.inherit(L, Box2D.Dynamics.Contacts.b2Contact);
L.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;
L.b2PolygonContact = function() {
Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments)
};
L.Create = function() {
return new L
};
L.Destroy = function() {};
L.prototype.Reset = function(b, c) {
this.__super.Reset.call(this, b, c)
};
L.prototype.Evaluate = function() {
var b =
this.m_fixtureA.GetBody(),
c = this.m_fixtureB.GetBody();
S.CollidePolygons(this.m_manifold, this.m_fixtureA.GetShape() instanceof d ? this.m_fixtureA.GetShape() : null, b.m_xf, this.m_fixtureB.GetShape() instanceof d ? this.m_fixtureB.GetShape() : null, c.m_xf)
};
E.b2PositionSolverManifold = function() {};
E.prototype.b2PositionSolverManifold = function() {
this.m_normal = new P;
this.m_separations = new Vector_a2j_Number(R.b2_maxManifoldPoints);
this.m_points = new Vector(R.b2_maxManifoldPoints);
for (var b = 0; b < R.b2_maxManifoldPoints; b++) this.m_points[b] =
new P
};
E.prototype.Initialize = function(b) {
R.b2Assert(0 < b.pointCount);
var c = 0,
d = 0,
e = 0,
f, p = 0,
g = 0;
switch (b.type) {
case U.e_circles:
f = b.bodyA.m_xf.R;
e = b.localPoint;
c = b.bodyA.m_xf.position.x + (f.col1.x * e.x + f.col2.x * e.y);
d = b.bodyA.m_xf.position.y + (f.col1.y * e.x + f.col2.y * e.y);
f = b.bodyB.m_xf.R;
e = b.points[0].localPoint;
p = b.bodyB.m_xf.position.x + (f.col1.x * e.x + f.col2.x * e.y);
f = b.bodyB.m_xf.position.y + (f.col1.y * e.x + f.col2.y * e.y);
var e = p - c,
g = f - d,
j = e * e + g * g;
j > Number.MIN_VALUE * Number.MIN_VALUE ? (j = Math.sqrt(j), this.m_normal.x =
e / j, this.m_normal.y = g / j) : (this.m_normal.x = 1, this.m_normal.y = 0);
this.m_points[0].x = 0.5 * (c + p);
this.m_points[0].y = 0.5 * (d + f);
this.m_separations[0] = e * this.m_normal.x + g * this.m_normal.y - b.radius;
break;
case U.e_faceA:
f = b.bodyA.m_xf.R;
e = b.localPlaneNormal;
this.m_normal.x = f.col1.x * e.x + f.col2.x * e.y;
this.m_normal.y = f.col1.y * e.x + f.col2.y * e.y;
f = b.bodyA.m_xf.R;
e = b.localPoint;
p = b.bodyA.m_xf.position.x + (f.col1.x * e.x + f.col2.x * e.y);
g = b.bodyA.m_xf.position.y + (f.col1.y * e.x + f.col2.y * e.y);
f = b.bodyB.m_xf.R;
for (c = 0; c < b.pointCount; ++c) e =
b.points[c].localPoint, d = b.bodyB.m_xf.position.x + (f.col1.x * e.x + f.col2.x * e.y), e = b.bodyB.m_xf.position.y + (f.col1.y * e.x + f.col2.y * e.y), this.m_separations[c] = (d - p) * this.m_normal.x + (e - g) * this.m_normal.y - b.radius, this.m_points[c].x = d, this.m_points[c].y = e;
break;
case U.e_faceB:
f = b.bodyB.m_xf.R;
e = b.localPlaneNormal;
this.m_normal.x = f.col1.x * e.x + f.col2.x * e.y;
this.m_normal.y = f.col1.y * e.x + f.col2.y * e.y;
f = b.bodyB.m_xf.R;
e = b.localPoint;
p = b.bodyB.m_xf.position.x + (f.col1.x * e.x + f.col2.x * e.y);
g = b.bodyB.m_xf.position.y +
(f.col1.y * e.x + f.col2.y * e.y);
f = b.bodyA.m_xf.R;
for (c = 0; c < b.pointCount; ++c) e = b.points[c].localPoint, d = b.bodyA.m_xf.position.x + (f.col1.x * e.x + f.col2.x * e.y), e = b.bodyA.m_xf.position.y + (f.col1.y * e.x + f.col2.y * e.y), this.m_separations[c] = (d - p) * this.m_normal.x + (e - g) * this.m_normal.y - b.radius, this.m_points[c].Set(d, e);
this.m_normal.x *= -1;
this.m_normal.y *= -1
}
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointA = new P;
Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointB =
new P
})
})();
(function() {
var b = Box2D.Common.Math.b2Mat22,
c = Box2D.Common.Math.b2Math,
d = Box2D.Common.Math.b2Vec2,
e = Box2D.Common.b2Color,
f = Box2D.Dynamics.Controllers.b2BuoyancyController,
j = Box2D.Dynamics.Controllers.b2ConstantAccelController,
q = Box2D.Dynamics.Controllers.b2ConstantForceController,
n = Box2D.Dynamics.Controllers.b2Controller,
g = Box2D.Dynamics.Controllers.b2ControllerEdge,
y = Box2D.Dynamics.Controllers.b2GravityController,
A = Box2D.Dynamics.Controllers.b2TensorDampingController;
Box2D.inherit(f, Box2D.Dynamics.Controllers.b2Controller);
f.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;
f.b2BuoyancyController = function() {
Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);
this.normal = new d(0, -1);
this.density = this.offset = 0;
this.velocity = new d(0, 0);
this.linearDrag = 2;
this.angularDrag = 1;
this.useDensity = !1;
this.useWorldGravity = !0;
this.gravity = null
};
f.prototype.Step = function() {
if (this.m_bodyList) {
this.useWorldGravity && (this.gravity = this.GetWorld().GetGravity().Copy());
for (var b = this.m_bodyList; b; b =
b.nextBody) {
var c = b.body;
if (!1 != c.IsAwake()) {
for (var e = new d, f = new d, g = 0, j = 0, n = c.GetFixtureList(); n; n = n.GetNext()) {
var q = new d,
y = n.GetShape().ComputeSubmergedArea(this.normal, this.offset, c.GetTransform(), q),
g = g + y;
e.x += y * q.x;
e.y += y * q.y;
var A = 0,
A = 1,
j = j + y * A;
f.x += y * q.x * A;
f.y += y * q.y * A
}
e.x /= g;
e.y /= g;
f.x /= j;
f.y /= j;
g < Number.MIN_VALUE || (j = this.gravity.GetNegative(), j.Multiply(this.density * g), c.ApplyForce(j, f), f = c.GetLinearVelocityFromWorldPoint(e), f.Subtract(this.velocity), f.Multiply(-this.linearDrag * g), c.ApplyForce(f,
e), c.ApplyTorque(-c.GetInertia() / c.GetMass() * g * c.GetAngularVelocity() * this.angularDrag))
}
}
}
};
f.prototype.Draw = function(b) {
var c = new d,
f = new d;
c.x = this.normal.x * this.offset + 1E3 * this.normal.y;
c.y = this.normal.y * this.offset - 1E3 * this.normal.x;
f.x = this.normal.x * this.offset - 1E3 * this.normal.y;
f.y = this.normal.y * this.offset + 1E3 * this.normal.x;
var g = new e(0, 0, 1);
b.DrawSegment(c, f, g)
};
Box2D.inherit(j, Box2D.Dynamics.Controllers.b2Controller);
j.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;
j.b2ConstantAccelController = function() {
Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);
this.A = new d(0, 0)
};
j.prototype.Step = function(b) {
b = new d(this.A.x * b.dt, this.A.y * b.dt);
for (var c = this.m_bodyList; c; c = c.nextBody) {
var e = c.body;
e.IsAwake() && e.SetLinearVelocity(new d(e.GetLinearVelocity().x + b.x, e.GetLinearVelocity().y + b.y))
}
};
Box2D.inherit(q, Box2D.Dynamics.Controllers.b2Controller);
q.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;
q.b2ConstantForceController =
function() {
Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);
this.F = new d(0, 0)
};
q.prototype.Step = function() {
for (var b = this.m_bodyList; b; b = b.nextBody) {
var c = b.body;
c.IsAwake() && c.ApplyForce(this.F, c.GetWorldCenter())
}
};
n.b2Controller = function() {};
n.prototype.Step = function() {};
n.prototype.Draw = function() {};
n.prototype.AddBody = function(b) {
var c = new g;
c.controller = this;
c.body = b;
c.nextBody = this.m_bodyList;
c.prevBody = null;
this.m_bodyList = c;
c.nextBody && (c.nextBody.prevBody = c);
this.m_bodyCount++;
c.nextController = b.m_controllerList;
c.prevController = null;
b.m_controllerList = c;
c.nextController && (c.nextController.prevController = c);
b.m_controllerCount++
};
n.prototype.RemoveBody = function(b) {
for (var c = b.m_controllerList; c && c.controller != this;) c = c.nextController;
c.prevBody && (c.prevBody.nextBody = c.nextBody);
c.nextBody && (c.nextBody.prevBody = c.prevBody);
c.nextController && (c.nextController.prevController = c.prevController);
c.prevController && (c.prevController.nextController = c.nextController);
this.m_bodyList ==
c && (this.m_bodyList = c.nextBody);
b.m_controllerList == c && (b.m_controllerList = c.nextController);
b.m_controllerCount--;
this.m_bodyCount--
};
n.prototype.Clear = function() {
for (; this.m_bodyList;) this.RemoveBody(this.m_bodyList.body)
};
n.prototype.GetNext = function() {
return this.m_next
};
n.prototype.GetWorld = function() {
return this.m_world
};
n.prototype.GetBodyList = function() {
return this.m_bodyList
};
g.b2ControllerEdge = function() {};
Box2D.inherit(y, Box2D.Dynamics.Controllers.b2Controller);
y.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;
y.b2GravityController = function() {
Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);
this.G = 1;
this.invSqr = !0
};
y.prototype.Step = function() {
var b = null,
c = null,
e = null,
f = 0,
g = null,
j = null,
n = null,
q = 0,
y = 0,
A = 0;
if (this.invSqr)
for (b = this.m_bodyList; b; b = b.nextBody) {
c = b.body;
e = c.GetWorldCenter();
f = c.GetMass();
for (g = this.m_bodyList; g != b; g = g.nextBody) j = g.body, n = j.GetWorldCenter(), q = n.x - e.x, y = n.y - e.y, A = q * q + y * y, A < Number.MIN_VALUE || (q = new d(q, y), q.Multiply(this.G / A / Math.sqrt(A) * f * j.GetMass()),
c.IsAwake() && c.ApplyForce(q, e), q.Multiply(-1), j.IsAwake() && j.ApplyForce(q, n))
} else
for (b = this.m_bodyList; b; b = b.nextBody) {
c = b.body;
e = c.GetWorldCenter();
f = c.GetMass();
for (g = this.m_bodyList; g != b; g = g.nextBody) j = g.body, n = j.GetWorldCenter(), q = n.x - e.x, y = n.y - e.y, A = q * q + y * y, A < Number.MIN_VALUE || (q = new d(q, y), q.Multiply(this.G / A * f * j.GetMass()), c.IsAwake() && c.ApplyForce(q, e), q.Multiply(-1), j.IsAwake() && j.ApplyForce(q, n))
}
};
Box2D.inherit(A, Box2D.Dynamics.Controllers.b2Controller);
A.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;
A.b2TensorDampingController = function() {
Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);
this.T = new b;
this.maxTimestep = 0
};
A.prototype.SetAxisAligned = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
this.T.col1.x = -b;
this.T.col1.y = 0;
this.T.col2.x = 0;
this.T.col2.y = -c;
this.maxTimestep = 0 < b || 0 < c ? 1 / Math.max(b, c) : 0
};
A.prototype.Step = function(b) {
b = b.dt;
if (!(b <= Number.MIN_VALUE)) {
b > this.maxTimestep && 0 < this.maxTimestep && (b = this.maxTimestep);
for (var e = this.m_bodyList; e; e = e.nextBody) {
var f =
e.body;
if (f.IsAwake()) {
var g = f.GetWorldVector(c.MulMV(this.T, f.GetLocalVector(f.GetLinearVelocity())));
f.SetLinearVelocity(new d(f.GetLinearVelocity().x + g.x * b, f.GetLinearVelocity().y + g.y * b))
}
}
}
}
})();
(function() {
var b = Box2D.Common.b2Settings,
c = Box2D.Common.Math.b2Mat22,
d = Box2D.Common.Math.b2Mat33,
e = Box2D.Common.Math.b2Math,
f = Box2D.Common.Math.b2Vec2,
j = Box2D.Common.Math.b2Vec3,
q = Box2D.Dynamics.Joints.b2DistanceJoint,
n = Box2D.Dynamics.Joints.b2DistanceJointDef,
g = Box2D.Dynamics.Joints.b2FrictionJoint,
y = Box2D.Dynamics.Joints.b2FrictionJointDef,
A = Box2D.Dynamics.Joints.b2GearJoint,
z = Box2D.Dynamics.Joints.b2GearJointDef,
B = Box2D.Dynamics.Joints.b2Jacobian,
C = Box2D.Dynamics.Joints.b2Joint,
G = Box2D.Dynamics.Joints.b2JointDef,
I = Box2D.Dynamics.Joints.b2JointEdge,
u = Box2D.Dynamics.Joints.b2LineJoint,
L = Box2D.Dynamics.Joints.b2LineJointDef,
E = Box2D.Dynamics.Joints.b2MouseJoint,
Q = Box2D.Dynamics.Joints.b2MouseJointDef,
M = Box2D.Dynamics.Joints.b2PrismaticJoint,
R = Box2D.Dynamics.Joints.b2PrismaticJointDef,
K = Box2D.Dynamics.Joints.b2PulleyJoint,
X = Box2D.Dynamics.Joints.b2PulleyJointDef,
P = Box2D.Dynamics.Joints.b2RevoluteJoint,
S = Box2D.Dynamics.Joints.b2RevoluteJointDef,
Z = Box2D.Dynamics.Joints.b2WeldJoint,
U = Box2D.Dynamics.Joints.b2WeldJointDef;
Box2D.inherit(q, Box2D.Dynamics.Joints.b2Joint);
q.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;
q.b2DistanceJoint = function() {
Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);
this.m_localAnchor1 = new f;
this.m_localAnchor2 = new f;
this.m_u = new f
};
q.prototype.GetAnchorA = function() {
return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)
};
q.prototype.GetAnchorB = function() {
return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)
};
q.prototype.GetReactionForce = function(b) {
void 0 === b && (b = 0);
return new f(b * this.m_impulse * this.m_u.x, b * this.m_impulse * this.m_u.y)
};
q.prototype.GetReactionTorque = function() {
return 0
};
q.prototype.GetLength = function() {
return this.m_length
};
q.prototype.SetLength = function(b) {
void 0 === b && (b = 0);
this.m_length = b
};
q.prototype.GetFrequency = function() {
return this.m_frequencyHz
};
q.prototype.SetFrequency = function(b) {
void 0 === b && (b = 0);
this.m_frequencyHz = b
};
q.prototype.GetDampingRatio = function() {
return this.m_dampingRatio
};
q.prototype.SetDampingRatio = function(b) {
void 0 ===
b && (b = 0);
this.m_dampingRatio = b
};
q.prototype.b2DistanceJoint = function(b) {
this.__super.b2Joint.call(this, b);
this.m_localAnchor1.SetV(b.localAnchorA);
this.m_localAnchor2.SetV(b.localAnchorB);
this.m_length = b.length;
this.m_frequencyHz = b.frequencyHz;
this.m_dampingRatio = b.dampingRatio;
this.m_bias = this.m_gamma = this.m_impulse = 0
};
q.prototype.InitVelocityConstraints = function(c) {
var d, e = 0,
f = this.m_bodyA,
g = this.m_bodyB;
d = f.m_xf.R;
var j = this.m_localAnchor1.x - f.m_sweep.localCenter.x,
n = this.m_localAnchor1.y - f.m_sweep.localCenter.y,
e = d.col1.x * j + d.col2.x * n,
n = d.col1.y * j + d.col2.y * n,
j = e;
d = g.m_xf.R;
var l = this.m_localAnchor2.x - g.m_sweep.localCenter.x,
r = this.m_localAnchor2.y - g.m_sweep.localCenter.y,
e = d.col1.x * l + d.col2.x * r,
r = d.col1.y * l + d.col2.y * r,
l = e;
this.m_u.x = g.m_sweep.c.x + l - f.m_sweep.c.x - j;
this.m_u.y = g.m_sweep.c.y + r - f.m_sweep.c.y - n;
e = Math.sqrt(this.m_u.x * this.m_u.x + this.m_u.y * this.m_u.y);
e > b.b2_linearSlop ? this.m_u.Multiply(1 / e) : this.m_u.SetZero();
d = j * this.m_u.y - n * this.m_u.x;
var q = l * this.m_u.y - r * this.m_u.x;
d = f.m_invMass + f.m_invI *
d * d + g.m_invMass + g.m_invI * q * q;
this.m_mass = 0 != d ? 1 / d : 0;
if (0 < this.m_frequencyHz) {
var e = e - this.m_length,
q = 2 * Math.PI * this.m_frequencyHz,
s = this.m_mass * q * q;
this.m_gamma = c.dt * (2 * this.m_mass * this.m_dampingRatio * q + c.dt * s);
this.m_gamma = 0 != this.m_gamma ? 1 / this.m_gamma : 0;
this.m_bias = e * c.dt * s * this.m_gamma;
this.m_mass = d + this.m_gamma;
this.m_mass = 0 != this.m_mass ? 1 / this.m_mass : 0
}
c.warmStarting ? (this.m_impulse *= c.dtRatio, c = this.m_impulse * this.m_u.x, d = this.m_impulse * this.m_u.y, f.m_linearVelocity.x -= f.m_invMass * c, f.m_linearVelocity.y -=
f.m_invMass * d, f.m_angularVelocity -= f.m_invI * (j * d - n * c), g.m_linearVelocity.x += g.m_invMass * c, g.m_linearVelocity.y += g.m_invMass * d, g.m_angularVelocity += g.m_invI * (l * d - r * c)) : this.m_impulse = 0
};
q.prototype.SolveVelocityConstraints = function() {
var b, c = this.m_bodyA,
d = this.m_bodyB;
b = c.m_xf.R;
var e = this.m_localAnchor1.x - c.m_sweep.localCenter.x,
f = this.m_localAnchor1.y - c.m_sweep.localCenter.y,
g = b.col1.x * e + b.col2.x * f,
f = b.col1.y * e + b.col2.y * f,
e = g;
b = d.m_xf.R;
var j = this.m_localAnchor2.x - d.m_sweep.localCenter.x,
l = this.m_localAnchor2.y -
d.m_sweep.localCenter.y,
g = b.col1.x * j + b.col2.x * l,
l = b.col1.y * j + b.col2.y * l,
j = g,
g = -this.m_mass * (this.m_u.x * (d.m_linearVelocity.x + -d.m_angularVelocity * l - (c.m_linearVelocity.x + -c.m_angularVelocity * f)) + this.m_u.y * (d.m_linearVelocity.y + d.m_angularVelocity * j - (c.m_linearVelocity.y + c.m_angularVelocity * e)) + this.m_bias + this.m_gamma * this.m_impulse);
this.m_impulse += g;
b = g * this.m_u.x;
g *= this.m_u.y;
c.m_linearVelocity.x -= c.m_invMass * b;
c.m_linearVelocity.y -= c.m_invMass * g;
c.m_angularVelocity -= c.m_invI * (e * g - f * b);
d.m_linearVelocity.x +=
d.m_invMass * b;
d.m_linearVelocity.y += d.m_invMass * g;
d.m_angularVelocity += d.m_invI * (j * g - l * b)
};
q.prototype.SolvePositionConstraints = function() {
var c;
if (0 < this.m_frequencyHz) return !0;
var d = this.m_bodyA,
f = this.m_bodyB;
c = d.m_xf.R;
var g = this.m_localAnchor1.x - d.m_sweep.localCenter.x,
j = this.m_localAnchor1.y - d.m_sweep.localCenter.y,
n = c.col1.x * g + c.col2.x * j,
j = c.col1.y * g + c.col2.y * j,
g = n;
c = f.m_xf.R;
var q = this.m_localAnchor2.x - f.m_sweep.localCenter.x,
l = this.m_localAnchor2.y - f.m_sweep.localCenter.y,
n = c.col1.x * q + c.col2.x *
l,
l = c.col1.y * q + c.col2.y * l,
q = n,
n = f.m_sweep.c.x + q - d.m_sweep.c.x - g,
r = f.m_sweep.c.y + l - d.m_sweep.c.y - j;
c = Math.sqrt(n * n + r * r);
n /= c;
r /= c;
c -= this.m_length;
c = e.Clamp(c, -b.b2_maxLinearCorrection, b.b2_maxLinearCorrection);
var u = -this.m_mass * c;
this.m_u.Set(n, r);
n = u * this.m_u.x;
r = u * this.m_u.y;
d.m_sweep.c.x -= d.m_invMass * n;
d.m_sweep.c.y -= d.m_invMass * r;
d.m_sweep.a -= d.m_invI * (g * r - j * n);
f.m_sweep.c.x += f.m_invMass * n;
f.m_sweep.c.y += f.m_invMass * r;
f.m_sweep.a += f.m_invI * (q * r - l * n);
d.SynchronizeTransform();
f.SynchronizeTransform();
return e.Abs(c) < b.b2_linearSlop
};
Box2D.inherit(n, Box2D.Dynamics.Joints.b2JointDef);
n.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;
n.b2DistanceJointDef = function() {
Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);
this.localAnchorA = new f;
this.localAnchorB = new f
};
n.prototype.b2DistanceJointDef = function() {
this.__super.b2JointDef.call(this);
this.type = C.e_distanceJoint;
this.length = 1;
this.dampingRatio = this.frequencyHz = 0
};
n.prototype.Initialize = function(b, c, d, e) {
this.bodyA =
b;
this.bodyB = c;
this.localAnchorA.SetV(this.bodyA.GetLocalPoint(d));
this.localAnchorB.SetV(this.bodyB.GetLocalPoint(e));
b = e.x - d.x;
d = e.y - d.y;
this.length = Math.sqrt(b * b + d * d);
this.dampingRatio = this.frequencyHz = 0
};
Box2D.inherit(g, Box2D.Dynamics.Joints.b2Joint);
g.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;
g.b2FrictionJoint = function() {
Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);
this.m_localAnchorA = new f;
this.m_localAnchorB = new f;
this.m_linearMass = new c;
this.m_linearImpulse =
new f
};
g.prototype.GetAnchorA = function() {
return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)
};
g.prototype.GetAnchorB = function() {
return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)
};
g.prototype.GetReactionForce = function(b) {
void 0 === b && (b = 0);
return new f(b * this.m_linearImpulse.x, b * this.m_linearImpulse.y)
};
g.prototype.GetReactionTorque = function(b) {
void 0 === b && (b = 0);
return b * this.m_angularImpulse
};
g.prototype.SetMaxForce = function(b) {
void 0 === b && (b = 0);
this.m_maxForce = b
};
g.prototype.GetMaxForce = function() {
return this.m_maxForce
};
g.prototype.SetMaxTorque = function(b) {
void 0 === b && (b = 0);
this.m_maxTorque = b
};
g.prototype.GetMaxTorque = function() {
return this.m_maxTorque
};
g.prototype.b2FrictionJoint = function(b) {
this.__super.b2Joint.call(this, b);
this.m_localAnchorA.SetV(b.localAnchorA);
this.m_localAnchorB.SetV(b.localAnchorB);
this.m_linearMass.SetZero();
this.m_angularMass = 0;
this.m_linearImpulse.SetZero();
this.m_angularImpulse = 0;
this.m_maxForce = b.maxForce;
this.m_maxTorque = b.maxTorque
};
g.prototype.InitVelocityConstraints = function(b) {
var d,
e = 0,
f = this.m_bodyA,
g = this.m_bodyB;
d = f.m_xf.R;
var j = this.m_localAnchorA.x - f.m_sweep.localCenter.x,
n = this.m_localAnchorA.y - f.m_sweep.localCenter.y,
e = d.col1.x * j + d.col2.x * n,
n = d.col1.y * j + d.col2.y * n,
j = e;
d = g.m_xf.R;
var l = this.m_localAnchorB.x - g.m_sweep.localCenter.x,
r = this.m_localAnchorB.y - g.m_sweep.localCenter.y,
e = d.col1.x * l + d.col2.x * r,
r = d.col1.y * l + d.col2.y * r,
l = e;
d = f.m_invMass;
var e = g.m_invMass,
q = f.m_invI,
s = g.m_invI,
u = new c;
u.col1.x = d + e;
u.col2.x = 0;
u.col1.y = 0;
u.col2.y = d + e;
u.col1.x += q * n * n;
u.col2.x += -q * j *
n;
u.col1.y += -q * j * n;
u.col2.y += q * j * j;
u.col1.x += s * r * r;
u.col2.x += -s * l * r;
u.col1.y += -s * l * r;
u.col2.y += s * l * l;
u.GetInverse(this.m_linearMass);
this.m_angularMass = q + s;
0 < this.m_angularMass && (this.m_angularMass = 1 / this.m_angularMass);
b.warmStarting ? (this.m_linearImpulse.x *= b.dtRatio, this.m_linearImpulse.y *= b.dtRatio, this.m_angularImpulse *= b.dtRatio, b = this.m_linearImpulse, f.m_linearVelocity.x -= d * b.x, f.m_linearVelocity.y -= d * b.y, f.m_angularVelocity -= q * (j * b.y - n * b.x + this.m_angularImpulse), g.m_linearVelocity.x += e * b.x,
g.m_linearVelocity.y += e * b.y, g.m_angularVelocity += s * (l * b.y - r * b.x + this.m_angularImpulse)) : (this.m_linearImpulse.SetZero(), this.m_angularImpulse = 0)
};
g.prototype.SolveVelocityConstraints = function(b) {
var c, d = 0,
g = this.m_bodyA,
j = this.m_bodyB,
n = g.m_linearVelocity,
q = g.m_angularVelocity,
l = j.m_linearVelocity,
r = j.m_angularVelocity,
u = g.m_invMass,
s = j.m_invMass,
y = g.m_invI,
z = j.m_invI;
c = g.m_xf.R;
var A = this.m_localAnchorA.x - g.m_sweep.localCenter.x,
C = this.m_localAnchorA.y - g.m_sweep.localCenter.y,
d = c.col1.x * A + c.col2.x *
C,
C = c.col1.y * A + c.col2.y * C,
A = d;
c = j.m_xf.R;
var B = this.m_localAnchorB.x - j.m_sweep.localCenter.x,
m = this.m_localAnchorB.y - j.m_sweep.localCenter.y,
d = c.col1.x * B + c.col2.x * m,
m = c.col1.y * B + c.col2.y * m,
B = d,
d = -this.m_angularMass * (r - q),
E = this.m_angularImpulse;
c = b.dt * this.m_maxTorque;
this.m_angularImpulse = e.Clamp(this.m_angularImpulse + d, -c, c);
d = this.m_angularImpulse - E;
q -= y * d;
r += z * d;
c = e.MulMV(this.m_linearMass, new f(-(l.x - r * m - n.x + q * C), -(l.y + r * B - n.y - q * A)));
d = this.m_linearImpulse.Copy();
this.m_linearImpulse.Add(c);
c = b.dt * this.m_maxForce;
this.m_linearImpulse.LengthSquared() > c * c && (this.m_linearImpulse.Normalize(), this.m_linearImpulse.Multiply(c));
c = e.SubtractVV(this.m_linearImpulse, d);
n.x -= u * c.x;
n.y -= u * c.y;
q -= y * (A * c.y - C * c.x);
l.x += s * c.x;
l.y += s * c.y;
r += z * (B * c.y - m * c.x);
g.m_angularVelocity = q;
j.m_angularVelocity = r
};
g.prototype.SolvePositionConstraints = function() {
return !0
};
Box2D.inherit(y, Box2D.Dynamics.Joints.b2JointDef);
y.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;
y.b2FrictionJointDef = function() {
Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,
arguments);
this.localAnchorA = new f;
this.localAnchorB = new f
};
y.prototype.b2FrictionJointDef = function() {
this.__super.b2JointDef.call(this);
this.type = C.e_frictionJoint;
this.maxTorque = this.maxForce = 0
};
y.prototype.Initialize = function(b, c, d) {
this.bodyA = b;
this.bodyB = c;
this.localAnchorA.SetV(this.bodyA.GetLocalPoint(d));
this.localAnchorB.SetV(this.bodyB.GetLocalPoint(d))
};
Box2D.inherit(A, Box2D.Dynamics.Joints.b2Joint);
A.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;
A.b2GearJoint = function() {
Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,
arguments);
this.m_groundAnchor1 = new f;
this.m_groundAnchor2 = new f;
this.m_localAnchor1 = new f;
this.m_localAnchor2 = new f;
this.m_J = new B
};
A.prototype.GetAnchorA = function() {
return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)
};
A.prototype.GetAnchorB = function() {
return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)
};
A.prototype.GetReactionForce = function(b) {
void 0 === b && (b = 0);
return new f(b * this.m_impulse * this.m_J.linearB.x, b * this.m_impulse * this.m_J.linearB.y)
};
A.prototype.GetReactionTorque = function(b) {
void 0 ===
b && (b = 0);
var c = this.m_bodyB.m_xf.R,
d = this.m_localAnchor1.x - this.m_bodyB.m_sweep.localCenter.x,
e = this.m_localAnchor1.y - this.m_bodyB.m_sweep.localCenter.y,
f = c.col1.x * d + c.col2.x * e,
e = c.col1.y * d + c.col2.y * e;
return b * (this.m_impulse * this.m_J.angularB - f * this.m_impulse * this.m_J.linearB.y + e * this.m_impulse * this.m_J.linearB.x)
};
A.prototype.GetRatio = function() {
return this.m_ratio
};
A.prototype.SetRatio = function(b) {
void 0 === b && (b = 0);
this.m_ratio = b
};
A.prototype.b2GearJoint = function(b) {
this.__super.b2Joint.call(this,
b);
var c = parseInt(b.joint1.m_type),
d = parseInt(b.joint2.m_type);
this.m_prismatic2 = this.m_revolute2 = this.m_prismatic1 = this.m_revolute1 = null;
var e = 0,
f = 0;
this.m_ground1 = b.joint1.GetBodyA();
this.m_bodyA = b.joint1.GetBodyB();
c == C.e_revoluteJoint ? (this.m_revolute1 = b.joint1 instanceof P ? b.joint1 : null, this.m_groundAnchor1.SetV(this.m_revolute1.m_localAnchor1), this.m_localAnchor1.SetV(this.m_revolute1.m_localAnchor2), e = this.m_revolute1.GetJointAngle()) : (this.m_prismatic1 = b.joint1 instanceof M ? b.joint1 : null,
this.m_groundAnchor1.SetV(this.m_prismatic1.m_localAnchor1), this.m_localAnchor1.SetV(this.m_prismatic1.m_localAnchor2), e = this.m_prismatic1.GetJointTranslation());
this.m_ground2 = b.joint2.GetBodyA();
this.m_bodyB = b.joint2.GetBodyB();
d == C.e_revoluteJoint ? (this.m_revolute2 = b.joint2 instanceof P ? b.joint2 : null, this.m_groundAnchor2.SetV(this.m_revolute2.m_localAnchor1), this.m_localAnchor2.SetV(this.m_revolute2.m_localAnchor2), f = this.m_revolute2.GetJointAngle()) : (this.m_prismatic2 = b.joint2 instanceof M ? b.joint2 :
null, this.m_groundAnchor2.SetV(this.m_prismatic2.m_localAnchor1), this.m_localAnchor2.SetV(this.m_prismatic2.m_localAnchor2), f = this.m_prismatic2.GetJointTranslation());
this.m_ratio = b.ratio;
this.m_constant = e + this.m_ratio * f;
this.m_impulse = 0
};
A.prototype.InitVelocityConstraints = function(b) {
var c = this.m_ground1,
d = this.m_ground2,
e = this.m_bodyA,
f = this.m_bodyB,
g = 0,
j = 0,
l = 0,
n = 0,
q = 0,
s = 0;
this.m_J.SetZero();
this.m_revolute1 ? (this.m_J.angularA = -1, s += e.m_invI) : (c = c.m_xf.R, j = this.m_prismatic1.m_localXAxis1, g = c.col1.x *
j.x + c.col2.x * j.y, j = c.col1.y * j.x + c.col2.y * j.y, c = e.m_xf.R, l = this.m_localAnchor1.x - e.m_sweep.localCenter.x, n = this.m_localAnchor1.y - e.m_sweep.localCenter.y, q = c.col1.x * l + c.col2.x * n, n = c.col1.y * l + c.col2.y * n, l = q * j - n * g, this.m_J.linearA.Set(-g, -j), this.m_J.angularA = -l, s += e.m_invMass + e.m_invI * l * l);
this.m_revolute2 ? (this.m_J.angularB = -this.m_ratio, s += this.m_ratio * this.m_ratio * f.m_invI) : (c = d.m_xf.R, j = this.m_prismatic2.m_localXAxis1, g = c.col1.x * j.x + c.col2.x * j.y, j = c.col1.y * j.x + c.col2.y * j.y, c = f.m_xf.R, l = this.m_localAnchor2.x -
f.m_sweep.localCenter.x, n = this.m_localAnchor2.y - f.m_sweep.localCenter.y, q = c.col1.x * l + c.col2.x * n, n = c.col1.y * l + c.col2.y * n, l = q * j - n * g, this.m_J.linearB.Set(-this.m_ratio * g, -this.m_ratio * j), this.m_J.angularB = -this.m_ratio * l, s += this.m_ratio * this.m_ratio * (f.m_invMass + f.m_invI * l * l));
this.m_mass = 0 < s ? 1 / s : 0;
b.warmStarting ? (e.m_linearVelocity.x += e.m_invMass * this.m_impulse * this.m_J.linearA.x, e.m_linearVelocity.y += e.m_invMass * this.m_impulse * this.m_J.linearA.y, e.m_angularVelocity += e.m_invI * this.m_impulse * this.m_J.angularA,
f.m_linearVelocity.x += f.m_invMass * this.m_impulse * this.m_J.linearB.x, f.m_linearVelocity.y += f.m_invMass * this.m_impulse * this.m_J.linearB.y, f.m_angularVelocity += f.m_invI * this.m_impulse * this.m_J.angularB) : this.m_impulse = 0
};
A.prototype.SolveVelocityConstraints = function() {
var b = this.m_bodyA,
c = this.m_bodyB,
d = -this.m_mass * this.m_J.Compute(b.m_linearVelocity, b.m_angularVelocity, c.m_linearVelocity, c.m_angularVelocity);
this.m_impulse += d;
b.m_linearVelocity.x += b.m_invMass * d * this.m_J.linearA.x;
b.m_linearVelocity.y +=
b.m_invMass * d * this.m_J.linearA.y;
b.m_angularVelocity += b.m_invI * d * this.m_J.angularA;
c.m_linearVelocity.x += c.m_invMass * d * this.m_J.linearB.x;
c.m_linearVelocity.y += c.m_invMass * d * this.m_J.linearB.y;
c.m_angularVelocity += c.m_invI * d * this.m_J.angularB
};
A.prototype.SolvePositionConstraints = function() {
var c = this.m_bodyA,
d = this.m_bodyB,
e = 0,
f = 0,
e = this.m_revolute1 ? this.m_revolute1.GetJointAngle() : this.m_prismatic1.GetJointTranslation(),
f = this.m_revolute2 ? this.m_revolute2.GetJointAngle() : this.m_prismatic2.GetJointTranslation(),
e = -this.m_mass * (this.m_constant - (e + this.m_ratio * f));
c.m_sweep.c.x += c.m_invMass * e * this.m_J.linearA.x;
c.m_sweep.c.y += c.m_invMass * e * this.m_J.linearA.y;
c.m_sweep.a += c.m_invI * e * this.m_J.angularA;
d.m_sweep.c.x += d.m_invMass * e * this.m_J.linearB.x;
d.m_sweep.c.y += d.m_invMass * e * this.m_J.linearB.y;
d.m_sweep.a += d.m_invI * e * this.m_J.angularB;
c.SynchronizeTransform();
d.SynchronizeTransform();
return 0 < b.b2_linearSlop
};
Box2D.inherit(z, Box2D.Dynamics.Joints.b2JointDef);
z.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;
z.b2GearJointDef = function() {
Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments)
};
z.prototype.b2GearJointDef = function() {
this.__super.b2JointDef.call(this);
this.type = C.e_gearJoint;
this.joint2 = this.joint1 = null;
this.ratio = 1
};
B.b2Jacobian = function() {
this.linearA = new f;
this.linearB = new f
};
B.prototype.SetZero = function() {
this.linearA.SetZero();
this.angularA = 0;
this.linearB.SetZero();
this.angularB = 0
};
B.prototype.Set = function(b, c, d, e) {
void 0 === c && (c = 0);
void 0 === e && (e = 0);
this.linearA.SetV(b);
this.angularA =
c;
this.linearB.SetV(d);
this.angularB = e
};
B.prototype.Compute = function(b, c, d, e) {
void 0 === c && (c = 0);
void 0 === e && (e = 0);
return this.linearA.x * b.x + this.linearA.y * b.y + this.angularA * c + (this.linearB.x * d.x + this.linearB.y * d.y) + this.angularB * e
};
C.b2Joint = function() {
this.m_edgeA = new I;
this.m_edgeB = new I;
this.m_localCenterA = new f;
this.m_localCenterB = new f
};
C.prototype.GetType = function() {
return this.m_type
};
C.prototype.GetAnchorA = function() {
return null
};
C.prototype.GetAnchorB = function() {
return null
};
C.prototype.GetReactionForce =
function() {
return null
};
C.prototype.GetReactionTorque = function() {
return 0
};
C.prototype.GetBodyA = function() {
return this.m_bodyA
};
C.prototype.GetBodyB = function() {
return this.m_bodyB
};
C.prototype.GetNext = function() {
return this.m_next
};
C.prototype.GetUserData = function() {
return this.m_userData
};
C.prototype.SetUserData = function(b) {
this.m_userData = b
};
C.prototype.IsActive = function() {
return this.m_bodyA.IsActive() && this.m_bodyB.IsActive()
};
C.Create = function(b) {
var c = null;
switch (b.type) {
case C.e_distanceJoint:
c =
new q(b instanceof n ? b : null);
break;
case C.e_mouseJoint:
c = new E(b instanceof Q ? b : null);
break;
case C.e_prismaticJoint:
c = new M(b instanceof R ? b : null);
break;
case C.e_revoluteJoint:
c = new P(b instanceof S ? b : null);
break;
case C.e_pulleyJoint:
c = new K(b instanceof X ? b : null);
break;
case C.e_gearJoint:
c = new A(b instanceof z ? b : null);
break;
case C.e_lineJoint:
c = new u(b instanceof L ? b : null);
break;
case C.e_weldJoint:
c = new Z(b instanceof U ? b : null);
break;
case C.e_frictionJoint:
c = new g(b instanceof y ? b : null)
}
return c
};
C.Destroy = function() {};
C.prototype.b2Joint = function(c) {
b.b2Assert(c.bodyA != c.bodyB);
this.m_type = c.type;
this.m_next = this.m_prev = null;
this.m_bodyA = c.bodyA;
this.m_bodyB = c.bodyB;
this.m_collideConnected = c.collideConnected;
this.m_islandFlag = !1;
this.m_userData = c.userData
};
C.prototype.InitVelocityConstraints = function() {};
C.prototype.SolveVelocityConstraints = function() {};
C.prototype.FinalizeVelocityConstraints = function() {};
C.prototype.SolvePositionConstraints = function() {
return !1
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.Joints.b2Joint.e_unknownJoint =
0;
Box2D.Dynamics.Joints.b2Joint.e_revoluteJoint = 1;
Box2D.Dynamics.Joints.b2Joint.e_prismaticJoint = 2;
Box2D.Dynamics.Joints.b2Joint.e_distanceJoint = 3;
Box2D.Dynamics.Joints.b2Joint.e_pulleyJoint = 4;
Box2D.Dynamics.Joints.b2Joint.e_mouseJoint = 5;
Box2D.Dynamics.Joints.b2Joint.e_gearJoint = 6;
Box2D.Dynamics.Joints.b2Joint.e_lineJoint = 7;
Box2D.Dynamics.Joints.b2Joint.e_weldJoint = 8;
Box2D.Dynamics.Joints.b2Joint.e_frictionJoint = 9;
Box2D.Dynamics.Joints.b2Joint.e_inactiveLimit = 0;
Box2D.Dynamics.Joints.b2Joint.e_atLowerLimit =
1;
Box2D.Dynamics.Joints.b2Joint.e_atUpperLimit = 2;
Box2D.Dynamics.Joints.b2Joint.e_equalLimits = 3
});
G.b2JointDef = function() {};
G.prototype.b2JointDef = function() {
this.type = C.e_unknownJoint;
this.bodyB = this.bodyA = this.userData = null;
this.collideConnected = !1
};
I.b2JointEdge = function() {};
Box2D.inherit(u, Box2D.Dynamics.Joints.b2Joint);
u.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;
u.b2LineJoint = function() {
Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);
this.m_localAnchor1 = new f;
this.m_localAnchor2 =
new f;
this.m_localXAxis1 = new f;
this.m_localYAxis1 = new f;
this.m_axis = new f;
this.m_perp = new f;
this.m_K = new c;
this.m_impulse = new f
};
u.prototype.GetAnchorA = function() {
return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)
};
u.prototype.GetAnchorB = function() {
return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)
};
u.prototype.GetReactionForce = function(b) {
void 0 === b && (b = 0);
return new f(b * (this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.x), b * (this.m_impulse.x * this.m_perp.y +
(this.m_motorImpulse + this.m_impulse.y) * this.m_axis.y))
};
u.prototype.GetReactionTorque = function(b) {
void 0 === b && (b = 0);
return b * this.m_impulse.y
};
u.prototype.GetJointTranslation = function() {
var b = this.m_bodyA,
c = this.m_bodyB,
d = b.GetWorldPoint(this.m_localAnchor1),
e = c.GetWorldPoint(this.m_localAnchor2),
c = e.x - d.x,
d = e.y - d.y,
b = b.GetWorldVector(this.m_localXAxis1);
return b.x * c + b.y * d
};
u.prototype.GetJointSpeed = function() {
var b = this.m_bodyA,
c = this.m_bodyB,
d;
d = b.m_xf.R;
var e = this.m_localAnchor1.x - b.m_sweep.localCenter.x,
f = this.m_localAnchor1.y - b.m_sweep.localCenter.y,
g = d.col1.x * e + d.col2.x * f,
f = d.col1.y * e + d.col2.y * f,
e = g;
d = c.m_xf.R;
var j = this.m_localAnchor2.x - c.m_sweep.localCenter.x,
l = this.m_localAnchor2.y - c.m_sweep.localCenter.y,
g = d.col1.x * j + d.col2.x * l,
l = d.col1.y * j + d.col2.y * l,
j = g;
d = c.m_sweep.c.x + j - (b.m_sweep.c.x + e);
var g = c.m_sweep.c.y + l - (b.m_sweep.c.y + f),
n = b.GetWorldVector(this.m_localXAxis1),
q = b.m_linearVelocity,
s = c.m_linearVelocity,
b = b.m_angularVelocity,
c = c.m_angularVelocity;
return d * -b * n.y + g * b * n.x + (n.x * (s.x + -c *
l - q.x - -b * f) + n.y * (s.y + c * j - q.y - b * e))
};
u.prototype.IsLimitEnabled = function() {
return this.m_enableLimit
};
u.prototype.EnableLimit = function(b) {
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_enableLimit = b
};
u.prototype.GetLowerLimit = function() {
return this.m_lowerTranslation
};
u.prototype.GetUpperLimit = function() {
return this.m_upperTranslation
};
u.prototype.SetLimits = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_lowerTranslation = b;
this.m_upperTranslation =
c
};
u.prototype.IsMotorEnabled = function() {
return this.m_enableMotor
};
u.prototype.EnableMotor = function(b) {
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_enableMotor = b
};
u.prototype.SetMotorSpeed = function(b) {
void 0 === b && (b = 0);
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_motorSpeed = b
};
u.prototype.GetMotorSpeed = function() {
return this.m_motorSpeed
};
u.prototype.SetMaxMotorForce = function(b) {
void 0 === b && (b = 0);
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_maxMotorForce =
b
};
u.prototype.GetMaxMotorForce = function() {
return this.m_maxMotorForce
};
u.prototype.GetMotorForce = function() {
return this.m_motorImpulse
};
u.prototype.b2LineJoint = function(b) {
this.__super.b2Joint.call(this, b);
this.m_localAnchor1.SetV(b.localAnchorA);
this.m_localAnchor2.SetV(b.localAnchorB);
this.m_localXAxis1.SetV(b.localAxisA);
this.m_localYAxis1.x = -this.m_localXAxis1.y;
this.m_localYAxis1.y = this.m_localXAxis1.x;
this.m_impulse.SetZero();
this.m_motorImpulse = this.m_motorMass = 0;
this.m_lowerTranslation = b.lowerTranslation;
this.m_upperTranslation = b.upperTranslation;
this.m_maxMotorForce = b.maxMotorForce;
this.m_motorSpeed = b.motorSpeed;
this.m_enableLimit = b.enableLimit;
this.m_enableMotor = b.enableMotor;
this.m_limitState = C.e_inactiveLimit;
this.m_axis.SetZero();
this.m_perp.SetZero()
};
u.prototype.InitVelocityConstraints = function(c) {
var d = this.m_bodyA,
f = this.m_bodyB,
g, j = 0;
this.m_localCenterA.SetV(d.GetLocalCenter());
this.m_localCenterB.SetV(f.GetLocalCenter());
var n = d.GetTransform();
f.GetTransform();
g = d.m_xf.R;
var q = this.m_localAnchor1.x -
this.m_localCenterA.x,
l = this.m_localAnchor1.y - this.m_localCenterA.y,
j = g.col1.x * q + g.col2.x * l,
l = g.col1.y * q + g.col2.y * l,
q = j;
g = f.m_xf.R;
var r = this.m_localAnchor2.x - this.m_localCenterB.x,
u = this.m_localAnchor2.y - this.m_localCenterB.y,
j = g.col1.x * r + g.col2.x * u,
u = g.col1.y * r + g.col2.y * u,
r = j;
g = f.m_sweep.c.x + r - d.m_sweep.c.x - q;
j = f.m_sweep.c.y + u - d.m_sweep.c.y - l;
this.m_invMassA = d.m_invMass;
this.m_invMassB = f.m_invMass;
this.m_invIA = d.m_invI;
this.m_invIB = f.m_invI;
this.m_axis.SetV(e.MulMV(n.R, this.m_localXAxis1));
this.m_a1 =
(g + q) * this.m_axis.y - (j + l) * this.m_axis.x;
this.m_a2 = r * this.m_axis.y - u * this.m_axis.x;
this.m_motorMass = this.m_invMassA + this.m_invMassB + this.m_invIA * this.m_a1 * this.m_a1 + this.m_invIB * this.m_a2 * this.m_a2;
this.m_motorMass = this.m_motorMass > Number.MIN_VALUE ? 1 / this.m_motorMass : 0;
this.m_perp.SetV(e.MulMV(n.R, this.m_localYAxis1));
this.m_s1 = (g + q) * this.m_perp.y - (j + l) * this.m_perp.x;
this.m_s2 = r * this.m_perp.y - u * this.m_perp.x;
n = this.m_invMassA;
q = this.m_invMassB;
l = this.m_invIA;
r = this.m_invIB;
this.m_K.col1.x = n + q + l * this.m_s1 *
this.m_s1 + r * this.m_s2 * this.m_s2;
this.m_K.col1.y = l * this.m_s1 * this.m_a1 + r * this.m_s2 * this.m_a2;
this.m_K.col2.x = this.m_K.col1.y;
this.m_K.col2.y = n + q + l * this.m_a1 * this.m_a1 + r * this.m_a2 * this.m_a2;
this.m_enableLimit ? (g = this.m_axis.x * g + this.m_axis.y * j, e.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2 * b.b2_linearSlop ? this.m_limitState = C.e_equalLimits : g <= this.m_lowerTranslation ? this.m_limitState != C.e_atLowerLimit && (this.m_limitState = C.e_atLowerLimit, this.m_impulse.y = 0) : g >= this.m_upperTranslation ? this.m_limitState !=
C.e_atUpperLimit && (this.m_limitState = C.e_atUpperLimit, this.m_impulse.y = 0) : (this.m_limitState = C.e_inactiveLimit, this.m_impulse.y = 0)) : this.m_limitState = C.e_inactiveLimit;
!1 == this.m_enableMotor && (this.m_motorImpulse = 0);
c.warmStarting ? (this.m_impulse.x *= c.dtRatio, this.m_impulse.y *= c.dtRatio, this.m_motorImpulse *= c.dtRatio, c = this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.x, g = this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.y, j = this.m_impulse.x *
this.m_s1 + (this.m_motorImpulse + this.m_impulse.y) * this.m_a1, n = this.m_impulse.x * this.m_s2 + (this.m_motorImpulse + this.m_impulse.y) * this.m_a2, d.m_linearVelocity.x -= this.m_invMassA * c, d.m_linearVelocity.y -= this.m_invMassA * g, d.m_angularVelocity -= this.m_invIA * j, f.m_linearVelocity.x += this.m_invMassB * c, f.m_linearVelocity.y += this.m_invMassB * g, f.m_angularVelocity += this.m_invIB * n) : (this.m_impulse.SetZero(), this.m_motorImpulse = 0)
};
u.prototype.SolveVelocityConstraints = function(b) {
var c = this.m_bodyA,
d = this.m_bodyB,
g = c.m_linearVelocity,
j = c.m_angularVelocity,
n = d.m_linearVelocity,
q = d.m_angularVelocity,
l = 0,
r = 0,
u = 0,
s = 0;
this.m_enableMotor && this.m_limitState != C.e_equalLimits && (s = this.m_motorMass * (this.m_motorSpeed - (this.m_axis.x * (n.x - g.x) + this.m_axis.y * (n.y - g.y) + this.m_a2 * q - this.m_a1 * j)), l = this.m_motorImpulse, r = b.dt * this.m_maxMotorForce, this.m_motorImpulse = e.Clamp(this.m_motorImpulse + s, -r, r), s = this.m_motorImpulse - l, l = s * this.m_axis.x, r = s * this.m_axis.y, u = s * this.m_a1, s *= this.m_a2, g.x -= this.m_invMassA * l, g.y -= this.m_invMassA *
r, j -= this.m_invIA * u, n.x += this.m_invMassB * l, n.y += this.m_invMassB * r, q += this.m_invIB * s);
r = this.m_perp.x * (n.x - g.x) + this.m_perp.y * (n.y - g.y) + this.m_s2 * q - this.m_s1 * j;
this.m_enableLimit && this.m_limitState != C.e_inactiveLimit ? (u = this.m_axis.x * (n.x - g.x) + this.m_axis.y * (n.y - g.y) + this.m_a2 * q - this.m_a1 * j, l = this.m_impulse.Copy(), b = this.m_K.Solve(new f, -r, -u), this.m_impulse.Add(b), this.m_limitState == C.e_atLowerLimit ? this.m_impulse.y = e.Max(this.m_impulse.y, 0) : this.m_limitState == C.e_atUpperLimit && (this.m_impulse.y =
e.Min(this.m_impulse.y, 0)), r = -r - (this.m_impulse.y - l.y) * this.m_K.col2.x, u = 0 != this.m_K.col1.x ? r / this.m_K.col1.x + l.x : l.x, this.m_impulse.x = u, b.x = this.m_impulse.x - l.x, b.y = this.m_impulse.y - l.y, l = b.x * this.m_perp.x + b.y * this.m_axis.x, r = b.x * this.m_perp.y + b.y * this.m_axis.y, u = b.x * this.m_s1 + b.y * this.m_a1, s = b.x * this.m_s2 + b.y * this.m_a2) : (b = 0 != this.m_K.col1.x ? -r / this.m_K.col1.x : 0, this.m_impulse.x += b, l = b * this.m_perp.x, r = b * this.m_perp.y, u = b * this.m_s1, s = b * this.m_s2);
g.x -= this.m_invMassA * l;
g.y -= this.m_invMassA * r;
j -=
this.m_invIA * u;
n.x += this.m_invMassB * l;
n.y += this.m_invMassB * r;
q += this.m_invIB * s;
c.m_linearVelocity.SetV(g);
c.m_angularVelocity = j;
d.m_linearVelocity.SetV(n);
d.m_angularVelocity = q
};
u.prototype.SolvePositionConstraints = function() {
var d = this.m_bodyA,
g = this.m_bodyB,
j = d.m_sweep.c,
n = d.m_sweep.a,
q = g.m_sweep.c,
u = g.m_sweep.a,
y, l = 0,
r = 0,
z = 0,
s = 0,
A = 0,
C = 0,
r = !1,
B = 0,
E = c.FromAngle(n),
z = c.FromAngle(u);
y = E;
var C = this.m_localAnchor1.x - this.m_localCenterA.x,
G = this.m_localAnchor1.y - this.m_localCenterA.y,
l = y.col1.x * C + y.col2.x *
G,
G = y.col1.y * C + y.col2.y * G,
C = l;
y = z;
z = this.m_localAnchor2.x - this.m_localCenterB.x;
s = this.m_localAnchor2.y - this.m_localCenterB.y;
l = y.col1.x * z + y.col2.x * s;
s = y.col1.y * z + y.col2.y * s;
z = l;
y = q.x + z - j.x - C;
l = q.y + s - j.y - G;
if (this.m_enableLimit) {
this.m_axis = e.MulMV(E, this.m_localXAxis1);
this.m_a1 = (y + C) * this.m_axis.y - (l + G) * this.m_axis.x;
this.m_a2 = z * this.m_axis.y - s * this.m_axis.x;
var m = this.m_axis.x * y + this.m_axis.y * l;
e.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2 * b.b2_linearSlop ? (B = e.Clamp(m, -b.b2_maxLinearCorrection,
b.b2_maxLinearCorrection), A = e.Abs(m), r = !0) : m <= this.m_lowerTranslation ? (B = e.Clamp(m - this.m_lowerTranslation + b.b2_linearSlop, -b.b2_maxLinearCorrection, 0), A = this.m_lowerTranslation - m, r = !0) : m >= this.m_upperTranslation && (B = e.Clamp(m - this.m_upperTranslation + b.b2_linearSlop, 0, b.b2_maxLinearCorrection), A = m - this.m_upperTranslation, r = !0)
}
this.m_perp = e.MulMV(E, this.m_localYAxis1);
this.m_s1 = (y + C) * this.m_perp.y - (l + G) * this.m_perp.x;
this.m_s2 = z * this.m_perp.y - s * this.m_perp.x;
E = new f;
G = this.m_perp.x * y + this.m_perp.y *
l;
A = e.Max(A, e.Abs(G));
C = 0;
r ? (r = this.m_invMassA, z = this.m_invMassB, s = this.m_invIA, y = this.m_invIB, this.m_K.col1.x = r + z + s * this.m_s1 * this.m_s1 + y * this.m_s2 * this.m_s2, this.m_K.col1.y = s * this.m_s1 * this.m_a1 + y * this.m_s2 * this.m_a2, this.m_K.col2.x = this.m_K.col1.y, this.m_K.col2.y = r + z + s * this.m_a1 * this.m_a1 + y * this.m_a2 * this.m_a2, this.m_K.Solve(E, -G, -B)) : (r = this.m_invMassA, z = this.m_invMassB, s = this.m_invIA, y = this.m_invIB, B = r + z + s * this.m_s1 * this.m_s1 + y * this.m_s2 * this.m_s2, E.x = 0 != B ? -G / B : 0, E.y = 0);
B = E.x * this.m_perp.x + E.y *
this.m_axis.x;
r = E.x * this.m_perp.y + E.y * this.m_axis.y;
G = E.x * this.m_s1 + E.y * this.m_a1;
E = E.x * this.m_s2 + E.y * this.m_a2;
j.x -= this.m_invMassA * B;
j.y -= this.m_invMassA * r;
n -= this.m_invIA * G;
q.x += this.m_invMassB * B;
q.y += this.m_invMassB * r;
u += this.m_invIB * E;
d.m_sweep.a = n;
g.m_sweep.a = u;
d.SynchronizeTransform();
g.SynchronizeTransform();
return A <= b.b2_linearSlop && C <= b.b2_angularSlop
};
Box2D.inherit(L, Box2D.Dynamics.Joints.b2JointDef);
L.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;
L.b2LineJointDef = function() {
Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,
arguments);
this.localAnchorA = new f;
this.localAnchorB = new f;
this.localAxisA = new f
};
L.prototype.b2LineJointDef = function() {
this.__super.b2JointDef.call(this);
this.type = C.e_lineJoint;
this.localAxisA.Set(1, 0);
this.enableLimit = !1;
this.upperTranslation = this.lowerTranslation = 0;
this.enableMotor = !1;
this.motorSpeed = this.maxMotorForce = 0
};
L.prototype.Initialize = function(b, c, d, e) {
this.bodyA = b;
this.bodyB = c;
this.localAnchorA = this.bodyA.GetLocalPoint(d);
this.localAnchorB = this.bodyB.GetLocalPoint(d);
this.localAxisA =
this.bodyA.GetLocalVector(e)
};
Box2D.inherit(E, Box2D.Dynamics.Joints.b2Joint);
E.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;
E.b2MouseJoint = function() {
Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);
this.K = new c;
this.K1 = new c;
this.K2 = new c;
this.m_localAnchor = new f;
this.m_target = new f;
this.m_impulse = new f;
this.m_mass = new c;
this.m_C = new f
};
E.prototype.GetAnchorA = function() {
return this.m_target
};
E.prototype.GetAnchorB = function() {
return this.m_bodyB.GetWorldPoint(this.m_localAnchor)
};
E.prototype.GetReactionForce = function(b) {
void 0 === b && (b = 0);
return new f(b * this.m_impulse.x, b * this.m_impulse.y)
};
E.prototype.GetReactionTorque = function() {
return 0
};
E.prototype.GetTarget = function() {
return this.m_target
};
E.prototype.SetTarget = function(b) {
!1 == this.m_bodyB.IsAwake() && this.m_bodyB.SetAwake(!0);
this.m_target = b
};
E.prototype.GetMaxForce = function() {
return this.m_maxForce
};
E.prototype.SetMaxForce = function(b) {
void 0 === b && (b = 0);
this.m_maxForce = b
};
E.prototype.GetFrequency = function() {
return this.m_frequencyHz
};
E.prototype.SetFrequency = function(b) {
void 0 === b && (b = 0);
this.m_frequencyHz = b
};
E.prototype.GetDampingRatio = function() {
return this.m_dampingRatio
};
E.prototype.SetDampingRatio = function(b) {
void 0 === b && (b = 0);
this.m_dampingRatio = b
};
E.prototype.b2MouseJoint = function(b) {
this.__super.b2Joint.call(this, b);
this.m_target.SetV(b.target);
var c = this.m_target.x - this.m_bodyB.m_xf.position.x,
d = this.m_target.y - this.m_bodyB.m_xf.position.y,
e = this.m_bodyB.m_xf.R;
this.m_localAnchor.x = c * e.col1.x + d * e.col1.y;
this.m_localAnchor.y =
c * e.col2.x + d * e.col2.y;
this.m_maxForce = b.maxForce;
this.m_impulse.SetZero();
this.m_frequencyHz = b.frequencyHz;
this.m_dampingRatio = b.dampingRatio;
this.m_gamma = this.m_beta = 0
};
E.prototype.InitVelocityConstraints = function(b) {
var c = this.m_bodyB,
d = c.GetMass(),
e = 2 * Math.PI * this.m_frequencyHz,
f = d * e * e;
this.m_gamma = b.dt * (2 * d * this.m_dampingRatio * e + b.dt * f);
this.m_gamma = 0 != this.m_gamma ? 1 / this.m_gamma : 0;
this.m_beta = b.dt * f * this.m_gamma;
var f = c.m_xf.R,
d = this.m_localAnchor.x - c.m_sweep.localCenter.x,
e = this.m_localAnchor.y -
c.m_sweep.localCenter.y,
g = f.col1.x * d + f.col2.x * e,
e = f.col1.y * d + f.col2.y * e,
d = g,
f = c.m_invMass,
g = c.m_invI;
this.K1.col1.x = f;
this.K1.col2.x = 0;
this.K1.col1.y = 0;
this.K1.col2.y = f;
this.K2.col1.x = g * e * e;
this.K2.col2.x = -g * d * e;
this.K2.col1.y = -g * d * e;
this.K2.col2.y = g * d * d;
this.K.SetM(this.K1);
this.K.AddM(this.K2);
this.K.col1.x += this.m_gamma;
this.K.col2.y += this.m_gamma;
this.K.GetInverse(this.m_mass);
this.m_C.x = c.m_sweep.c.x + d - this.m_target.x;
this.m_C.y = c.m_sweep.c.y + e - this.m_target.y;
c.m_angularVelocity *= 0.98;
this.m_impulse.x *=
b.dtRatio;
this.m_impulse.y *= b.dtRatio;
c.m_linearVelocity.x += f * this.m_impulse.x;
c.m_linearVelocity.y += f * this.m_impulse.y;
c.m_angularVelocity += g * (d * this.m_impulse.y - e * this.m_impulse.x)
};
E.prototype.SolveVelocityConstraints = function(b) {
var c = this.m_bodyB,
d, e = 0,
f = 0;
d = c.m_xf.R;
var g = this.m_localAnchor.x - c.m_sweep.localCenter.x,
j = this.m_localAnchor.y - c.m_sweep.localCenter.y,
e = d.col1.x * g + d.col2.x * j,
j = d.col1.y * g + d.col2.y * j,
g = e,
e = c.m_linearVelocity.x + -c.m_angularVelocity * j,
l = c.m_linearVelocity.y + c.m_angularVelocity *
g;
d = this.m_mass;
e = e + this.m_beta * this.m_C.x + this.m_gamma * this.m_impulse.x;
f = l + this.m_beta * this.m_C.y + this.m_gamma * this.m_impulse.y;
l = -(d.col1.x * e + d.col2.x * f);
f = -(d.col1.y * e + d.col2.y * f);
d = this.m_impulse.x;
e = this.m_impulse.y;
this.m_impulse.x += l;
this.m_impulse.y += f;
b = b.dt * this.m_maxForce;
this.m_impulse.LengthSquared() > b * b && this.m_impulse.Multiply(b / this.m_impulse.Length());
l = this.m_impulse.x - d;
f = this.m_impulse.y - e;
c.m_linearVelocity.x += c.m_invMass * l;
c.m_linearVelocity.y += c.m_invMass * f;
c.m_angularVelocity +=
c.m_invI * (g * f - j * l)
};
E.prototype.SolvePositionConstraints = function() {
return !0
};
Box2D.inherit(Q, Box2D.Dynamics.Joints.b2JointDef);
Q.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;
Q.b2MouseJointDef = function() {
Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);
this.target = new f
};
Q.prototype.b2MouseJointDef = function() {
this.__super.b2JointDef.call(this);
this.type = C.e_mouseJoint;
this.maxForce = 0;
this.frequencyHz = 5;
this.dampingRatio = 0.7
};
Box2D.inherit(M, Box2D.Dynamics.Joints.b2Joint);
M.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;
M.b2PrismaticJoint = function() {
Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);
this.m_localAnchor1 = new f;
this.m_localAnchor2 = new f;
this.m_localXAxis1 = new f;
this.m_localYAxis1 = new f;
this.m_axis = new f;
this.m_perp = new f;
this.m_K = new d;
this.m_impulse = new j
};
M.prototype.GetAnchorA = function() {
return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)
};
M.prototype.GetAnchorB = function() {
return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)
};
M.prototype.GetReactionForce = function(b) {
void 0 === b && (b = 0);
return new f(b * (this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.x), b * (this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.y))
};
M.prototype.GetReactionTorque = function(b) {
void 0 === b && (b = 0);
return b * this.m_impulse.y
};
M.prototype.GetJointTranslation = function() {
var b = this.m_bodyA,
c = this.m_bodyB,
d = b.GetWorldPoint(this.m_localAnchor1),
e = c.GetWorldPoint(this.m_localAnchor2),
c = e.x - d.x,
d = e.y - d.y,
b = b.GetWorldVector(this.m_localXAxis1);
return b.x * c + b.y * d
};
M.prototype.GetJointSpeed = function() {
var b = this.m_bodyA,
c = this.m_bodyB,
d;
d = b.m_xf.R;
var e = this.m_localAnchor1.x - b.m_sweep.localCenter.x,
f = this.m_localAnchor1.y - b.m_sweep.localCenter.y,
g = d.col1.x * e + d.col2.x * f,
f = d.col1.y * e + d.col2.y * f,
e = g;
d = c.m_xf.R;
var j = this.m_localAnchor2.x - c.m_sweep.localCenter.x,
l = this.m_localAnchor2.y - c.m_sweep.localCenter.y,
g = d.col1.x * j + d.col2.x * l,
l = d.col1.y * j + d.col2.y * l,
j = g;
d = c.m_sweep.c.x + j - (b.m_sweep.c.x +
e);
var g = c.m_sweep.c.y + l - (b.m_sweep.c.y + f),
n = b.GetWorldVector(this.m_localXAxis1),
q = b.m_linearVelocity,
s = c.m_linearVelocity,
b = b.m_angularVelocity,
c = c.m_angularVelocity;
return d * -b * n.y + g * b * n.x + (n.x * (s.x + -c * l - q.x - -b * f) + n.y * (s.y + c * j - q.y - b * e))
};
M.prototype.IsLimitEnabled = function() {
return this.m_enableLimit
};
M.prototype.EnableLimit = function(b) {
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_enableLimit = b
};
M.prototype.GetLowerLimit = function() {
return this.m_lowerTranslation
};
M.prototype.GetUpperLimit =
function() {
return this.m_upperTranslation
};
M.prototype.SetLimits = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_lowerTranslation = b;
this.m_upperTranslation = c
};
M.prototype.IsMotorEnabled = function() {
return this.m_enableMotor
};
M.prototype.EnableMotor = function(b) {
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_enableMotor = b
};
M.prototype.SetMotorSpeed = function(b) {
void 0 === b && (b = 0);
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_motorSpeed = b
};
M.prototype.GetMotorSpeed = function() {
return this.m_motorSpeed
};
M.prototype.SetMaxMotorForce = function(b) {
void 0 === b && (b = 0);
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_maxMotorForce = b
};
M.prototype.GetMotorForce = function() {
return this.m_motorImpulse
};
M.prototype.b2PrismaticJoint = function(b) {
this.__super.b2Joint.call(this, b);
this.m_localAnchor1.SetV(b.localAnchorA);
this.m_localAnchor2.SetV(b.localAnchorB);
this.m_localXAxis1.SetV(b.localAxisA);
this.m_localYAxis1.x = -this.m_localXAxis1.y;
this.m_localYAxis1.y = this.m_localXAxis1.x;
this.m_refAngle = b.referenceAngle;
this.m_impulse.SetZero();
this.m_motorImpulse = this.m_motorMass = 0;
this.m_lowerTranslation = b.lowerTranslation;
this.m_upperTranslation = b.upperTranslation;
this.m_maxMotorForce = b.maxMotorForce;
this.m_motorSpeed = b.motorSpeed;
this.m_enableLimit = b.enableLimit;
this.m_enableMotor = b.enableMotor;
this.m_limitState = C.e_inactiveLimit;
this.m_axis.SetZero();
this.m_perp.SetZero()
};
M.prototype.InitVelocityConstraints = function(c) {
var d = this.m_bodyA,
f = this.m_bodyB,
g, j = 0;
this.m_localCenterA.SetV(d.GetLocalCenter());
this.m_localCenterB.SetV(f.GetLocalCenter());
var n = d.GetTransform();
f.GetTransform();
g = d.m_xf.R;
var q = this.m_localAnchor1.x - this.m_localCenterA.x,
l = this.m_localAnchor1.y - this.m_localCenterA.y,
j = g.col1.x * q + g.col2.x * l,
l = g.col1.y * q + g.col2.y * l,
q = j;
g = f.m_xf.R;
var r = this.m_localAnchor2.x - this.m_localCenterB.x,
u = this.m_localAnchor2.y - this.m_localCenterB.y,
j = g.col1.x * r + g.col2.x * u,
u = g.col1.y * r + g.col2.y * u,
r = j;
g = f.m_sweep.c.x + r - d.m_sweep.c.x -
q;
j = f.m_sweep.c.y + u - d.m_sweep.c.y - l;
this.m_invMassA = d.m_invMass;
this.m_invMassB = f.m_invMass;
this.m_invIA = d.m_invI;
this.m_invIB = f.m_invI;
this.m_axis.SetV(e.MulMV(n.R, this.m_localXAxis1));
this.m_a1 = (g + q) * this.m_axis.y - (j + l) * this.m_axis.x;
this.m_a2 = r * this.m_axis.y - u * this.m_axis.x;
this.m_motorMass = this.m_invMassA + this.m_invMassB + this.m_invIA * this.m_a1 * this.m_a1 + this.m_invIB * this.m_a2 * this.m_a2;
this.m_motorMass > Number.MIN_VALUE && (this.m_motorMass = 1 / this.m_motorMass);
this.m_perp.SetV(e.MulMV(n.R, this.m_localYAxis1));
this.m_s1 = (g + q) * this.m_perp.y - (j + l) * this.m_perp.x;
this.m_s2 = r * this.m_perp.y - u * this.m_perp.x;
n = this.m_invMassA;
q = this.m_invMassB;
l = this.m_invIA;
r = this.m_invIB;
this.m_K.col1.x = n + q + l * this.m_s1 * this.m_s1 + r * this.m_s2 * this.m_s2;
this.m_K.col1.y = l * this.m_s1 + r * this.m_s2;
this.m_K.col1.z = l * this.m_s1 * this.m_a1 + r * this.m_s2 * this.m_a2;
this.m_K.col2.x = this.m_K.col1.y;
this.m_K.col2.y = l + r;
this.m_K.col2.z = l * this.m_a1 + r * this.m_a2;
this.m_K.col3.x = this.m_K.col1.z;
this.m_K.col3.y = this.m_K.col2.z;
this.m_K.col3.z = n + q + l * this.m_a1 *
this.m_a1 + r * this.m_a2 * this.m_a2;
this.m_enableLimit ? (g = this.m_axis.x * g + this.m_axis.y * j, e.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2 * b.b2_linearSlop ? this.m_limitState = C.e_equalLimits : g <= this.m_lowerTranslation ? this.m_limitState != C.e_atLowerLimit && (this.m_limitState = C.e_atLowerLimit, this.m_impulse.z = 0) : g >= this.m_upperTranslation ? this.m_limitState != C.e_atUpperLimit && (this.m_limitState = C.e_atUpperLimit, this.m_impulse.z = 0) : (this.m_limitState = C.e_inactiveLimit, this.m_impulse.z = 0)) : this.m_limitState =
C.e_inactiveLimit;
!1 == this.m_enableMotor && (this.m_motorImpulse = 0);
c.warmStarting ? (this.m_impulse.x *= c.dtRatio, this.m_impulse.y *= c.dtRatio, this.m_motorImpulse *= c.dtRatio, c = this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.x, g = this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.y, j = this.m_impulse.x * this.m_s1 + this.m_impulse.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_a1, n = this.m_impulse.x * this.m_s2 + this.m_impulse.y + (this.m_motorImpulse +
this.m_impulse.z) * this.m_a2, d.m_linearVelocity.x -= this.m_invMassA * c, d.m_linearVelocity.y -= this.m_invMassA * g, d.m_angularVelocity -= this.m_invIA * j, f.m_linearVelocity.x += this.m_invMassB * c, f.m_linearVelocity.y += this.m_invMassB * g, f.m_angularVelocity += this.m_invIB * n) : (this.m_impulse.SetZero(), this.m_motorImpulse = 0)
};
M.prototype.SolveVelocityConstraints = function(b) {
var c = this.m_bodyA,
d = this.m_bodyB,
g = c.m_linearVelocity,
n = c.m_angularVelocity,
q = d.m_linearVelocity,
u = d.m_angularVelocity,
l = 0,
r = 0,
y = 0,
s = 0;
this.m_enableMotor &&
this.m_limitState != C.e_equalLimits && (s = this.m_motorMass * (this.m_motorSpeed - (this.m_axis.x * (q.x - g.x) + this.m_axis.y * (q.y - g.y) + this.m_a2 * u - this.m_a1 * n)), l = this.m_motorImpulse, b = b.dt * this.m_maxMotorForce, this.m_motorImpulse = e.Clamp(this.m_motorImpulse + s, -b, b), s = this.m_motorImpulse - l, l = s * this.m_axis.x, r = s * this.m_axis.y, y = s * this.m_a1, s *= this.m_a2, g.x -= this.m_invMassA * l, g.y -= this.m_invMassA * r, n -= this.m_invIA * y, q.x += this.m_invMassB * l, q.y += this.m_invMassB * r, u += this.m_invIB * s);
y = this.m_perp.x * (q.x - g.x) + this.m_perp.y *
(q.y - g.y) + this.m_s2 * u - this.m_s1 * n;
r = u - n;
this.m_enableLimit && this.m_limitState != C.e_inactiveLimit ? (b = this.m_axis.x * (q.x - g.x) + this.m_axis.y * (q.y - g.y) + this.m_a2 * u - this.m_a1 * n, l = this.m_impulse.Copy(), b = this.m_K.Solve33(new j, -y, -r, -b), this.m_impulse.Add(b), this.m_limitState == C.e_atLowerLimit ? this.m_impulse.z = e.Max(this.m_impulse.z, 0) : this.m_limitState == C.e_atUpperLimit && (this.m_impulse.z = e.Min(this.m_impulse.z, 0)), y = -y - (this.m_impulse.z - l.z) * this.m_K.col3.x, r = -r - (this.m_impulse.z - l.z) * this.m_K.col3.y,
r = this.m_K.Solve22(new f, y, r), r.x += l.x, r.y += l.y, this.m_impulse.x = r.x, this.m_impulse.y = r.y, b.x = this.m_impulse.x - l.x, b.y = this.m_impulse.y - l.y, b.z = this.m_impulse.z - l.z, l = b.x * this.m_perp.x + b.z * this.m_axis.x, r = b.x * this.m_perp.y + b.z * this.m_axis.y, y = b.x * this.m_s1 + b.y + b.z * this.m_a1, s = b.x * this.m_s2 + b.y + b.z * this.m_a2) : (b = this.m_K.Solve22(new f, -y, -r), this.m_impulse.x += b.x, this.m_impulse.y += b.y, l = b.x * this.m_perp.x, r = b.x * this.m_perp.y, y = b.x * this.m_s1 + b.y, s = b.x * this.m_s2 + b.y);
g.x -= this.m_invMassA * l;
g.y -= this.m_invMassA *
r;
n -= this.m_invIA * y;
q.x += this.m_invMassB * l;
q.y += this.m_invMassB * r;
u += this.m_invIB * s;
c.m_linearVelocity.SetV(g);
c.m_angularVelocity = n;
d.m_linearVelocity.SetV(q);
d.m_angularVelocity = u
};
M.prototype.SolvePositionConstraints = function() {
var d = this.m_bodyA,
g = this.m_bodyB,
n = d.m_sweep.c,
q = d.m_sweep.a,
u = g.m_sweep.c,
y = g.m_sweep.a,
z, l = 0,
r = 0,
A = 0,
s = 0,
C = 0,
r = !1,
B = 0,
E = c.FromAngle(q),
G = c.FromAngle(y);
z = E;
var C = this.m_localAnchor1.x - this.m_localCenterA.x,
I = this.m_localAnchor1.y - this.m_localCenterA.y,
l = z.col1.x * C + z.col2.x *
I,
I = z.col1.y * C + z.col2.y * I,
C = l;
z = G;
G = this.m_localAnchor2.x - this.m_localCenterB.x;
A = this.m_localAnchor2.y - this.m_localCenterB.y;
l = z.col1.x * G + z.col2.x * A;
A = z.col1.y * G + z.col2.y * A;
G = l;
z = u.x + G - n.x - C;
l = u.y + A - n.y - I;
if (this.m_enableLimit) {
this.m_axis = e.MulMV(E, this.m_localXAxis1);
this.m_a1 = (z + C) * this.m_axis.y - (l + I) * this.m_axis.x;
this.m_a2 = G * this.m_axis.y - A * this.m_axis.x;
var m = this.m_axis.x * z + this.m_axis.y * l;
e.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2 * b.b2_linearSlop ? (B = e.Clamp(m, -b.b2_maxLinearCorrection,
b.b2_maxLinearCorrection), s = e.Abs(m), r = !0) : m <= this.m_lowerTranslation ? (B = e.Clamp(m - this.m_lowerTranslation + b.b2_linearSlop, -b.b2_maxLinearCorrection, 0), s = this.m_lowerTranslation - m, r = !0) : m >= this.m_upperTranslation && (B = e.Clamp(m - this.m_upperTranslation + b.b2_linearSlop, 0, b.b2_maxLinearCorrection), s = m - this.m_upperTranslation, r = !0)
}
this.m_perp = e.MulMV(E, this.m_localYAxis1);
this.m_s1 = (z + C) * this.m_perp.y - (l + I) * this.m_perp.x;
this.m_s2 = G * this.m_perp.y - A * this.m_perp.x;
E = new j;
I = this.m_perp.x * z + this.m_perp.y *
l;
G = y - q - this.m_refAngle;
s = e.Max(s, e.Abs(I));
C = e.Abs(G);
r ? (r = this.m_invMassA, A = this.m_invMassB, z = this.m_invIA, l = this.m_invIB, this.m_K.col1.x = r + A + z * this.m_s1 * this.m_s1 + l * this.m_s2 * this.m_s2, this.m_K.col1.y = z * this.m_s1 + l * this.m_s2, this.m_K.col1.z = z * this.m_s1 * this.m_a1 + l * this.m_s2 * this.m_a2, this.m_K.col2.x = this.m_K.col1.y, this.m_K.col2.y = z + l, this.m_K.col2.z = z * this.m_a1 + l * this.m_a2, this.m_K.col3.x = this.m_K.col1.z, this.m_K.col3.y = this.m_K.col2.z, this.m_K.col3.z = r + A + z * this.m_a1 * this.m_a1 + l * this.m_a2 * this.m_a2,
this.m_K.Solve33(E, -I, -G, -B)) : (r = this.m_invMassA, A = this.m_invMassB, z = this.m_invIA, l = this.m_invIB, B = z * this.m_s1 + l * this.m_s2, m = z + l, this.m_K.col1.Set(r + A + z * this.m_s1 * this.m_s1 + l * this.m_s2 * this.m_s2, B, 0), this.m_K.col2.Set(B, m, 0), B = this.m_K.Solve22(new f, -I, -G), E.x = B.x, E.y = B.y, E.z = 0);
B = E.x * this.m_perp.x + E.z * this.m_axis.x;
r = E.x * this.m_perp.y + E.z * this.m_axis.y;
I = E.x * this.m_s1 + E.y + E.z * this.m_a1;
E = E.x * this.m_s2 + E.y + E.z * this.m_a2;
n.x -= this.m_invMassA * B;
n.y -= this.m_invMassA * r;
q -= this.m_invIA * I;
u.x += this.m_invMassB *
B;
u.y += this.m_invMassB * r;
y += this.m_invIB * E;
d.m_sweep.a = q;
g.m_sweep.a = y;
d.SynchronizeTransform();
g.SynchronizeTransform();
return s <= b.b2_linearSlop && C <= b.b2_angularSlop
};
Box2D.inherit(R, Box2D.Dynamics.Joints.b2JointDef);
R.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;
R.b2PrismaticJointDef = function() {
Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);
this.localAnchorA = new f;
this.localAnchorB = new f;
this.localAxisA = new f
};
R.prototype.b2PrismaticJointDef = function() {
this.__super.b2JointDef.call(this);
this.type = C.e_prismaticJoint;
this.localAxisA.Set(1, 0);
this.referenceAngle = 0;
this.enableLimit = !1;
this.upperTranslation = this.lowerTranslation = 0;
this.enableMotor = !1;
this.motorSpeed = this.maxMotorForce = 0
};
R.prototype.Initialize = function(b, c, d, e) {
this.bodyA = b;
this.bodyB = c;
this.localAnchorA = this.bodyA.GetLocalPoint(d);
this.localAnchorB = this.bodyB.GetLocalPoint(d);
this.localAxisA = this.bodyA.GetLocalVector(e);
this.referenceAngle = this.bodyB.GetAngle() - this.bodyA.GetAngle()
};
Box2D.inherit(K, Box2D.Dynamics.Joints.b2Joint);
K.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;
K.b2PulleyJoint = function() {
Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);
this.m_groundAnchor1 = new f;
this.m_groundAnchor2 = new f;
this.m_localAnchor1 = new f;
this.m_localAnchor2 = new f;
this.m_u1 = new f;
this.m_u2 = new f
};
K.prototype.GetAnchorA = function() {
return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)
};
K.prototype.GetAnchorB = function() {
return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)
};
K.prototype.GetReactionForce = function(b) {
void 0 ===
b && (b = 0);
return new f(b * this.m_impulse * this.m_u2.x, b * this.m_impulse * this.m_u2.y)
};
K.prototype.GetReactionTorque = function() {
return 0
};
K.prototype.GetGroundAnchorA = function() {
var b = this.m_ground.m_xf.position.Copy();
b.Add(this.m_groundAnchor1);
return b
};
K.prototype.GetGroundAnchorB = function() {
var b = this.m_ground.m_xf.position.Copy();
b.Add(this.m_groundAnchor2);
return b
};
K.prototype.GetLength1 = function() {
var b = this.m_bodyA.GetWorldPoint(this.m_localAnchor1),
c = b.x - (this.m_ground.m_xf.position.x + this.m_groundAnchor1.x),
b = b.y - (this.m_ground.m_xf.position.y + this.m_groundAnchor1.y);
return Math.sqrt(c * c + b * b)
};
K.prototype.GetLength2 = function() {
var b = this.m_bodyB.GetWorldPoint(this.m_localAnchor2),
c = b.x - (this.m_ground.m_xf.position.x + this.m_groundAnchor2.x),
b = b.y - (this.m_ground.m_xf.position.y + this.m_groundAnchor2.y);
return Math.sqrt(c * c + b * b)
};
K.prototype.GetRatio = function() {
return this.m_ratio
};
K.prototype.b2PulleyJoint = function(b) {
this.__super.b2Joint.call(this, b);
this.m_ground = this.m_bodyA.m_world.m_groundBody;
this.m_groundAnchor1.x =
b.groundAnchorA.x - this.m_ground.m_xf.position.x;
this.m_groundAnchor1.y = b.groundAnchorA.y - this.m_ground.m_xf.position.y;
this.m_groundAnchor2.x = b.groundAnchorB.x - this.m_ground.m_xf.position.x;
this.m_groundAnchor2.y = b.groundAnchorB.y - this.m_ground.m_xf.position.y;
this.m_localAnchor1.SetV(b.localAnchorA);
this.m_localAnchor2.SetV(b.localAnchorB);
this.m_ratio = b.ratio;
this.m_constant = b.lengthA + this.m_ratio * b.lengthB;
this.m_maxLength1 = e.Min(b.maxLengthA, this.m_constant - this.m_ratio * K.b2_minPulleyLength);
this.m_maxLength2 = e.Min(b.maxLengthB, (this.m_constant - K.b2_minPulleyLength) / this.m_ratio);
this.m_limitImpulse2 = this.m_limitImpulse1 = this.m_impulse = 0
};
K.prototype.InitVelocityConstraints = function(c) {
var d = this.m_bodyA,
e = this.m_bodyB,
f;
f = d.m_xf.R;
var g = this.m_localAnchor1.x - d.m_sweep.localCenter.x,
j = this.m_localAnchor1.y - d.m_sweep.localCenter.y,
n = f.col1.x * g + f.col2.x * j,
j = f.col1.y * g + f.col2.y * j,
g = n;
f = e.m_xf.R;
var l = this.m_localAnchor2.x - e.m_sweep.localCenter.x,
r = this.m_localAnchor2.y - e.m_sweep.localCenter.y,
n = f.col1.x * l + f.col2.x * r,
r = f.col1.y * l + f.col2.y * r,
l = n;
f = e.m_sweep.c.x + l;
var n = e.m_sweep.c.y + r,
q = this.m_ground.m_xf.position.x + this.m_groundAnchor2.x,
s = this.m_ground.m_xf.position.y + this.m_groundAnchor2.y;
this.m_u1.Set(d.m_sweep.c.x + g - (this.m_ground.m_xf.position.x + this.m_groundAnchor1.x), d.m_sweep.c.y + j - (this.m_ground.m_xf.position.y + this.m_groundAnchor1.y));
this.m_u2.Set(f - q, n - s);
f = this.m_u1.Length();
n = this.m_u2.Length();
f > b.b2_linearSlop ? this.m_u1.Multiply(1 / f) : this.m_u1.SetZero();
n > b.b2_linearSlop ?
this.m_u2.Multiply(1 / n) : this.m_u2.SetZero();
0 < this.m_constant - f - this.m_ratio * n ? (this.m_state = C.e_inactiveLimit, this.m_impulse = 0) : this.m_state = C.e_atUpperLimit;
f < this.m_maxLength1 ? (this.m_limitState1 = C.e_inactiveLimit, this.m_limitImpulse1 = 0) : this.m_limitState1 = C.e_atUpperLimit;
n < this.m_maxLength2 ? (this.m_limitState2 = C.e_inactiveLimit, this.m_limitImpulse2 = 0) : this.m_limitState2 = C.e_atUpperLimit;
f = g * this.m_u1.y - j * this.m_u1.x;
n = l * this.m_u2.y - r * this.m_u2.x;
this.m_limitMass1 = d.m_invMass + d.m_invI * f * f;
this.m_limitMass2 =
e.m_invMass + e.m_invI * n * n;
this.m_pulleyMass = this.m_limitMass1 + this.m_ratio * this.m_ratio * this.m_limitMass2;
this.m_limitMass1 = 1 / this.m_limitMass1;
this.m_limitMass2 = 1 / this.m_limitMass2;
this.m_pulleyMass = 1 / this.m_pulleyMass;
c.warmStarting ? (this.m_impulse *= c.dtRatio, this.m_limitImpulse1 *= c.dtRatio, this.m_limitImpulse2 *= c.dtRatio, c = (-this.m_impulse - this.m_limitImpulse1) * this.m_u1.x, f = (-this.m_impulse - this.m_limitImpulse1) * this.m_u1.y, n = (-this.m_ratio * this.m_impulse - this.m_limitImpulse2) * this.m_u2.x, q = (-this.m_ratio *
this.m_impulse - this.m_limitImpulse2) * this.m_u2.y, d.m_linearVelocity.x += d.m_invMass * c, d.m_linearVelocity.y += d.m_invMass * f, d.m_angularVelocity += d.m_invI * (g * f - j * c), e.m_linearVelocity.x += e.m_invMass * n, e.m_linearVelocity.y += e.m_invMass * q, e.m_angularVelocity += e.m_invI * (l * q - r * n)) : this.m_limitImpulse2 = this.m_limitImpulse1 = this.m_impulse = 0
};
K.prototype.SolveVelocityConstraints = function() {
var b = this.m_bodyA,
c = this.m_bodyB,
d;
d = b.m_xf.R;
var f = this.m_localAnchor1.x - b.m_sweep.localCenter.x,
g = this.m_localAnchor1.y -
b.m_sweep.localCenter.y,
j = d.col1.x * f + d.col2.x * g,
g = d.col1.y * f + d.col2.y * g,
f = j;
d = c.m_xf.R;
var n = this.m_localAnchor2.x - c.m_sweep.localCenter.x,
l = this.m_localAnchor2.y - c.m_sweep.localCenter.y,
j = d.col1.x * n + d.col2.x * l,
l = d.col1.y * n + d.col2.y * l,
n = j,
r = 0,
q = 0;
this.m_state == C.e_atUpperLimit && (d = b.m_linearVelocity.x + -b.m_angularVelocity * g, j = b.m_linearVelocity.y + b.m_angularVelocity * f, r = c.m_linearVelocity.x + -c.m_angularVelocity * l, q = c.m_linearVelocity.y + c.m_angularVelocity * n, d = -(this.m_u1.x * d + this.m_u1.y * j) - this.m_ratio *
(this.m_u2.x * r + this.m_u2.y * q), q = this.m_pulleyMass * -d, d = this.m_impulse, this.m_impulse = e.Max(0, this.m_impulse + q), q = this.m_impulse - d, d = -q * this.m_u1.x, j = -q * this.m_u1.y, r = -this.m_ratio * q * this.m_u2.x, q = -this.m_ratio * q * this.m_u2.y, b.m_linearVelocity.x += b.m_invMass * d, b.m_linearVelocity.y += b.m_invMass * j, b.m_angularVelocity += b.m_invI * (f * j - g * d), c.m_linearVelocity.x += c.m_invMass * r, c.m_linearVelocity.y += c.m_invMass * q, c.m_angularVelocity += c.m_invI * (n * q - l * r));
this.m_limitState1 == C.e_atUpperLimit && (d = b.m_linearVelocity.x +
-b.m_angularVelocity * g, j = b.m_linearVelocity.y + b.m_angularVelocity * f, d = -(this.m_u1.x * d + this.m_u1.y * j), q = -this.m_limitMass1 * d, d = this.m_limitImpulse1, this.m_limitImpulse1 = e.Max(0, this.m_limitImpulse1 + q), q = this.m_limitImpulse1 - d, d = -q * this.m_u1.x, j = -q * this.m_u1.y, b.m_linearVelocity.x += b.m_invMass * d, b.m_linearVelocity.y += b.m_invMass * j, b.m_angularVelocity += b.m_invI * (f * j - g * d));
this.m_limitState2 == C.e_atUpperLimit && (r = c.m_linearVelocity.x + -c.m_angularVelocity * l, q = c.m_linearVelocity.y + c.m_angularVelocity * n,
d = -(this.m_u2.x * r + this.m_u2.y * q), q = -this.m_limitMass2 * d, d = this.m_limitImpulse2, this.m_limitImpulse2 = e.Max(0, this.m_limitImpulse2 + q), q = this.m_limitImpulse2 - d, r = -q * this.m_u2.x, q = -q * this.m_u2.y, c.m_linearVelocity.x += c.m_invMass * r, c.m_linearVelocity.y += c.m_invMass * q, c.m_angularVelocity += c.m_invI * (n * q - l * r))
};
K.prototype.SolvePositionConstraints = function() {
var c = this.m_bodyA,
d = this.m_bodyB,
f, g = this.m_ground.m_xf.position.x + this.m_groundAnchor1.x,
j = this.m_ground.m_xf.position.y + this.m_groundAnchor1.y,
n =
this.m_ground.m_xf.position.x + this.m_groundAnchor2.x,
q = this.m_ground.m_xf.position.y + this.m_groundAnchor2.y,
l = 0,
r = 0,
u = 0,
s = 0,
y = 0,
z = 0,
A = 0,
B = 0;
this.m_state == C.e_atUpperLimit && (f = c.m_xf.R, l = this.m_localAnchor1.x - c.m_sweep.localCenter.x, r = this.m_localAnchor1.y - c.m_sweep.localCenter.y, y = f.col1.x * l + f.col2.x * r, r = f.col1.y * l + f.col2.y * r, l = y, f = d.m_xf.R, u = this.m_localAnchor2.x - d.m_sweep.localCenter.x, s = this.m_localAnchor2.y - d.m_sweep.localCenter.y, y = f.col1.x * u + f.col2.x * s, s = f.col1.y * u + f.col2.y * s, u = y, f = c.m_sweep.c.x +
l, y = c.m_sweep.c.y + r, z = d.m_sweep.c.x + u, A = d.m_sweep.c.y + s, this.m_u1.Set(f - g, y - j), this.m_u2.Set(z - n, A - q), f = this.m_u1.Length(), y = this.m_u2.Length(), f > b.b2_linearSlop ? this.m_u1.Multiply(1 / f) : this.m_u1.SetZero(), y > b.b2_linearSlop ? this.m_u2.Multiply(1 / y) : this.m_u2.SetZero(), f = this.m_constant - f - this.m_ratio * y, B = e.Max(B, -f), f = e.Clamp(f + b.b2_linearSlop, -b.b2_maxLinearCorrection, 0), A = -this.m_pulleyMass * f, f = -A * this.m_u1.x, y = -A * this.m_u1.y, z = -this.m_ratio * A * this.m_u2.x, A = -this.m_ratio * A * this.m_u2.y, c.m_sweep.c.x +=
c.m_invMass * f, c.m_sweep.c.y += c.m_invMass * y, c.m_sweep.a += c.m_invI * (l * y - r * f), d.m_sweep.c.x += d.m_invMass * z, d.m_sweep.c.y += d.m_invMass * A, d.m_sweep.a += d.m_invI * (u * A - s * z), c.SynchronizeTransform(), d.SynchronizeTransform());
this.m_limitState1 == C.e_atUpperLimit && (f = c.m_xf.R, l = this.m_localAnchor1.x - c.m_sweep.localCenter.x, r = this.m_localAnchor1.y - c.m_sweep.localCenter.y, y = f.col1.x * l + f.col2.x * r, r = f.col1.y * l + f.col2.y * r, l = y, f = c.m_sweep.c.x + l, y = c.m_sweep.c.y + r, this.m_u1.Set(f - g, y - j), f = this.m_u1.Length(), f > b.b2_linearSlop ?
(this.m_u1.x *= 1 / f, this.m_u1.y *= 1 / f) : this.m_u1.SetZero(), f = this.m_maxLength1 - f, B = e.Max(B, -f), f = e.Clamp(f + b.b2_linearSlop, -b.b2_maxLinearCorrection, 0), A = -this.m_limitMass1 * f, f = -A * this.m_u1.x, y = -A * this.m_u1.y, c.m_sweep.c.x += c.m_invMass * f, c.m_sweep.c.y += c.m_invMass * y, c.m_sweep.a += c.m_invI * (l * y - r * f), c.SynchronizeTransform());
this.m_limitState2 == C.e_atUpperLimit && (f = d.m_xf.R, u = this.m_localAnchor2.x - d.m_sweep.localCenter.x, s = this.m_localAnchor2.y - d.m_sweep.localCenter.y, y = f.col1.x * u + f.col2.x * s, s = f.col1.y *
u + f.col2.y * s, u = y, z = d.m_sweep.c.x + u, A = d.m_sweep.c.y + s, this.m_u2.Set(z - n, A - q), y = this.m_u2.Length(), y > b.b2_linearSlop ? (this.m_u2.x *= 1 / y, this.m_u2.y *= 1 / y) : this.m_u2.SetZero(), f = this.m_maxLength2 - y, B = e.Max(B, -f), f = e.Clamp(f + b.b2_linearSlop, -b.b2_maxLinearCorrection, 0), A = -this.m_limitMass2 * f, z = -A * this.m_u2.x, A = -A * this.m_u2.y, d.m_sweep.c.x += d.m_invMass * z, d.m_sweep.c.y += d.m_invMass * A, d.m_sweep.a += d.m_invI * (u * A - s * z), d.SynchronizeTransform());
return B < b.b2_linearSlop
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.Joints.b2PulleyJoint.b2_minPulleyLength =
2
});
Box2D.inherit(X, Box2D.Dynamics.Joints.b2JointDef);
X.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;
X.b2PulleyJointDef = function() {
Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);
this.groundAnchorA = new f;
this.groundAnchorB = new f;
this.localAnchorA = new f;
this.localAnchorB = new f
};
X.prototype.b2PulleyJointDef = function() {
this.__super.b2JointDef.call(this);
this.type = C.e_pulleyJoint;
this.groundAnchorA.Set(-1, 1);
this.groundAnchorB.Set(1, 1);
this.localAnchorA.Set(-1, 0);
this.localAnchorB.Set(1,
0);
this.maxLengthB = this.lengthB = this.maxLengthA = this.lengthA = 0;
this.ratio = 1;
this.collideConnected = !0
};
X.prototype.Initialize = function(b, c, d, e, f, g, j) {
void 0 === j && (j = 0);
this.bodyA = b;
this.bodyB = c;
this.groundAnchorA.SetV(d);
this.groundAnchorB.SetV(e);
this.localAnchorA = this.bodyA.GetLocalPoint(f);
this.localAnchorB = this.bodyB.GetLocalPoint(g);
b = f.x - d.x;
d = f.y - d.y;
this.lengthA = Math.sqrt(b * b + d * d);
d = g.x - e.x;
e = g.y - e.y;
this.lengthB = Math.sqrt(d * d + e * e);
this.ratio = j;
j = this.lengthA + this.ratio * this.lengthB;
this.maxLengthA =
j - this.ratio * K.b2_minPulleyLength;
this.maxLengthB = (j - K.b2_minPulleyLength) / this.ratio
};
Box2D.inherit(P, Box2D.Dynamics.Joints.b2Joint);
P.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;
P.b2RevoluteJoint = function() {
Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);
this.K = new c;
this.K1 = new c;
this.K2 = new c;
this.K3 = new c;
this.impulse3 = new j;
this.impulse2 = new f;
this.reduced = new f;
this.m_localAnchor1 = new f;
this.m_localAnchor2 = new f;
this.m_impulse = new j;
this.m_mass = new d
};
P.prototype.GetAnchorA =
function() {
return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)
};
P.prototype.GetAnchorB = function() {
return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)
};
P.prototype.GetReactionForce = function(b) {
void 0 === b && (b = 0);
return new f(b * this.m_impulse.x, b * this.m_impulse.y)
};
P.prototype.GetReactionTorque = function(b) {
void 0 === b && (b = 0);
return b * this.m_impulse.z
};
P.prototype.GetJointAngle = function() {
return this.m_bodyB.m_sweep.a - this.m_bodyA.m_sweep.a - this.m_referenceAngle
};
P.prototype.GetJointSpeed = function() {
return this.m_bodyB.m_angularVelocity -
this.m_bodyA.m_angularVelocity
};
P.prototype.IsLimitEnabled = function() {
return this.m_enableLimit
};
P.prototype.EnableLimit = function(b) {
this.m_enableLimit = b
};
P.prototype.GetLowerLimit = function() {
return this.m_lowerAngle
};
P.prototype.GetUpperLimit = function() {
return this.m_upperAngle
};
P.prototype.SetLimits = function(b, c) {
void 0 === b && (b = 0);
void 0 === c && (c = 0);
this.m_lowerAngle = b;
this.m_upperAngle = c
};
P.prototype.IsMotorEnabled = function() {
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
return this.m_enableMotor
};
P.prototype.EnableMotor = function(b) {
this.m_enableMotor = b
};
P.prototype.SetMotorSpeed = function(b) {
void 0 === b && (b = 0);
this.m_bodyA.SetAwake(!0);
this.m_bodyB.SetAwake(!0);
this.m_motorSpeed = b
};
P.prototype.GetMotorSpeed = function() {
return this.m_motorSpeed
};
P.prototype.SetMaxMotorTorque = function(b) {
void 0 === b && (b = 0);
this.m_maxMotorTorque = b
};
P.prototype.GetMotorTorque = function() {
return this.m_maxMotorTorque
};
P.prototype.b2RevoluteJoint = function(b) {
this.__super.b2Joint.call(this, b);
this.m_localAnchor1.SetV(b.localAnchorA);
this.m_localAnchor2.SetV(b.localAnchorB);
this.m_referenceAngle = b.referenceAngle;
this.m_impulse.SetZero();
this.m_motorImpulse = 0;
this.m_lowerAngle = b.lowerAngle;
this.m_upperAngle = b.upperAngle;
this.m_maxMotorTorque = b.maxMotorTorque;
this.m_motorSpeed = b.motorSpeed;
this.m_enableLimit = b.enableLimit;
this.m_enableMotor = b.enableMotor;
this.m_limitState = C.e_inactiveLimit
};
P.prototype.InitVelocityConstraints = function(c) {
var d = this.m_bodyA,
f = this.m_bodyB,
g, j = 0;
g = d.m_xf.R;
var n = this.m_localAnchor1.x - d.m_sweep.localCenter.x,
q = this.m_localAnchor1.y - d.m_sweep.localCenter.y,
j = g.col1.x * n + g.col2.x * q,
q = g.col1.y * n + g.col2.y * q,
n = j;
g = f.m_xf.R;
var l = this.m_localAnchor2.x - f.m_sweep.localCenter.x,
r = this.m_localAnchor2.y - f.m_sweep.localCenter.y,
j = g.col1.x * l + g.col2.x * r,
r = g.col1.y * l + g.col2.y * r,
l = j;
g = d.m_invMass;
var j = f.m_invMass,
u = d.m_invI,
s = f.m_invI;
this.m_mass.col1.x = g + j + q * q * u + r * r * s;
this.m_mass.col2.x = -q * n * u - r * l * s;
this.m_mass.col3.x = -q * u - r * s;
this.m_mass.col1.y = this.m_mass.col2.x;
this.m_mass.col2.y = g + j + n * n * u + l * l * s;
this.m_mass.col3.y =
n * u + l * s;
this.m_mass.col1.z = this.m_mass.col3.x;
this.m_mass.col2.z = this.m_mass.col3.y;
this.m_mass.col3.z = u + s;
this.m_motorMass = 1 / (u + s);
!1 == this.m_enableMotor && (this.m_motorImpulse = 0);
if (this.m_enableLimit) {
var y = f.m_sweep.a - d.m_sweep.a - this.m_referenceAngle;
e.Abs(this.m_upperAngle - this.m_lowerAngle) < 2 * b.b2_angularSlop ? this.m_limitState = C.e_equalLimits : y <= this.m_lowerAngle ? (this.m_limitState != C.e_atLowerLimit && (this.m_impulse.z = 0), this.m_limitState = C.e_atLowerLimit) : y >= this.m_upperAngle ? (this.m_limitState !=
C.e_atUpperLimit && (this.m_impulse.z = 0), this.m_limitState = C.e_atUpperLimit) : (this.m_limitState = C.e_inactiveLimit, this.m_impulse.z = 0)
} else this.m_limitState = C.e_inactiveLimit;
c.warmStarting ? (this.m_impulse.x *= c.dtRatio, this.m_impulse.y *= c.dtRatio, this.m_motorImpulse *= c.dtRatio, c = this.m_impulse.x, y = this.m_impulse.y, d.m_linearVelocity.x -= g * c, d.m_linearVelocity.y -= g * y, d.m_angularVelocity -= u * (n * y - q * c + this.m_motorImpulse + this.m_impulse.z), f.m_linearVelocity.x += j * c, f.m_linearVelocity.y += j * y, f.m_angularVelocity +=
s * (l * y - r * c + this.m_motorImpulse + this.m_impulse.z)) : (this.m_impulse.SetZero(), this.m_motorImpulse = 0)
};
P.prototype.SolveVelocityConstraints = function(b) {
var c = this.m_bodyA,
d = this.m_bodyB,
f = 0,
g = 0,
j = 0,
n = 0,
l = 0,
q = c.m_linearVelocity,
u = c.m_angularVelocity,
s = d.m_linearVelocity,
y = d.m_angularVelocity,
z = c.m_invMass,
A = d.m_invMass,
B = c.m_invI,
E = d.m_invI;
this.m_enableMotor && this.m_limitState != C.e_equalLimits && (g = this.m_motorMass * -(y - u - this.m_motorSpeed), j = this.m_motorImpulse, n = b.dt * this.m_maxMotorTorque, this.m_motorImpulse =
e.Clamp(this.m_motorImpulse + g, -n, n), g = this.m_motorImpulse - j, u -= B * g, y += E * g);
if (this.m_enableLimit && this.m_limitState != C.e_inactiveLimit) {
b = c.m_xf.R;
g = this.m_localAnchor1.x - c.m_sweep.localCenter.x;
j = this.m_localAnchor1.y - c.m_sweep.localCenter.y;
f = b.col1.x * g + b.col2.x * j;
j = b.col1.y * g + b.col2.y * j;
g = f;
b = d.m_xf.R;
n = this.m_localAnchor2.x - d.m_sweep.localCenter.x;
l = this.m_localAnchor2.y - d.m_sweep.localCenter.y;
f = b.col1.x * n + b.col2.x * l;
l = b.col1.y * n + b.col2.y * l;
n = f;
b = s.x + -y * l - q.x - -u * j;
var m = s.y + y * n - q.y - u * g;
this.m_mass.Solve33(this.impulse3, -b, -m, -(y - u));
this.m_limitState == C.e_equalLimits ? this.m_impulse.Add(this.impulse3) : this.m_limitState == C.e_atLowerLimit ? (f = this.m_impulse.z + this.impulse3.z, 0 > f && (this.m_mass.Solve22(this.reduced, -b, -m), this.impulse3.x = this.reduced.x, this.impulse3.y = this.reduced.y, this.impulse3.z = -this.m_impulse.z, this.m_impulse.x += this.reduced.x, this.m_impulse.y += this.reduced.y, this.m_impulse.z = 0)) : this.m_limitState == C.e_atUpperLimit && (f = this.m_impulse.z + this.impulse3.z, 0 < f && (this.m_mass.Solve22(this.reduced, -b, -m),
this.impulse3.x = this.reduced.x, this.impulse3.y = this.reduced.y, this.impulse3.z = -this.m_impulse.z, this.m_impulse.x += this.reduced.x, this.m_impulse.y += this.reduced.y, this.m_impulse.z = 0));
q.x -= z * this.impulse3.x;
q.y -= z * this.impulse3.y;
u -= B * (g * this.impulse3.y - j * this.impulse3.x + this.impulse3.z);
s.x += A * this.impulse3.x;
s.y += A * this.impulse3.y;
y += E * (n * this.impulse3.y - l * this.impulse3.x + this.impulse3.z)
} else b = c.m_xf.R, g = this.m_localAnchor1.x - c.m_sweep.localCenter.x, j = this.m_localAnchor1.y - c.m_sweep.localCenter.y,
f = b.col1.x * g + b.col2.x * j, j = b.col1.y * g + b.col2.y * j, g = f, b = d.m_xf.R, n = this.m_localAnchor2.x - d.m_sweep.localCenter.x, l = this.m_localAnchor2.y - d.m_sweep.localCenter.y, f = b.col1.x * n + b.col2.x * l, l = b.col1.y * n + b.col2.y * l, n = f, this.m_mass.Solve22(this.impulse2, -(s.x + -y * l - q.x - -u * j), -(s.y + y * n - q.y - u * g)), this.m_impulse.x += this.impulse2.x, this.m_impulse.y += this.impulse2.y, q.x -= z * this.impulse2.x, q.y -= z * this.impulse2.y, u -= B * (g * this.impulse2.y - j * this.impulse2.x), s.x += A * this.impulse2.x, s.y += A * this.impulse2.y, y += E * (n * this.impulse2.y -
l * this.impulse2.x);
c.m_linearVelocity.SetV(q);
c.m_angularVelocity = u;
d.m_linearVelocity.SetV(s);
d.m_angularVelocity = y
};
P.prototype.SolvePositionConstraints = function() {
var c = 0,
d, f = this.m_bodyA,
g = this.m_bodyB,
j = 0,
n = 0,
q = 0,
l = 0;
if (this.m_enableLimit && this.m_limitState != C.e_inactiveLimit) {
var c = g.m_sweep.a - f.m_sweep.a - this.m_referenceAngle,
r = 0;
this.m_limitState == C.e_equalLimits ? (c = e.Clamp(c - this.m_lowerAngle, -b.b2_maxAngularCorrection, b.b2_maxAngularCorrection), r = -this.m_motorMass * c, j = e.Abs(c)) : this.m_limitState ==
C.e_atLowerLimit ? (c -= this.m_lowerAngle, j = -c, c = e.Clamp(c + b.b2_angularSlop, -b.b2_maxAngularCorrection, 0), r = -this.m_motorMass * c) : this.m_limitState == C.e_atUpperLimit && (j = c -= this.m_upperAngle, c = e.Clamp(c - b.b2_angularSlop, 0, b.b2_maxAngularCorrection), r = -this.m_motorMass * c);
f.m_sweep.a -= f.m_invI * r;
g.m_sweep.a += g.m_invI * r;
f.SynchronizeTransform();
g.SynchronizeTransform()
}
d = f.m_xf.R;
r = this.m_localAnchor1.x - f.m_sweep.localCenter.x;
c = this.m_localAnchor1.y - f.m_sweep.localCenter.y;
n = d.col1.x * r + d.col2.x * c;
c = d.col1.y *
r + d.col2.y * c;
r = n;
d = g.m_xf.R;
var u = this.m_localAnchor2.x - g.m_sweep.localCenter.x,
s = this.m_localAnchor2.y - g.m_sweep.localCenter.y,
n = d.col1.x * u + d.col2.x * s,
s = d.col1.y * u + d.col2.y * s,
u = n,
q = g.m_sweep.c.x + u - f.m_sweep.c.x - r,
l = g.m_sweep.c.y + s - f.m_sweep.c.y - c,
y = q * q + l * l;
d = Math.sqrt(y);
var n = f.m_invMass,
z = g.m_invMass,
A = f.m_invI,
B = g.m_invI,
E = 10 * b.b2_linearSlop;
y > E * E && (y = 1 / (n + z), q = y * -q, l = y * -l, f.m_sweep.c.x -= 0.5 * n * q, f.m_sweep.c.y -= 0.5 * n * l, g.m_sweep.c.x += 0.5 * z * q, g.m_sweep.c.y += 0.5 * z * l, q = g.m_sweep.c.x + u - f.m_sweep.c.x -
r, l = g.m_sweep.c.y + s - f.m_sweep.c.y - c);
this.K1.col1.x = n + z;
this.K1.col2.x = 0;
this.K1.col1.y = 0;
this.K1.col2.y = n + z;
this.K2.col1.x = A * c * c;
this.K2.col2.x = -A * r * c;
this.K2.col1.y = -A * r * c;
this.K2.col2.y = A * r * r;
this.K3.col1.x = B * s * s;
this.K3.col2.x = -B * u * s;
this.K3.col1.y = -B * u * s;
this.K3.col2.y = B * u * u;
this.K.SetM(this.K1);
this.K.AddM(this.K2);
this.K.AddM(this.K3);
this.K.Solve(P.tImpulse, -q, -l);
q = P.tImpulse.x;
l = P.tImpulse.y;
f.m_sweep.c.x -= f.m_invMass * q;
f.m_sweep.c.y -= f.m_invMass * l;
f.m_sweep.a -= f.m_invI * (r * l - c * q);
g.m_sweep.c.x +=
g.m_invMass * q;
g.m_sweep.c.y += g.m_invMass * l;
g.m_sweep.a += g.m_invI * (u * l - s * q);
f.SynchronizeTransform();
g.SynchronizeTransform();
return d <= b.b2_linearSlop && j <= b.b2_angularSlop
};
Box2D.postDefs.push(function() {
Box2D.Dynamics.Joints.b2RevoluteJoint.tImpulse = new f
});
Box2D.inherit(S, Box2D.Dynamics.Joints.b2JointDef);
S.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;
S.b2RevoluteJointDef = function() {
Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);
this.localAnchorA = new f;
this.localAnchorB =
new f
};
S.prototype.b2RevoluteJointDef = function() {
this.__super.b2JointDef.call(this);
this.type = C.e_revoluteJoint;
this.localAnchorA.Set(0, 0);
this.localAnchorB.Set(0, 0);
this.motorSpeed = this.maxMotorTorque = this.upperAngle = this.lowerAngle = this.referenceAngle = 0;
this.enableMotor = this.enableLimit = !1
};
S.prototype.Initialize = function(b, c, d) {
this.bodyA = b;
this.bodyB = c;
this.localAnchorA = this.bodyA.GetLocalPoint(d);
this.localAnchorB = this.bodyB.GetLocalPoint(d);
this.referenceAngle = this.bodyB.GetAngle() - this.bodyA.GetAngle()
};
Box2D.inherit(Z, Box2D.Dynamics.Joints.b2Joint);
Z.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;
Z.b2WeldJoint = function() {
Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);
this.m_localAnchorA = new f;
this.m_localAnchorB = new f;
this.m_impulse = new j;
this.m_mass = new d
};
Z.prototype.GetAnchorA = function() {
return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)
};
Z.prototype.GetAnchorB = function() {
return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)
};
Z.prototype.GetReactionForce = function(b) {
void 0 ===
b && (b = 0);
return new f(b * this.m_impulse.x, b * this.m_impulse.y)
};
Z.prototype.GetReactionTorque = function(b) {
void 0 === b && (b = 0);
return b * this.m_impulse.z
};
Z.prototype.b2WeldJoint = function(b) {
this.__super.b2Joint.call(this, b);
this.m_localAnchorA.SetV(b.localAnchorA);
this.m_localAnchorB.SetV(b.localAnchorB);
this.m_referenceAngle = b.referenceAngle;
this.m_impulse.SetZero();
this.m_mass = new d
};
Z.prototype.InitVelocityConstraints = function(b) {
var c, d = 0,
e = this.m_bodyA,
f = this.m_bodyB;
c = e.m_xf.R;
var g = this.m_localAnchorA.x -
e.m_sweep.localCenter.x,
j = this.m_localAnchorA.y - e.m_sweep.localCenter.y,
d = c.col1.x * g + c.col2.x * j,
j = c.col1.y * g + c.col2.y * j,
g = d;
c = f.m_xf.R;
var l = this.m_localAnchorB.x - f.m_sweep.localCenter.x,
n = this.m_localAnchorB.y - f.m_sweep.localCenter.y,
d = c.col1.x * l + c.col2.x * n,
n = c.col1.y * l + c.col2.y * n,
l = d;
c = e.m_invMass;
var d = f.m_invMass,
q = e.m_invI,
s = f.m_invI;
this.m_mass.col1.x = c + d + j * j * q + n * n * s;
this.m_mass.col2.x = -j * g * q - n * l * s;
this.m_mass.col3.x = -j * q - n * s;
this.m_mass.col1.y = this.m_mass.col2.x;
this.m_mass.col2.y = c + d + g * g *
q + l * l * s;
this.m_mass.col3.y = g * q + l * s;
this.m_mass.col1.z = this.m_mass.col3.x;
this.m_mass.col2.z = this.m_mass.col3.y;
this.m_mass.col3.z = q + s;
b.warmStarting ? (this.m_impulse.x *= b.dtRatio, this.m_impulse.y *= b.dtRatio, this.m_impulse.z *= b.dtRatio, e.m_linearVelocity.x -= c * this.m_impulse.x, e.m_linearVelocity.y -= c * this.m_impulse.y, e.m_angularVelocity -= q * (g * this.m_impulse.y - j * this.m_impulse.x + this.m_impulse.z), f.m_linearVelocity.x += d * this.m_impulse.x, f.m_linearVelocity.y += d * this.m_impulse.y, f.m_angularVelocity += s *
(l * this.m_impulse.y - n * this.m_impulse.x + this.m_impulse.z)) : this.m_impulse.SetZero()
};
Z.prototype.SolveVelocityConstraints = function() {
var b, c = 0,
d = this.m_bodyA,
e = this.m_bodyB,
f = d.m_linearVelocity,
g = d.m_angularVelocity,
n = e.m_linearVelocity,
l = e.m_angularVelocity,
q = d.m_invMass,
u = e.m_invMass,
s = d.m_invI,
y = e.m_invI;
b = d.m_xf.R;
var z = this.m_localAnchorA.x - d.m_sweep.localCenter.x,
A = this.m_localAnchorA.y - d.m_sweep.localCenter.y,
c = b.col1.x * z + b.col2.x * A,
A = b.col1.y * z + b.col2.y * A,
z = c;
b = e.m_xf.R;
var B = this.m_localAnchorB.x -
e.m_sweep.localCenter.x,
C = this.m_localAnchorB.y - e.m_sweep.localCenter.y,
c = b.col1.x * B + b.col2.x * C,
C = b.col1.y * B + b.col2.y * C,
B = c;
b = n.x - l * C - f.x + g * A;
var c = n.y + l * B - f.y - g * z,
m = l - g,
E = new j;
this.m_mass.Solve33(E, -b, -c, -m);
this.m_impulse.Add(E);
f.x -= q * E.x;
f.y -= q * E.y;
g -= s * (z * E.y - A * E.x + E.z);
n.x += u * E.x;
n.y += u * E.y;
l += y * (B * E.y - C * E.x + E.z);
d.m_angularVelocity = g;
e.m_angularVelocity = l
};
Z.prototype.SolvePositionConstraints = function() {
var c, d = 0,
f = this.m_bodyA,
g = this.m_bodyB;
c = f.m_xf.R;
var n = this.m_localAnchorA.x - f.m_sweep.localCenter.x,
q = this.m_localAnchorA.y - f.m_sweep.localCenter.y,
d = c.col1.x * n + c.col2.x * q,
q = c.col1.y * n + c.col2.y * q,
n = d;
c = g.m_xf.R;
var u = this.m_localAnchorB.x - g.m_sweep.localCenter.x,
l = this.m_localAnchorB.y - g.m_sweep.localCenter.y,
d = c.col1.x * u + c.col2.x * l,
l = c.col1.y * u + c.col2.y * l,
u = d;
c = f.m_invMass;
var d = g.m_invMass,
r = f.m_invI,
y = g.m_invI,
s = g.m_sweep.c.x + u - f.m_sweep.c.x - n,
z = g.m_sweep.c.y + l - f.m_sweep.c.y - q,
A = g.m_sweep.a - f.m_sweep.a - this.m_referenceAngle,
B = 10 * b.b2_linearSlop,
C = Math.sqrt(s * s + z * z),
E = e.Abs(A);
C > B && (r *= 1, y *= 1);
this.m_mass.col1.x = c + d + q * q * r + l * l * y;
this.m_mass.col2.x = -q * n * r - l * u * y;
this.m_mass.col3.x = -q * r - l * y;
this.m_mass.col1.y = this.m_mass.col2.x;
this.m_mass.col2.y = c + d + n * n * r + u * u * y;
this.m_mass.col3.y = n * r + u * y;
this.m_mass.col1.z = this.m_mass.col3.x;
this.m_mass.col2.z = this.m_mass.col3.y;
this.m_mass.col3.z = r + y;
B = new j;
this.m_mass.Solve33(B, -s, -z, -A);
f.m_sweep.c.x -= c * B.x;
f.m_sweep.c.y -= c * B.y;
f.m_sweep.a -= r * (n * B.y - q * B.x + B.z);
g.m_sweep.c.x += d * B.x;
g.m_sweep.c.y += d * B.y;
g.m_sweep.a += y * (u * B.y - l * B.x + B.z);
f.SynchronizeTransform();
g.SynchronizeTransform();
return C <= b.b2_linearSlop && E <= b.b2_angularSlop
};
Box2D.inherit(U, Box2D.Dynamics.Joints.b2JointDef);
U.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;
U.b2WeldJointDef = function() {
Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);
this.localAnchorA = new f;
this.localAnchorB = new f
};
U.prototype.b2WeldJointDef = function() {
this.__super.b2JointDef.call(this);
this.type = C.e_weldJoint;
this.referenceAngle = 0
};
U.prototype.Initialize = function(b, c, d) {
this.bodyA = b;
this.bodyB = c;
this.localAnchorA.SetV(this.bodyA.GetLocalPoint(d));
this.localAnchorB.SetV(this.bodyB.GetLocalPoint(d));
this.referenceAngle = this.bodyB.GetAngle() - this.bodyA.GetAngle()
}
})();
(function() {
var b = Box2D.Dynamics.b2DebugDraw;
b.b2DebugDraw = function() {
this.m_xformScale = this.m_fillAlpha = this.m_alpha = this.m_lineThickness = this.m_drawScale = 1;
var b = this;
this.m_sprite = {
graphics: {
clear: function() {
b.m_ctx.clearRect(0, 0, b.m_ctx.canvas.width, b.m_ctx.canvas.height)
}
}
}
};
b.prototype._color = function(b, d) {
return "rgba(" + ((b & 16711680) >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + d + ")"
};
b.prototype.b2DebugDraw = function() {
this.m_drawFlags = 0
};
b.prototype.SetFlags = function(b) {
void 0 === b && (b = 0);
this.m_drawFlags =
b
};
b.prototype.GetFlags = function() {
return this.m_drawFlags
};
b.prototype.AppendFlags = function(b) {
void 0 === b && (b = 0);
this.m_drawFlags |= b
};
b.prototype.ClearFlags = function(b) {
void 0 === b && (b = 0);
this.m_drawFlags &= ~b
};
b.prototype.SetSprite = function(b) {
this.m_ctx = b
};
b.prototype.GetSprite = function() {
return this.m_ctx
};
b.prototype.SetDrawScale = function(b) {
void 0 === b && (b = 0);
this.m_drawScale = b
};
b.prototype.GetDrawScale = function() {
return this.m_drawScale
};
b.prototype.SetLineThickness = function(b) {
void 0 === b && (b =
0);
this.m_lineThickness = b;
this.m_ctx.strokeWidth = b
};
b.prototype.GetLineThickness = function() {
return this.m_lineThickness
};
b.prototype.SetAlpha = function(b) {
void 0 === b && (b = 0);
this.m_alpha = b
};
b.prototype.GetAlpha = function() {
return this.m_alpha
};
b.prototype.SetFillAlpha = function(b) {
void 0 === b && (b = 0);
this.m_fillAlpha = b
};
b.prototype.GetFillAlpha = function() {
return this.m_fillAlpha
};
b.prototype.SetXFormScale = function(b) {
void 0 === b && (b = 0);
this.m_xformScale = b
};
b.prototype.GetXFormScale = function() {
return this.m_xformScale
};
b.prototype.DrawPolygon = function(b, d, e) {
if (d) {
var f = this.m_ctx,
j = this.m_drawScale;
f.beginPath();
f.strokeStyle = this._color(e.color, this.m_alpha);
f.moveTo(b[0].x * j, b[0].y * j);
for (e = 1; e < d; e++) f.lineTo(b[e].x * j, b[e].y * j);
f.lineTo(b[0].x * j, b[0].y * j);
f.closePath();
f.stroke()
}
};
b.prototype.DrawSolidPolygon = function(b, d, e) {
if (d) {
var f = this.m_ctx,
j = this.m_drawScale;
f.beginPath();
f.strokeStyle = this._color(e.color, this.m_alpha);
f.fillStyle = this._color(e.color, this.m_fillAlpha);
f.moveTo(b[0].x * j, b[0].y * j);
for (e =
1; e < d; e++) f.lineTo(b[e].x * j, b[e].y * j);
f.lineTo(b[0].x * j, b[0].y * j);
f.closePath();
f.fill();
f.stroke()
}
};
b.prototype.DrawCircle = function(b, d, e) {
if (d) {
var f = this.m_ctx,
j = this.m_drawScale;
f.beginPath();
f.strokeStyle = this._color(e.color, this.m_alpha);
f.arc(b.x * j, b.y * j, d * j, 0, 2 * Math.PI, !0);
f.closePath();
f.stroke()
}
};
b.prototype.DrawSolidCircle = function(b, d, e, f) {
if (d) {
var j = this.m_ctx,
q = this.m_drawScale,
n = b.x * q,
g = b.y * q;
j.moveTo(0, 0);
j.beginPath();
j.strokeStyle = this._color(f.color, this.m_alpha);
j.fillStyle =
this._color(f.color, this.m_fillAlpha);
j.arc(n, g, d * q, 0, 2 * Math.PI, !0);
j.moveTo(n, g);
j.lineTo((b.x + e.x * d) * q, (b.y + e.y * d) * q);
j.closePath();
j.fill();
j.stroke()
}
};
b.prototype.DrawSegment = function(b, d, e) {
var f = this.m_ctx,
j = this.m_drawScale;
f.strokeStyle = this._color(e.color, this.m_alpha);
f.beginPath();
f.moveTo(b.x * j, b.y * j);
f.lineTo(d.x * j, d.y * j);
f.closePath();
f.stroke()
};
b.prototype.DrawTransform = function(b) {
var d = this.m_ctx,
e = this.m_drawScale;
d.beginPath();
d.strokeStyle = this._color(16711680, this.m_alpha);
d.moveTo(b.position.x * e, b.position.y * e);
d.lineTo((b.position.x + this.m_xformScale * b.R.col1.x) * e, (b.position.y + this.m_xformScale * b.R.col1.y) * e);
d.strokeStyle = this._color(65280, this.m_alpha);
d.moveTo(b.position.x * e, b.position.y * e);
d.lineTo((b.position.x + this.m_xformScale * b.R.col2.x) * e, (b.position.y + this.m_xformScale * b.R.col2.y) * e);
d.closePath();
d.stroke()
}
})();
var i;
for (i = 0; i < Box2D.postDefs.length; ++i) Box2D.postDefs[i]();
delete Box2D.postDefs;
"undefined" != typeof global && (global.Box2D = Box2D);
ig.baked = !0;
ig.module("plugins.box2d.lib").defines(function() {});
ig.baked = !0;
ig.module("plugins.box2d.game").requires("plugins.box2d.lib", "impact.game").defines(function() {
ig.Box2DGame = ig.Game.extend({
collisionRects: [],
debugCollisionRects: !1,
worldVelocityIterations: 6,
worldPositionIterations: 6,
updateTimestep: 1 / 60,
updateTimestepAccumulator: 0,
updateTimestepAccumulatorRatio: 0,
lastUpdateTime: -1,
nWorldSteps: 0,
bodyDestroyQueue: [],
defaultTileSegmentsDef: {},
defaultTileVerticesDef: {},
loadLevel: function(b) {
this.collisionMap = ig.CollisionMap.staticNoCollision;
for (var c = 0; c < b.layer.length; c++) {
var d =
b.layer[c];
"collision" == d.name && (this.collisionMap = new ig.CollisionMap(d.tilesize, d.data))
}
this.mergedShape = this.mergeRectangles(this.collisionMap);
ig.world = this.createWorldFromCollisionMap(this.collisionMap, this.mergedShape);
this.setupContactListener();
this.parent(b)
},
createWorldFromMap: function(b, c, d, e) {
var f = new Box2D.Collision.b2AABB;
f.lowerBound.Set(0, 0);
f.upperBound.Set((c + 1) * e * Box2D.SCALE, (d + 1) * e * Box2D.SCALE);
f = new Box2D.Common.Math.b2Vec2(0, ig.game.gravity * Box2D.SCALE);
world = new Box2D.Dynamics.b2World(f, !0);
b = ig.copy(b);
this.collisionRects = [];
for (f = 0; f < d; f++)
for (var j = 0; j < c; j++)
if (b[f][j]) {
var q = this._extractRectFromMap(b, c, d, j, f);
this.collisionRects.push(q)
}
for (c = 0; c < this.collisionRects.length; c++) d = this.collisionRects[c], b = new Box2D.Dynamics.b2BodyDef, b.position.Set(d.x * e * Box2D.SCALE + d.width * e / 2 * Box2D.SCALE, d.y * e * Box2D.SCALE + d.height * e / 2 * Box2D.SCALE), b = world.CreateBody(b), f = new Box2D.Collision.Shapes.b2PolygonShape, f.SetAsBox(d.width * e / 2 * Box2D.SCALE, d.height * e / 2 * Box2D.SCALE), b.CreateFixture2(f);
return world
},
_extractRectFromMap: function(b, c, d, e, f) {
for (var j = {
x: e,
y: f,
width: 1,
height: 1
}, q = e + 1; q < c && b[f][q]; q++) j.width++, b[f][q] = 0;
for (c = f + 1; c < d; c++) {
f = 0;
for (q = e; q < e + j.width && b[c][q]; q++) f++;
if (f == j.width) {
j.height++;
for (q = e; q < e + j.width; q++) b[c][q] = 0
} else break
}
return j
},
update: function() {
if (!ig.game.box2dPaused && ig.world) {
var b = ig.system.clock.delta() - this.lastUpdateTime;
this.lastUpdateTime = ig.system.clock.delta();
this.updateTimestepAccumulator += b;
this.nWorldSteps = Math.floor(this.updateTimestepAccumulator /
this.updateTimestep);
0 < this.nWorldSteps && (this.updateTimestepAccumulator -= this.nWorldSteps * this.updateTimestep);
this.updateTimestepAccumulatorRatio = this.updateTimestepAccumulator / this.updateTimestep;
for (var b = Math.min(this.nWorldSteps, 5), c = 0; c < b; c++) {
this.resetSmoothStates();
ig.world.Step(this.updateTimestep, this.worldVelocityIterations, this.worldPositionIterations);
for (var d = ig.world.GetBodyList(); d; d = d.m_next)
if (d.IsAwake()) {
var e = d.GetFixtureList();
if (!e || !e.IsSensor()) {
var e = 0.6 > Math.abs(d.GetAngularVelocity()),
f = 0.6 > Math.abs(d.GetLinearVelocity().Length());
e && f ? 30 < d.slowTime ? (d.slowTime = 0, d.SetAwake(!1)) : d.slowTime += 1 : d.slowTime = 0
}
}
}
ig.world.ClearForces();
this.smoothStates()
}
this.parent();
if (0 < this.bodyDestroyQueue.length) {
for (c = 0; c < this.bodyDestroyQueue.length; c++) ig.world.DestroyBody(this.bodyDestroyQueue[c]);
this.bodyDestroyQueue = []
}
},
smoothStates: function() {
for (var b = 1 - this.updateTimestepAccumulatorRatio, c = 0; c < this.entities.length; c++) {
var d = this.entities[c];
null != d.body && d.dynamicType != Box2D.Dynamics.b2Body.b2_staticBody &&
(d.pos.x = this.updateTimestepAccumulatorRatio * d.body.GetPosition().x + b * d.previousBodyPosition.x, d.pos.y = this.updateTimestepAccumulatorRatio * d.body.GetPosition().y + b * d.previousBodyPosition.y, d.angle = this.updateTimestepAccumulatorRatio * d.body.GetAngle() + b * d.previousBodyAngle, d.currentAnim && (d.currentAnim.update(), d.currentAnim.angle = d.angle))
}
},
resetSmoothStates: function() {
for (var b = 0; b < this.entities.length; b++) {
var c = this.entities[b];
null != c.body && c.dynamicType != Box2D.Dynamics.b2Body.b2_staticBody &&
(c.pos.x = c.body.GetPosition().x, c.previousBodyPosition.x = c.pos.x, c.pos.y = c.body.GetPosition().y, c.previousBodyPosition.y = c.pos.y, c.angle = c.body.GetAngle(), c.previousBodyAngle = c.body.GetAngle(), c.currentAnim && (c.currentAnim.update(), c.currentAnim.angle = c.angle))
}
},
draw: function() {
this.parent();
if (this.debugCollisionRects)
for (var b = this.collisionMap.tilesize, c = 0; c < this.collisionRects.length; c++) {
var d = this.collisionRects[c];
ig.system.context.strokeStyle = "#00ff00";
ig.system.context.strokeRect(ig.system.getDrawPos(d.x *
b - this.screen.x), ig.system.getDrawPos(d.y * b - this.screen.y), ig.system.getDrawPos(d.width * b), ig.system.getDrawPos(d.height * b))
}
},
queueDestroyBody: function(b) {
this.bodyDestroyQueue.push(b)
},
mergeRectangles: function(b) {
if (void 0 != b.data) {
for (var c = ig.copy(b.data), d = [], e = 0; e < c.length; e++) {
void 0 == d[e] && (d[e] = []);
for (var f = 0; f < c[0].length; f++) d[e].push(0)
}
c = this._shapesFromCollisionMap(b);
b = [];
f = [];
for (e = 0; e < c.length; e++) 1 == c[e].id ? (f.push(c[e]), d[c[e].tile.y][c[e].tile.x] = f[f.length - 1]) : b.push(c[e]);
for (e =
f.length - 1; 0 <= e; e--) 1 == f[e].id && (f[e].neighbours = this.checkNeighbour(d, f[e].tile.x, f[e].tile.y));
d = this.linkSquares(f, d);
return b.concat(d)
}
},
sideAbleCheck: function(b, c, d, e) {
return b ? b[d] ? b[d][c] ? b[d][c].neighbours ? -1 < b[d][c].neighbours.indexOf(e) ? !0 : !1 : !1 : !1 : !1 : !1
},
linkSquares: function(b, c) {
for (var d = [], e = [], f = 0; f < b.length; f++) {
var j = b[f],
q = j.tile.x,
n = j.tile.y;
if (!(-1 < d.indexOf(j)))
if (d.push(j), -1 < j.neighbours.indexOf("right")) {
for (var g = 1; !0 == this.sideAbleCheck(c, j.tile.x + g, j.tile.y, "right");) j.tile.x +
g < q && (q = j.tile.x + g), d.push(c[j.tile.y][j.tile.x + g]), g++;
c[j.tile.y][q].settings.size.x *= g + 1;
for (var y = c[j.tile.y][q].settings.vertices, A = 0; A < y.length; A++) y[A].x *= g + 1;
d.push(c[j.tile.y][j.tile.x + g + 1]);
e.push(c[j.tile.y][q])
} else if (-1 < j.neighbours.indexOf("down") && -1 == j.neighbours.indexOf("right") && -1 == j.neighbours.indexOf("left")) {
j.tile.y + g < n && (n = j.tile.y + g);
y = 0;
for (q = 1; !0 == this.sideAbleCheck(c, j.tile.x, j.tile.y + q, "down") && !1 == this.sideAbleCheck(c, j.tile.x, j.tile.y + q, "right") && !1 == this.sideAbleCheck(c,
j.tile.x, j.tile.y + q, "left");) y = 1, d.push(c[j.tile.y + q][j.tile.x]), q++;
!0 == this.sideAbleCheck(c, j.tile.x, j.tile.y + q, "up") && !1 == this.sideAbleCheck(c, j.tile.x, j.tile.y + q, "right") && !1 == this.sideAbleCheck(c, j.tile.x, j.tile.y + q, "left") ? y = 1 : !0 == this.sideAbleCheck(c, j.tile.x, j.tile.y + q, "up") && !0 == this.sideAbleCheck(c, j.tile.x, j.tile.y + q, "right") ? (d.splice(d.indexOf(c[j.tile.y + q][j.tile.x]), 1), q--) : !0 == this.sideAbleCheck(c, j.tile.x, j.tile.y + q, "up") && !0 == this.sideAbleCheck(c, j.tile.x, j.tile.y + q, "left") && (d.splice(d.indexOf(c[j.tile.y +
q][j.tile.x]), 1), q--);
if (1 == y) {
c[n][j.tile.x].settings.size.y *= q + 1;
y = c[n][j.tile.x].settings.vertices;
for (A = 0; A < y.length; A++) y[A].y *= q + 1;
c[j.tile.y + q] && d.push(c[j.tile.y + q][j.tile.x])
}
e.push(c[n][j.tile.x])
} else if (!(-1 < j.neighbours.indexOf("left")))
if (-1 < j.neighbours.indexOf("up")) {
if (!0 == this.sideAbleCheck(c, j.tile.x, j.tile.y - 1, "down") && (!0 == this.sideAbleCheck(c, j.tile.x, j.tile.y - 1, "right") || !0 == this.sideAbleCheck(c, j.tile.x, j.tile.y - 1, "left"))) d.push(c[j.tile.y][j.tile.x]), e.push(c[j.tile.y][j.tile.x])
} else d.push(c[j.tile.y][j.tile.x]),
e.push(c[j.tile.y][j.tile.x])
}
return e
},
getNeighbourTiles: function(b, c, d, e) {
switch (e) {
case "left":
return [{
x: c - 1,
y: d
}];
case "right":
return [{
x: c + 1,
y: d
}];
case "up":
return [{
x: c,
y: d - 1
}];
case "down":
return [{
x: c,
y: d + 1
}];
case "topL":
return [{
x: c,
y: d - 1
}, {
x: c - 1,
y: d
}, {
x: c - 1,
y: d - 1
}];
case "topR":
return [{
x: c,
y: d - 1
}, {
x: c + 1,
y: d
}, {
x: c + 1,
y: d - 1
}];
case "bottomL":
return [{
x: c,
y: d + 1
}, {
x: c - 1,
y: d
}, {
x: c - 1,
y: d + 1
}];
case "bottomR":
return [{
x: c,
y: d + 1
}, {
x: c + 1,
y: d
}, {
x: c + 1,
y: d + 1
}]
}
},
checkNeighbour: function(b, c, d) {
var e = [];
0 != this.checkArr(b,
c - 1, d) && e.push("left");
0 != this.checkArr(b, c, d + 1) && e.push("down");
0 != this.checkArr(b, c + 1, d) && e.push("right");
0 != this.checkArr(b, c, d - 1) && e.push("up");
return e
},
checkArr: function(b, c, d) {
return void 0 == b[d] ? 0 : void 0 == b[d][c] ? 0 : b[d][c]
},
createWorldFromCollisionMap: function(b, c) {
var d = new Box2D.Common.Math.b2Vec2(0, 0),
d = new Box2D.Common.Math.b2Vec2(0, ig.game.gravity * Box2D.SCALE);
world = new Box2D.Dynamics.b2World(d, !0);
for (var d = void 0 != c ? c : this._shapesFromCollisionMap(this.collisionMap), e = 0; e < d.length; e++) {
var f =
d[e],
j = f.settings.size.x,
q = f.settings.size.y,
n = f.settings.vertices,
g = new Box2D.Dynamics.b2BodyDef;
g.position.Set(f.x * Box2D.SCALE + j / 2 * Box2D.SCALE, f.y * Box2D.SCALE + q / 2 * Box2D.SCALE);
j = world.CreateBody(g);
f = new Box2D.Collision.Shapes.b2PolygonShape;
f.SetAsArray(n, n.length);
j.CreateFixture2(f)
}
return world
},
setupContactListener: function() {
var b = function(b, c, f) {
var j = c.GetFixtureA().GetBody().entity,
q = c.GetFixtureB().GetBody().entity;
if (j && q) j[b](q, c, f), q[b](j, c, f);
else if (j && !q) j[b](null, c, f);
else if (q &&
!j) q[b](null, c, f)
},
c = new Box2D.Dynamics.b2ContactListener;
c.BeginContact = function(c) {
b("beginContact", c)
};
c.EndContact = function(c) {
b("endContact", c)
};
c.PostSolve = function(c, e) {
b("postSolve", c, e)
};
c.PreSolve = function(c, e) {
b("preSolve", c, e)
};
ig.world.SetContactListener(c)
},
_shapesFromCollisionMap: function(b) {
var c = [];
if (b instanceof ig.CollisionMap) {
var d = ig.copy(b.data),
e = b.tilesize,
f = b.width,
j = b.height,
q, n, g, y, A, z, B, C, G, I;
for (z = 0; z < j; z++)
for (A = 0; A < f; A++) {
I = this._shapeFromTile(b, A, z);
G = {
id: b.data[z][A],
ix: A,
iy: z,
x: A * e,
y: z * e,
width: e,
height: e,
shape: I
};
if (0 < I.vertices.length) {
n = [];
q = I.vertices;
g = I.segments;
B = 0;
for (C = g.length; B < C; B++) {
y = g[B];
var u = q[y.a],
L = G.width / 20,
E = G.height / 20;
n[y.a] = {
x: u.x.map(0, 1, -L, L),
y: u.y.map(0, 1, -E, E)
}
}
I.vertices = n;
I.vertices[I.vertices.length - 1].x === I.vertices[0].x && I.vertices[I.vertices.length - 1].y === I.vertices[0].y && I.vertices.pop();
q = {
id: G.id,
settings: {
size: {
x: G.width,
y: G.height
},
vertices: ig.copy(I.vertices)
},
x: G.x,
y: G.y,
tile: {
x: A,
y: z
}
};
c.push(q)
}
d[z][A] = G
}
}
return c
},
_shapeFromTile: function(b, c, d) {
var e;
e = b.data[d][c];
b = this._verticesFromTile(b, c, d);
var f;
if (b)
if (this.defaultTileSegmentsDef[e]) f = this.defaultTileSegmentsDef[e];
else {
this.defaultTileSegmentsDef[e] = f = [];
e = 0;
for (c = b.length; e < c; e++) {
var j = b[e];
d = e === c - 1 ? 0 : e + 1;
var q = b[d],
n = q.x - j.x,
j = q.y - j.y,
q = Math.sqrt(n * n + j * j);
f.push({
a: e,
b: d,
normal: {
x: j / q,
y: -n / q
}
})
}
}
return {
vertices: b,
segments: f || []
}
},
_verticesFromTile: function(b, c, d) {
c = b.data[d][c];
if (this.defaultTileVerticesDef[c]) d = this.defaultTileVerticesDef[c];
else if (1 === c) d = [{
x: 0,
y: 0
}, {
x: 1,
y: 0
}, {
x: 1,
y: 1
}, {
x: 0,
y: 1
}];
else {
d = [];
if (b = b.tiledef[c]) {
var e = d[0] = {
x: b[0],
y: b[1]
},
f = d[1] = {
x: b[2],
y: b[3]
};
b = e.x;
var e = e.y,
j = f.x,
f = f.y,
q = j - b,
n = f - e,
g = d[2] = {
x: 0 > n ? 1 : 0,
y: 0 < q ? 1 : 0
},
y = g.x,
g = g.y,
A;
A = !1;
if (1 > Math.abs(q) && 1 > Math.abs(n)) {
var q = _utv2.pointQuadrant(b, e, 0.5, 0.5),
n = _utv2.pointQuadrant(j, f, 0.5, 0.5),
z = _utv2.pointQuadrant(y, g, 0.5, 0.5);
!(q & z) && !(n & z) && (A = !0)
}!0 === A ? (y !== g ? (A = y, n = g, 1 == y ? (g = 1, q = 0) : (g = 0, q = 1)) : (q = y, n = 1 == y ? A = 0 : A = 1), d[3] = {
x: A,
y: g
}, d[4] = {
x: q,
y: n
}) : (y !== g ? (A =
y, n = g, 1 == y ? (g = Math.max(e, f), q = Math.min(b, j)) : (g = Math.min(e, f), q = Math.max(b, j))) : (q = y, 1 == y ? (A = Math.min(b, j), n = Math.min(e, f)) : (A = Math.max(b, j), n = Math.max(e, f))), A === b && g === e || A === j && g === f ? q === b && n === e || q === j && n === f || (d[3] = {
x: q,
y: n
}) : d[3] = {
x: A,
y: g
});
d = this._pointsToConvexHull(d)
}
this.defaultTileVerticesDef[c] = d
}
return d
},
_pointsToConvexHull: function(b) {
if (3 > b.length) return b;
var c, d, e = 0,
f = b[e],
j;
c = 1;
for (d = b.length; c < d; c++) j = b[c], j.y === f.y ? j.x < f.x && (e = c, f = j) : j.y < f.y && (e = c, f = j);
var q = [],
n;
c = 0;
for (d = b.length; c <
d; c++) c !== e && (j = b[c], n = {
x: j.x,
y: j.y
}, n.angle = Math.atan((j.y - f.y) / (j.x - f.x)), 0 > n.angle && (n.angle += Math.PI), n.distance = (j.x - f.x) * (j.x - f.x) + (j.y - f.y) * (j.y - f.y), n.index = c, q.push(n));
q.sort(function(b, c) {
return b.angle < c.angle ? -1 : b.angle > c.angle ? 1 : b.distance < c.distance ? -1 : b.distance > c.distance ? 1 : 0
});
q.unshift(q[q.length - 1], {
x: f.x,
y: f.y,
index: e
});
e = 2;
c = 3;
for (d = b.length; c <= d; c++) {
for (; 0 >= this._pointsCW(q[e - 1], q[e], q[c]);) e--;
e++;
f = q[c];
q[c] = q[e];
q[e] = f
}
d = [];
for (c = 0; c <= e; c++) d[c] = b[q[c].index];
return d
},
_pointsCW: function(b, c, d) {
return (c.x - b.x) * (d.y - b.y) - (c.y - b.y) * (d.x - b.x)
}
});
Box2D.Common.b2Settings.b2_maxTranslation = 10;
Box2D.Common.b2Settings.b2_maxTranslationSquared = 100;
Box2D.Common.b2Settings.b2_velocityThreshold = 1
});
ig.baked = !0;
ig.module("plugins.camera").requires("impact.entity").defines(function() {
Camera = ig.Class.extend({
trap: {
pos: {
x: 0,
y: 0
},
size: {
x: 16,
y: 16
}
},
max: {
x: 0,
y: 0
},
offset: {
x: 0,
y: 0
},
pos: {
x: 0,
y: 0
},
damping: 5,
lookAhead: {
x: 0,
y: 0
},
currentLookAhead: {
x: 0,
y: 0
},
debug: !0,
init: function(b, c, d) {
this.offset.x = b;
this.offset.y = c;
this.damping = d ? d : this.damping
},
set: function(b) {
this.pos.x = b.pos.x - this.offset.x;
this.pos.y = b.pos.y - this.offset.y;
this.trap.pos.x = b.pos.x - this.trap.size.x / 2;
this.trap.pos.y = b.pos.y - this.trap.size.y
},
follow: function(b) {
isNaN(b.pos.x) &&
(b.pos.x = 0);
isNaN(b.pos.y) && (b.pos.y = 0);
isNaN(b.size.x) && (b.size.x = 0);
isNaN(b.size.y) && (b.size.y = 0);
this.pos.x = this.move("x", b.pos.x, b.size.x);
this.pos.y = this.move("y", b.pos.y, b.size.y);
if (isNaN(this.pos.x) || isNaN(this.pos.y)) console.log(this.pos.x + " | " + this.trap.pos.x + " | " + this.offset.x + " | " + this.currentLookAhead.x), this.pos.x = 10, this.pos.y = 10;
ig.game.screen.x = this.pos.x;
ig.game.screen.y = this.pos.y
},
move: function(b, c, d) {
isNaN(c) && (c = 10);
isNaN(d) && (d = 0);
isNaN(this.currentLookAhead[b]) && (this.currentLookAhead[b] =
0);
return !isNaN(c) && !isNaN(d) ? (c < this.trap.pos[b] ? (this.trap.pos[b] = c, this.currentLookAhead[b] = this.lookAhead[b]) : c + d > this.trap.pos[b] + this.trap.size[b] && (this.trap.pos[b] = c + d - this.trap.size[b], this.currentLookAhead[b] = -this.lookAhead[b]), (this.pos[b] - (this.pos[b] - this.trap.pos[b] + this.offset[b] + this.currentLookAhead[b]) * ig.system.tick * this.damping).limit(10, this.max[b])) : 0
},
draw: function() {
this.debug && (ig.system.context.fillStyle = "rgba(255,0,255,0)", ig.system.context.fillRect((this.trap.pos.x - this.pos.x) *
ig.system.scale, (this.trap.pos.y - this.pos.y) * ig.system.scale, this.trap.size.x * ig.system.scale, this.trap.size.y * ig.system.scale))
}
})
});
ig.baked = !0;
ig.module("plugins.curve-level").defines(function() {
CurveLevel = ig.Class.extend({
level1: [
[{
p0: {
x: -8.703442350483613,
y: 236.6510896564636
},
p3: {
x: 29.19990172547093,
y: 320.51589978833726
},
p1: {
x: 16.428830986197212,
y: 214.8532688166353
},
p2: {
x: 22.938010069978368,
y: 273.2177187709015
}
}, {
p0: {
x: 29.19990172547093,
y: 320.51589978833726
},
p3: {
x: 104.37099634038081,
y: 409.31418787152893
},
p1: {
x: 35.62204844639051,
y: 390.37865176585336
},
p2: {
x: 65.73437303776075,
y: 408.4649542547201
}
}, {
p0: {
x: 104.37099634038081,
y: 409.31418787152893
},
p3: {
x: 249.30690293295126,
y: 408.4159540597435
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 249.30690293295126,
y: 408.4159540597435
},
p3: {
x: 329.41535956539553,
y: 450.3066278710067
},
p1: {
x: 285.564723813528,
y: 407.38718662952635
},
p2: {
x: 304.0181470238324,
y: 429.7408461772167
}
}, {
p0: {
x: 329.41535956539553,
y: 450.3066278710067
},
p3: {
x: 453.41013909589236,
y: 421.3015526205514
},
p1: {
x: 368.7141543019781,
y: 478.2609525613615
},
p2: {
x: 412.8793066087622,
y: 478.3967932987995
}
}, {
p0: {
x: 453.41013909589236,
y: 421.3015526205514
},
p3: {
x: 558.4760603353126,
y: 322.209912229989
},
p1: {
x: 473.849416913595,
y: 381.92083807727204
},
p2: {
x: 508.8505807536656,
y: 327.7691701266621
}
}, {
p0: {
x: 558.4760603353126,
y: 322.209912229989
},
p3: {
x: 699.7876476687082,
y: 390.8803279550112
},
p1: {
x: 627.3970673253797,
y: 318.1600882955798
},
p2: {
x: 636.6779839175908,
y: 365.48778052241556
}
}, {
p0: {
x: 699.7876476687082,
y: 390.8803279550112
},
p3: {
x: 812.3454038997211,
y: 356.5236768802228
},
p1: {
x: 747.6100278551529,
y: 402.65181058495807
},
p2: {
x: 788.6128133704738,
y: 388.3899721448468
}
}, {
p0: {
x: 812.3454038997211,
y: 356.5236768802228
},
p3: {
x: 873.2924791086352,
y: 296.57938718662956
},
p1: {
x: 838.5292479108635,
y: 329.5598885793872
},
p2: {
x: 854.5738161559888,
y: 306.3844011142061
}
}, {
p0: {
x: 873.2924791086352,
y: 296.57938718662956
},
p3: {
x: 979.3649025069639,
y: 295.6880222841225
},
p1: {
x: 919.6434540389972,
y: 294.79665738161555
},
p2: {
x: 950.841225626741,
y: 296.8022284122562
}
}, {
p0: {
x: 979.3649025069639,
y: 295.6880222841225
},
p3: {
x: 1005.6601671309197,
y: 295.91086350974945
},
p1: {
x: 977.136490250696,
y: 340.47910863509776
},
p2: {
x: 1006.5515320334267,
y: 341.37047353760465
}
}, {
p0: {
x: 1005.6601671309197,
y: 295.91086350974945
},
p3: {
x: 1133.9610027855158,
y: 164.88022284122567
},
p1: {
x: 1093.0139275766019,
y: 299.4763231197771
},
p2: {
x: 1110.7855153203345,
y: 276.3008356545963
}
}, {
p0: {
x: 1133.9610027855158,
y: 164.88022284122567
},
p3: {
x: 1217.1922005571032,
y: 187.16434540389972
},
p1: {
x: 1151.2869080779938,
y: 72.40111420612811
},
p2: {
x: 1193.2367688022282,
y: 36.4122562674093
}
}, {
p0: {
x: 1217.1922005571032,
y: 187.16434540389972
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
level2: [
[{
p0: {
x: -23.821552586704087,
y: 142.16290068008564
},
p3: {
x: 19.836292617491203,
y: 214.72321205065722
},
p1: {
x: 8.869775868086975,
y: 102.41232393474556
},
p2: {
x: 8.764781723521672,
y: 159.831891999248
}
}, {
p0: {
x: 19.836292617491203,
y: 214.72321205065722
},
p3: {
x: 112.00343154772487,
y: 277.92668513487433
},
p1: {
x: 31.84252088733537,
y: 266.59912420679825
},
p2: {
x: 41.167443903902495,
y: 276.181489687791
}
}, {
p0: {
x: 112.00343154772487,
y: 277.92668513487433
},
p3: {
x: 258.7727637885207,
y: 314.83856305726613
},
p1: {
x: 196.12543742161773,
y: 278.8960075274436
},
p2: {
x: 239.97571308819042,
y: 269.1599084584772
}
}, {
p0: {
x: 258.7727637885207,
y: 314.83856305726613
},
p3: {
x: 363.0021185953792,
y: 281.6905589589427
},
p1: {
x: 289.5748031496063,
y: 367.83179954854637
},
p2: {
x: 327.17439850220063,
y: 363.5965906946196
}
}, {
p0: {
x: 363.0021185953792,
y: 281.6905589589427
},
p3: {
x: 464.3735810679646,
y: 301.2360468364273
},
p1: {
x: 396.9422807233358,
y: 200.3526157863776
},
p2: {
x: 438.6542601059616,
y: 202.0948187585414
}
}, {
p0: {
x: 464.3735810679646,
y: 301.2360468364273
},
p3: {
x: 576.3568094962696,
y: 352.88766603196814
},
p1: {
x: 496.4461156253062,
y: 403.12997231279434
},
p2: {
x: 542.2938225444176,
y: 404.63880013142295
}
}, {
p0: {
x: 576.3568094962696,
y: 352.88766603196814
},
p3: {
x: 682.4617134556745,
y: 381.41336556142005
},
p1: {
x: 612.1361342051312,
y: 303.0530014967615
},
p2: {
x: 650.1639443796512,
y: 307.90412272291474
}
}, {
p0: {
x: 682.4617134556745,
y: 381.41336556142005
},
p3: {
x: 790.9170133171427,
y: 388.23829057924104
},
p1: {
x: 722.8257781142343,
y: 456.0027360569653
},
p2: {
x: 755.5385670670198,
y: 455.1238161846224
}
}, {
p0: {
x: 790.9170133171427,
y: 388.23829057924104
},
p3: {
x: 881.0968360498562,
y: 357.6836049856185
},
p1: {
x: 814.5700720712758,
y: 344.68794924460605
},
p2: {
x: 848.0935331833372,
y: 295.8419542824864
}
}, {
p0: {
x: 881.0968360498562,
y: 357.6836049856185
},
p3: {
x: 991.5474592521572,
y: 358.6040268456377
},
p1: {
x: 895.8235858101631,
y: 357.6836049856187
},
p2: {
x: 949.2080536912752,
y: 357.6836049856185
}
}, {
p0: {
x: 991.5474592521572,
y: 358.6040268456377
},
p3: {
x: 1014.558005752637,
y: 358.77660594439106
},
p1: {
x: 974.0594439117931,
y: 398.3547459252156
},
p2: {
x: 1032.0460210930012,
y: 399.275167785235
}
}, {
p0: {
x: 1014.558005752637,
y: 358.77660594439106
},
p3: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p1: {
x: 1130.531160115053,
y: 358.77660594439124
},
p2: {
x: 1148.0191754554169,
y: 357.85618408437193
}
}, {
p0: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p3: {
x: 1268.594439117929,
y: 202.30488974113135
},
p1: {
x: 1202.3240651965477,
y: 180.21476510067112
},
p2: {
x: 1241.9022051773734,
y: 133.2732502396932
}
}, {
p0: {
x: 1268.594439117929,
y: 202.30488974113135
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
level3: [
[{
p0: {
x: -23.821552586704087,
y: 142.16290068008564
},
p3: {
x: 19.836292617491203,
y: 212.79936435526642
},
p1: {
x: 8.869775868086975,
y: 102.41232393474556
},
p2: {
x: 8.764781723521672,
y: 159.831891999248
}
}, {
p0: {
x: 19.836292617491203,
y: 212.79936435526642
},
p3: {
x: 80.7090883070729,
y: 277.92668513487433
},
p1: {
x: 31.84252088733537,
y: 266.59912420679825
},
p2: {
x: 41.167443903902495,
y: 276.181489687791
}
}, {
p0: {
x: 80.7090883070729,
y: 277.92668513487433
},
p3: {
x: 260.7700457058332,
y: 308.6592344312516
},
p1: {
x: 194.20158972622696,
y: 279.73342541211036
},
p2: {
x: 237.08994154510427,
y: 267.23606076308647
}
}, {
p0: {
x: 260.7700457058332,
y: 308.6592344312516
},
p3: {
x: 354.37949266949977,
y: 418.66270591473733
},
p1: {
x: 296.19837658850764,
y: 363.2552575223399
},
p2: {
x: 327.3461528501835,
y: 399.421908481401
}
}, {
p0: {
x: 354.37949266949977,
y: 418.66270591473733
},
p3: {
x: 455.0650943019607,
y: 436.68778392745054
},
p1: {
x: 387.0738373550893,
y: 438.46414229613373
},
p2: {
x: 420.20146114832085,
y: 445.97954694645057
}
}, {
p0: {
x: 455.0650943019607,
y: 436.68778392745054
},
p3: {
x: 542.5084866585717,
y: 364.14770567330805
},
p1: {
x: 490.11772693316004,
y: 424.94058701636095
},
p2: {
x: 519.2972030102327,
y: 400.5217203135847
}
}, {
p0: {
x: 542.5084866585717,
y: 364.14770567330805
},
p3: {
x: 664.3022881813483,
y: 367.6900416364849
},
p1: {
x: 578.988154517057,
y: 298.9407313477459
},
p2: {
x: 635.4081176094601,
y: 302.3815915627997
}
}, {
p0: {
x: 664.3022881813483,
y: 367.6900416364849
},
p3: {
x: 778.1629913710452,
y: 418.4314477468841
},
p1: {
x: 705.2962607861937,
y: 446.04410354745926
},
p2: {
x: 740.2722914669222,
y: 458.93000958772774
}
}, {
p0: {
x: 778.1629913710452,
y: 418.4314477468841
},
p3: {
x: 881.0968360498562,
y: 357.6836049856185
},
p1: {
x: 799.1792905081497,
y: 389.89837008628945
},
p2: {
x: 841.1657027392038,
y: 294.3295497891731
}
}, {
p0: {
x: 881.0968360498562,
y: 357.6836049856185
},
p3: {
x: 991.5474592521572,
y: 358.6040268456377
},
p1: {
x: 895.8235858101631,
y: 357.6836049856187
},
p2: {
x: 949.2080536912752,
y: 357.6836049856185
}
}, {
p0: {
x: 991.5474592521572,
y: 358.6040268456377
},
p3: {
x: 1014.558005752637,
y: 358.77660594439106
},
p1: {
x: 974.0594439117931,
y: 398.3547459252156
},
p2: {
x: 1032.0460210930012,
y: 399.275167785235
}
}, {
p0: {
x: 1014.558005752637,
y: 358.77660594439106
},
p3: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p1: {
x: 1130.531160115053,
y: 358.77660594439124
},
p2: {
x: 1148.0191754554169,
y: 357.85618408437193
}
}, {
p0: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p3: {
x: 1268.594439117929,
y: 202.30488974113135
},
p1: {
x: 1202.3240651965477,
y: 180.21476510067112
},
p2: {
x: 1241.9022051773734,
y: 133.2732502396932
}
}, {
p0: {
x: 1268.594439117929,
y: 202.30488974113135
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
level4: [
[{
p0: {
x: -115.65363008939516,
y: 162.15049011844437
},
p3: {
x: 12.521659552209115,
y: 197.94311960463676
},
p1: {
x: -80.93000884666006,
y: 95.35096763765188
},
p2: {
x: 11.384676613662798,
y: 60.592988687654184
}
}, {
p0: {
x: 12.521659552209115,
y: 197.94311960463676
},
p3: {
x: 117.93342425809152,
y: 280.7666490164015
},
p1: {
x: 17.89352056510465,
y: 300.5274382258871
},
p2: {
x: -10.262382209866608,
y: 276.12240045236007
}
}, {
p0: {
x: 117.93342425809152,
y: 280.7666490164015
},
p3: {
x: 140.937769545572,
y: 281.0267927775008
},
p1: {
x: 103.3678802237503,
y: 325.59336216032193
},
p2: {
x: 150.7775243192764,
y: 326.5400029531618
}
}, {
p0: {
x: 140.937769545572,
y: 281.0267927775008
},
p3: {
x: 256.76377246325006,
y: 302.49182716161624
},
p1: {
x: 235.209082074312,
y: 279.26477850192606
},
p2: {
x: 256.49037148114934,
y: 280.5269698147743
}
}, {
p0: {
x: 256.76377246325006,
y: 302.49182716161624
},
p3: {
x: 297.7347216473643,
y: 411.0460962222872
},
p1: {
x: 262.9189429583823,
y: 395.14111380169646
},
p2: {
x: 239.28432061959444,
y: 411.1315745482255
}
}, {
p0: {
x: 297.7347216473643,
y: 411.0460962222872
},
p3: {
x: 502.09358360073225,
y: 411.0497617734247
},
p1: {
x: 356.7330741128121,
y: 411.34432097221946
},
p2: {
x: 431.5321173845027,
y: 411.2963637468274
}
}, {
p0: {
x: 502.09358360073225,
y: 411.0497617734247
},
p3: {
x: 580.4902863531049,
y: 350.82092760355044
},
p1: {
x: 548.7254799006181,
y: 409.4223803416678
},
p2: {
x: 552.6467637208882,
y: 386.75644719024643
}
}, {
p0: {
x: 580.4902863531049,
y: 350.82092760355044
},
p3: {
x: 691.3932654090715,
y: 374.54855203644064
},
p1: {
x: 612.1361342051312,
y: 303.0530014967615
},
p2: {
x: 651.19731359386,
y: 303.77064586607946
}
}, {
p0: {
x: 691.3932654090715,
y: 374.54855203644064
},
p3: {
x: 788.8502748887252,
y: 377.9045984371528
},
p1: {
x: 723.8591473284431,
y: 420.8681827738652
},
p2: {
x: 756.5719362812287,
y: 422.05600132994
}
}, {
p0: {
x: 788.8502748887252,
y: 377.9045984371528
},
p3: {
x: 881.0968360498562,
y: 357.6836049856185
},
p1: {
x: 814.5700720712758,
y: 344.68794924460605
},
p2: {
x: 848.0935331833372,
y: 295.8419542824864
}
}, {
p0: {
x: 881.0968360498562,
y: 357.6836049856185
},
p3: {
x: 991.5474592521572,
y: 358.6040268456377
},
p1: {
x: 895.8235858101631,
y: 357.6836049856187
},
p2: {
x: 949.2080536912752,
y: 357.6836049856185
}
}, {
p0: {
x: 991.5474592521572,
y: 358.6040268456377
},
p3: {
x: 1088.9605891756723,
y: 357.7432367301822
},
p1: {
x: 1022.6277969796079,
y: 358.05334657107136
},
p2: {
x: 1053.7467745913866,
y: 357.9403992168818
}
}, {
p0: {
x: 1088.9605891756723,
y: 357.7432367301822
},
p3: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p1: {
x: 1130.531160115053,
y: 358.77660594439124
},
p2: {
x: 1148.0191754554169,
y: 357.85618408437193
}
}, {
p0: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p3: {
x: 1268.594439117929,
y: 202.30488974113135
},
p1: {
x: 1202.3240651965477,
y: 180.21476510067112
},
p2: {
x: 1241.9022051773734,
y: 133.2732502396932
}
}, {
p0: {
x: 1268.594439117929,
y: 202.30488974113135
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
level5: [
[{
p0: {
x: -8.703442350483613,
y: 236.6510896564636
},
p3: {
x: 29.19990172547093,
y: 320.51589978833726
},
p1: {
x: 16.428830986197212,
y: 214.8532688166353
},
p2: {
x: 22.938010069978368,
y: 273.2177187709015
}
}, {
p0: {
x: 29.19990172547093,
y: 320.51589978833726
},
p3: {
x: 104.37099634038081,
y: 409.31418787152893
},
p1: {
x: 35.62204844639051,
y: 390.37865176585336
},
p2: {
x: 65.73437303776075,
y: 408.4649542547201
}
}, {
p0: {
x: 104.37099634038081,
y: 409.31418787152893
},
p3: {
x: 249.30690293295126,
y: 408.4159540597435
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 249.30690293295126,
y: 408.4159540597435
},
p3: {
x: 335.11268894225014,
y: 456.9535121440037
},
p1: {
x: 285.564723813528,
y: 407.38718662952635
},
p2: {
x: 304.0181470238324,
y: 429.7408461772167
}
}, {
p0: {
x: 335.11268894225014,
y: 456.9535121440037
},
p3: {
x: 460.53633209695283,
y: 531.2485303511983
},
p1: {
x: 366.8331696296621,
y: 498.6396291129315
},
p2: {
x: 389.5512702578272,
y: 531.5396450472757
}
}, {
p0: {
x: 460.53633209695283,
y: 531.2485303511983
},
p3: {
x: 1292.9794289014458,
y: 531.3943132986161
},
p1: {
x: 595.8989400278431,
y: 532.5889186711215
},
p2: {
x: 672.7580545336027,
y: 532.5296573651302
}
}, {
p0: {
x: 1292.9794289014458,
y: 531.3943132986161
},
p3: {
x: 1292.391691394658,
y: 306.16023738872406
},
p1: {
x: 1293.3412462908016,
y: 457.139465875371
},
p2: {
x: 1294.290801186944,
y: 349.83976261127583
}
}, {
p0: {
x: 1292.391691394658,
y: 306.16023738872406
},
p3: {
x: 1118.6231454005929,
y: 304.26112759643917
},
p1: {
x: 1219.275964391691,
y: 304.26112759643917
},
p2: {
x: 1175.5964391691396,
y: 305.2106824925814
}
}, {
p0: {
x: 1118.6231454005929,
y: 304.26112759643917
},
p3: {
x: 904.973293768546,
y: 305.2106824925816
},
p1: {
x: 1045.5074183976265,
y: 304.26112759643917
},
p2: {
x: 976.1899109792283,
y: 304.2611275964392
}
}, {
p0: {
x: 904.973293768546,
y: 305.2106824925816
},
p3: {
x: 795.7744807121666,
y: 198.8605341246291
},
p1: {
x: 902.1246290801188,
y: 252.9851632047479
},
p2: {
x: 801.4718100890206,
y: 252.98516320474766
}
}, {
p0: {
x: 795.7744807121666,
y: 198.8605341246291
},
p3: {
x: 991.3827893175078,
y: 198.86053412462908
},
p1: {
x: 884.0830860534123,
y: 198.86053412462908
},
p2: {
x: 938.2077151335308,
y: 198.86053412462903
}
}, {
p0: {
x: 991.3827893175078,
y: 198.86053412462908
},
p3: {
x: 1019.8694362017804,
y: 198.86053412462903
},
p1: {
x: 989.4836795252226,
y: 252.0356083086054
},
p2: {
x: 1019.8694362017807,
y: 252.03560830860533
}
}, {
p0: {
x: 1019.8694362017804,
y: 198.86053412462903
},
p3: {
x: 1149.2462908011867,
y: 199.98813056379814
},
p1: {
x: 1105.566765578635,
y: 199.9881305637982
},
p2: {
x: 1120.7596439169142,
y: 199.98813056379817
}
}, {
p0: {
x: 1149.2462908011867,
y: 199.98813056379814
},
p3: {
x: 1151.857566765579,
y: 99.15727002967353
},
p1: {
x: 1175.59643916914,
y: 177.02077151335314
},
p2: {
x: 1177.495548961424,
y: 124.79525222551933
}
}, {
p0: {
x: 1151.857566765579,
y: 99.15727002967353
},
p3: {
x: 1369.2462908011867,
y: 286.2195845697329
},
p1: {
x: 1333.1632047477747,
y: 98.20771513353111
},
p2: {
x: 1360.7002967359053,
y: 138.08902077151336
}
}, {
p0: {
x: 1369.2462908011867,
y: 286.2195845697329
}
}]
],
level6: [
[{
p0: {
x: -47.26581021517704,
y: 240.71028627379977
},
p3: {
x: 32.24429918847303,
y: 240.34676659594825
},
p1: {
x: -23.148336032830287,
y: 240.22324767498623
},
p2: {
x: 4.671625291965711,
y: 240.74414583221235
}
}, {
p0: {
x: 32.24429918847303,
y: 240.34676659594825
},
p3: {
x: 36.37945300000024,
y: 409.31418787152893
},
p1: {
x: 5.178073816369327,
y: 287.88393717811556
},
p2: {
x: 5.861222932052492,
y: 358.73979569235223
}
}, {
p0: {
x: 36.37945300000024,
y: 409.31418787152893
},
p3: {
x: 250.32170208728533,
y: 408.4159540597435
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 250.32170208728533,
y: 408.4159540597435
},
p3: {
x: 355.408672028931,
y: 157.58776161546248
},
p1: {
x: 275.41673227018765,
y: 272.4188991030994
},
p2: {
x: 325.3289292648472,
y: 272.44697725544086
}
}, {
p0: {
x: 355.408672028931,
y: 157.58776161546248
},
p3: {
x: 438.2107507016041,
y: 156.78764240193814
},
p1: {
x: 381.04035779033865,
y: 154.6227157936926
},
p2: {
x: 409.8472533445079,
y: 155.04915878934773
}
}, {
p0: {
x: 438.2107507016041,
y: 156.78764240193814
},
p3: {
x: 353.2754119881266,
y: 576.0454760893139
},
p1: {
x: 423.38308379105655,
y: 293.0963182482885
},
p2: {
x: 307.43035897334903,
y: 315.36263833764593
}
}, {
p0: {
x: 353.2754119881266,
y: 576.0454760893139
},
p3: {
x: 515.6897886462439,
y: 579.0989266064831
},
p1: {
x: 411.48078117452275,
y: 577.9005652411217
},
p2: {
x: 463.1702937873668,
y: 579.1843714907683
}
}, {
p0: {
x: 515.6897886462439,
y: 579.0989266064831
},
p3: {
x: 531.0544350411851,
y: 308.32032421377534
},
p1: {
x: 475.4281842648411,
y: 509.2505567719149
},
p2: {
x: 476.39982183298764,
y: 395.52780722831085
}
}, {
p0: {
x: 531.0544350411851,
y: 308.32032421377534
},
p3: {
x: 683.7470781237258,
y: 309.2698791099178
},
p1: {
x: 579.7146065583031,
y: 306.29072590510725
},
p2: {
x: 635.2173951229917,
y: 307.3055250594414
}
}, {
p0: {
x: 683.7470781237258,
y: 309.2698791099178
},
p3: {
x: 685.1613728897564,
y: 582.4546144628955
},
p1: {
x: 636.2472506446009,
y: 399.1162414288495
},
p2: {
x: 642.1483428585765,
y: 515.8181441772635
}
}, {
p0: {
x: 685.1613728897564,
y: 582.4546144628955
},
p3: {
x: 786.3933601420322,
y: 583.4694136172293
},
p1: {
x: 719.6856230512981,
y: 582.4546144628957
},
p2: {
x: 749.4550724273998,
y: 582.4546144628954
}
}, {
p0: {
x: 786.3933601420322,
y: 583.4694136172293
},
p3: {
x: 846.33878081066,
y: 178.5645510379483
},
p1: {
x: 717.5175061637003,
y: 347.426728816005
},
p2: {
x: 826.0427977239794,
y: 299.7311685623052
}
}, {
p0: {
x: 846.33878081066,
y: 178.5645510379483
},
p3: {
x: 944.2568616257106,
y: 180.70694663145147
},
p1: {
x: 883.3257507794813,
y: 176.64775001411533
},
p2: {
x: 909.6814198154342,
y: 176.6477500141154
}
}, {
p0: {
x: 944.2568616257106,
y: 180.70694663145147
},
p3: {
x: 882.9357908670587,
y: 398.5230205582148
},
p1: {
x: 943.2074328266458,
y: 267.3378962490826
},
p2: {
x: 874.0706018155465,
y: 324.71068562932487
}
}, {
p0: {
x: 882.9357908670587,
y: 398.5230205582148
},
p3: {
x: 962.311829913237,
y: 399.8770898551452
},
p1: {
x: 917.095551470819,
y: 399.6030639707403
},
p2: {
x: 943.6178443046158,
y: 398.89240343536113
}
}, {
p0: {
x: 962.311829913237,
y: 399.8770898551452
},
p3: {
x: 989.3953488372092,
y: 401.1501057082452
},
p1: {
x: 946.7737843551799,
y: 461.0232558139534
},
p2: {
x: 1004.6173361522201,
y: 460.00845665961947
}
}, {
p0: {
x: 989.3953488372092,
y: 401.1501057082452
},
p3: {
x: 1071.5940803382668,
y: 402.1649048625793
},
p1: {
x: 1018.8245243128964,
y: 402.16490486257925
},
p2: {
x: 1052.3128964059194,
y: 402.16490486257925
}
}, {
p0: {
x: 1071.5940803382668,
y: 402.1649048625793
},
p3: {
x: 1141.6152219873147,
y: 95.69556025369978
},
p1: {
x: 1131.4672304439748,
y: 319.9661733615222
},
p2: {
x: 1175.103594080338,
y: 192.1014799154334
}
}, {
p0: {
x: 1141.6152219873147,
y: 95.69556025369978
},
p3: {
x: 1381.107822410148,
y: 287.492600422833
},
p1: {
x: 1349.6490486257928,
y: 93.66596194503171
},
p2: {
x: 1376.0338266384776,
y: 180.938689217759
}
}, {
p0: {
x: 1381.107822410148,
y: 287.492600422833
}
}]
],
level7: [
[{
p0: {
x: -8.703442350483613,
y: 236.6510896564636
},
p3: {
x: 29.19990172547093,
y: 320.51589978833726
},
p1: {
x: 16.428830986197212,
y: 214.8532688166353
},
p2: {
x: 22.938010069978368,
y: 273.2177187709015
}
}, {
p0: {
x: 29.19990172547093,
y: 320.51589978833726
},
p3: {
x: 104.37099634038081,
y: 409.31418787152893
},
p1: {
x: 35.62204844639051,
y: 390.37865176585336
},
p2: {
x: 65.73437303776075,
y: 408.4649542547201
}
}, {
p0: {
x: 104.37099634038081,
y: 409.31418787152893
},
p3: {
x: 249.30690293295126,
y: 408.4159540597435
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 249.30690293295126,
y: 408.4159540597435
},
p3: {
x: 329.41535956539553,
y: 450.3066278710067
},
p1: {
x: 285.564723813528,
y: 407.38718662952635
},
p2: {
x: 304.0181470238324,
y: 429.7408461772167
}
}, {
p0: {
x: 329.41535956539553,
y: 450.3066278710067
},
p3: {
x: 453.41013909589236,
y: 421.3015526205514
},
p1: {
x: 368.7141543019781,
y: 478.2609525613615
},
p2: {
x: 412.8793066087622,
y: 478.3967932987995
}
}, {
p0: {
x: 453.41013909589236,
y: 421.3015526205514
},
p3: {
x: 560.5056586439805,
y: 262.3367621242808
},
p1: {
x: 473.849416913595,
y: 381.92083807727204
},
p2: {
x: 507.76493524735747,
y: 262.44484226271715
}
}, {
p0: {
x: 560.5056586439805,
y: 262.3367621242808
},
p3: {
x: 774.882785089427,
y: 401.02831949835155
},
p1: {
x: 634.8069970403106,
y: 253.42548147412387
},
p2: {
x: 644.5858337682272,
y: 393.3124358012794
}
}, {
p0: {
x: 774.882785089427,
y: 401.02831949835155
},
p3: {
x: 961.520879586825,
y: 401.1748396709205
},
p1: {
x: 862.2823322948992,
y: 401.6370114306241
},
p2: {
x: 895.1667245755477,
y: 402.5971603055234
}
}, {
p0: {
x: 961.520879586825,
y: 401.1748396709205
},
p3: {
x: 988.9795827027153,
y: 401.1037000830355
},
p1: {
x: 954.2163515049438,
y: 459.45418033414404
},
p2: {
x: 995.6308986084199,
y: 459.61907341864594
}
}, {
p0: {
x: 988.9795827027153,
y: 401.1037000830355
},
p3: {
x: 1097.0816044097123,
y: 398.18273687186036
},
p1: {
x: 1053.59694241109,
y: 400.3357694323554
},
p2: {
x: 1075.9152213984112,
y: 400.01575906764737
}
}, {
p0: {
x: 1097.0816044097123,
y: 398.18273687186036
},
p3: {
x: 1095.9772918666488,
y: 246.18570494738162
},
p1: {
x: 1095.8679913077785,
y: 341.4939077894318
},
p2: {
x: 1095.8538576148221,
y: 288.6009175122347
}
}, {
p0: {
x: 1095.9772918666488,
y: 246.18570494738162
},
p3: {
x: 680.5413566430872,
y: 241.34439117614914
},
p1: {
x: 947.8976485068342,
y: 245.69196794007306
},
p2: {
x: 870.2781157431675,
y: 246.87166017890917
}
}, {
p0: {
x: 680.5413566430872,
y: 241.34439117614914
},
p3: {
x: 561.4962411690266,
y: 155.1198419208287
},
p1: {
x: 666.1710031967048,
y: 190.16770790604156
},
p2: {
x: 560.057975310613,
y: 203.8561124044123
}
}, {
p0: {
x: 561.4962411690266,
y: 155.1198419208287
},
p3: {
x: 754.4246914504167,
y: 157.71031575271127
},
p1: {
x: 624.0584232944798,
y: 155.46431177384042
},
p2: {
x: 681.5627108707989,
y: 157.08978652547285
}
}, {
p0: {
x: 754.4246914504167,
y: 157.71031575271127
},
p3: {
x: 1067.5771670190281,
y: 160.7272727272727
},
p1: {
x: 832.143763213531,
y: 159.71247357293865
},
p2: {
x: 966.0972515856238,
y: 161.74207188160685
}
}, {
p0: {
x: 1067.5771670190281,
y: 160.7272727272727
},
p3: {
x: 1246.816067653277,
y: 160.8599849077313
},
p1: {
x: 1157.4199454932116,
y: 159.37420718816065
},
p2: {
x: 1207.3097469862237,
y: 160.97872738498384
}
}, {
p0: {
x: 1246.816067653277,
y: 160.8599849077313
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
level8: [
[{
p0: {
x: -31.29167764460125,
y: 621.1216778917576
},
p3: {
x: 25.435195843117945,
y: 627.8100174353964
},
p1: {
x: -5.218227837332208,
y: 558.8532688166354
},
p2: {
x: 13.526245364095907,
y: 572.0412481826661
}
}, {
p0: {
x: 25.435195843117945,
y: 627.8100174353964
},
p3: {
x: 100.60629045802789,
y: 682.7259525774114
},
p1: {
x: 40.32793079933167,
y: 679.7904164717357
},
p2: {
x: 50.675549508349064,
y: 682.8178954311908
}
}, {
p0: {
x: 100.60629045802789,
y: 682.7259525774114
},
p3: {
x: 245.54219705059833,
y: 684.6512481773907
},
p1: {
x: 146.2245931674175,
y: 684.557152884392
},
p2: {
x: 197.4049021750255,
y: 684.2698727130636
}
}, {
p0: {
x: 245.54219705059833,
y: 684.6512481773907
},
p3: {
x: 363.29771250657205,
y: 728.4242749298304
},
p1: {
x: 325.0941355782338,
y: 677.9754219236439
},
p2: {
x: 321.9004999650089,
y: 731.3879050007464
}
}, {
p0: {
x: 363.29771250657205,
y: 728.4242749298304
},
p3: {
x: 427.99837439001004,
y: 645.7721408558456
},
p1: {
x: 396.9494484196252,
y: 728.1433055025378
},
p2: {
x: 416.6440124911151,
y: 681.2203227105641
}
}, {
p0: {
x: 427.99837439001004,
y: 645.7721408558456
},
p3: {
x: 466.2407662176655,
y: 562.9157945829302
},
p1: {
x: 436.67294632535976,
y: 623.3326027831545
},
p2: {
x: 446.73293369484213,
y: 587.0632877737208
}
}, {
p0: {
x: 466.2407662176655,
y: 562.9157945829302
},
p3: {
x: 561.4347064922375,
y: 540.0567985432465
},
p1: {
x: 493.7500085018504,
y: 528.5130294720506
},
p2: {
x: 536.9132780352379,
y: 542.8995452282978
}
}, {
p0: {
x: 561.4347064922375,
y: 540.0567985432465
},
p3: {
x: 675.8748156644265,
y: 465.2295592331639
},
p1: {
x: 597.9629690316232,
y: 543.1223988202527
},
p2: {
x: 651.2010486645913,
y: 540.3899721448468
}
}, {
p0: {
x: 675.8748156644265,
y: 465.2295592331639
},
p3: {
x: 773.5277732262824,
y: 410.93232836310017
},
p1: {
x: 696.4116008520404,
y: 412.85400622644596
},
p2: {
x: 732.2208749795183,
y: 322.8549893495002
}
}, {
p0: {
x: 773.5277732262824,
y: 410.93232836310017
},
p3: {
x: 889.011961330493,
y: 375.21743404882835
},
p1: {
x: 854.702277568409,
y: 412.9143044404391
},
p2: {
x: 876.4882844502708,
y: 413.97869900049153
}
}, {
p0: {
x: 889.011961330493,
y: 375.21743404882835
},
p3: {
x: 1016.0131083073903,
y: 267.2049811568083
},
p1: {
x: 925.371784368343,
y: 275.0673439292153
},
p2: {
x: 918.0809437981326,
y: 262.782238243487
}
}, {
p0: {
x: 1016.0131083073903,
y: 267.2049811568083
},
p3: {
x: 1038.9021792561039,
y: 266.9978699000492
},
p1: {
x: 1002.6609864001313,
y: 312.1822054727183
},
p2: {
x: 1047.7266917909228,
y: 312.5361297722434
}
}, {
p0: {
x: 1038.9021792561039,
y: 266.9978699000492
},
p3: {
x: 1160.7216123218093,
y: 265.5172865803703
},
p1: {
x: 1100.463378666229,
y: 265.8128789120105
},
p2: {
x: 1149.0014746845816,
y: 264.6475503850564
}
}, {
p0: {
x: 1160.7216123218093,
y: 265.5172865803703
},
p3: {
x: 1265.8823529411768,
y: 420.235294117647
},
p1: {
x: 1245.1764705882363,
y: 266.82352941176475
},
p2: {
x: 1260.2352941176473,
y: 353.4117647058824
}
}, {
p0: {
x: 1265.8823529411768,
y: 420.235294117647
},
p3: {
x: 1306.3529411764703,
y: 487.0588235294118
},
p1: {
x: 1274.3529411764707,
y: 457.88235294117646
},
p2: {
x: 1294.1176470588234,
y: 469.1764705882353
}
}, {
p0: {
x: 1306.3529411764703,
y: 487.0588235294118
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 588.764723813528
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
level9: [
[{
p0: {
x: -31.29167764460125,
y: 621.1216778917576
},
p3: {
x: 25.435195843117945,
y: 627.8100174353964
},
p1: {
x: -5.218227837332208,
y: 558.8532688166354
},
p2: {
x: 13.526245364095907,
y: 572.0412481826661
}
}, {
p0: {
x: 25.435195843117945,
y: 627.8100174353964
},
p3: {
x: 100.60629045802789,
y: 682.7259525774114
},
p1: {
x: 40.32793079933167,
y: 679.7904164717357
},
p2: {
x: 50.675549508349064,
y: 682.8178954311908
}
}, {
p0: {
x: 100.60629045802789,
y: 682.7259525774114
},
p3: {
x: 245.54219705059833,
y: 684.6512481773907
},
p1: {
x: 146.2245931674175,
y: 684.557152884392
},
p2: {
x: 197.4049021750255,
y: 684.2698727130636
}
}, {
p0: {
x: 245.54219705059833,
y: 684.6512481773907
},
p3: {
x: 363.29771250657205,
y: 728.4242749298304
},
p1: {
x: 325.0941355782338,
y: 677.9754219236439
},
p2: {
x: 321.9004999650089,
y: 731.3879050007464
}
}, {
p0: {
x: 363.29771250657205,
y: 728.4242749298304
},
p3: {
x: 421.29178756366275,
y: 662.0595660055461
},
p1: {
x: 396.9494484196252,
y: 728.1433055025378
},
p2: {
x: 404.1889226707558,
y: 699.4239155249353
}
}, {
p0: {
x: 421.29178756366275,
y: 662.0595660055461
},
p3: {
x: 455.7018440619769,
y: 573.4547167386188
},
p1: {
x: 429.00827566667715,
y: 636.745776435849
},
p2: {
x: 438.11017920382415,
y: 607.1830482527628
}
}, {
p0: {
x: 455.7018440619769,
y: 573.4547167386188
},
p3: {
x: 532.6921915221776,
y: 572.6316488426476
},
p1: {
x: 478.4206671844851,
y: 531.3872809690565
},
p2: {
x: 512.0030983945194,
y: 520.8636170845853
}
}, {
p0: {
x: 532.6921915221776,
y: 572.6316488426476
},
p3: {
x: 665.3358935087382,
y: 525.5888406702896
},
p1: {
x: 621.9150648400063,
y: 576.6553329519891
},
p2: {
x: 643.5363780059085,
y: 578.7133254382601
}
}, {
p0: {
x: 665.3358935087382,
y: 525.5888406702896
},
p3: {
x: 773.5277732262824,
y: 442.54909483016604
},
p1: {
x: 682.0403433670103,
y: 481.83604215458973
},
p2: {
x: 723.5981204885004,
y: 347.7651689902188
}
}, {
p0: {
x: 773.5277732262824,
y: 442.54909483016604
},
p3: {
x: 935.9580691149243,
y: 403.95994901888815
},
p1: {
x: 860.4507805624211,
y: 446.4472385721756
},
p2: {
x: 916.7278054083548,
y: 449.42780079689874
}
}, {
p0: {
x: 935.9580691149243,
y: 403.95994901888815
},
p3: {
x: 1065.833467588827,
y: 435.8277356478263
},
p1: {
x: 971.3598083204388,
y: 313.3906972226285
},
p2: {
x: 1012.9312431993302,
y: 314.5187651895948
}
}, {
p0: {
x: 1065.833467588827,
y: 435.8277356478263
},
p3: {
x: 1227.6446942261637,
y: 564.9619417563366
},
p1: {
x: 1081.1041001725864,
y: 475.53549888589197
},
p2: {
x: 1118.6248953837373,
y: 556.8475070177524
}
}, {
p0: {
x: 1227.6446942261637,
y: 564.9619417563366
},
p3: {
x: 1296.6497560343842,
y: 625.7568075384542
},
p1: {
x: 1265.2537978279056,
y: 574.3158729239865
},
p2: {
x: 1291.755965702546,
y: 595.186472540745
}
}, {
p0: {
x: 1296.6497560343842,
y: 625.7568075384542
},
p3: {
x: 1320.4931313842906,
y: 708.6185276505811
},
p1: {
x: 1306.4938358576974,
y: 644.3085593518844
},
p2: {
x: 1311.971821063755,
y: 669.579429376541
}
}, {
p0: {
x: 1320.4931313842906,
y: 708.6185276505811
},
p3: {
x: 1347.5505459668893,
y: 818.5558295174359
},
p1: {
x: 1328.9637196195847,
y: 752.0140894681225
},
p2: {
x: 1338.1895033462486,
y: 780.5537160972173
}
}, {
p0: {
x: 1347.5505459668893,
y: 818.5558295174359
},
p3: {
x: 1369.0778443113775,
y: 916.3832335329344
},
p1: {
x: 1354.7065868263471,
y: 851.2335329341319
},
p2: {
x: 1375.7844311377248,
y: 892.4311377245509
}
}, {
p0: {
x: 1369.0778443113775,
y: 916.3832335329344
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 588.764723813528
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
level10: [
[{
p0: {
x: -272.02085615059957,
y: 924.0853371075856
},
p3: {
x: -200.7063759857968,
y: 924.8138007497503
},
p1: {
x: -255.30315790885163,
y: 927.4141463148483
},
p2: {
x: -228.3784033468505,
y: 924.8772927350382
}
}, {
p0: {
x: -200.7063759857968,
y: 924.8138007497503
},
p3: {
x: -102.8760525434879,
y: 927.0845167360463
},
p1: {
x: -168.7994705503939,
y: 929.7870631024913
},
p2: {
x: -132.51312258499004,
y: 921.4925880140579
}
}, {
p0: {
x: -102.8760525434879,
y: 927.0845167360463
},
p3: {
x: -14.837156416915661,
y: 925.291353488261
},
p1: {
x: -68.16222836460112,
y: 923.5795418246853
},
p2: {
x: -40.65386758595568,
y: 927.3692230913651
}
}, {
p0: {
x: -14.837156416915661,
y: 925.291353488261
},
p3: {
x: 65.33238055801806,
y: 916.5885695110733
},
p1: {
x: 19.13800606246599,
y: 918.0012049579973
},
p2: {
x: 40.41929546930331,
y: 923.0541169026321
}
}, {
p0: {
x: 65.33238055801806,
y: 916.5885695110733
},
p3: {
x: 138.5244551123199,
y: 914.2642600919811
},
p1: {
x: 99.36514236608218,
y: 915.4570071876788
},
p2: {
x: 115.1382199285776,
y: 916.2450987338128
}
}, {
p0: {
x: 138.5244551123199,
y: 914.2642600919811
},
p3: {
x: 235.7954592177116,
y: 915.2156058010654
},
p1: {
x: 174.77848378704704,
y: 918.3532054737002
},
p2: {
x: 213.56568105676337,
y: 918.3052482483082
}
}, {
p0: {
x: 235.7954592177116,
y: 915.2156058010654
},
p3: {
x: 361.5761698674189,
y: 861.620532736818
},
p1: {
x: 270.1075134642903,
y: 917.3789450010953
},
p2: {
x: 330.8896067613619,
y: 894.7130118496739
}
}, {
p0: {
x: 361.5761698674189,
y: 861.620532736818
},
p3: {
x: 481.9559505028523,
y: 857.8654325892542
},
p1: {
x: 411.22794072043234,
y: 882.0855780021908
},
p2: {
x: 456.92288121478794,
y: 886.5939430032956
}
}, {
p0: {
x: 481.9559505028523,
y: 857.8654325892542
},
p3: {
x: 690.291538462269,
y: 654.6272045575872
},
p1: {
x: 539.061516528838,
y: 823.6322499012099
},
p2: {
x: 643.7979974855723,
y: 766.0638986645896
}
}, {
p0: {
x: 690.291538462269,
y: 654.6272045575872
},
p3: {
x: 842.2419495740417,
y: 677.9994983716008
},
p1: {
x: 760.5523030683144,
y: 532.3286205180511
},
p2: {
x: 767.5407197578684,
y: 679.6524182508971
}
}, {
p0: {
x: 842.2419495740417,
y: 677.9994983716008
},
p3: {
x: 985.8613783044771,
y: 676.0768797577798
},
p1: {
x: 867.3931810717623,
y: 677.999498371601
},
p2: {
x: 887.6088434247403,
y: 677.9994983716006
}
}, {
p0: {
x: 985.8613783044771,
y: 676.0768797577798
},
p3: {
x: 1090.855949491566,
y: 674.2684094843777
},
p1: {
x: 1025.4708374534478,
y: 674.5785193252668
},
p2: {
x: 1052.79909443344,
y: 674.4655719710772
}
}, {
p0: {
x: 1090.855949491566,
y: 674.2684094843777
},
p3: {
x: 1165.616223987492,
y: 559.7184179965338
},
p1: {
x: 1135.2695609047864,
y: 672.4587382247469
},
p2: {
x: 1152.7575762451504,
y: 645.0032719422201
}
}, {
p0: {
x: 1165.616223987492,
y: 559.7184179965338
},
p3: {
x: 1249.6408359589948,
y: 581.3769529198084
},
p1: {
x: 1175.7890207740402,
y: 524.2226624353207
},
p2: {
x: 1201.1519583856652,
y: 465.90898567898245
}
}, {
p0: {
x: 1249.6408359589948,
y: 581.3769529198084
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
level11: [
[{
p0: {
x: -8.703442350483613,
y: 236.6510896564636
},
p3: {
x: 29.19990172547093,
y: 320.51589978833726
},
p1: {
x: 16.428830986197212,
y: 214.8532688166353
},
p2: {
x: 22.938010069978368,
y: 273.2177187709015
}
}, {
p0: {
x: 29.19990172547093,
y: 320.51589978833726
},
p3: {
x: 104.37099634038081,
y: 409.31418787152893
},
p1: {
x: 35.62204844639051,
y: 390.37865176585336
},
p2: {
x: 65.73437303776075,
y: 408.4649542547201
}
}, {
p0: {
x: 104.37099634038081,
y: 409.31418787152893
},
p3: {
x: 247.1616515363032,
y: 410.5612054563915
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 247.1616515363032,
y: 410.5612054563915
},
p3: {
x: 361.5941305151162,
y: 410.61947703301786
},
p1: {
x: 292.00047800347215,
y: 411.6776894228225
},
p2: {
x: 326.5432866886369,
y: 411.50620930570835
}
}, {
p0: {
x: 361.5941305151162,
y: 410.61947703301786
},
p3: {
x: 478.08053015734487,
y: 411.64792133563515
},
p1: {
x: 400.89292525169884,
y: 411.7581592652721
},
p2: {
x: 441.84020046351077,
y: 410.82137430438604
}
}, {
p0: {
x: 478.08053015734487,
y: 411.64792133563515
},
p3: {
x: 585.291702793413,
y: 411.2378451908829
},
p1: {
x: 513.5365677515839,
y: 411.9543576303446
},
p2: {
x: 543.1746031000343,
y: 412.50660029425995
}
}, {
p0: {
x: 585.291702793413,
y: 411.2378451908829
},
p3: {
x: 705.1507761603283,
y: 409.11496482651955
},
p1: {
x: 627.3970673253797,
y: 412.5511497480938
},
p2: {
x: 668.8567548673117,
y: 410.5380598520245
}
}, {
p0: {
x: 705.1507761603283,
y: 409.11496482651955
},
p3: {
x: 812.3454038997211,
y: 356.5236768802228
},
p1: {
x: 752.973156346773,
y: 402.65181058495807
},
p2: {
x: 787.5401876721497,
y: 384.0994693515507
}
}, {
p0: {
x: 812.3454038997211,
y: 356.5236768802228
},
p3: {
x: 873.2924791086352,
y: 296.57938718662956
},
p1: {
x: 838.5292479108635,
y: 329.5598885793872
},
p2: {
x: 854.5738161559888,
y: 306.3844011142061
}
}, {
p0: {
x: 873.2924791086352,
y: 296.57938718662956
},
p3: {
x: 979.3649025069639,
y: 295.6880222841225
},
p1: {
x: 919.6434540389972,
y: 294.79665738161555
},
p2: {
x: 950.841225626741,
y: 296.8022284122562
}
}, {
p0: {
x: 979.3649025069639,
y: 295.6880222841225
},
p3: {
x: 1005.6601671309197,
y: 295.91086350974945
},
p1: {
x: 977.136490250696,
y: 340.47910863509776
},
p2: {
x: 1006.5515320334267,
y: 341.37047353760465
}
}, {
p0: {
x: 1005.6601671309197,
y: 295.91086350974945
},
p3: {
x: 1133.9610027855158,
y: 164.88022284122567
},
p1: {
x: 1093.0139275766019,
y: 299.4763231197771
},
p2: {
x: 1110.7855153203345,
y: 276.3008356545963
}
}, {
p0: {
x: 1133.9610027855158,
y: 164.88022284122567
},
p3: {
x: 1217.1922005571032,
y: 187.16434540389972
},
p1: {
x: 1151.2869080779938,
y: 72.40111420612811
},
p2: {
x: 1193.2367688022282,
y: 36.4122562674093
}
}, {
p0: {
x: 1217.1922005571032,
y: 187.16434540389972
},
p3: {
x: 1237.2290502793296,
y: 281.6983240223463
},
p1: {
x: 1227.486033519553,
y: 222.70391061452514
},
p2: {
x: 1230.7039106145253,
y: 250.59217877094972
}
}, {
p0: {
x: 1237.2290502793296,
y: 281.6983240223463
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
init: function() {},
getLevel: function(b) {
return this["level" + b] ? this["level" + b] : []
},
loadLand: function() {
ig.game.landpoints = this.getLevel(ig.game.levelNow);
JSON.stringify(ig.game.landpoints)
}
})
});
this.START_BRANDING_SPLASH;
ig.baked = !0;
ig.module("plugins.branding.splash").requires("impact.impact", "impact.entity").defines(function() {
ig.BrandingSplash = ig.Class.extend({
init: function() {
ig.game.spawnEntity(EntityBranding, 0, 0);
console.log("spawn branding")
}
});
EntityBranding = ig.Entity.extend({
gravityFactor: 0,
size: {
x: 32,
y: 32
},
splash: new ig.Image("branding/splash1.png"),
init: function(b, c, d) {
this.parent(b, c, d);
320 >= ig.system.width ? (this.size.x = 320, this.size.y = 200) : (this.size.x = 480, this.size.y = 240);
this.pos.x = (ig.system.width - this.size.x) /
2;
this.pos.y = -this.size.y - 200;
this.endPosY = (ig.system.height - this.size.y) / 2;
b = this.tween({
pos: {
y: this.endPosY
}
}, 0.5, {
easing: ig.Tween.Easing.Bounce.EaseIn
});
c = this.tween({}, 2.5, {
onComplete: function() {
ig.game.director.loadLevel(ig.game.director.currentLevel)
}
});
b.chain(c);
b.start();
this.currentAnim = this.anims.idle
},
createClickableLayer: function() {
console.log("Build clickable layer");
this.checkClickableLayer("branding-splash", _SETTINGS.Branding.Logo.Link, _SETTINGS.Branding.Logo.NewWindow)
},
doesClickableLayerExist: function(b) {
for (k in dynamicClickableEntityDivs)
if (k ==
b) return !0;
return !1
},
checkClickableLayer: function(b, c, d) {
"undefined" == typeof wm && (this.doesClickableLayerExist(b) ? (ig.game.showOverlay([b]), $("#" + b).find("[href]").attr("href", c)) : this.createClickableOutboundLayer(b, c, "media/graphics/misc/invisible.png", d))
},
createClickableOutboundLayer: function(b, c, d, e) {
var f = ig.$new("div");
f.id = b;
document.body.appendChild(f);
f = $("#" + f.id);
f.css("float", "left");
f.css("position", "absolute");
if (ig.ua.mobile) {
var j = window.innerHeight / mobileHeight,
q = window.innerWidth /
mobileWidth;
f.css("left", this.pos.x * q);
f.css("top", this.pos.y * j);
f.css("width", this.size.x * q);
f.css("height", this.size.y * j)
} else j = w / 2 - destW / 2, q = h / 2 - destH / 2, console.log(j, q), f.css("left", j + this.pos.x * multiplier), f.css("top", q + this.pos.y * multiplier), f.css("width", this.size.x * multiplier), f.css("height", this.size.y * multiplier);
e ? f.html("<a target='_blank' href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>") : f.html("<a href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>");
dynamicClickableEntityDivs[b] = {};
dynamicClickableEntityDivs[b].width = this.size.x * multiplier;
dynamicClickableEntityDivs[b].height = this.size.y * multiplier;
dynamicClickableEntityDivs[b].entity_pos_x = this.pos.x;
dynamicClickableEntityDivs[b].entity_pos_y = this.pos.y
},
draw: function() {
ig.system.context.fillStyle = "#ffffff";
ig.system.context.fillRect(0, 0, ig.system.width, ig.system.height);
ig.system.context.fillStyle = "#000";
ig.system.context.font = "12px Arial";
ig.system.context.textAlign = "left";
320 >= ig.system.width ?
ig.system.context.fillText("powered by mobiltr.com", ig.system.width - 150, ig.system.height - 15) : ig.system.context.fillText("powered by mobiltr.com", ig.system.width - 160, ig.system.height - 15);
this.parent();
this.splash && ig.system.context.drawImage(this.splash.data, 0, 0, this.splash.data.width, this.splash.data.height, this.pos.x, this.pos.y, this.size.x, this.size.y)
}
})
});
this.END_BRANDING_SPLASH;
ig.baked = !0;
ig.module("game.entities.buttons.button").requires("impact.entity", "plugins.data.vector").defines(function() {
EntityButton = ig.Entity.extend({
collides: ig.Entity.COLLIDES.NEVER,
type: ig.Entity.TYPE.A,
size: new Vector2(48, 48),
fillColor: null,
zIndex: 95E3,
init: function(b, c, d) {
this.parent(b, c, d);
!ig.global.wm && !isNaN(d.zIndex) && (this.zIndex = d.zIndex);
b = Math.floor(256 * Math.random());
c = Math.floor(256 * Math.random());
d = Math.floor(256 * Math.random());
this.fillColor = "rgba(" + b + "," + d + "," + c + ",1)"
},
clicked: function() {
throw "no implementation on clicked()";
},
clicking: function() {
throw "no implementation on clicking()";
},
released: function() {
throw "no implementation on released()";
}
})
});
ig.baked = !0;
ig.module("plugins.clickable-div-layer").requires("plugins.data.vector").defines(function() {
ClickableDivLayer = ig.Class.extend({
pos: new Vector2(0, 0),
size: new Vector2(0, 0),
identifier: null,
invisImagePath: "media/graphics/misc/invisible.png",
init: function(b) {
this.pos = new Vector2(b.pos.x, b.pos.y);
this.size = new Vector2(b.size.x, b.size.y);
var c = "more-games",
d = "www.google.com",
e = !1;
b.div_layer_name && (c = b.div_layer_name);
b.link && (d = b.link);
b.newWindow && (e = b.newWindow);
this.createClickableLayer(c, d, e)
},
createClickableLayer: function(b,
c, d) {
this.identifier = b;
var e = ig.domHandler.getElementById("#" + b);
e ? (ig.domHandler.show(e), ig.domHandler.attr(e, "href", c)) : this.createClickableOutboundLayer(b, c, this.invisImagePath, d)
},
update: function(b, c) {
this.pos.x === b && this.pos.y === c || (ig.sizeHandler.dynamicClickableEntityDivs[this.identifier] = {}, ig.sizeHandler.dynamicClickableEntityDivs[this.identifier].width = this.size.x, ig.sizeHandler.dynamicClickableEntityDivs[this.identifier].height = this.size.y, ig.sizeHandler.dynamicClickableEntityDivs[this.identifier].entity_pos_x =
this.pos.x, ig.sizeHandler.dynamicClickableEntityDivs[this.identifier].entity_pos_y = this.pos.y)
},
createClickableOutboundLayer: function(b, c, d, e) {
var f = ig.domHandler.create("div");
ig.domHandler.attr(f, "id", b);
var j = ig.domHandler.create("a");
e ? (ig.domHandler.attr(j, "href", c), ig.domHandler.attr(j, "target", "_blank")) : ig.domHandler.attr(j, "href", c);
c = ig.domHandler.create("img");
ig.domHandler.css(c, {
width: "100%",
height: "100%"
});
ig.domHandler.attr(c, "src", d);
d = Math.min(ig.sizeHandler.scaleRatioMultiplier.x,
ig.sizeHandler.scaleRatioMultiplier.y);
if (ig.ua.mobile) {
e = Math.floor(this.pos.x * ig.sizeHandler.scaleRatioMultiplier.x) + "px";
var q = Math.floor(this.pos.y * ig.sizeHandler.scaleRatioMultiplier.y) + "px",
n = Math.floor(this.size.x * ig.sizeHandler.scaleRatioMultiplier.x) + "px";
d = Math.floor(this.size.y * ig.sizeHandler.scaleRatioMultiplier.y) + "px"
} else e = ig.domHandler.getElementById("#canvas"), e = ig.domHandler.getOffsets(e), q = e.top, e = Math.floor(e.left + this.pos.x * d) + "px", q = Math.floor(q + this.pos.y * d) + "px", n = Math.floor(this.size.x *
d) + "px", d = Math.floor(this.size.y * d) + "px";
ig.domHandler.css(f, {
"float": "left",
position: "absolute",
left: e,
top: q,
width: n,
height: d,
"z-index": 3
});
ig.domHandler.addEvent(f, "mousemove", ig.input.mousemove.bind(ig.input), !1);
ig.domHandler.appendChild(j, c);
ig.domHandler.appendChild(f, j);
ig.domHandler.appendToBody(f);
ig.sizeHandler.dynamicClickableEntityDivs[b] = {};
ig.sizeHandler.dynamicClickableEntityDivs[b].width = this.size.x;
ig.sizeHandler.dynamicClickableEntityDivs[b].height = this.size.y;
ig.sizeHandler.dynamicClickableEntityDivs[b].entity_pos_x =
this.pos.x;
ig.sizeHandler.dynamicClickableEntityDivs[b].entity_pos_y = this.pos.y
}
})
});
ig.baked = !0;
ig.module("game.entities.buttons.button-branding-logo").requires("game.entities.buttons.button", "plugins.clickable-div-layer").defines(function() {
EntityButtonBrandingLogo = EntityButton.extend({
type: ig.Entity.TYPE.A,
gravityFactor: 0,
logo: new ig.AnimationSheet("branding/logo.png", _SETTINGS.Branding.Logo.Width, _SETTINGS.Branding.Logo.Height),
zIndex: 10001,
size: {
x: 64,
y: 66
},
clickableLayer: null,
link: null,
newWindow: !1,
div_layer_name: "branding-logo",
name: "brandinglogo",
init: function(b, c, d) {
this.parent(b, c, d);
if (!ig.global.wm) {
if ("undefined" == typeof wm)
if (_SETTINGS.Branding.Logo.Enabled) this.size.x = _SETTINGS.Branding.Logo.Width, this.size.y = _SETTINGS.Branding.Logo.Height, this.anims.idle = new ig.Animation(this.logo, 0, [0], !0), this.currentAnim = this.anims.idle, d && d.centralize && (this.pos.x = ig.system.width / 2 - this.size.x / 2, console.log("centralize true ... centering branded logo ...")), _SETTINGS.Branding.Logo.LinkEnabled && (this.link = _SETTINGS.Branding.Logo.Link, this.newWindow = _SETTINGS.Branding.Logo.NewWindow, this.clickableLayer =
new ClickableDivLayer(this));
else {
this.kill();
return
}
this.div_layer_name = d.div_layer_name ? d.div_layer_name : "branding-logo"
}
},
show: function() {
var b = ig.domHandler.getElementById("#" + this.div_layer_name);
ig.domHandler.show(b)
},
hide: function() {
var b = ig.domHandler.getElementById("#" + this.div_layer_name);
ig.domHandler.hide(b)
},
clicked: function() {},
clicking: function() {},
released: function() {}
})
});
ig.baked = !0;
ig.module("game.entities.branding-logo-placeholder").requires("impact.entity", "game.entities.buttons.button-branding-logo").defines(function() {
EntityBrandingLogoPlaceholder = ig.Entity.extend({
gravityFactor: 0,
size: {
x: 32,
y: 32
},
_wmDrawBox: !0,
_wmBoxColor: "rgba(0, 0, 255, 0.7)",
init: function(b, c, d) {
this.parent(b, c, d);
if (d) switch (console.log("settings found ... using that div layer name"), b = d.div_layer_name, console.log("settings.centralize:", d.centralize), d.centralize) {
case "true":
console.log("centralize true");
centralize = !0;
break;
case "false":
console.log("centralize false");
centralize = !1;
break;
default:
console.log("default ... centralize false"), centralize = !1
} else b = "branding-logo", centralize = !1;
if ("undefined" == typeof wm) {
if (_SETTINGS.Branding.Logo.Enabled) try {
ig.game.spawnEntity(EntityButtonBrandingLogo, this.pos.x, this.pos.y, {
div_layer_name: b,
centralize: centralize
})
} catch (e) {
console.log(e)
}
this.kill()
}
}
})
});
ig.baked = !0;
ig.module("game.entities.buttons.button-more-games").requires("game.entities.buttons.button", "plugins.clickable-div-layer").defines(function() {
EntityButtonMoreGames = EntityButton.extend({
type: ig.Entity.TYPE.A,
gravityFactor: 0,
logo: new ig.AnimationSheet("media/graphics/menu/btmoregames.png", 123, 74),
size: {
x: 123,
y: 74
},
clickableLayer: null,
link: null,
newWindow: !1,
div_layer_name: "more-games",
name: "moregames",
init: function(b, c, d) {
this.parent(b, c, d);
this.animSheet = this.logo;
this.addAnim("idle", 1, [0]);
this.currentAnim =
this.anims.idle;
ig.global.wm || (this.div_layer_name = d.div_layer_name ? d.div_layer_name : "more-games", _SETTINGS.MoreGames.Disabled ? (this.anims.idle = new ig.Animation(this.logo, 0, [0], !0), this.currentAnim = this.anims.idle, _SETTINGS.MoreGames.Link && (this.link = _SETTINGS.MoreGames.Link), _SETTINGS.MoreGames.NewWindow && (this.newWindow = _SETTINGS.MoreGames.NewWindow), this.clickableLayer = new ClickableDivLayer(this)) : this.kill())
},
ready: function() {
this.pos.x = -200;
this.posChange()
},
show: function() {
var b = ig.domHandler.getElementById("#" +
this.div_layer_name);
ig.domHandler.show(b)
},
hide: function() {
var b = ig.domHandler.getElementById("#" + this.div_layer_name);
ig.domHandler.hide(b)
},
clicked: function() {},
clicking: function() {},
released: function() {},
posChange: function() {
this.tween({
pos: {
x: -4,
y: this.pos.y
}
}, 0.8, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.endPosChange()
}.bind(this)
}).start()
},
endPosChange: function() {
this.show()
}
})
});
ig.baked = !0;
ig.module("game.entities.opening-shield").requires("impact.entity").defines(function() {
EntityOpeningShield = ig.Entity.extend({
size: {
x: 48,
y: 48
},
move: 0,
mIconAnim: 0,
shieldAnim: 0,
titleAnim: 0,
init: function(b, c, d) {
this.parent(b, c, d)
},
ready: function() {
if (!ig.wm)
if (_SETTINGS.DeveloperBranding.Splash.Disabled) {
this.initTimer = new ig.Timer(0.1);
try {
ig.soundHandler.playSound(ig.soundHandler.SOUNDID.openingSound)
} catch (b) {
console.log(b)
}
} else ig.game.director.nextLevel(), ig.system.context.globalAlpha = 1, this.kill()
},
update: function() {
this.parent();
this.updateOriginalShieldOpening()
},
draw: function() {
this.parent();
ig.global.wm || (this.nextLevelTimer && 0 > this.nextLevelTimer.delta() && (ig.system.context.globalAlpha = -this.nextLevelTimer.delta()), this.drawOriginalShieldOpening())
},
updateOriginalShieldOpening: function() {
this.initTimer && 0 < this.initTimer.delta() &&
(this.initTimer = null, this.sheildTimer = new ig.Timer(0.05));
this.sheildTimer && 0 < this.sheildTimer.delta() && (3 > this.shieldAnim ? (this.shieldAnim++, this.sheildTimer.reset()) : (this.sheildTimer = null, this.moveTimer = new ig.Timer(0.0010), this.mIconTimer = new ig.Timer(0.05), this.titleTimer = new ig.Timer(0.15)));
this.moveTimer && 0 < this.moveTimer.delta() && (this.move += 0.3, this.moveTimer.reset());
this.mIconTimer && 0 < this.mIconTimer.delta() && (12 > this.mIconAnim ? (this.mIconAnim++, this.moveTimer.reset()) : this.mIconTimer =
null);
this.titleTimer && 0 < this.titleTimer.delta() && (11 > this.titleAnim ? (this.titleAnim++, this.titleTimer.reset()) : (this.titleTimer = null, this.nextLevelTimer = new ig.Timer(1)));
this.nextLevelTimer && 0 < this.nextLevelTimer.delta() && (this.nextLevelTimer = null, ig.game.director.nextLevel(), ig.system.context.globalAlpha = 1)
},
drawOriginalShieldOpening: function() {
if (this.moveTimer) {
var b = ig.system.context;
b.save();
var c = ig.system.width / 2,
d = ig.system.height / 2;
b.translate(c, d);
b.rotate(this.move * Math.PI / 180);
b.beginPath();
b.moveTo(0, 0);
for (var e = 0, f = 1; 48 >= f; f += 1) b.lineTo(0 + 800 * Math.cos(2 * f * Math.PI / 48), 0 + 800 * Math.sin(2 * f * Math.PI / 48)), e++, 2 == e && (e = 0, b.lineTo(0, 0));
b.translate(-c, -d);
c = b.createRadialGradient(c, d, 100, c, d, 250);
c.addColorStop(0, "rgba(255,255,255,0.1)");
c.addColorStop(1, "rgba(0,0,0,0)");
b.fillStyle = c;
b.fill();
b.restore()
}
this.shieldImage.drawTile(ig.system.width / 2 - 91, 0 - (768 - ig.system.height) / 2, this.shieldAnim, 182, 768);
this.moveTimer && (this.mIconImage.drawTile(ig.system.width / 2 - 96, ig.system.height / 2 - 70, this.mIconAnim,
166, 160), this.titleImage.drawTile(ig.system.width / 2 - 204, ig.system.height / 2 + 100, this.titleAnim, 409, 76));
ig.system.context.globalAlpha = 1
}
})
});
ig.baked = !0;
ig.module("game.entities.opening-kitty").requires("impact.entity").defines(function() {
EntityOpeningKitty = ig.Entity.extend({
size: {
x: 48,
y: 48
},
kittyAnim: -1,
soundKey: "kittyopeningSound",
init: function(b, c, d) {
this.parent(b, c, d)
},
ready: function() {
if (!ig.wm)
if (_SETTINGS.DeveloperBranding.Splash.Disabled) {
this.initTimer = new ig.Timer(0.1);
try {
ig.soundHandler.sfxPlayer.play(this.soundKey)
} catch (b) {
console.log(b)
}
} else ig.game.director.nextLevel(),
ig.system.context.globalAlpha = 1, this.kill()
},
update: function() {
this.parent();
this.updateKittyOpening()
},
draw: function() {
this.parent();
ig.global.wm || (this.nextLevelTimer && 0 > this.nextLevelTimer.delta() && (ig.system.context.globalAlpha = -this.nextLevelTimer.delta()), this.drawKittyOpening())
},
updateKittyOpening: function() {
this.initTimer && 0 < this.initTimer.delta() && (this.initTimer = null, this.kittyTimer = new ig.Timer(0.15));
this.kittyTimer && 0 < this.kittyTimer.delta() && (7 > this.kittyAnim ? (this.kittyAnim++, this.kittyTimer.reset()) :
(this.kittyTimer = null, this.nextLevelTimer = new ig.Timer(2)));
this.nextLevelTimer && 0 < this.nextLevelTimer.delta() && (this.nextLevelTimer = null, ig.game.director.nextLevel(), ig.system.context.globalAlpha = 1)
},
drawKittyOpening: function() {
var b = ig.system.context.createLinearGradient(0, 0, 0, ig.system.height);
b.addColorStop(0, "#ffed94");
b.addColorStop(1, "#ffcd85");
ig.system.context.fillStyle = b;
ig.system.context.fillRect(0, 0, ig.system.width, ig.system.height);
0 <= this.kittyAnim && (this.kittyImage.drawTile(ig.system.width /
2 - this.kittyImage.width / 8, ig.system.height / 2 - this.kittyImage.height / 4, this.kittyAnim, 218, 325), this.kittyTitleImage.drawTile(ig.system.width / 2 - this.kittyTitleImage.width / 2, ig.system.height / 2 + this.kittyImage.height / 4 + 10, this.kittyAnim, 380, 37));
ig.system.context.globalAlpha = 1
}
})
});
ig.baked = !0;
ig.module("game.entities.pointer").requires("impact.entity").defines(function() {
EntityPointer = ig.Entity.extend({
checkAgainst: ig.Entity.TYPE.BOTH,
isFirstPressed: !1,
isPressed: !1,
isReleased: !1,
isHovering: !1,
hoveringItem: null,
objectArray: [],
clickedObjectList: [],
ignorePause: !0,
zIndex: 5E3,
realpos: {
x: 0,
y: 0
},
check: function(b) {
this.objectArray.push(b)
},
clickObject: function(b) {
this.isFirstPressed && "function" == typeof b.clicked && (b.clicked(), this.addToClickedObjectList(b));
this.isPressed && !this.isReleased && "function" ==
typeof b.clicking && b.clicking();
this.isReleased && "function" == typeof b.released && (b.released(), this.removeFromClickedObjectList(b))
},
refreshPos: function() {
this.pos = ig.game.io.getClickPos();
this.pos.x += ig.game.screen.x;
this.pos.y += ig.game.screen.y
},
update: function() {
this.parent();
this.refreshPos();
var b = null,
c = -1;
for (a = this.objectArray.length - 1; - 1 < a; a--) this.objectArray[a].zIndex > c && (c = this.objectArray[a].zIndex, b = this.objectArray[a]);
if (null != b) null != this.hoveringItem ? this.hoveringItem != b && ("function" ==
typeof this.hoveringItem.leave && this.hoveringItem.leave(), "function" == typeof b.over && b.over()) : "function" == typeof b.over && b.over(), this.hoveringItem = b, this.clickObject(b), this.objectArray = [];
else if (null != this.hoveringItem && "function" == typeof this.hoveringItem.leave && (this.hoveringItem.leave(), this.hoveringItem = null), this.isReleased) {
for (b = 0; b < this.clickedObjectList.length; b++) c = this.clickedObjectList[b], "function" == typeof c.releasedOutside && c.releasedOutside();
this.clickedObjectList = []
}
this.isFirstPressed =
ig.input.pressed("click");
this.isReleased = ig.input.released("click");
this.isPressed = ig.input.state("click")
},
addToClickedObjectList: function(b) {
this.clickedObjectList.push(b)
},
removeFromClickedObjectList: function(b) {
for (var c = [], d = 0; d < this.clickedObjectList.length; d++) {
var e = this.clickedObjectList[d];
e != b && c.push(e)
}
this.clickedObjectList = c
}
})
});
ig.baked = !0;
ig.module("game.entities.pointer-selector").requires("game.entities.pointer").defines(function() {
EntityPointerSelector = EntityPointer.extend({
zIndex: 1E3,
_wmDrawBox: !0,
_wmBoxColor: "rgba(0, 0, 255, 0.7)",
size: {
x: 20,
y: 20
},
init: function(b, c, d) {
this.parent(b, c, d)
}
})
});
ig.baked = !0;
ig.module("game.entities.select").requires("impact.entity").defines(function() {
EntitySelect = ig.Entity.extend({
type: ig.Entity.TYPE.B,
checkAgainst: ig.Entity.TYPE.A,
collides: ig.Entity.COLLIDES.NEVER,
canSelect: !1,
canSelectTimerDuration: 0.35,
zIndex: 99999,
isHovering: !1,
isSelected: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.canSelectTimer = new ig.Timer(this.canSelectTimerDuration)
},
doesClickableLayerExist: function(b) {
for (k in dynamicClickableEntityDivs)
if (k == b) return !0;
return !1
},
checkClickableLayer: function(b,
c, d) {
"undefined" == typeof wm && (this.doesClickableLayerExist(b) ? (ig.game.showOverlay([b]), $("#" + b).find("[href]").attr("href", c)) : this.createClickableOutboundLayer(b, c, "media/graphics/misc/invisible.png", d))
},
createClickableOutboundLayer: function(b, c, d, e) {
var f = ig.$new("div");
f.id = b;
document.body.appendChild(f);
$("#" + f.id).css("float", "left");
$("#" + f.id).css("width", this.size.x * multiplier);
$("#" + f.id).css("height", this.size.y * multiplier);
$("#" + f.id).css("position", "absolute");
var j = w / 2 - destW / 2,
q = h /
2 - destH / 2;
w == mobileWidth ? ($("#" + f.id).css("left", this.pos.x), $("#" + f.id).css("top", this.pos.y)) : ($("#" + f.id).css("left", j + this.pos.x * multiplier), $("#" + f.id).css("top", q + this.pos.y * multiplier));
e ? $("#" + f.id).html("<a target='_blank' href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>") : $("#" + f.id).html("<a href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>");
dynamicClickableEntityDivs[b] = {};
dynamicClickableEntityDivs[b].width = $("#" + f.id).width();
dynamicClickableEntityDivs[b].height =
$("#" + f.id).height();
dynamicClickableEntityDivs[b].entity_pos_x = this.pos.x;
dynamicClickableEntityDivs[b].entity_pos_y = this.pos.y
},
hovered: function() {
this.isHovering = !0;
this.dehoverOthers()
},
dehoverOthers: function() {
var b = ig.game.getEntitiesByType(EntitySelect);
for (i = 0; i < b.length; i++) b[i] != this && (b[i].isHovering = !1)
},
deselectOthers: function() {
var b = ig.game.getEntitiesByType(EntitySelect);
for (i = 0; i < b.length; i++) b[i] != this && (b[i].isSelected = !1)
},
update: function() {
this.parent();
this.canSelectTimer && 0 <
this.canSelectTimer.delta() && (this.canSelect = !0, this.canSelectTimer = null)
}
})
});
ig.baked = !0;
ig.module("game.entities.text").requires("impact.entity").defines(function() {
EntityText = ig.Entity.extend({
text: "",
textTmp: 0,
size: {
x: 5,
y: 5
},
_wmDrawBox: !0,
_wmBoxColor: "rgba(255, 255, 255, 0.5)",
newText: [],
idxText: 0,
textStatus: !0,
type: ig.Entity.TYPE.B,
init: function(b, c, d) {
this.parent(b, c, d);
this.textTmp = this.text;
this.timer = new ig.Timer;
"undefined" == typeof wm && d && (this.name = d.name, this.useLanguageFile = d.useLanguageFile, this.languageFileSectionName = d.languageFileSectionName, this.text = eval(this.useLanguageFile) ?
ig.game.language.selected[this.languageFileSectionName][d.text] : d.text, this.fontSize = d.fontSize, this.fontSize || (this.fontSize = "24"), this.fontStyle = d.fontStyle, this.fontStyle || (this.fontStyle = "Arial"), this.fontWeight = d.fontWeight, this.fontWeight || (this.fontWeight = "bold"), this.fontColor = d.fontColor, this.fontColor || (this.fontColor = "#fff"), this.textAlign = d.textAlign, this.textAlign || (this.textAlign = "left"), this.textSpace = d.textSpace, this.textSpace || (this.textSpace = 22), this.textBorder = d.textBorder, this.textStroke =
d.textStroke, this.textStroke || (this.textStroke = ""), this.textStrokeSize = d.textStrokeSize, this.textStrokeSize || (this.textStrokeSize = 8), this.backgroundBorderColor = d.backgroundBorderColor, this.backgroundColor = d.backgroundColor, this.backgroundHeight = d.backgroundHeight)
},
update: function() {
this.parent();
if (this.textStatus) {
this.newText = this.text.split("<br>");
this.idxText = this.newText.length - 1;
for (x = 0; x <= this.idxText; x++) {
var b = this.newText[x];
"undefined" != typeof b && (b = b.replace("<br>", " "), b = b.replace(">",
" "), b = b.replace("r>", " "), b = b.replace("br>", " "), b = b.replace("<", " "), b = b.replace("<b", " "), b = b.replace("<br", " "), "br" == b.substr(b.length - 2, 2) && (b = b.substr(0, b.length - 2), this.newText[x] = b, "b" == b.substr(b.length - 2, 1) && (b = b.substr(0, b.length - 2), this.newText[x] = b)))
}
this.textStatus = !1
}
this.textTmp != this.text && (this.textStatus = !0, this.textTmp = this.text)
},
draw: function() {
this.parent();
if ("undefined" == typeof wm)
for (i = 0; i <= this.idxText; i++) {
var b = this.newText[i];
"undefined" != typeof b && (this.timer.tick(),
b = b.replace("<br>", " "), b = b.replace("<", " "), b = b.replace("<b", " "), b = b.replace("<br", " "), b = b.replace(">", " "), b = b.replace("r>", " "), b = b.replace("br>", " "), "b" == b.substr(b.length - 1, 1) && (b = b.substr(0, b.length - 1)), this.textBorder && (ig.system.context.fillStyle = this.textBorder, ig.system.context.textAlign = this.textAlign, ig.system.context.font = this.fontWeight + " " + this.fontSize + "px " + this.fontStyle, ig.system.context.fillText(b, this.pos.x + 1, this.pos.y + 1 + i * this.textSpace), ig.system.context.fillText(b, this.pos.x -
1, this.pos.y + 1 + i * this.textSpace), ig.system.context.fillText(b, this.pos.x + 1, this.pos.y - 1 + i * this.textSpace), ig.system.context.fillText(b, this.pos.x - 1, this.pos.y - 1 + i * this.textSpace)), ig.system.context.fillStyle = this.fontColor, ig.system.context.textAlign = this.textAlign, ig.system.context.font = this.fontWeight + " " + this.fontSize + "px " + this.fontStyle, "" != this.textStroke && (ig.system.context.strokeStyle = this.textStroke, ig.system.context.lineWidth = this.textStrokeSize, ig.system.context.strokeText(b, this.pos.x,
this.pos.y + i * this.textSpace)), ig.system.context.fillText(b, this.pos.x, this.pos.y + i * this.textSpace), this.timer.tick())
}
}
})
});
ig.baked = !0;
ig.module("game.entities.landmarker").requires("impact.entity").defines(function() {
EntityLandmarker = ig.Entity.extend({
size: {
x: 32,
y: 32
},
gravityFactor: 0,
clicking: !1,
landpoints: [],
segments: [],
segmentSize: 20,
segmentWidth: 5,
name: "game",
rocktile: new ig.Image("media/graphics/gameplay/rock.png"),
drawLandPoints: [],
zIndex: 50,
landlevel: {
1: [
[{
p0: {
x: -8.703442350483613,
y: 236.6510896564636
},
p3: {
x: 29.19990172547093,
y: 320.51589978833726
},
p1: {
x: 16.428830986197212,
y: 214.8532688166353
},
p2: {
x: 22.938010069978368,
y: 273.2177187709015
}
}, {
p0: {
x: 29.19990172547093,
y: 320.51589978833726
},
p3: {
x: 104.37099634038081,
y: 409.31418787152893
},
p1: {
x: 35.62204844639051,
y: 390.37865176585336
},
p2: {
x: 65.73437303776075,
y: 408.4649542547201
}
}, {
p0: {
x: 104.37099634038081,
y: 409.31418787152893
},
p3: {
x: 249.30690293295126,
y: 408.4159540597435
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 249.30690293295126,
y: 408.4159540597435
},
p3: {
x: 329.41535956539553,
y: 450.3066278710067
},
p1: {
x: 285.564723813528,
y: 407.38718662952635
},
p2: {
x: 304.0181470238324,
y: 429.7408461772167
}
}, {
p0: {
x: 329.41535956539553,
y: 450.3066278710067
},
p3: {
x: 453.41013909589236,
y: 421.3015526205514
},
p1: {
x: 368.7141543019781,
y: 478.2609525613615
},
p2: {
x: 412.8793066087622,
y: 478.3967932987995
}
}, {
p0: {
x: 453.41013909589236,
y: 421.3015526205514
},
p3: {
x: 558.4760603353126,
y: 322.209912229989
},
p1: {
x: 473.849416913595,
y: 381.92083807727204
},
p2: {
x: 508.8505807536656,
y: 327.7691701266621
}
}, {
p0: {
x: 558.4760603353126,
y: 322.209912229989
},
p3: {
x: 699.7876476687082,
y: 390.8803279550112
},
p1: {
x: 627.3970673253797,
y: 318.1600882955798
},
p2: {
x: 636.6779839175908,
y: 365.48778052241556
}
}, {
p0: {
x: 699.7876476687082,
y: 390.8803279550112
},
p3: {
x: 812.3454038997211,
y: 356.5236768802228
},
p1: {
x: 747.6100278551529,
y: 402.65181058495807
},
p2: {
x: 788.6128133704738,
y: 388.3899721448468
}
}, {
p0: {
x: 812.3454038997211,
y: 356.5236768802228
},
p3: {
x: 873.2924791086352,
y: 296.57938718662956
},
p1: {
x: 838.5292479108635,
y: 329.5598885793872
},
p2: {
x: 854.5738161559888,
y: 306.3844011142061
}
}, {
p0: {
x: 873.2924791086352,
y: 296.57938718662956
},
p3: {
x: 979.3649025069639,
y: 295.6880222841225
},
p1: {
x: 919.6434540389972,
y: 294.79665738161555
},
p2: {
x: 950.841225626741,
y: 296.8022284122562
}
}, {
p0: {
x: 979.3649025069639,
y: 295.6880222841225
},
p3: {
x: 1005.6601671309197,
y: 295.91086350974945
},
p1: {
x: 977.136490250696,
y: 340.47910863509776
},
p2: {
x: 1006.5515320334267,
y: 341.37047353760465
}
}, {
p0: {
x: 1005.6601671309197,
y: 295.91086350974945
},
p3: {
x: 1133.9610027855158,
y: 164.88022284122567
},
p1: {
x: 1093.0139275766019,
y: 299.4763231197771
},
p2: {
x: 1110.7855153203345,
y: 276.3008356545963
}
}, {
p0: {
x: 1133.9610027855158,
y: 164.88022284122567
},
p3: {
x: 1217.1922005571032,
y: 187.16434540389972
},
p1: {
x: 1151.2869080779938,
y: 72.40111420612811
},
p2: {
x: 1193.2367688022282,
y: 36.4122562674093
}
}, {
p0: {
x: 1217.1922005571032,
y: 187.16434540389972
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
2: [
[{
p0: {
x: -23.821552586704087,
y: 142.16290068008564
},
p3: {
x: 19.836292617491203,
y: 214.72321205065722
},
p1: {
x: 8.869775868086975,
y: 102.41232393474556
},
p2: {
x: 8.764781723521672,
y: 159.831891999248
}
}, {
p0: {
x: 19.836292617491203,
y: 214.72321205065722
},
p3: {
x: 112.00343154772487,
y: 277.92668513487433
},
p1: {
x: 31.84252088733537,
y: 266.59912420679825
},
p2: {
x: 41.167443903902495,
y: 276.181489687791
}
}, {
p0: {
x: 112.00343154772487,
y: 277.92668513487433
},
p3: {
x: 258.7727637885207,
y: 314.83856305726613
},
p1: {
x: 196.12543742161773,
y: 278.8960075274436
},
p2: {
x: 239.97571308819042,
y: 269.1599084584772
}
}, {
p0: {
x: 258.7727637885207,
y: 314.83856305726613
},
p3: {
x: 363.0021185953792,
y: 281.6905589589427
},
p1: {
x: 289.5748031496063,
y: 367.83179954854637
},
p2: {
x: 327.17439850220063,
y: 363.5965906946196
}
}, {
p0: {
x: 363.0021185953792,
y: 281.6905589589427
},
p3: {
x: 464.3735810679646,
y: 301.2360468364273
},
p1: {
x: 396.9422807233358,
y: 200.3526157863776
},
p2: {
x: 438.6542601059616,
y: 202.0948187585414
}
}, {
p0: {
x: 464.3735810679646,
y: 301.2360468364273
},
p3: {
x: 576.3568094962696,
y: 352.88766603196814
},
p1: {
x: 496.4461156253062,
y: 403.12997231279434
},
p2: {
x: 542.2938225444176,
y: 404.63880013142295
}
}, {
p0: {
x: 576.3568094962696,
y: 352.88766603196814
},
p3: {
x: 682.4617134556745,
y: 381.41336556142005
},
p1: {
x: 612.1361342051312,
y: 303.0530014967615
},
p2: {
x: 650.1639443796512,
y: 307.90412272291474
}
}, {
p0: {
x: 682.4617134556745,
y: 381.41336556142005
},
p3: {
x: 790.9170133171427,
y: 388.23829057924104
},
p1: {
x: 722.8257781142343,
y: 456.0027360569653
},
p2: {
x: 755.5385670670198,
y: 455.1238161846224
}
}, {
p0: {
x: 790.9170133171427,
y: 388.23829057924104
},
p3: {
x: 881.0968360498562,
y: 357.6836049856185
},
p1: {
x: 814.5700720712758,
y: 344.68794924460605
},
p2: {
x: 848.0935331833372,
y: 295.8419542824864
}
}, {
p0: {
x: 881.0968360498562,
y: 357.6836049856185
},
p3: {
x: 991.5474592521572,
y: 358.6040268456377
},
p1: {
x: 895.8235858101631,
y: 357.6836049856187
},
p2: {
x: 949.2080536912752,
y: 357.6836049856185
}
}, {
p0: {
x: 991.5474592521572,
y: 358.6040268456377
},
p3: {
x: 1014.558005752637,
y: 358.77660594439106
},
p1: {
x: 974.0594439117931,
y: 398.3547459252156
},
p2: {
x: 1032.0460210930012,
y: 399.275167785235
}
}, {
p0: {
x: 1014.558005752637,
y: 358.77660594439106
},
p3: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p1: {
x: 1130.531160115053,
y: 358.77660594439124
},
p2: {
x: 1148.0191754554169,
y: 357.85618408437193
}
}, {
p0: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p3: {
x: 1268.594439117929,
y: 202.30488974113135
},
p1: {
x: 1202.3240651965477,
y: 180.21476510067112
},
p2: {
x: 1241.9022051773734,
y: 133.2732502396932
}
}, {
p0: {
x: 1268.594439117929,
y: 202.30488974113135
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
3: [
[{
p0: {
x: -23.821552586704087,
y: 142.16290068008564
},
p3: {
x: 19.836292617491203,
y: 212.79936435526642
},
p1: {
x: 8.869775868086975,
y: 102.41232393474556
},
p2: {
x: 8.764781723521672,
y: 159.831891999248
}
}, {
p0: {
x: 19.836292617491203,
y: 212.79936435526642
},
p3: {
x: 80.7090883070729,
y: 277.92668513487433
},
p1: {
x: 31.84252088733537,
y: 266.59912420679825
},
p2: {
x: 41.167443903902495,
y: 276.181489687791
}
}, {
p0: {
x: 80.7090883070729,
y: 277.92668513487433
},
p3: {
x: 260.7700457058332,
y: 308.6592344312516
},
p1: {
x: 194.20158972622696,
y: 279.73342541211036
},
p2: {
x: 237.08994154510427,
y: 267.23606076308647
}
}, {
p0: {
x: 260.7700457058332,
y: 308.6592344312516
},
p3: {
x: 354.37949266949977,
y: 418.66270591473733
},
p1: {
x: 296.19837658850764,
y: 363.2552575223399
},
p2: {
x: 327.3461528501835,
y: 399.421908481401
}
}, {
p0: {
x: 354.37949266949977,
y: 418.66270591473733
},
p3: {
x: 455.0650943019607,
y: 436.68778392745054
},
p1: {
x: 387.0738373550893,
y: 438.46414229613373
},
p2: {
x: 420.20146114832085,
y: 445.97954694645057
}
}, {
p0: {
x: 455.0650943019607,
y: 436.68778392745054
},
p3: {
x: 542.5084866585717,
y: 364.14770567330805
},
p1: {
x: 490.11772693316004,
y: 424.94058701636095
},
p2: {
x: 519.2972030102327,
y: 400.5217203135847
}
}, {
p0: {
x: 542.5084866585717,
y: 364.14770567330805
},
p3: {
x: 664.3022881813483,
y: 367.6900416364849
},
p1: {
x: 578.988154517057,
y: 298.9407313477459
},
p2: {
x: 635.4081176094601,
y: 302.3815915627997
}
}, {
p0: {
x: 664.3022881813483,
y: 367.6900416364849
},
p3: {
x: 778.1629913710452,
y: 418.4314477468841
},
p1: {
x: 705.2962607861937,
y: 446.04410354745926
},
p2: {
x: 740.2722914669222,
y: 458.93000958772774
}
}, {
p0: {
x: 778.1629913710452,
y: 418.4314477468841
},
p3: {
x: 881.0968360498562,
y: 357.6836049856185
},
p1: {
x: 799.1792905081497,
y: 389.89837008628945
},
p2: {
x: 841.1657027392038,
y: 294.3295497891731
}
}, {
p0: {
x: 881.0968360498562,
y: 357.6836049856185
},
p3: {
x: 991.5474592521572,
y: 358.6040268456377
},
p1: {
x: 895.8235858101631,
y: 357.6836049856187
},
p2: {
x: 949.2080536912752,
y: 357.6836049856185
}
}, {
p0: {
x: 991.5474592521572,
y: 358.6040268456377
},
p3: {
x: 1014.558005752637,
y: 358.77660594439106
},
p1: {
x: 974.0594439117931,
y: 398.3547459252156
},
p2: {
x: 1032.0460210930012,
y: 399.275167785235
}
}, {
p0: {
x: 1014.558005752637,
y: 358.77660594439106
},
p3: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p1: {
x: 1130.531160115053,
y: 358.77660594439124
},
p2: {
x: 1148.0191754554169,
y: 357.85618408437193
}
}, {
p0: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p3: {
x: 1268.594439117929,
y: 202.30488974113135
},
p1: {
x: 1202.3240651965477,
y: 180.21476510067112
},
p2: {
x: 1241.9022051773734,
y: 133.2732502396932
}
}, {
p0: {
x: 1268.594439117929,
y: 202.30488974113135
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
4: [
[{
p0: {
x: -115.65363008939516,
y: 162.15049011844437
},
p3: {
x: 12.521659552209115,
y: 197.94311960463676
},
p1: {
x: -80.93000884666006,
y: 95.35096763765188
},
p2: {
x: 11.384676613662798,
y: 60.592988687654184
}
}, {
p0: {
x: 12.521659552209115,
y: 197.94311960463676
},
p3: {
x: 117.93342425809152,
y: 280.7666490164015
},
p1: {
x: 17.89352056510465,
y: 300.5274382258871
},
p2: {
x: -10.262382209866608,
y: 276.12240045236007
}
}, {
p0: {
x: 117.93342425809152,
y: 280.7666490164015
},
p3: {
x: 140.937769545572,
y: 281.0267927775008
},
p1: {
x: 103.3678802237503,
y: 325.59336216032193
},
p2: {
x: 150.7775243192764,
y: 326.5400029531618
}
}, {
p0: {
x: 140.937769545572,
y: 281.0267927775008
},
p3: {
x: 256.76377246325006,
y: 302.49182716161624
},
p1: {
x: 235.209082074312,
y: 279.26477850192606
},
p2: {
x: 256.49037148114934,
y: 280.5269698147743
}
}, {
p0: {
x: 256.76377246325006,
y: 302.49182716161624
},
p3: {
x: 297.7347216473643,
y: 411.0460962222872
},
p1: {
x: 262.9189429583823,
y: 395.14111380169646
},
p2: {
x: 239.28432061959444,
y: 411.1315745482255
}
}, {
p0: {
x: 297.7347216473643,
y: 411.0460962222872
},
p3: {
x: 502.09358360073225,
y: 411.0497617734247
},
p1: {
x: 356.7330741128121,
y: 411.34432097221946
},
p2: {
x: 431.5321173845027,
y: 411.2963637468274
}
}, {
p0: {
x: 502.09358360073225,
y: 411.0497617734247
},
p3: {
x: 580.4902863531049,
y: 350.82092760355044
},
p1: {
x: 548.7254799006181,
y: 409.4223803416678
},
p2: {
x: 552.6467637208882,
y: 386.75644719024643
}
}, {
p0: {
x: 580.4902863531049,
y: 350.82092760355044
},
p3: {
x: 691.3932654090715,
y: 374.54855203644064
},
p1: {
x: 612.1361342051312,
y: 303.0530014967615
},
p2: {
x: 651.19731359386,
y: 303.77064586607946
}
}, {
p0: {
x: 691.3932654090715,
y: 374.54855203644064
},
p3: {
x: 788.8502748887252,
y: 377.9045984371528
},
p1: {
x: 723.8591473284431,
y: 420.8681827738652
},
p2: {
x: 756.5719362812287,
y: 422.05600132994
}
}, {
p0: {
x: 788.8502748887252,
y: 377.9045984371528
},
p3: {
x: 881.0968360498562,
y: 357.6836049856185
},
p1: {
x: 814.5700720712758,
y: 344.68794924460605
},
p2: {
x: 848.0935331833372,
y: 295.8419542824864
}
}, {
p0: {
x: 881.0968360498562,
y: 357.6836049856185
},
p3: {
x: 991.5474592521572,
y: 358.6040268456377
},
p1: {
x: 895.8235858101631,
y: 357.6836049856187
},
p2: {
x: 949.2080536912752,
y: 357.6836049856185
}
}, {
p0: {
x: 991.5474592521572,
y: 358.6040268456377
},
p3: {
x: 1088.9605891756723,
y: 357.7432367301822
},
p1: {
x: 1022.6277969796079,
y: 358.05334657107136
},
p2: {
x: 1053.7467745913866,
y: 357.9403992168818
}
}, {
p0: {
x: 1088.9605891756723,
y: 357.7432367301822
},
p3: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p1: {
x: 1130.531160115053,
y: 358.77660594439124
},
p2: {
x: 1148.0191754554169,
y: 357.85618408437193
}
}, {
p0: {
x: 1161.8255033557052,
y: 325.6414189837009
},
p3: {
x: 1268.594439117929,
y: 202.30488974113135
},
p1: {
x: 1202.3240651965477,
y: 180.21476510067112
},
p2: {
x: 1241.9022051773734,
y: 133.2732502396932
}
}, {
p0: {
x: 1268.594439117929,
y: 202.30488974113135
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
5: [
[{
p0: {
x: -8.703442350483613,
y: 236.6510896564636
},
p3: {
x: 29.19990172547093,
y: 320.51589978833726
},
p1: {
x: 16.428830986197212,
y: 214.8532688166353
},
p2: {
x: 22.938010069978368,
y: 273.2177187709015
}
}, {
p0: {
x: 29.19990172547093,
y: 320.51589978833726
},
p3: {
x: 104.37099634038081,
y: 409.31418787152893
},
p1: {
x: 35.62204844639051,
y: 390.37865176585336
},
p2: {
x: 65.73437303776075,
y: 408.4649542547201
}
}, {
p0: {
x: 104.37099634038081,
y: 409.31418787152893
},
p3: {
x: 249.30690293295126,
y: 408.4159540597435
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 249.30690293295126,
y: 408.4159540597435
},
p3: {
x: 335.11268894225014,
y: 456.9535121440037
},
p1: {
x: 285.564723813528,
y: 407.38718662952635
},
p2: {
x: 304.0181470238324,
y: 429.7408461772167
}
}, {
p0: {
x: 335.11268894225014,
y: 456.9535121440037
},
p3: {
x: 460.53633209695283,
y: 531.2485303511983
},
p1: {
x: 366.8331696296621,
y: 498.6396291129315
},
p2: {
x: 389.5512702578272,
y: 531.5396450472757
}
}, {
p0: {
x: 460.53633209695283,
y: 531.2485303511983
},
p3: {
x: 1292.9794289014458,
y: 531.3943132986161
},
p1: {
x: 595.8989400278431,
y: 532.5889186711215
},
p2: {
x: 672.7580545336027,
y: 532.5296573651302
}
}, {
p0: {
x: 1292.9794289014458,
y: 531.3943132986161
},
p3: {
x: 1292.391691394658,
y: 306.16023738872406
},
p1: {
x: 1293.3412462908016,
y: 457.139465875371
},
p2: {
x: 1294.290801186944,
y: 349.83976261127583
}
}, {
p0: {
x: 1292.391691394658,
y: 306.16023738872406
},
p3: {
x: 1118.6231454005929,
y: 304.26112759643917
},
p1: {
x: 1219.275964391691,
y: 304.26112759643917
},
p2: {
x: 1175.5964391691396,
y: 305.2106824925814
}
}, {
p0: {
x: 1118.6231454005929,
y: 304.26112759643917
},
p3: {
x: 904.973293768546,
y: 305.2106824925816
},
p1: {
x: 1045.5074183976265,
y: 304.26112759643917
},
p2: {
x: 976.1899109792283,
y: 304.2611275964392
}
}, {
p0: {
x: 904.973293768546,
y: 305.2106824925816
},
p3: {
x: 795.7744807121666,
y: 198.8605341246291
},
p1: {
x: 902.1246290801188,
y: 252.9851632047479
},
p2: {
x: 801.4718100890206,
y: 252.98516320474766
}
}, {
p0: {
x: 795.7744807121666,
y: 198.8605341246291
},
p3: {
x: 991.3827893175078,
y: 198.86053412462908
},
p1: {
x: 884.0830860534123,
y: 198.86053412462908
},
p2: {
x: 938.2077151335308,
y: 198.86053412462903
}
}, {
p0: {
x: 991.3827893175078,
y: 198.86053412462908
},
p3: {
x: 1019.8694362017804,
y: 198.86053412462903
},
p1: {
x: 989.4836795252226,
y: 252.0356083086054
},
p2: {
x: 1019.8694362017807,
y: 252.03560830860533
}
}, {
p0: {
x: 1019.8694362017804,
y: 198.86053412462903
},
p3: {
x: 1149.2462908011867,
y: 199.98813056379814
},
p1: {
x: 1105.566765578635,
y: 199.9881305637982
},
p2: {
x: 1120.7596439169142,
y: 199.98813056379817
}
}, {
p0: {
x: 1149.2462908011867,
y: 199.98813056379814
},
p3: {
x: 1151.857566765579,
y: 99.15727002967353
},
p1: {
x: 1175.59643916914,
y: 177.02077151335314
},
p2: {
x: 1177.495548961424,
y: 124.79525222551933
}
}, {
p0: {
x: 1151.857566765579,
y: 99.15727002967353
},
p3: {
x: 1369.2462908011867,
y: 286.2195845697329
},
p1: {
x: 1333.1632047477747,
y: 98.20771513353111
},
p2: {
x: 1360.7002967359053,
y: 138.08902077151336
}
}, {
p0: {
x: 1369.2462908011867,
y: 286.2195845697329
}
}]
],
6: [
[{
p0: {
x: -47.26581021517704,
y: 240.71028627379977
},
p3: {
x: 32.24429918847303,
y: 240.34676659594825
},
p1: {
x: -23.148336032830287,
y: 240.22324767498623
},
p2: {
x: 4.671625291965711,
y: 240.74414583221235
}
}, {
p0: {
x: 32.24429918847303,
y: 240.34676659594825
},
p3: {
x: 36.37945300000024,
y: 409.31418787152893
},
p1: {
x: 5.178073816369327,
y: 287.88393717811556
},
p2: {
x: 5.861222932052492,
y: 358.73979569235223
}
}, {
p0: {
x: 36.37945300000024,
y: 409.31418787152893
},
p3: {
x: 250.32170208728533,
y: 408.4159540597435
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 250.32170208728533,
y: 408.4159540597435
},
p3: {
x: 355.408672028931,
y: 157.58776161546248
},
p1: {
x: 275.41673227018765,
y: 272.4188991030994
},
p2: {
x: 325.3289292648472,
y: 272.44697725544086
}
}, {
p0: {
x: 355.408672028931,
y: 157.58776161546248
},
p3: {
x: 438.2107507016041,
y: 156.78764240193814
},
p1: {
x: 381.04035779033865,
y: 154.6227157936926
},
p2: {
x: 409.8472533445079,
y: 155.04915878934773
}
}, {
p0: {
x: 438.2107507016041,
y: 156.78764240193814
},
p3: {
x: 353.2754119881266,
y: 576.0454760893139
},
p1: {
x: 423.38308379105655,
y: 293.0963182482885
},
p2: {
x: 307.43035897334903,
y: 315.36263833764593
}
}, {
p0: {
x: 353.2754119881266,
y: 576.0454760893139
},
p3: {
x: 515.6897886462439,
y: 579.0989266064831
},
p1: {
x: 411.48078117452275,
y: 577.9005652411217
},
p2: {
x: 463.1702937873668,
y: 579.1843714907683
}
}, {
p0: {
x: 515.6897886462439,
y: 579.0989266064831
},
p3: {
x: 531.0544350411851,
y: 308.32032421377534
},
p1: {
x: 475.4281842648411,
y: 509.2505567719149
},
p2: {
x: 476.39982183298764,
y: 395.52780722831085
}
}, {
p0: {
x: 531.0544350411851,
y: 308.32032421377534
},
p3: {
x: 683.7470781237258,
y: 309.2698791099178
},
p1: {
x: 579.7146065583031,
y: 306.29072590510725
},
p2: {
x: 635.2173951229917,
y: 307.3055250594414
}
}, {
p0: {
x: 683.7470781237258,
y: 309.2698791099178
},
p3: {
x: 685.1613728897564,
y: 582.4546144628955
},
p1: {
x: 636.2472506446009,
y: 399.1162414288495
},
p2: {
x: 642.1483428585765,
y: 515.8181441772635
}
}, {
p0: {
x: 685.1613728897564,
y: 582.4546144628955
},
p3: {
x: 786.3933601420322,
y: 583.4694136172293
},
p1: {
x: 719.6856230512981,
y: 582.4546144628957
},
p2: {
x: 749.4550724273998,
y: 582.4546144628954
}
}, {
p0: {
x: 786.3933601420322,
y: 583.4694136172293
},
p3: {
x: 846.33878081066,
y: 178.5645510379483
},
p1: {
x: 717.5175061637003,
y: 347.426728816005
},
p2: {
x: 826.0427977239794,
y: 299.7311685623052
}
}, {
p0: {
x: 846.33878081066,
y: 178.5645510379483
},
p3: {
x: 944.2568616257106,
y: 180.70694663145147
},
p1: {
x: 883.3257507794813,
y: 176.64775001411533
},
p2: {
x: 909.6814198154342,
y: 176.6477500141154
}
}, {
p0: {
x: 944.2568616257106,
y: 180.70694663145147
},
p3: {
x: 882.9357908670587,
y: 398.5230205582148
},
p1: {
x: 943.2074328266458,
y: 267.3378962490826
},
p2: {
x: 874.0706018155465,
y: 324.71068562932487
}
}, {
p0: {
x: 882.9357908670587,
y: 398.5230205582148
},
p3: {
x: 962.311829913237,
y: 399.8770898551452
},
p1: {
x: 917.095551470819,
y: 399.6030639707403
},
p2: {
x: 943.6178443046158,
y: 398.89240343536113
}
}, {
p0: {
x: 962.311829913237,
y: 399.8770898551452
},
p3: {
x: 989.3953488372092,
y: 401.1501057082452
},
p1: {
x: 946.7737843551799,
y: 461.0232558139534
},
p2: {
x: 1004.6173361522201,
y: 460.00845665961947
}
}, {
p0: {
x: 989.3953488372092,
y: 401.1501057082452
},
p3: {
x: 1071.5940803382668,
y: 402.1649048625793
},
p1: {
x: 1018.8245243128964,
y: 402.16490486257925
},
p2: {
x: 1052.3128964059194,
y: 402.16490486257925
}
}, {
p0: {
x: 1071.5940803382668,
y: 402.1649048625793
},
p3: {
x: 1141.6152219873147,
y: 95.69556025369978
},
p1: {
x: 1131.4672304439748,
y: 319.9661733615222
},
p2: {
x: 1175.103594080338,
y: 192.1014799154334
}
}, {
p0: {
x: 1141.6152219873147,
y: 95.69556025369978
},
p3: {
x: 1381.107822410148,
y: 287.492600422833
},
p1: {
x: 1349.6490486257928,
y: 93.66596194503171
},
p2: {
x: 1376.0338266384776,
y: 180.938689217759
}
}, {
p0: {
x: 1381.107822410148,
y: 287.492600422833
}
}]
],
7: [
[{
p0: {
x: -8.703442350483613,
y: 236.6510896564636
},
p3: {
x: 29.19990172547093,
y: 320.51589978833726
},
p1: {
x: 16.428830986197212,
y: 214.8532688166353
},
p2: {
x: 22.938010069978368,
y: 273.2177187709015
}
}, {
p0: {
x: 29.19990172547093,
y: 320.51589978833726
},
p3: {
x: 104.37099634038081,
y: 409.31418787152893
},
p1: {
x: 35.62204844639051,
y: 390.37865176585336
},
p2: {
x: 65.73437303776075,
y: 408.4649542547201
}
}, {
p0: {
x: 104.37099634038081,
y: 409.31418787152893
},
p3: {
x: 249.30690293295126,
y: 408.4159540597435
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 249.30690293295126,
y: 408.4159540597435
},
p3: {
x: 329.41535956539553,
y: 450.3066278710067
},
p1: {
x: 285.564723813528,
y: 407.38718662952635
},
p2: {
x: 304.0181470238324,
y: 429.7408461772167
}
}, {
p0: {
x: 329.41535956539553,
y: 450.3066278710067
},
p3: {
x: 453.41013909589236,
y: 421.3015526205514
},
p1: {
x: 368.7141543019781,
y: 478.2609525613615
},
p2: {
x: 412.8793066087622,
y: 478.3967932987995
}
}, {
p0: {
x: 453.41013909589236,
y: 421.3015526205514
},
p3: {
x: 560.5056586439805,
y: 262.3367621242808
},
p1: {
x: 473.849416913595,
y: 381.92083807727204
},
p2: {
x: 507.76493524735747,
y: 262.44484226271715
}
}, {
p0: {
x: 560.5056586439805,
y: 262.3367621242808
},
p3: {
x: 774.882785089427,
y: 401.02831949835155
},
p1: {
x: 634.8069970403106,
y: 253.42548147412387
},
p2: {
x: 644.5858337682272,
y: 393.3124358012794
}
}, {
p0: {
x: 774.882785089427,
y: 401.02831949835155
},
p3: {
x: 961.520879586825,
y: 401.1748396709205
},
p1: {
x: 862.2823322948992,
y: 401.6370114306241
},
p2: {
x: 895.1667245755477,
y: 402.5971603055234
}
}, {
p0: {
x: 961.520879586825,
y: 401.1748396709205
},
p3: {
x: 988.9795827027153,
y: 401.1037000830355
},
p1: {
x: 954.2163515049438,
y: 459.45418033414404
},
p2: {
x: 995.6308986084199,
y: 459.61907341864594
}
}, {
p0: {
x: 988.9795827027153,
y: 401.1037000830355
},
p3: {
x: 1097.0816044097123,
y: 398.18273687186036
},
p1: {
x: 1053.59694241109,
y: 400.3357694323554
},
p2: {
x: 1075.9152213984112,
y: 400.01575906764737
}
}, {
p0: {
x: 1097.0816044097123,
y: 398.18273687186036
},
p3: {
x: 1095.9772918666488,
y: 246.18570494738162
},
p1: {
x: 1095.8679913077785,
y: 341.4939077894318
},
p2: {
x: 1095.8538576148221,
y: 288.6009175122347
}
}, {
p0: {
x: 1095.9772918666488,
y: 246.18570494738162
},
p3: {
x: 680.5413566430872,
y: 241.34439117614914
},
p1: {
x: 947.8976485068342,
y: 245.69196794007306
},
p2: {
x: 870.2781157431675,
y: 246.87166017890917
}
}, {
p0: {
x: 680.5413566430872,
y: 241.34439117614914
},
p3: {
x: 561.4962411690266,
y: 155.1198419208287
},
p1: {
x: 666.1710031967048,
y: 190.16770790604156
},
p2: {
x: 560.057975310613,
y: 203.8561124044123
}
}, {
p0: {
x: 561.4962411690266,
y: 155.1198419208287
},
p3: {
x: 754.4246914504167,
y: 157.71031575271127
},
p1: {
x: 624.0584232944798,
y: 155.46431177384042
},
p2: {
x: 681.5627108707989,
y: 157.08978652547285
}
}, {
p0: {
x: 754.4246914504167,
y: 157.71031575271127
},
p3: {
x: 1067.5771670190281,
y: 160.7272727272727
},
p1: {
x: 832.143763213531,
y: 159.71247357293865
},
p2: {
x: 966.0972515856238,
y: 161.74207188160685
}
}, {
p0: {
x: 1067.5771670190281,
y: 160.7272727272727
},
p3: {
x: 1246.816067653277,
y: 160.8599849077313
},
p1: {
x: 1157.4199454932116,
y: 159.37420718816065
},
p2: {
x: 1207.3097469862237,
y: 160.97872738498384
}
}, {
p0: {
x: 1246.816067653277,
y: 160.8599849077313
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
8: [
[{
p0: {
x: -31.29167764460125,
y: 621.1216778917576
},
p3: {
x: 25.435195843117945,
y: 627.8100174353964
},
p1: {
x: -5.218227837332208,
y: 558.8532688166354
},
p2: {
x: 13.526245364095907,
y: 572.0412481826661
}
}, {
p0: {
x: 25.435195843117945,
y: 627.8100174353964
},
p3: {
x: 100.60629045802789,
y: 682.7259525774114
},
p1: {
x: 40.32793079933167,
y: 679.7904164717357
},
p2: {
x: 50.675549508349064,
y: 682.8178954311908
}
}, {
p0: {
x: 100.60629045802789,
y: 682.7259525774114
},
p3: {
x: 245.54219705059833,
y: 684.6512481773907
},
p1: {
x: 146.2245931674175,
y: 684.557152884392
},
p2: {
x: 197.4049021750255,
y: 684.2698727130636
}
}, {
p0: {
x: 245.54219705059833,
y: 684.6512481773907
},
p3: {
x: 363.29771250657205,
y: 728.4242749298304
},
p1: {
x: 325.0941355782338,
y: 677.9754219236439
},
p2: {
x: 321.9004999650089,
y: 731.3879050007464
}
}, {
p0: {
x: 363.29771250657205,
y: 728.4242749298304
},
p3: {
x: 427.99837439001004,
y: 645.7721408558456
},
p1: {
x: 396.9494484196252,
y: 728.1433055025378
},
p2: {
x: 416.6440124911151,
y: 681.2203227105641
}
}, {
p0: {
x: 427.99837439001004,
y: 645.7721408558456
},
p3: {
x: 466.2407662176655,
y: 562.9157945829302
},
p1: {
x: 436.67294632535976,
y: 623.3326027831545
},
p2: {
x: 446.73293369484213,
y: 587.0632877737208
}
}, {
p0: {
x: 466.2407662176655,
y: 562.9157945829302
},
p3: {
x: 561.4347064922375,
y: 540.0567985432465
},
p1: {
x: 493.7500085018504,
y: 528.5130294720506
},
p2: {
x: 536.9132780352379,
y: 542.8995452282978
}
}, {
p0: {
x: 561.4347064922375,
y: 540.0567985432465
},
p3: {
x: 675.8748156644265,
y: 465.2295592331639
},
p1: {
x: 597.9629690316232,
y: 543.1223988202527
},
p2: {
x: 651.2010486645913,
y: 540.3899721448468
}
}, {
p0: {
x: 675.8748156644265,
y: 465.2295592331639
},
p3: {
x: 773.5277732262824,
y: 410.93232836310017
},
p1: {
x: 696.4116008520404,
y: 412.85400622644596
},
p2: {
x: 732.2208749795183,
y: 322.8549893495002
}
}, {
p0: {
x: 773.5277732262824,
y: 410.93232836310017
},
p3: {
x: 889.011961330493,
y: 375.21743404882835
},
p1: {
x: 854.702277568409,
y: 412.9143044404391
},
p2: {
x: 876.4882844502708,
y: 413.97869900049153
}
}, {
p0: {
x: 889.011961330493,
y: 375.21743404882835
},
p3: {
x: 1016.0131083073903,
y: 267.2049811568083
},
p1: {
x: 925.371784368343,
y: 275.0673439292153
},
p2: {
x: 918.0809437981326,
y: 262.782238243487
}
}, {
p0: {
x: 1016.0131083073903,
y: 267.2049811568083
},
p3: {
x: 1038.9021792561039,
y: 266.9978699000492
},
p1: {
x: 1002.6609864001313,
y: 312.1822054727183
},
p2: {
x: 1047.7266917909228,
y: 312.5361297722434
}
}, {
p0: {
x: 1038.9021792561039,
y: 266.9978699000492
},
p3: {
x: 1160.7216123218093,
y: 265.5172865803703
},
p1: {
x: 1100.463378666229,
y: 265.8128789120105
},
p2: {
x: 1149.0014746845816,
y: 264.6475503850564
}
}, {
p0: {
x: 1160.7216123218093,
y: 265.5172865803703
},
p3: {
x: 1265.8823529411768,
y: 420.235294117647
},
p1: {
x: 1245.1764705882363,
y: 266.82352941176475
},
p2: {
x: 1260.2352941176473,
y: 353.4117647058824
}
}, {
p0: {
x: 1265.8823529411768,
y: 420.235294117647
},
p3: {
x: 1306.3529411764703,
y: 487.0588235294118
},
p1: {
x: 1274.3529411764707,
y: 457.88235294117646
},
p2: {
x: 1294.1176470588234,
y: 469.1764705882353
}
}, {
p0: {
x: 1306.3529411764703,
y: 487.0588235294118
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 588.764723813528
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
9: [
[{
p0: {
x: -31.29167764460125,
y: 621.1216778917576
},
p3: {
x: 25.435195843117945,
y: 627.8100174353964
},
p1: {
x: -5.218227837332208,
y: 558.8532688166354
},
p2: {
x: 13.526245364095907,
y: 572.0412481826661
}
}, {
p0: {
x: 25.435195843117945,
y: 627.8100174353964
},
p3: {
x: 100.60629045802789,
y: 682.7259525774114
},
p1: {
x: 40.32793079933167,
y: 679.7904164717357
},
p2: {
x: 50.675549508349064,
y: 682.8178954311908
}
}, {
p0: {
x: 100.60629045802789,
y: 682.7259525774114
},
p3: {
x: 245.54219705059833,
y: 684.6512481773907
},
p1: {
x: 146.2245931674175,
y: 684.557152884392
},
p2: {
x: 197.4049021750255,
y: 684.2698727130636
}
}, {
p0: {
x: 245.54219705059833,
y: 684.6512481773907
},
p3: {
x: 363.29771250657205,
y: 728.4242749298304
},
p1: {
x: 325.0941355782338,
y: 677.9754219236439
},
p2: {
x: 321.9004999650089,
y: 731.3879050007464
}
}, {
p0: {
x: 363.29771250657205,
y: 728.4242749298304
},
p3: {
x: 421.29178756366275,
y: 662.0595660055461
},
p1: {
x: 396.9494484196252,
y: 728.1433055025378
},
p2: {
x: 404.1889226707558,
y: 699.4239155249353
}
}, {
p0: {
x: 421.29178756366275,
y: 662.0595660055461
},
p3: {
x: 455.7018440619769,
y: 573.4547167386188
},
p1: {
x: 429.00827566667715,
y: 636.745776435849
},
p2: {
x: 438.11017920382415,
y: 607.1830482527628
}
}, {
p0: {
x: 455.7018440619769,
y: 573.4547167386188
},
p3: {
x: 532.6921915221776,
y: 572.6316488426476
},
p1: {
x: 478.4206671844851,
y: 531.3872809690565
},
p2: {
x: 512.0030983945194,
y: 520.8636170845853
}
}, {
p0: {
x: 532.6921915221776,
y: 572.6316488426476
},
p3: {
x: 665.3358935087382,
y: 525.5888406702896
},
p1: {
x: 621.9150648400063,
y: 576.6553329519891
},
p2: {
x: 643.5363780059085,
y: 578.7133254382601
}
}, {
p0: {
x: 665.3358935087382,
y: 525.5888406702896
},
p3: {
x: 773.5277732262824,
y: 442.54909483016604
},
p1: {
x: 682.0403433670103,
y: 481.83604215458973
},
p2: {
x: 723.5981204885004,
y: 347.7651689902188
}
}, {
p0: {
x: 773.5277732262824,
y: 442.54909483016604
},
p3: {
x: 935.9580691149243,
y: 403.95994901888815
},
p1: {
x: 860.4507805624211,
y: 446.4472385721756
},
p2: {
x: 916.7278054083548,
y: 449.42780079689874
}
}, {
p0: {
x: 935.9580691149243,
y: 403.95994901888815
},
p3: {
x: 1065.833467588827,
y: 435.8277356478263
},
p1: {
x: 971.3598083204388,
y: 313.3906972226285
},
p2: {
x: 1012.9312431993302,
y: 314.5187651895948
}
}, {
p0: {
x: 1065.833467588827,
y: 435.8277356478263
},
p3: {
x: 1227.6446942261637,
y: 564.9619417563366
},
p1: {
x: 1081.1041001725864,
y: 475.53549888589197
},
p2: {
x: 1118.6248953837373,
y: 556.8475070177524
}
}, {
p0: {
x: 1227.6446942261637,
y: 564.9619417563366
},
p3: {
x: 1296.6497560343842,
y: 625.7568075384542
},
p1: {
x: 1265.2537978279056,
y: 574.3158729239865
},
p2: {
x: 1291.755965702546,
y: 595.186472540745
}
}, {
p0: {
x: 1296.6497560343842,
y: 625.7568075384542
},
p3: {
x: 1320.4931313842906,
y: 708.6185276505811
},
p1: {
x: 1306.4938358576974,
y: 644.3085593518844
},
p2: {
x: 1311.971821063755,
y: 669.579429376541
}
}, {
p0: {
x: 1320.4931313842906,
y: 708.6185276505811
},
p3: {
x: 1347.5505459668893,
y: 818.5558295174359
},
p1: {
x: 1328.9637196195847,
y: 752.0140894681225
},
p2: {
x: 1338.1895033462486,
y: 780.5537160972173
}
}, {
p0: {
x: 1347.5505459668893,
y: 818.5558295174359
},
p3: {
x: 1369.0778443113775,
y: 916.3832335329344
},
p1: {
x: 1354.7065868263471,
y: 851.2335329341319
},
p2: {
x: 1375.7844311377248,
y: 892.4311377245509
}
}, {
p0: {
x: 1369.0778443113775,
y: 916.3832335329344
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 588.764723813528
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
10: [
[{
p0: {
x: -272.02085615059957,
y: 924.0853371075856
},
p3: {
x: -200.7063759857968,
y: 924.8138007497503
},
p1: {
x: -255.30315790885163,
y: 927.4141463148483
},
p2: {
x: -228.3784033468505,
y: 924.8772927350382
}
}, {
p0: {
x: -200.7063759857968,
y: 924.8138007497503
},
p3: {
x: -102.8760525434879,
y: 927.0845167360463
},
p1: {
x: -168.7994705503939,
y: 929.7870631024913
},
p2: {
x: -132.51312258499004,
y: 921.4925880140579
}
}, {
p0: {
x: -102.8760525434879,
y: 927.0845167360463
},
p3: {
x: -14.837156416915661,
y: 925.291353488261
},
p1: {
x: -68.16222836460112,
y: 923.5795418246853
},
p2: {
x: -40.65386758595568,
y: 927.3692230913651
}
}, {
p0: {
x: -14.837156416915661,
y: 925.291353488261
},
p3: {
x: 65.33238055801806,
y: 916.5885695110733
},
p1: {
x: 19.13800606246599,
y: 918.0012049579973
},
p2: {
x: 40.41929546930331,
y: 923.0541169026321
}
}, {
p0: {
x: 65.33238055801806,
y: 916.5885695110733
},
p3: {
x: 138.5244551123199,
y: 914.2642600919811
},
p1: {
x: 99.36514236608218,
y: 915.4570071876788
},
p2: {
x: 115.1382199285776,
y: 916.2450987338128
}
}, {
p0: {
x: 138.5244551123199,
y: 914.2642600919811
},
p3: {
x: 235.7954592177116,
y: 915.2156058010654
},
p1: {
x: 174.77848378704704,
y: 918.3532054737002
},
p2: {
x: 213.56568105676337,
y: 918.3052482483082
}
}, {
p0: {
x: 235.7954592177116,
y: 915.2156058010654
},
p3: {
x: 361.5761698674189,
y: 861.620532736818
},
p1: {
x: 270.1075134642903,
y: 917.3789450010953
},
p2: {
x: 330.8896067613619,
y: 894.7130118496739
}
}, {
p0: {
x: 361.5761698674189,
y: 861.620532736818
},
p3: {
x: 481.9559505028523,
y: 857.8654325892542
},
p1: {
x: 411.22794072043234,
y: 882.0855780021908
},
p2: {
x: 456.92288121478794,
y: 886.5939430032956
}
}, {
p0: {
x: 481.9559505028523,
y: 857.8654325892542
},
p3: {
x: 690.291538462269,
y: 654.6272045575872
},
p1: {
x: 539.061516528838,
y: 823.6322499012099
},
p2: {
x: 643.7979974855723,
y: 766.0638986645896
}
}, {
p0: {
x: 690.291538462269,
y: 654.6272045575872
},
p3: {
x: 842.2419495740417,
y: 677.9994983716008
},
p1: {
x: 760.5523030683144,
y: 532.3286205180511
},
p2: {
x: 767.5407197578684,
y: 679.6524182508971
}
}, {
p0: {
x: 842.2419495740417,
y: 677.9994983716008
},
p3: {
x: 985.8613783044771,
y: 676.0768797577798
},
p1: {
x: 867.3931810717623,
y: 677.999498371601
},
p2: {
x: 887.6088434247403,
y: 677.9994983716006
}
}, {
p0: {
x: 985.8613783044771,
y: 676.0768797577798
},
p3: {
x: 1090.855949491566,
y: 674.2684094843777
},
p1: {
x: 1025.4708374534478,
y: 674.5785193252668
},
p2: {
x: 1052.79909443344,
y: 674.4655719710772
}
}, {
p0: {
x: 1090.855949491566,
y: 674.2684094843777
},
p3: {
x: 1165.616223987492,
y: 559.7184179965338
},
p1: {
x: 1135.2695609047864,
y: 672.4587382247469
},
p2: {
x: 1152.7575762451504,
y: 645.0032719422201
}
}, {
p0: {
x: 1165.616223987492,
y: 559.7184179965338
},
p3: {
x: 1249.6408359589948,
y: 581.3769529198084
},
p1: {
x: 1175.7890207740402,
y: 524.2226624353207
},
p2: {
x: 1201.1519583856652,
y: 465.90898567898245
}
}, {
p0: {
x: 1249.6408359589948,
y: 581.3769529198084
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
],
11: [
[{
p0: {
x: -8.703442350483613,
y: 236.6510896564636
},
p3: {
x: 29.19990172547093,
y: 320.51589978833726
},
p1: {
x: 16.428830986197212,
y: 214.8532688166353
},
p2: {
x: 22.938010069978368,
y: 273.2177187709015
}
}, {
p0: {
x: 29.19990172547093,
y: 320.51589978833726
},
p3: {
x: 104.37099634038081,
y: 409.31418787152893
},
p1: {
x: 35.62204844639051,
y: 390.37865176585336
},
p2: {
x: 65.73437303776075,
y: 408.4649542547201
}
}, {
p0: {
x: 104.37099634038081,
y: 409.31418787152893
},
p3: {
x: 247.1616515363032,
y: 410.5612054563915
},
p1: {
x: 156.57753434388806,
y: 411.1453881785095
},
p2: {
x: 197.4049021750255,
y: 410.858108007181
}
}, {
p0: {
x: 247.1616515363032,
y: 410.5612054563915
},
p3: {
x: 361.5941305151162,
y: 410.61947703301786
},
p1: {
x: 292.00047800347215,
y: 411.6776894228225
},
p2: {
x: 326.5432866886369,
y: 411.50620930570835
}
}, {
p0: {
x: 361.5941305151162,
y: 410.61947703301786
},
p3: {
x: 478.08053015734487,
y: 411.64792133563515
},
p1: {
x: 400.89292525169884,
y: 411.7581592652721
},
p2: {
x: 441.84020046351077,
y: 410.82137430438604
}
}, {
p0: {
x: 478.08053015734487,
y: 411.64792133563515
},
p3: {
x: 585.291702793413,
y: 411.2378451908829
},
p1: {
x: 513.5365677515839,
y: 411.9543576303446
},
p2: {
x: 543.1746031000343,
y: 412.50660029425995
}
}, {
p0: {
x: 585.291702793413,
y: 411.2378451908829
},
p3: {
x: 705.1507761603283,
y: 409.11496482651955
},
p1: {
x: 627.3970673253797,
y: 412.5511497480938
},
p2: {
x: 668.8567548673117,
y: 410.5380598520245
}
}, {
p0: {
x: 705.1507761603283,
y: 409.11496482651955
},
p3: {
x: 812.3454038997211,
y: 356.5236768802228
},
p1: {
x: 752.973156346773,
y: 402.65181058495807
},
p2: {
x: 787.5401876721497,
y: 384.0994693515507
}
}, {
p0: {
x: 812.3454038997211,
y: 356.5236768802228
},
p3: {
x: 873.2924791086352,
y: 296.57938718662956
},
p1: {
x: 838.5292479108635,
y: 329.5598885793872
},
p2: {
x: 854.5738161559888,
y: 306.3844011142061
}
}, {
p0: {
x: 873.2924791086352,
y: 296.57938718662956
},
p3: {
x: 979.3649025069639,
y: 295.6880222841225
},
p1: {
x: 919.6434540389972,
y: 294.79665738161555
},
p2: {
x: 950.841225626741,
y: 296.8022284122562
}
}, {
p0: {
x: 979.3649025069639,
y: 295.6880222841225
},
p3: {
x: 1005.6601671309197,
y: 295.91086350974945
},
p1: {
x: 977.136490250696,
y: 340.47910863509776
},
p2: {
x: 1006.5515320334267,
y: 341.37047353760465
}
}, {
p0: {
x: 1005.6601671309197,
y: 295.91086350974945
},
p3: {
x: 1133.9610027855158,
y: 164.88022284122567
},
p1: {
x: 1093.0139275766019,
y: 299.4763231197771
},
p2: {
x: 1110.7855153203345,
y: 276.3008356545963
}
}, {
p0: {
x: 1133.9610027855158,
y: 164.88022284122567
},
p3: {
x: 1217.1922005571032,
y: 187.16434540389972
},
p1: {
x: 1151.2869080779938,
y: 72.40111420612811
},
p2: {
x: 1193.2367688022282,
y: 36.4122562674093
}
}, {
p0: {
x: 1217.1922005571032,
y: 187.16434540389972
},
p3: {
x: 1237.2290502793296,
y: 281.6983240223463
},
p1: {
x: 1227.486033519553,
y: 222.70391061452514
},
p2: {
x: 1230.7039106145253,
y: 250.59217877094972
}
}, {
p0: {
x: 1237.2290502793296,
y: 281.6983240223463
}
}],
[{
p0: {
x: 1377.2415383587436,
y: 388.76472381352806
},
p3: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p1: {
x: 1374.0094325791883,
y: 347.1979087888956
},
p2: {
x: 1376.1937103230034,
y: 309.5460002821476
}
}, {
p0: {
x: 1357.0585577835382,
y: 249.4386890651236
},
p3: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p1: {
x: 1359.4353331692084,
y: 236.76270120299955
},
p2: {
x: 1359.5975403374155,
y: 220.83118670697877
}
}, {
p0: {
x: 1353.3609867418322,
y: 200.81926569722248
},
p3: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p1: {
x: 1351.7883008356546,
y: 167.3871866295265
},
p2: {
x: 1353.2924791086352,
y: 138.13927576601674
}
}, {
p0: {
x: 1350.7869869133333,
y: 106.19288379670994
},
p3: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}, {
p0: {
x: 1392.0111420612814,
y: 136.24512534818942
}
}]
]
},
init: function(b, c, d) {
this.parent(b, c, d);
this.srcMaxX =
1167;
this.srcMaxY = 747;
!ig.global.wm && !0 == ig.game.makeLand && (this.landpoints = this.landlevel[ig.game.levelNow], this.createPointsAlongCurve(), this.createLand(), this.createLandCanvas())
},
createPointsAlongCurve: function() {
for (var b = 0; b < this.landpoints.length; b++) {
this.segments[b] = [];
for (var c = 0; c < this.landpoints[b].length; c++) {
var d = this.landpoints[b][c];
if (d.p2) {
for (var e = this.cubicBezierLength(d.p0, d.p1, d.p2, d.p3), f = Math.floor(e / this.segmentSize), j = 0; j < f; j++) this.segments[b].push(this.cubicBezier(this.segmentSize *
j / e, d.p0, d.p1, d.p2, d.p3));
c == this.landpoints[b].length - 1 && this.segments[b].push(this.cubicBezier(1, d.p0, d.p1, d.p2, d.p3))
} else(d = this.landpoints[b][c - 1]) && d.p2 && this.segments[b].push(this.cubicBezier(1, d.p0, d.p1, d.p2, d.p3))
}
}
},
expandDot: function(b, c, d) {
return [{
x: b.x + Math.cos(c + 0.5 * Math.PI) * d,
y: b.y + Math.sin(c + 0.5 * Math.PI) * d
}, {
x: b.x + Math.cos(c - 0.5 * Math.PI) * d,
y: b.y + Math.sin(c - 0.5 * Math.PI) * d
}]
},
createLand: function() {
for (var b = 0; b < this.segments.length; b++) {
this.drawLandPoints[b] = [];
for (var c = 0; c < this.segments[b].length; c++)
if (c <
this.segments[b].length - 1) {
var d = this.segments[b][c],
e = this.segments[b][c + 1],
f = [],
j = this.getAngle(d, e),
q = d.x + 0.5 * (e.x - d.x),
n = d.y + 0.5 * (e.y - d.y),
d = this.expandDot(d, j, this.segmentWidth),
e = this.expandDot(e, j, this.segmentWidth),
f = f.concat(d, e),
f = this.arrangeClockwise(f);
this.drawLandPoints.push(f.slice());
for (e = 0; e < f.length; e++) f[e].x = (f[e].x - q) * Box2D.SCALE, f[e].y = (f[e].y - n) * Box2D.SCALE;
e = new Box2D.Dynamics.b2BodyDef;
e.position.Set(q * Box2D.SCALE, n * Box2D.SCALE);
q = ig.world.CreateBody(e);
n = new Box2D.Collision.Shapes.b2PolygonShape;
n.SetAsArray(f, f.length);
q.CreateFixture2(n)
}
}
},
update: function() {
this.parent()
},
quadraticBezier: function(b, c, d, e) {
var f = {};
f.x = Math.pow(1 - b, 2) * c.x + 2 * (1 - b) * b * d.x + Math.pow(b, 2) * e.x;
f.y = Math.pow(1 - b, 2) * c.y + 2 * (1 - b) * b * d.y + Math.pow(b, 2) * e.y;
return f
},
cubicBezierLength: function(b, c, d, e) {
for (var f = 0, j = {
x: 0,
y: 0
}, q = 0, n = 0, g = 0; 40 > g; g++) t = g / 39, j = this.cubicBezier(t, b, c, d, e), 0 < g && (q = j.x - q, n = j.y - n, f += Math.sqrt(q * q + n * n)), q = j.x, n = j.y;
return f
},
cubicBezier: function(b, c, d, e, f) {
var j = {};
j.x = Math.pow(1 - b, 3) * c.x + 3 * Math.pow(1 -
b, 2) * b * d.x + 3 * (1 - b) * Math.pow(b, 2) * e.x + Math.pow(b, 3) * f.x;
j.y = Math.pow(1 - b, 3) * c.y + 3 * Math.pow(1 - b, 2) * b * d.y + 3 * (1 - b) * Math.pow(b, 2) * e.y + Math.pow(b, 3) * f.y;
return j
},
getAngle: function(b, c) {
return Math.atan2(b.y - c.y, b.x - c.x)
},
normal: function(b, c) {
return {
x: c.y - b.y,
y: c.x - b.x
}
},
arrangeClockwise: function(b) {
var c = b.length,
d, e = 1,
f = c - 1,
j = [],
q, n;
b.sort(this.pointXsort);
j[0] = b[0];
q = b[0];
n = b[c - 1];
for (i = 1; i < c - 1; i++) d = this.det(q.x, q.y, n.x, n.y, b[i].x, b[i].y), 0 > d ? j[e++] = b[i] : j[f--] = b[i];
j[e] = b[c - 1];
return j
},
pointXsort: function(b,
c) {
return b.x > c.x ? 1 : b.x < c.x ? -1 : 0
},
det: function(b, c, d, e, f, j) {
return b * e + d * j + f * c - c * d - e * f - j * b
},
createLandCanvas: function() {
null == ig.game.landEle ? (ig.game.landEle = document.createElement("canvas"), ig.game.landCtx = ig.game.landEle.getContext("2d"), ig.game.landEle.width = 2E3, ig.game.landEle.height = 2E3) : ig.game.landCtx.clearRect(0, 0, 2E3, 2E3);
this.prerenderLand()
},
prerenderLand: function() {
if (!0 == ig.game.makeLand) {
var b = ig.game.landCtx;
b.fillStyle = "#237148";
b.lineWidth = 2 * this.segmentWidth;
for (var c = 0; c < this.landpoints.length; c++) {
b.save();
b.beginPath();
for (var d = 0; d < this.landpoints[c].length; d++) {
var e = this.landpoints[c][d];
0 == d && (b.moveTo(e.p0.x, 1167), b.lineTo(e.p0.x, e.p0.y));
e.p2 && (b.bezierCurveTo(e.p1.x, e.p1.y, e.p2.x, e.p2.y, e.p3.x, e.p3.y), lastX = e.p3.x)
}
b.strokeStyle = "#237148";
b.stroke();
b.lineTo(lastX, 1167);
b.clip();
d = b.createPattern(this.rocktile.data, "repeat");
b.rect(0, 0, 1167, 547);
b.fillStyle = d;
b.fill();
b.restore()
}
}
},
draw: function() {
this.parent();
ig.system.context.drawImage(ig.game.landEle, -ig.game.screen.x, -ig.game.screen.y,
2E3, 2E3)
}
})
});
ig.baked = !0;
ig.module("game.levels.opening").requires("impact.image", "game.entities.opening-kitty").defines(function() {
LevelOpening = {
entities: [{
type: "EntityOpeningKitty",
x: 520,
y: 212
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.entities.buttons.button-sound").requires("game.entities.buttons.button").defines(function() {
EntityButtonSound = EntityButton.extend({
type: ig.Entity.TYPE.A,
gravityFactor: 0,
logo: new ig.AnimationSheet("branding/logo.png", _SETTINGS.Branding.Logo.Width, _SETTINGS.Branding.Logo.Height),
zIndex: 10001,
size: {
x: 50,
y: 50
},
mutetest: !1,
name: "soundtest",
init: function(b, c, d) {
this.parent(b, c, d)
},
draw: function() {
this.parent();
ig.system.context.fillRect(this.pos.x, this.pos.y, 50, 50)
},
clicked: function() {
console.log("pressed");
this.mutetest ? (console.log("unmute"), ig.soundHandler.unmuteAll(!0), this.mutetest = !1) : (console.log("mute"), ig.soundHandler.muteAll(!0), this.mutetest = !0)
},
clicking: function() {},
released: function() {}
})
});
ig.baked = !0;
ig.module("game.levels.test-desktop").requires("impact.image", "game.entities.branding-logo-placeholder", "game.entities.buttons.button-more-games", "game.entities.pointer", "game.entities.buttons.button-sound").defines(function() {
LevelTestDesktop = {
entities: [{
type: "EntityBrandingLogoPlaceholder",
x: 296,
y: 396,
settings: {
div_layer_name: "layer_mainmenu",
centralize: "true"
}
}, {
type: "EntityButtonMoreGames",
x: 432,
y: 284,
settings: {
div_layer_name: "layer_moregames_mainmenu"
}
}, {
type: "EntityPointer",
x: 608,
y: 120
}, {
type: "EntityButtonSound",
x: 192,
y: 284
}],
layer: [{
name: "background",
width: 40,
height: 30,
linkWithCollision: !1,
visible: 1,
tilesetName: "media/graphics/backgrounds/desktop/background.jpg",
repeat: !1,
preRender: !0,
distance: "1",
tilesize: 16,
foreground: !1,
data: [
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40],
[41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80],
[81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120
],
[121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 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, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320],
[321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360
],
[361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400],
[401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440],
[441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468,
469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480
],
[481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520],
[521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560],
[561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592,
593, 594, 595, 596, 597, 598, 599, 600
],
[601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640],
[641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680],
[681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716,
717, 718, 719, 720
],
[721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760],
[761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800],
[801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840],
[841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880],
[881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920],
[921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960],
[961, 962, 963, 964,
965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1E3
],
[1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040],
[1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071,
1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080
],
[1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120],
[1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160],
[1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170,
1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200
]
]
}]
};
LevelTestDesktopResources = [new ig.Image("media/graphics/backgrounds/desktop/background.jpg")]
});
ig.baked = !0;
ig.module("game.levels.test-mobile").requires("impact.image", "game.entities.branding-logo-placeholder", "game.entities.buttons.button-more-games", "game.entities.pointer").defines(function() {
LevelTestMobile = {
entities: [{
type: "EntityBrandingLogoPlaceholder",
x: 216,
y: 548,
settings: {
div_layer_name: "layer_mainmenu",
centralize: "true"
}
}, {
type: "EntityButtonMoreGames",
x: 204,
y: 372,
settings: {
div_layer_name: "layer_moregames_mainmenu"
}
}, {
type: "EntityPointer",
x: 444,
y: 192
}],
layer: [{
name: "background",
width: 30,
height: 40,
linkWithCollision: !1,
visible: 1,
tilesetName: "media/graphics/backgrounds/mobile/background.jpg",
repeat: !1,
preRender: !0,
distance: "1",
tilesize: 16,
foreground: !1,
data: [
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
[31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60],
[61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90],
[91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
111, 112, 113, 114, 115, 116, 117, 118, 119, 120
],
[121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150],
[151, 152, 153, 154, 155, 156, 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, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330],
[331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358,
359, 360
],
[361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390],
[391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420],
[421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450],
[451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480],
[481,
482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510
],
[511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540],
[541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570],
[571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600],
[601, 602, 603, 604, 605,
606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630
],
[631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660],
[661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690],
[691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720],
[721, 722, 723, 724, 725, 726, 727, 728, 729,
730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750
],
[751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780],
[781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810],
[811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840],
[841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853,
854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870
],
[871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900],
[901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930],
[931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960],
[961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977,
978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990
],
[991, 992, 993, 994, 995, 996, 997, 998, 999, 1E3, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020],
[1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050],
[1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080],
[1081,
1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110
],
[1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140],
[1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170],
[1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180,
1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200
]
]
}]
};
LevelTestMobileResources = [new ig.Image("media/graphics/backgrounds/mobile/background.jpg")]
});
ig.baked = !0;
ig.module("game.entities.menu.menu-background").requires("impact.entity").defines(function() {
EntityMenuBackground = ig.Entity.extend({
size: {
x: 960,
y: 540
},
animSheet: new ig.AnimationSheet("media/graphics/menu/background.png", 960, 540),
Offset: 0,
gravityFactor: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
draw: function() {
this.parent()
}
});
EntityMenuLogo = ig.Entity.extend({
size: {
x: 557,
y: 385
},
animSheet: new ig.AnimationSheet("media/graphics/menu/logo.png",
557, 385),
Offset: 0,
gravityFactor: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
ready: function() {
this.getIn()
},
draw: function() {
this.parent()
},
getIn: function() {
this.tween({
pos: {
x: this.pos.x,
y: 20
}
}, 0.8, {
easing: ig.Tween.Easing.Bounce.EaseOut,
onComplete: function() {
this.endGetIn()
}.bind(this)
}).start()
},
endGetIn: function() {}
})
});
ig.baked = !0;
ig.module("game.entities.menu.button-play").requires("impact.entity").defines(function() {
EntityButtonPlay = ig.Entity.extend({
size: {
x: 182,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/btplay.png", 182, 80),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
ready: function() {
this.posChange()
},
clicked: function() {
"" == ig.game.popupOpen && (this.small = !0)
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, _SETTINGS.MoreGames.Disabled && ig.game.getEntitiesByType(EntityButtonMoreGames)[0].hide(), ig.soundHandler.sfxPlayer.play("button1"), ig.game.storage.get("firstPlay") ? ig.game.spawnEntity(EntityAsk, 290, -100, {
zIndex: this.zIndex + 100,
realpos: {
x: 300,
y: -100
}
}) : (ig.game.levelNow = 1, eval("ig.game.loadLevel(LevelHole" +
ig.game.levelNow + ");"))))
},
draw: function() {
this.parent()
},
posChange: function() {
this.tween({
pos: {
x: this.pos.x,
y: 350
}
}, 0.8, {
easing: ig.Tween.Easing.Back.EaseOut
}).start()
},
posBack: function() {}
});
EntityAsk = ig.Entity.extend({
size: {
x: 417,
y: 100
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/bgtext.png", 417, 100),
darkbg: new ig.Image("media/graphics/gameplay/darkbg.png"),
gravityFactor: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.setScale(1.2, 1.2);
this.ask = ig.game.spawnEntity(EntityText, this.pos.x + 240, this.pos.y + 40, {
name: "ask",
text: _STRINGS.Game.Ask,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 30,
textAlign: "center",
zIndex: this.zIndex + 100,
gravityFactor: 0
});
this.yes = ig.game.spawnEntity(EntityYes, 0, 0, {
zIndex: this.zIndex + 100,
realpos: {
x: 0,
y: 0
}
});
this.no = ig.game.spawnEntity(EntityNo, 0, 0, {
zIndex: this.zIndex + 100,
realpos: {
x: 0,
y: 0
}
});
ig.game.sortEntitiesDeferred();
this.getIn()
},
update: function() {
this.parent();
this.ask.pos = {
x: this.pos.x + 250,
y: this.pos.y + 50
};
this.yes.pos = {
x: this.pos.x + this.size.x - 100,
y: this.pos.y + 75
};
this.no.pos = {
x: this.pos.x + this.size.x - 170,
y: this.pos.y + 75
}
},
draw: function() {
this.parent();
this.darkbg.draw(0, 0)
},
getIn: function() {
ig.game.popupOpen = "ask";
this.tween({
pos: {
x: this.pos.x,
y: 220
}
}, 0.8, {
easing: ig.Tween.Easing.Bounce.EaseOut,
onComplete: function() {
this.endGetIn()
}.bind(this)
}).start()
},
endGetIn: function() {}
});
EntityYes = ig.Entity.extend({
size: {
x: 50,
y: 25
},
type: ig.Entity.TYPE.B,
small: !1,
big: !1,
gravityFactor: 0,
name: "btcontinue",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.txt = ig.game.spawnEntity(EntityText, this.pos.x, this.pos.y, {
name: "yes",
text: _STRINGS.Game.Yes,
fontColor: "#3672f8",
fontStyle: "FredokaOne",
fontSize: 30,
textAlign: "left",
zIndex: this.zIndex - 1,
gravityFactor: 0,
fontWeight: "italic"
})
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
this.txt.pos = {
x: this.pos.x,
y: this.pos.y + 20
};
this.small ? (this.small = !1, this.big = !0) : this.big && (_SETTINGS.MoreGames.Disabled &&
ig.game.getEntitiesByType(EntityButtonMoreGames)[0].hide(), this.big = this.small = !1, ig.game.popupOpen = "", ig.soundHandler.sfxPlayer.play("button2"), ig.game.levelNow = 11, ig.game.loadLevel(LevelDemo))
},
draw: function() {
this.parent()
}
});
EntityNo = ig.Entity.extend({
size: {
x: 50,
y: 25
},
type: ig.Entity.TYPE.B,
small: !1,
big: !1,
gravityFactor: 0,
name: "btcontinue",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.txt = ig.game.spawnEntity(EntityText, this.pos.x, this.pos.y, {
name: "yes",
text: _STRINGS.Game.No,
fontColor: "#3672f8",
fontStyle: "FredokaOne",
fontSize: 30,
textAlign: "left",
zIndex: this.zIndex - 1,
gravityFactor: 0,
fontWeight: "italic"
})
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
this.txt.pos = {
x: this.pos.x,
y: this.pos.y + 20
};
this.small ? (this.small = !1, this.big = !0) : this.big && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), _SETTINGS.MoreGames.Disabled && ig.game.getEntitiesByType(EntityButtonMoreGames)[0].hide(), ig.game.popupOpen = "", ig.game.levelNow = 1, eval("ig.game.loadLevel(LevelHole" +
ig.game.levelNow + ");"))
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.menu.button-shop").requires("impact.entity").defines(function() {
EntityButtonShop = ig.Entity.extend({
size: {
x: 124,
y: 75
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/btshop.png", 124, 75),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
ready: function() {
this.posChange()
},
clicked: function() {
"" == ig.game.popupOpen && (this.small = !0)
},
bigAgain: function() {},
endUp: function() {},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"), this.popshop = ig.game.spawnEntity(EntityPopupShop, 980, 80, {
zIndex: 50,
realpos: {
x: 0,
y: 0
}
})))
},
draw: function() {
this.parent()
},
posChange: function() {
this.tween({
pos: {
x: 840,
y: this.pos.y
}
}, 0.8, {
easing: ig.Tween.Easing.Quartic.EaseOut
}).start()
},
posBack: function() {}
})
});
ig.baked = !0;
ig.module("game.entities.menu.button-sfx").requires("impact.entity").defines(function() {
EntityButtonSfx = ig.Entity.extend({
size: {
x: 42,
y: 42
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/btsound.png", 42, 42),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("on", 1, [0]);
this.addAnim("off", 1, [1]);
this.currentAnim = this.anims.on;
ig.game.storage.get("sfxMute") ? (this.currentAnim = this.anims.off, ig.soundHandler.sfxPlayer.mute(!0)) :
(this.currentAnim = this.anims.on, ig.soundHandler.sfxPlayer.unmute(!0))
},
clicked: function() {
"ask" == ig.game.popupOpen || "popupshop" == ig.game.popupOpen || (this.small = !0)
},
bigAgain: function() {},
endUp: function() {},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"),
0 == this.currentAnim.sequence[0] ? (this.currentAnim = this.anims.off, ig.soundHandler.sfxPlayer.mute(!0), ig.game.storage.set("sfxMute", !0)) : (this.currentAnim = this.anims.on, ig.soundHandler.sfxPlayer.unmute(!0), ig.game.storage.set("sfxMute", !1))))
},
draw: function() {
this.parent()
},
posChange: function() {},
posBack: function() {}
})
});
ig.baked = !0;
ig.module("game.entities.menu.button-bgm").requires("impact.entity").defines(function() {
EntityButtonBgm = ig.Entity.extend({
size: {
x: 42,
y: 42
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/btmusic.png", 42, 42),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("on", 1, [0]);
this.addAnim("off", 1, [1]);
this.currentAnim = this.anims.on;
ig.game.storage.get("bgmMute") ? (this.currentAnim = this.anims.off, ig.soundHandler.bgmPlayer.mute(!0)) :
(this.currentAnim = this.anims.on, ig.soundHandler.bgmPlayer.unmute(!0))
},
clicked: function() {
"ask" == ig.game.popupOpen || "popupshop" == ig.game.popupOpen || (this.small = !0)
},
bigAgain: function() {},
endUp: function() {},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"),
0 == this.currentAnim.sequence[0] ? (this.currentAnim = this.anims.off, ig.game.storage.set("bgmMute", !0), ig.soundHandler.bgmPlayer.mute(!0)) : (this.currentAnim = this.anims.on, ig.game.storage.set("bgmMute", !1), ig.soundHandler.bgmPlayer.unmute(!0))))
},
draw: function() {
this.parent()
},
posChange: function() {},
posBack: function() {}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.money").requires("impact.entity").defines(function() {
EntityMoney = ig.Entity.extend({
size: {
x: 110,
y: 43
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/money.png", 110, 43),
gravityFactor: 0,
name: "btgo",
modeShop: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.count = ig.game.spawnEntity(EntityText, this.pos.x + 42, this.pos.y + 27, {
name: "count",
text: "$ 0",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 18,
textAlign: "left",
zIndex: this.zIndex + 1,
gravityFactor: 0
})
},
update: function() {
this.parent();
this.count.text = "$ " + ig.game.gameMoney.toString();
this.modeShop ? this.count.pos = {
x: this.pos.x + 42,
y: this.pos.y + 27
} : this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y + ig.game.screen.y
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.menu.popup-shop").requires("impact.entity", "game.entities.gameplay.money").defines(function() {
EntityPopupShop = ig.Entity.extend({
size: {
x: 593,
y: 360
},
gravityFactor: 0,
realpos: {
x: 90,
y: 0
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/shopbg2.png", 593, 360),
type: ig.Entity.TYPE.B,
clickcount: 0,
button: [],
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
ig.game.popupOpen = "popupshop";
this.more = ig.game.getEntitiesByType(EntityButtonMoreGames)[0];
this.more.hide();
this.title = ig.game.spawnEntity(EntityText, this.pos.x + 440, this.pos.y + 60, {
name: "title",
text: "Hats",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 34,
textAlign: "center",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.btclose = ig.game.spawnEntity(EntityButtonClosePopup, this.pos.x + this.size.x, this.pos.y + 30, {
zIndex: this.zIndex + 2,
gravityFactor: 0
});
this.btprev = ig.game.spawnEntity(EntityButtonPrev, this.pos.x + 25, this.pos.y + 135, {
zIndex: this.zIndex + 2,
gravityFactor: 0
});
this.btnext =
ig.game.spawnEntity(EntityButtonNext, this.pos.x + 500, this.pos.y + 135, {
zIndex: this.zIndex + 2,
gravityFactor: 0
});
this.moneyboard = ig.game.spawnEntity(EntityMoney, this.pos.x + 30, this.pos.y + 30, {
zIndex: this.zIndex + 2,
modeShop: !0,
gravityFactor: 0
});
this.hat1 = ig.game.spawnEntity(EntityHat1, this.pos.x + 50, this.pos.y - 300, {
zIndex: this.zIndex + 2,
gravityFactor: 0
});
this.hat2 = ig.game.spawnEntity(EntityHat2, this.pos.x + 150, this.pos.y - 300, {
zIndex: this.zIndex + 2,
gravityFactor: 0
});
this.hat3 = ig.game.spawnEntity(EntityHat3, this.pos.x +
250, this.pos.y - 300, {
zIndex: this.zIndex + 2,
gravityFactor: 0
});
this.hat4 = ig.game.spawnEntity(EntityHat4, this.pos.x + 350, this.pos.y - 300, {
zIndex: this.zIndex + 2,
gravityFactor: 0
});
this.hat5 = ig.game.spawnEntity(EntityHat5, this.pos.x + 450, this.pos.y - 300, {
zIndex: this.zIndex + 2,
gravityFactor: 0
});
this.hat6 = ig.game.spawnEntity(EntityHat6, this.pos.x + 550, this.pos.y - 300, {
zIndex: this.zIndex + 2,
gravityFactor: 0
});
this.button.push(this.hat1);
this.button.push(this.hat2);
this.button.push(this.hat3);
this.button.push(this.hat4);
this.button.push(this.hat5);
this.button.push(this.hat6);
ig.game.sortEntitiesDeferred();
this.getIn()
},
setButtonPos: function() {
for (i = 0; 2 >= i; i++) {
var b = ig.game.posVal[i];
try {
this.button[b - 1].pos.x = ig.game.posHats[i].x + this.pos.x + this.button[b - 1].ofset, this.button[b - 1].pos.y = ig.game.posHats[i].y + this.pos.y + this.button[b - 1].ofset
} catch (c) {}
}
},
getIn: function() {
this.tween({
pos: {
x: 184,
y: this.pos.y
}
}, 0.7, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.endGetIn()
}.bind(this)
}).start()
},
endGetIn: function() {},
getOut: function() {
this.tween({
pos: {
x: -900,
y: this.pos.y
}
}, 0.7, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.close()
}.bind(this)
}).start()
},
draw: function() {
this.parent()
},
update: function() {
this.parent();
this.title.pos.x = this.pos.x + 296;
this.btclose.pos.x = this.pos.x + this.size.x - 85;
this.moneyboard.pos.x = this.pos.x + 25;
this.btprev.pos = {
x: this.pos.x + 35 + this.btprev.ofset,
y: this.pos.y + 135 + this.btprev.ofset
};
this.btnext.pos = {
x: this.pos.x + 500 + this.btnext.ofset,
y: this.pos.y + 135 + this.btnext.ofset
};
this.setButtonPos()
},
close: function() {
ig.game.popupOpen = "";
this.title.kill();
this.btclose.kill();
this.moneyboard.kill();
this.hat1.kill();
this.hat2.kill();
this.hat3.kill();
this.hat4.kill();
this.hat5.kill();
this.hat6.kill();
this.btnext.kill();
this.btprev.kill();
this.more.show();
this.kill()
}
})
});
ig.baked = !0;
ig.module("game.entities.menu.button-close-popup").requires("impact.entity").defines(function() {
EntityButtonClosePopup = ig.Entity.extend({
size: {
x: 55,
y: 55
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/bt_close_popup.png", 55, 55),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
this.small ?
(this.small = !1, this.big = !0) : this.big && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"), ig.game.getEntitiesByType(EntityPopupShop)[0].getOut())
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.menu.hat").requires("impact.entity").defines(function() {
EntityHat1 = ig.Entity.extend({
size: {
x: 80,
y: 79
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/hat_empty.png", 80, 79),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.setAnim()
},
setAnim: function() {
this.currentAnim = 1 == ig.game.storage.get("hat") ? this.anims.hover : this.anims.idle
},
clicked: function() {
this.small = !0
},
released: function() {},
over: function() {
this.currentAnim = this.anims.hover
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), ig.game.storage.set("hat", 1), ig.game.playerChar = 1, this.setAnim(), this.otherAnim()))
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityHat2)[0].currentAnim = ig.game.getEntitiesByType(EntityHat2)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat3)[0].currentAnim = ig.game.getEntitiesByType(EntityHat3)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat4)[0].currentAnim = ig.game.getEntitiesByType(EntityHat4)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat5)[0].currentAnim = ig.game.getEntitiesByType(EntityHat5)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat6)[0].currentAnim = ig.game.getEntitiesByType(EntityHat6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityHat2 = ig.Entity.extend({
size: {
x: 80,
y: 81
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/hat_black.png", 80, 81),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 100,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 110, {
name: "price",
text: "$ 100",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim = 2 == ig.game.storage.get("hat") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("hatlock2") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("hatlock2") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("hatlock2") || (this.currentAnim = this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), 0 == ig.game.storage.get("hatlock2") && (ig.game.storage.set("hatlock2", 1), b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money", b)), ig.game.storage.set("hat", 2), ig.game.playerChar =
2, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x + 40 - this.ofset,
y: this.pos.y + 110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityHat1)[0].currentAnim = ig.game.getEntitiesByType(EntityHat1)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat3)[0].currentAnim = ig.game.getEntitiesByType(EntityHat3)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat4)[0].currentAnim = ig.game.getEntitiesByType(EntityHat4)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat5)[0].currentAnim = ig.game.getEntitiesByType(EntityHat5)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat6)[0].currentAnim = ig.game.getEntitiesByType(EntityHat6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityHat3 = ig.Entity.extend({
size: {
x: 80,
y: 82
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/hat_bunny.png", 80, 82),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 200,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40,
this.pos.y + 110, {
name: "price",
text: "$ 200",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim = 3 == ig.game.storage.get("hat") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("hatlock3") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("hatlock3") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue &&
0 == ig.game.storage.get("hatlock3") || (this.currentAnim = this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), 0 == ig.game.storage.get("hatlock3") && (ig.game.storage.set("hatlock3", 1),
b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money", b)), ig.game.storage.set("hat", 3), ig.game.playerChar = 3, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x + 40 - this.ofset,
y: this.pos.y + 110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityHat1)[0].currentAnim = ig.game.getEntitiesByType(EntityHat1)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat2)[0].currentAnim = ig.game.getEntitiesByType(EntityHat2)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat4)[0].currentAnim =
ig.game.getEntitiesByType(EntityHat4)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat5)[0].currentAnim = ig.game.getEntitiesByType(EntityHat5)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat6)[0].currentAnim = ig.game.getEntitiesByType(EntityHat6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityHat4 = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/hat_witch.png", 80, 80),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 300,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 110, {
name: "price",
text: "$ 300",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim = 4 == ig.game.storage.get("hat") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("hatlock4") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney <
this.pricevalue && 0 == ig.game.storage.get("hatlock4") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("hatlock4") || (this.currentAnim = this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b),
1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), 0 == ig.game.storage.get("hatlock4") && (ig.game.storage.set("hatlock4", 1), b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money", b)), ig.game.storage.set("hat", 4), ig.game.playerChar = 4, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x + 40 - this.ofset,
y: this.pos.y + 110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityHat1)[0].currentAnim = ig.game.getEntitiesByType(EntityHat1)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat2)[0].currentAnim = ig.game.getEntitiesByType(EntityHat2)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat3)[0].currentAnim = ig.game.getEntitiesByType(EntityHat3)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat5)[0].currentAnim = ig.game.getEntitiesByType(EntityHat5)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat6)[0].currentAnim = ig.game.getEntitiesByType(EntityHat6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityHat5 = ig.Entity.extend({
size: {
x: 80,
y: 79
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/hat_pirate.png", 80, 79),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 400,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 110, {
name: "price",
text: "$ 400",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim =
5 == ig.game.storage.get("hat") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("hatlock5") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("hatlock5") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("hatlock5") || (this.currentAnim = this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset +=
1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), 0 == ig.game.storage.get("hatlock5") && (ig.game.storage.set("hatlock5", 1), b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money", b)), ig.game.storage.set("hat", 5), ig.game.playerChar = 5, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x +
40 - this.ofset,
y: this.pos.y + 110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityHat1)[0].currentAnim = ig.game.getEntitiesByType(EntityHat1)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat2)[0].currentAnim = ig.game.getEntitiesByType(EntityHat2)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat3)[0].currentAnim = ig.game.getEntitiesByType(EntityHat3)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat4)[0].currentAnim = ig.game.getEntitiesByType(EntityHat4)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat6)[0].currentAnim =
ig.game.getEntitiesByType(EntityHat6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityHat6 = ig.Entity.extend({
size: {
x: 80,
y: 79
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/hat_chrown.png", 80, 79),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 500,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 110, {
name: "price",
text: "$ 500",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim = 6 == ig.game.storage.get("hat") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("hatlock6") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("hatlock6") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("hatlock6") || (this.currentAnim = this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), 0 == ig.game.storage.get("hatlock6") && (ig.game.storage.set("hatlock6", 1), b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money",
b)), ig.game.storage.set("hat", 6), ig.game.playerChar = 6, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x + 40 - this.ofset,
y: this.pos.y + 110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityHat1)[0].currentAnim = ig.game.getEntitiesByType(EntityHat1)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat2)[0].currentAnim = ig.game.getEntitiesByType(EntityHat2)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat3)[0].currentAnim = ig.game.getEntitiesByType(EntityHat3)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat4)[0].currentAnim =
ig.game.getEntitiesByType(EntityHat4)[0].anims.idle;
ig.game.getEntitiesByType(EntityHat5)[0].currentAnim = ig.game.getEntitiesByType(EntityHat5)[0].anims.idle
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.menu.ball-shop").requires("impact.entity").defines(function() {
EntityBallShop1 = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/ball_1.png", 80, 80),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.setAnim()
},
setAnim: function() {
this.currentAnim = 1 == ig.game.storage.get("ballshop") ? this.anims.hover : this.anims.idle
},
clicked: function() {
this.small = !0
},
released: function() {},
over: function() {
this.currentAnim = this.anims.hover
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.game.storage.set("ballshop", 1), ig.game.maxpower = 35, this.setAnim(), this.otherAnim()))
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityBallShop2)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop2)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop3)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop3)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop4)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop4)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop5)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop5)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop6)[0].currentAnim =
ig.game.getEntitiesByType(EntityBallShop6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityBallShop2 = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/ball_2.png", 80, 80),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 100,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 110, {
name: "price",
text: "$ 100",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim = 2 == ig.game.storage.get("ballshop") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("balllock2") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("balllock2") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("balllock2") || (this.currentAnim =
this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, 0 == ig.game.storage.get("balllock2") && (ig.game.storage.set("balllock2", 1), b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money",
b)), ig.game.storage.set("ballshop", 2), ig.game.maxpower = 40, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x + 40 - this.ofset,
y: this.pos.y + 110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityBallShop1)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop1)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop3)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop3)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop4)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop4)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop5)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop5)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop6)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityBallShop3 = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/ball_3.png", 80, 80),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 200,
init: function(b, c, d) {
this.parent(b,
c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 110, {
name: "price",
text: "$ 200",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim = 3 == ig.game.storage.get("ballshop") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("balllock3") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney < this.pricevalue &&
0 == ig.game.storage.get("balllock3") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("balllock3") || (this.currentAnim = this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big =
this.small = !1, 0 == ig.game.storage.get("balllock3") && (ig.game.storage.set("balllock3", 1), b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money", b)), ig.game.storage.set("ballshop", 3), ig.game.maxpower = 45, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x + 40 - this.ofset,
y: this.pos.y + 110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityBallShop1)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop1)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop2)[0].currentAnim =
ig.game.getEntitiesByType(EntityBallShop2)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop4)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop4)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop5)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop5)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop6)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityBallShop4 = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/ball_4.png", 80, 80),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 300,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 110, {
name: "price",
text: "$ 300",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim = 4 ==
ig.game.storage.get("ballshop") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("balllock4") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("balllock4") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("balllock4") || (this.currentAnim = this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, 0 == ig.game.storage.get("balllock4") && (ig.game.storage.set("balllock4", 1), b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money", b)), ig.game.storage.set("ballshop", 4), ig.game.maxpower = 50, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x + 40 - this.ofset,
y: this.pos.y +
110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityBallShop1)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop1)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop2)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop2)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop3)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop3)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop5)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop5)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop6)[0].currentAnim =
ig.game.getEntitiesByType(EntityBallShop6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityBallShop5 = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/ball_5.png", 80, 80),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 400,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 110, {
name: "price",
text: "$ 400",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim = 5 == ig.game.storage.get("ballshop") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("balllock5") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("balllock5") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("balllock5") || (this.currentAnim =
this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, 0 == ig.game.storage.get("balllock5") && (ig.game.storage.set("balllock5", 1), b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money",
b)), ig.game.storage.set("ballshop", 5), ig.game.maxpower = 55, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x + 40 - this.ofset,
y: this.pos.y + 110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityBallShop1)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop1)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop2)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop2)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop3)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop3)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop4)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop4)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop6)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop6)[0].anims.idle
},
draw: function() {
this.parent()
}
});
EntityBallShop6 = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/ball_6.png", 80, 80),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
pricevalue: 500,
init: function(b, c, d) {
this.parent(b,
c, d);
this.addAnim("idle", 1, [1]);
this.addAnim("hover", 1, [0]);
this.price = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 110, {
name: "price",
text: "$ 500",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 20,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.setAnim()
},
setAnim: function() {
this.currentAnim = 6 == ig.game.storage.get("ballshop") ? this.anims.hover : this.anims.idle;
1 == ig.game.storage.get("balllock6") && (this.price.text = "")
},
clicked: function() {
ig.game.gameMoney < this.pricevalue &&
0 == ig.game.storage.get("balllock6") || (this.small = !0)
},
released: function() {},
over: function() {
ig.game.gameMoney < this.pricevalue && 0 == ig.game.storage.get("balllock6") || (this.currentAnim = this.anims.hover)
},
leave: function() {
this.setAnim()
},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big =
this.small = !1, 0 == ig.game.storage.get("balllock6") && (ig.game.storage.set("balllock6", 1), b = ig.game.storage.get("money"), b -= this.pricevalue, ig.game.gameMoney = b, ig.game.storage.set("money", b)), ig.game.storage.set("ballshop", 6), ig.game.maxpower = 60, this.setAnim(), this.otherAnim()));
this.price.pos = {
x: this.pos.x + 40 - this.ofset,
y: this.pos.y + 110 - this.ofset
}
},
otherAnim: function() {
ig.game.getEntitiesByType(EntityBallShop1)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop1)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop2)[0].currentAnim =
ig.game.getEntitiesByType(EntityBallShop2)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop3)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop3)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop4)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop4)[0].anims.idle;
ig.game.getEntitiesByType(EntityBallShop5)[0].currentAnim = ig.game.getEntitiesByType(EntityBallShop5)[0].anims.idle
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.menu.button-next-prev").requires("impact.entity").defines(function() {
EntityButtonPrev = ig.Entity.extend({
size: {
x: 56,
y: 94
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/arrow_left.png", 56, 94),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
ready: function() {
this.posChange()
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else if (this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), b = ig.game.getEntitiesByType(EntityPopupShop)[0], 4 <= ig.game.posVal[2])))
for (i = 0; 2 >= i; i++) b.button[ig.game.posVal[i] - 1].pos.y = -300, ig.game.posVal[i] -= 1
},
draw: function() {
this.parent()
}
});
EntityButtonNext = ig.Entity.extend({
size: {
x: 54,
y: 91
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/arrow_right.png", 54, 91),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
ready: function() {
this.posChange()
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1,
this.big = !0)
} else if (this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), b = ig.game.getEntitiesByType(EntityPopupShop)[0], 4 > ig.game.posVal[0])))
for (i = 0; 2 >= i; i++) b.button[ig.game.posVal[i] - 1].pos.y = -300, ig.game.posVal[i] += 1
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.menu.button-tutorial").requires("impact.entity").defines(function() {
EntityButtonTutorial = ig.Entity.extend({
size: {
x: 42,
y: 42
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/bttutorial.png", 42, 42),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
"" == ig.game.popupOpen && (this.small = !0)
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, _SETTINGS.MoreGames.Disabled && ig.game.getEntitiesByType(EntityButtonMoreGames)[0].hide(), ig.soundHandler.sfxPlayer.play("button1"), ig.game.levelNow = 11, ig.game.loadLevel(LevelDemo)))
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.levels.menu").requires("impact.image", "game.entities.pointer", "game.entities.menu.menu-background", "game.entities.menu.button-play", "game.entities.buttons.button-more-games", "game.entities.menu.button-shop", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.menu.popup-shop", "game.entities.menu.button-close-popup", "game.entities.menu.hat", "game.entities.menu.ball-shop", "game.entities.menu.button-next-prev", "game.entities.menu.button-tutorial").defines(function() {
LevelMenu = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityMenuBackground",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityMenuLogo",
x: 170,
y: -400,
settings: {
zIndex: 2
}
}, {
type: "EntityButtonPlay",
x: 400,
y: 650,
settings: {
zIndex: 5
}
}, {
type: "EntityButtonMoreGames",
x: -4,
y: 450,
settings: {
zIndex: 5
}
}, {
type: "EntityButtonShop",
x: 1040,
y: 450,
settings: {
zIndex: 5
}
}, {
type: "EntityButtonSfx",
x: 10,
y: 10,
settings: {
zIndex: 5
}
}, {
type: "EntityButtonBgm",
x: 10,
y: 60,
settings: {
zIndex: 5
}
}, {
type: "EntityButtonTutorial",
x: 900,
y: 10,
settings: {
zIndex: 5
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.entities.gameplay.background").requires("impact.entity").defines(function() {
EntityBackground1 = ig.Entity.extend({
size: {
x: 1167,
y: 547
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/background_1.png", 1167, 547),
bgleft: new ig.Image("media/graphics/gameplay/background_1.png"),
cloud1: new ig.Image("media/graphics/gameplay/cloud1.png"),
cloud2: new ig.Image("media/graphics/gameplay/cloud2.png"),
cloud3: new ig.Image("media/graphics/gameplay/cloud3.png"),
cornerbg: new ig.Image("media/graphics/gameplay/cornerbg.png"),
Offset: 0,
gravityFactor: 0,
realpos: {
x: 0,
y: 0
},
init: function(b, c, d) {
this.parent(b, c, d);
if (ig.global.wm) return !1;
this.cloud1x = 450;
this.cloud2x = 750;
this.cloud3x = 100;
11 != ig.game.levelNow && (this.hole1 = ig.game.spawnEntity(EntityText, 0, 0, {
name: "hole",
text: _STRINGS.Game.Hole + " : " + ig.game.levelNow.toString(),
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 18,
textAlign: "center",
zIndex: this.zIndex + 100,
gravityFactor: 0
}), this.par1 = ig.game.spawnEntity(EntityText, 0, 0, {
name: "par",
text: _STRINGS.Game.Par + " : " + ig.game.valpar[ig.game.levelNow -
1].toString(),
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 18,
textAlign: "center",
zIndex: this.zIndex + 100,
gravityFactor: 0
}), this.strokes1 = ig.game.spawnEntity(EntityText, 0, 0, {
name: "strokes",
text: _STRINGS.Game.Strokes + " : " + ig.game.ballhit.toString(),
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 17,
textAlign: "center",
zIndex: this.zIndex + 100,
gravityFactor: 0
}))
},
ready: function() {
this.shadow = ig.game.getEntitiesByType(EntityBallShadow)[0]
},
draw: function() {
this.parent();
if (ig.global.wm) return !1;
this.bgleft.draw(0, 0);
this.bgleft.draw(this.pos.x + this.size.x - 500, 0);
this.cloud1.draw(this.cloud1x, 60);
this.cloud2.draw(this.cloud2x, 30);
this.cloud3.draw(this.cloud3x, 30);
11 != ig.game.levelNow && (this.cornerbg.draw(10, 10), this.cornerbg.draw(120, 10), this.cornerbg.draw(230, 10))
},
update: function() {
if (ig.global.wm) return !1;
this.pos = {
x: this.realpos.x,
y: this.realpos.y
};
11 != ig.game.levelNow && (this.hole1.pos = {
x: this.pos.x + 66,
y: this.pos.y + 37
}, this.par1.pos = {
x: this.pos.x + 176,
y: this.pos.y + 37
}, this.strokes1.pos = {
x: this.pos.x + 285,
y: this.pos.y + 37
}, this.strokes1.text = _STRINGS.Game.Strokes + " : " + ig.game.ballhit.toString());
"" == ig.game.popupOpen && (this.cloud1x += 0.15, 960 < this.cloud1x && (this.cloud1x = -144), this.cloud2x += 0.15, 960 < this.cloud2x && (this.cloud2x = -144), this.cloud3x += 0.15, 960 < this.cloud3x && (this.cloud3x = -144))
},
endlevel: function() {
this.hole1.kill();
this.par1.kill();
this.strokes1.kill()
}
});
EntityBackground2 = ig.Entity.extend({
size: {
x: 1167,
y: 547
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/background_2.png",
1167, 547),
back2: new ig.Image("media/graphics/gameplay/background_2.png"),
Offset: 0,
gravityFactor: 0,
realpos: {
x: 0,
y: 0
},
init: function(b, c, d) {
this.parent(b, c, d)
},
draw: function() {
this.parent();
this.back2.draw(0, 0)
},
update: function() {
this.parent();
this.pos = {
x: this.realpos.x,
y: this.realpos.y
}
}
});
EntityBackground3 = ig.Entity.extend({
size: {
x: 1167,
y: 547
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/background_3.png", 1167, 547),
bg1: new ig.Image("media/graphics/gameplay/background_3.png"),
realpos: {
x: 0,
y: 0
},
gravityFactor: 0,
init: function(b, c, d) {
this.parent(b, c, d)
},
draw: function() {
this.parent();
this.bg1.draw(this.pos.x, this.pos.y)
},
update: function() {
this.parent();
this.pos = {
x: this.realpos.x,
y: this.realpos.y
}
}
});
EntityBackgroundDark = ig.Entity.extend({
size: {
x: 960,
y: 540
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/darkbg.png", 960, 540),
Offset: 0,
gravityFactor: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
draw: function() {
this.parent()
},
update: function() {
this.parent();
this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y + ig.game.screen.y
}
}
});
EntityBackgroundDarkRes = ig.Entity.extend({
size: {
x: 349,
y: 263
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/popuppausebg.png", 349, 263),
Offset: 0,
gravityFactor: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
draw: function() {
this.parent()
},
update: function() {
this.parent();
this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y +
ig.game.screen.y
}
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.player").requires("impact.entity").defines(function() {
EntityPlayer = ig.Entity.extend({
size: {
x: 67,
y: 80
},
hit1: new ig.AnimationSheet("media/graphics/gameplay/player/hit1.png", 67, 80),
hit1rev: new ig.AnimationSheet("media/graphics/gameplay/player/hit1rev.png", 67, 80),
hit1low: new ig.AnimationSheet("media/graphics/gameplay/player/hit1low.png", 67, 80),
hit1lowrev: new ig.AnimationSheet("media/graphics/gameplay/player/hit1lowrev.png", 67, 80),
hit2: new ig.AnimationSheet("media/graphics/gameplay/player/hit2.png", 67,
80),
hit2rev: new ig.AnimationSheet("media/graphics/gameplay/player/hit2rev.png", 67, 80),
hit2low: new ig.AnimationSheet("media/graphics/gameplay/player/hit2low.png", 67, 80),
hit2lowrev: new ig.AnimationSheet("media/graphics/gameplay/player/hit2lowrev.png", 67, 80),
hit3: new ig.AnimationSheet("media/graphics/gameplay/player/hit6.png", 67, 80),
hit3rev: new ig.AnimationSheet("media/graphics/gameplay/player/hit6rev.png", 67, 80),
hit3low: new ig.AnimationSheet("media/graphics/gameplay/player/hit6low.png", 67, 80),
hit3lowrev: new ig.AnimationSheet("media/graphics/gameplay/player/hit6lowrev.png",
67, 80),
hit4: new ig.AnimationSheet("media/graphics/gameplay/player/hit4.png", 67, 80),
hit4rev: new ig.AnimationSheet("media/graphics/gameplay/player/hit4rev.png", 67, 80),
hit4low: new ig.AnimationSheet("media/graphics/gameplay/player/hit4low.png", 67, 80),
hit4lowrev: new ig.AnimationSheet("media/graphics/gameplay/player/hit4lowrev.png", 67, 80),
hit5: new ig.AnimationSheet("media/graphics/gameplay/player/hit5.png", 67, 80),
hit5rev: new ig.AnimationSheet("media/graphics/gameplay/player/hit5rev.png", 67, 80),
hit5low: new ig.AnimationSheet("media/graphics/gameplay/player/hit5low.png",
67, 80),
hit5lowrev: new ig.AnimationSheet("media/graphics/gameplay/player/hit5lowrev.png", 67, 80),
hit6: new ig.AnimationSheet("media/graphics/gameplay/player/hit3.png", 67, 80),
hit6rev: new ig.AnimationSheet("media/graphics/gameplay/player/hit3rev.png", 67, 80),
hit6low: new ig.AnimationSheet("media/graphics/gameplay/player/hit3low.png", 67, 80),
hit6lowrev: new ig.AnimationSheet("media/graphics/gameplay/player/hit3lowrev.png", 67, 80),
gravityFactor: 0,
tloop: null,
hitstatus: !1,
hitball: !1,
tloop: 0,
lowhit: !1,
inStatus: !1,
beforeHit: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.setPlayerChar();
this.lr = 1
},
setPlayerChar: function() {
1 == ig.game.playerChar ? (this.hit = this.hit1, this.hitrev = this.hit1rev, this.hitlow = this.hit1low, this.hitlowrev = this.hit1lowrev) : 2 == ig.game.playerChar ? (this.hit = this.hit2, this.hitrev = this.hit2rev, this.hitlow = this.hit2low, this.hitlowrev = this.hit2lowrev) : 3 == ig.game.playerChar ? (this.hit = this.hit3, this.hitrev = this.hit3rev, this.hitlow = this.hit3low, this.hitlowrev = this.hit3lowrev) : 4 == ig.game.playerChar ?
(this.hit = this.hit4, this.hitrev = this.hit4rev, this.hitlow = this.hit4low, this.hitlowrev = this.hit4lowrev) : 5 == ig.game.playerChar ? (this.hit = this.hit5, this.hitrev = this.hit5rev, this.hitlow = this.hit5low, this.hitlowrev = this.hit5lowrev) : 6 == ig.game.playerChar && (this.hit = this.hit6, this.hitrev = this.hit6rev, this.hitlow = this.hit6low, this.hitlowrev = this.hit6lowrev);
this.animSheet = this.hit;
this.addAnim("idle", 0.5, [0]);
this.addAnim("hit", 0.08, [0, 1, 2, 3, 4, 5, 6, 7, 8]);
this.currentAnim = this.anims.idle
},
ready: function() {
this.dire =
ig.game.getEntitiesByType(EntityDirection)[0]
},
getDirection: function() {
0 > 180 * this.dire.currentAnim.angle / Math.PI ? 15 < ig.game.power ? (this.animSheet = this.hitrev, this.addAnim("idle", 0.5, [4]), this.addAnim("hit", 0.08, [4, 3, 2, 1, 0, 9, 8, 7, 6]), this.currentAnim = this.anims.hit, this.lowhit = !1) : (this.animSheet = this.hitlowrev, this.addAnim("idle", 0.5, [2]), this.addAnim("hit", 0.08, [2, 1, 0, 5, 4, 3, 2, 2, 2]), this.currentAnim = this.anims.hit, this.lowhit = !0) : 15 < ig.game.power ? (this.animSheet = this.hit, this.addAnim("idle", 0.5, [0]),
this.addAnim("hit", 0.08, [0, 1, 2, 3, 4, 5, 6, 7, 8]), this.currentAnim = this.anims.hit, this.lowhit = !1) : (this.animSheet = this.hitlow, this.addAnim("idle", 0.5, [0]), this.addAnim("hit", 0.08, [0, 1, 2, 3, 4, 5, 0, 0, 0]), this.currentAnim = this.anims.hit, this.lowhit = !0)
},
setpos: function() {
try {
this.ball = ig.game.getEntitiesByType(EntityBall)[0], !this.ball.moveX && !this.ball.moveY && (!this.inStatus && !this.dire.hide && !this.ball.ballFly) && (this.dire.showPlayer = !0, this.pos = {
x: this.ball.pos.x - 16,
y: this.ball.pos.y - 55
})
} catch (b) {}
},
update: function() {
this.parent();
if ("" == ig.game.popupOpen)
if (this.tloop != this.currentAnim.loopCount && (this.setpos(), this.tloop = this.currentAnim.loopCount), this.hitstatus && (this.getDirection(), this.currentAnim.rewind(), this.hitstatus = !1, this.beforeHit = !0), 8 == this.currentAnim.frame && (this.currentAnim = this.anims.idle), this.lowhit) {
if (5 == this.currentAnim.frame && this.hitball) {
var b = ig.game.getEntitiesByType(EntityBall)[0];
b.hit = !0;
this.beforeHit = this.hitball = !1;
ig.soundHandler.sfxPlayer.play("hit_low");
b = ig.game.getEntitiesByType(EntityButtonGo)[0];
b.beforeHit = !0
}
} else 6 == this.currentAnim.frame && this.hitball && (b = ig.game.getEntitiesByType(EntityBall)[0], b.hit = !0, this.beforeHit = this.hitball = !1, ig.soundHandler.sfxPlayer.play("hit_hight"), b = ig.game.getEntitiesByType(EntityButtonGo)[0], b.beforeHit = !0)
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("plugins.box2d.entity").requires("impact.entity", "plugins.box2d.game").defines(function() {
ig.Box2DEntity = ig.Entity.extend({
body: null,
angle: 0,
box2dType: null,
dynamicType: null,
density: null,
friction: null,
restitution: null,
rotate: 0,
previousBodyPosition: {
x: 0,
y: 0
},
previousBodyAngle: 0,
slowTime: 0,
init: function(b, c, d) {
this.parent(b, c, d);
ig.global.wm || this.createBody()
},
createBody: function() {
var b = new Box2D.Dynamics.b2BodyDef;
b.position = new Box2D.Common.Math.b2Vec2((this.pos.x + this.size.x / 2) * Box2D.SCALE, (this.pos.y + this.size.y / 2) * Box2D.SCALE);
this.previousBodyPosition = {
x: b.position.x,
y: b.position.y
};
this.angle && (b.angle = this.angle);
this.previousBodyAngle = b.angle;
null == this.dynamicType || 0 == this.dynamicType ? b.type = Box2D.Dynamics.b2Body.b2_dynamicBody : 1 == this.dynamicType ? b.type = Box2D.Dynamics.b2Body.b2_kinematicBody : 2 == this.dynamicType && (b.type = Box2D.Dynamics.b2Body.b2_staticBody);
this.body = ig.world.CreateBody(b);
this.body.entity = this;
b = this.fixture = new Box2D.Dynamics.b2FixtureDef;
null == this.box2dType ||
0 == this.box2dType ? (b.shape = new Box2D.Collision.Shapes.b2PolygonShape, b.shape.SetAsBox(this.size.x / 2 * Box2D.SCALE, this.size.y / 2 * Box2D.SCALE)) : 1 == this.box2dType ? (b.shape = new Box2D.Collision.Shapes.b2CircleShape, b.shape.SetRadius(this.size.x / 2 * Box2D.SCALE)) : 2 == this.box2dType && (b.shape = new Box2D.Collision.Shapes.b2PolygonShape, b.shape.SetAsArray(this.vertices, this.vertices.length));
this.density && (b.density = this.density);
this.friction && (b.friction = this.friction);
this.restitution && (b.restitution = this.restitution);
this.body.CreateFixture(b);
this.body.SetUserData(this)
},
update: function() {
var b = this.body.GetPosition();
this.previousBodyPosition = {
x: this.pos.x,
y: this.pos.y
};
this.pos = {
x: b.x / Box2D.SCALE - this.size.x / 2,
y: b.y / Box2D.SCALE - this.size.y / 2
};
this.previousBodyAngle = this.angle;
this.angle = this.body.GetAngle().round(2);
this.currentAnim && (this.currentAnim.update(), this.currentAnim.angle = this.angle)
},
beginContact: function() {},
endContact: function() {},
postSolve: function() {},
preSolve: function() {},
processCollisionQueues: function() {
for (var b in this.checkQueue) {
var c =
this.checkQueue[b];
0 < this.entityContactCount[b] ? this.check(c) : delete this.checkQueue[b]
}
for (var d in this.collideQueue)
for (b in this.collideQueue[d]) c = this.collideQueue[d][b], this.collideWith(c, d), delete this.collideQueue[d][b]
},
kill: function() {
this.body && ig.game.queueDestroyBody(this.body);
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.explode.boom").requires("impact.entity").defines(function() {
EntityBoom = ig.Entity.extend({
size: {
x: 10,
y: 10
},
type: ig.Entity.TYPE.B,
init: function(b, c, d) {
this.parent(b, c, d);
this.createstar()
},
createstar: function() {
this.direction = {
1: {
x: 60,
y: -60
},
2: {
x: 70,
y: -70
},
3: {
x: 80,
y: -80
},
4: {
x: 90,
y: -90
},
5: {
x: 100,
y: -100
},
6: {
x: 110,
y: -110
},
7: {
x: 120,
y: -120
},
8: {
x: 130,
y: -130
},
9: {
x: 140,
y: -140
},
10: {
x: 150,
y: -150
},
11: {
x: -60,
y: -60
},
12: {
x: -70,
y: -70
},
13: {
x: -80,
y: -80
},
14: {
x: -90,
y: -90
},
15: {
x: -100,
y: -100
},
16: {
x: -110,
y: -110
},
17: {
x: -120,
y: -120
},
18: {
x: -130,
y: -130
},
19: {
x: -140,
y: -140
},
20: {
x: -150,
y: -150
},
21: {
x: 10,
y: -140
},
22: {
x: 5,
y: -150
},
23: {
x: 10,
y: -160
},
24: {
x: 15,
y: -170
},
25: {
x: 20,
y: -180
},
26: {
x: 25,
y: -40
},
27: {
x: 30,
y: -50
},
28: {
x: 35,
y: -60
},
29: {
x: 40,
y: -70
},
30: {
x: 45,
y: -80
},
31: {
x: -5,
y: -40
},
32: {
x: -10,
y: -50
},
33: {
x: -15,
y: -60
},
34: {
x: -20,
y: -70
},
35: {
x: -25,
y: -80
},
36: {
x: -30,
y: -110
},
37: {
x: -35,
y: -120
},
38: {
x: -40,
y: -130
},
39: {
x: -45,
y: -140
},
40: {
x: -50,
y: -150
}
};
this.scaling = {
1: {
s: 0.3
},
2: {
s: 0.4
},
3: {
s: 0.5
},
4: {
s: 0.6
},
5: {
s: 0.7
},
6: {
s: 0.8
}
};
this.tweentime = {
1: {
s: 0.4
},
2: {
s: 0.5
},
3: {
s: 0.6
},
4: {
s: 0.7
},
5: {
s: 0.8
},
6: {
s: 0.9
},
7: {
s: 1
}
};
for (i = 1; 50 >= i; i++) {
var b = Math.floor(40 * Math.random() + 1),
c = Math.floor(40 * Math.random() + 1),
d = Math.floor(6 * Math.random() + 1),
e = Math.floor(7 * Math.random() + 1);
ig.game.spawnEntity(EntityStar, this.pos.x - 40, this.pos.y - 40, {
name: "star",
zIndex: this.zIndex + 2,
twen: {
x: this.pos.x + this.direction[b].x,
y: this.pos.y + this.direction[c].y
},
scaling: this.scaling[d].s,
tweentime: this.tweentime[e].s
})
}
},
update: function() {
this.parent()
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.explode.star").requires("impact.entity").defines(function() {
EntityStar = ig.Entity.extend({
size: {
x: 10,
y: 10
},
star1: new ig.AnimationSheet("media/graphics/gameplay/star/blue.png", 16, 16),
star2: new ig.AnimationSheet("media/graphics/gameplay/star/green.png", 16, 16),
star3: new ig.AnimationSheet("media/graphics/gameplay/star/purple.png", 22, 21),
star4: new ig.AnimationSheet("media/graphics/gameplay/star/white.png", 25, 24),
star5: new ig.AnimationSheet("media/graphics/gameplay/star/yellow.png", 16,
15),
type: ig.Entity.TYPE.B,
gobig: !0,
init: function(b, c, d) {
this.parent(b, c, d);
b = Math.floor(5 * Math.random() + 1);
1 == b ? this.animSheet = this.star1 : 2 == b ? this.animSheet = this.star2 : 3 == b ? this.animSheet = this.star3 : 4 == b ? this.animSheet = this.star4 : 5 == b && (this.animSheet = this.star5);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.setScale(d.scaling, d.scaling);
this.tx = d.twen.x;
this.ty = d.twen.y;
this.twt = d.tweentime;
this.posChange()
},
update: function() {
this.parent()
},
draw: function() {
this.parent()
},
posChange: function() {
this.tween({
pos: {
x: this.tx,
y: this.ty
}
}, this.twt, {
easing: ig.Tween.Easing.Sinusoidal.EaseIn,
onComplete: function() {
this.endTween()
}.bind(this)
}).start()
},
endTween: function() {
this.kill()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.ball").requires("impact.entity", "plugins.box2d.entity", "game.entities.explode.boom", "game.entities.explode.star").defines(function() {
EntityBall = ig.Box2DEntity.extend({
size: {
x: 36,
y: 36
},
type: ig.Entity.TYPE.B,
checkAgainst: ig.Entity.TYPE.B,
animSheet1: new ig.AnimationSheet("media/graphics/gameplay/ball/ballwhite.png", 36, 36),
box2dType: 2,
dynamicType: 0,
density: 0.5,
friction: 2,
restitution: 0.4,
mass: 0.5,
INERTIA: 0,
ANGULAR_DAMPING: 0.715,
vertices: circlevertices(0.5),
name: "EntityBall",
hit: !1,
moveX: !0,
moveY: !0,
tempX: null,
tempY: null,
angle: -45,
tloop: 0,
firstpos: {
x: 0,
y: 0
},
outscreen: !0,
intoWater: !0,
water: null,
holepos: {
1: {
x: 973,
y: 288
},
2: {
x: 983,
y: 348
},
3: {
x: 983,
y: 348
},
4: {
x: 110,
y: 284
},
5: {
x: 986,
y: 205
},
6: {
x: 958,
y: 416
},
7: {
x: 955,
y: 410
},
8: {
x: 1008,
y: 270
},
9: {
x: 347,
y: 210
},
10: {
x: 367,
y: 390
},
11: {
x: 973,
y: 288
}
},
lastpos: {
x: 0,
y: 0
},
tball: !1,
ballFly: !1,
init: function(b, c, d) {
this.parent(b, c, d);
if (ig.global.wm) return !1;
1 == ig.game.storage.get("ballshop") && (this.animSheet = this.animSheet1);
1 == ig.game.storage.get("ballshop") ?
this.addAnim("idle", 0.5, [0]) : this.addAnim("idle", 0.1, [0, 1, 2, 3, 4, 5, 6, 7, 8]);
this.currentAnim = this.anims.idle;
this.firstpos = this.pos;
this.aa = 0
},
ready: function() {
this.control = ig.game.getEntitiesByType(EntityControl)[0];
this.drag = ig.game.getEntitiesByType(EntityScreenDrag)[0]
},
beginContact: function(b, c) {
if (c) {
this.ballFly = !1;
var d = 0.0050 * -this.body.GetLinearVelocity().x,
e = 0.0050 * -this.body.GetLinearVelocity().y;
this.body.ApplyImpulse({
x: d,
y: e
}, this.body.GetPosition());
0.23 > this.body.GetLinearVelocity().Length() &&
this.body.SetAwake(!1)
}
},
endContact: function() {
this.ballFly = !0
},
getMove: function() {
this.moveX = 0.7 >= Math.abs(this.body.m_linearVelocity.x) ? !1 : !0;
this.moveY = 0.7 >= Math.abs(this.body.m_linearVelocity.y) ? !1 : !0
},
update: function() {
this.parent();
if (ig.global.wm) return !1;
if ("" == ig.game.popupOpen) {
this.hit && (this.hit = !1, ig.game.camfollow = 0, this.setStrength());
this.tloop != this.currentAnim.loopCount && (this.getMove(), this.tloop = this.currentAnim.loopCount);
if ((1300 < this.pos.x || -50 > this.pos.x || 900 < this.pos.y) &&
this.outscreen && !ig.game.intoWater) this.message(), this.reset(), this.outscreen = !1;
this.pos.x >= this.holepos[ig.game.levelNow].x - 1 && this.pos.x <= this.holepos[ig.game.levelNow].x + 1 && (this.pos.y >= this.holepos[ig.game.levelNow].y - 1 && this.pos.y <= this.holepos[ig.game.levelNow].y + 1) && (ig.game.getEntitiesByType(EntityPlayer)[0].inStatus = !0, ig.game.popupOpen = "popupresult", ig.soundHandler.sfxPlayer.play("hole"), this.boom = ig.game.spawnEntity(EntityBoom, this.pos.x + 50, this.pos.y + 35, {
name: "boom",
zIndex: this.zIndex +
20
}), 11 == ig.game.levelNow ? (this.tball = !0, ig.game.storage.set("firstPlay", !1)) : setTimeout(function() {
ig.game.spawnEntity(EntityPopupResult, 0, 0, {
zIndex: 150,
realpos: {
x: 0,
y: 0
}
})
}, 1E3), this.resetWin())
}
},
reset: function() {
this.shadow = ig.game.spawnEntity(EntityBall, this.lastpos.x, this.lastpos.y, {
zIndex: 54
});
this.shadow.drag = ig.game.getEntitiesByType(EntityScreenDrag)[0];
this.kill();
ig.game.sortEntitiesDeferred();
ig.game.camfollow = 0;
try {
this.control.fnSetCamera(this.shadow)
} catch (b) {}
},
resetWin: function() {
this.shadow =
ig.game.spawnEntity(EntityBall, this.pos.x + 30, this.pos.y - 30, {
zIndex: 54
});
this.shadow.drag = ig.game.getEntitiesByType(EntityScreenDrag)[0];
try {
this.control.fnSetCamera(this.shadow)
} catch (b) {}
this.kill();
this.zIndex = 0;
this.shadow.zIndex = 0;
ig.game.getEntitiesByType(EntityPlayer);
ig.game.getEntitiesByType(EntityDirection)[0].zIndex = 0;
ig.game.sortEntitiesDeferred();
ig.game.box2dPaused = !0
},
draw: function() {
this.parent()
},
setStrength: function() {
this.lastpos = this.pos;
this.ballFly = !0;
this.drag.firstTimeClicked = !1;
var b = ig.game.getEntitiesByType(EntityWater)[0];
b.ball = this;
b.intoWater = !0;
ig.game.intoWater = !1;
ig.game.ballhit += 1;
var c = ig.game.power,
d = ig.game.getEntitiesByType(EntityDirection)[0].currentAnim.angle;
this.angle = -(90 - 180 * d / Math.PI);
d = this.angle * Math.PI / 180;
b = c * Math.cos(d);
c *= Math.sin(d);
b = new Box2D.Common.Math.b2Vec2(b, c);
this.body.ApplyImpulse(b, this.body.GetPosition())
},
message: function() {
this.msg = ig.game.spawnEntity(EntityText, 480, -50, {
name: "msg",
text: _STRINGS.Game.Area,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "center",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.msg.tween({
pos: {
y: 275
}
}, 0.8, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.hidemessage()
}.bind(this)
}).start()
},
hidemessage: function() {
this.msg.tween({
pos: {
y: 560
}
}, 0.8, {
easing: ig.Tween.Easing.Quartic.EaseIn,
onComplete: function() {
this.endmessage()
}.bind(this)
}).start()
},
endmessage: function() {
this.msg.kill()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.black-bar").requires("impact.entity").defines(function() {
EntityBlackBar = ig.Entity.extend({
size: {
x: 173,
y: 169
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/blackbar.png", 173, 169),
gravityFactor: 0,
name: "btblack",
offseth: 0,
offsetw: 0,
addh: !1,
direction: !0,
delaydown: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.offsetw = 176;
this.const = ig.game.maxpower / 169;
this.greenbar = ig.game.spawnEntity(EntityGreenBar,
this.pos.x + 1, this.pos.y + 3, {
zIndex: this.zIndex - 1,
realpos: {
x: this.pos.x + 1,
y: this.pos.y + 3
}
});
ig.game.sortEntitiesDeferred()
},
update: function() {
this.parent();
"" == ig.game.popupOpen && (this.addh ? (this.delaydown = !1, this.direction ? (169 > this.offseth && (this.offseth += 1.5), 0 > this.greenbar.angle ? this.greenbar.angle += 1 : this.direction = !1) : (0 < this.offseth && (this.offseth -= 1.5), -120 < this.greenbar.angle ? this.greenbar.angle -= 1 : this.direction = !0)) : this.delaydown && (0 < this.offseth && (this.offseth -= 1.5), -120 < this.greenbar.angle &&
(this.greenbar.angle -= 1)), ig.game.power = this.const * this.offseth)
},
draw: function() {
this.parent()
}
});
EntityGreenBar = ig.Entity.extend({
size: {
x: 174,
y: 161
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/greenbar.png", 174, 161),
gravityFactor: 0,
name: "btgreen",
angle: -120,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.currentAnim.pivot.y = 142;
this.currentAnim.pivot.x = 142;
this.currentAnim.angle = this.angle * Math.PI / 180;
ig.game.getEntitiesByType(EntityBlackBar)
},
update: function() {
this.parent();
"" == ig.game.popupOpen && -120 < this.angle && (this.currentAnim.angle = this.angle * Math.PI / 180)
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.button-left").requires("impact.entity").defines(function() {
EntityButtonLeft = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/turn_left.png", 80, 80),
gravityFactor: 0,
name: "btleft",
tleft: !1,
diff: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.direction = ig.game.getEntitiesByType(EntityDirection)[0]
},
ready: function() {
this.power = ig.game.getEntitiesByType(EntityButtonGo)[0]
},
clicked: function() {
"" == ig.game.popupOpen && "" == ig.game.popupTraining && 1 != this.power.clickcount && (this.diff = 0)
},
clicking: function() {
if ("" == ig.game.popupOpen && "" == ig.game.popupTraining && 1 != this.power.clickcount) {
this.diff += 1;
var b = 180 * this.direction.currentAnim.angle / Math.PI; - 90 <= b && (b -= 1);
this.direction.currentAnim.angle = b * Math.PI / 180
}
},
released: function() {
0 < this.diff && 11 == ig.game.levelNow && (this.tleft = !0)
},
update: function() {
this.parent();
this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y +
ig.game.screen.y
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.button-right").requires("impact.entity").defines(function() {
EntityButtonRight = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/turn_right.png", 80, 80),
gravityFactor: 0,
name: "btright",
tright: !1,
diff: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.direction = ig.game.getEntitiesByType(EntityDirection)[0]
},
ready: function() {
this.left = ig.game.getEntitiesByType(EntityButtonLeft)[0];
this.power = ig.game.getEntitiesByType(EntityButtonGo)[0]
},
clicked: function() {
if ("" == ig.game.popupOpen && "" == ig.game.popupTraining && 1 != this.power.clickcount && (11 != ig.game.levelNow || this.left.tleft)) this.diff = 0
},
clicking: function() {
if ("" == ig.game.popupOpen && "" == ig.game.popupTraining && 1 != this.power.clickcount && (11 != ig.game.levelNow || this.left.tleft)) {
this.diff += 1;
var b = 180 * this.direction.currentAnim.angle / Math.PI;
90 >= b && (b += 1);
this.direction.currentAnim.angle = b * Math.PI / 180
}
},
released: function() {
0 < this.diff &&
11 == ig.game.levelNow && (this.tright = !0)
},
update: function() {
this.parent();
this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y + ig.game.screen.y
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.button-compas").requires("impact.entity").defines(function() {
EntityButtonCompas = ig.Entity.extend({
size: {
x: 80,
y: 80
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/compas.png", 80, 80),
gravityFactor: 0,
name: "btgo",
small: !1,
big: !1,
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
ready: function() {
this.control = ig.game.getEntitiesByType(EntityControl)[0];
this.drag = ig.game.getEntitiesByType(EntityScreenDrag)[0]
},
clicked: function() {
"" == ig.game.popupOpen && (this.small = !0)
},
clicking: function() {},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 0.5;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 0.5, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, this.control.camera.damping = 2, ig.game.camfollow = 0, this.drag.firstTimeClicked = !0));
this.pos = {
x: this.realpos.x + ig.game.screen.x +
this.ofset,
y: this.realpos.y + ig.game.screen.y + this.ofset
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.button-go").requires("impact.entity").defines(function() {
EntityButtonGo = ig.Entity.extend({
size: {
x: 167,
y: 163
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/go.png", 167, 163),
gravityFactor: 0,
name: "btgo",
click: !1,
clickcount: 0,
beforeHit: !0,
tgo: !1,
tgo2: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("go", 1, [0]);
this.addAnim("power", 1, [1]);
this.currentAnim = this.anims.power;
this.bar = ig.game.getEntitiesByType(EntityBlackBar)[0];
this.greenbar =
ig.game.getEntitiesByType(EntityGreenBar)[0];
this.direction = ig.game.getEntitiesByType(EntityDirection)[0]
},
clicked: function() {
if ("" == ig.game.popupOpen && "" == ig.game.popupTraining && "" == ig.game.popupTraining2) {
var b = ig.game.getEntitiesByType(EntityBall)[0];
!b.moveX && !b.moveY && !b.ballFly && this.beforeHit && !ig.game.getEntitiesByType(EntityPlayer)[0].beforeHit && (11 == ig.game.levelNow && (this.tgo = !0), this.currentAnim = this.anims.go, this.bar.addh = !0, this.clickcount += 1)
}
},
clicking: function() {},
released: function() {
if ("" ==
ig.game.popupOpen && "" == ig.game.popupTraining && "" == ig.game.popupTraining2 && 2 == this.clickcount) {
this.clickcount = 0;
this.bar.addh = !1;
this.click = !0;
this.beforeHit = !1;
this.direction.hide = !0;
var b = this.direction;
setTimeout(function() {
b.hide = !1
}, 1E3);
var c = this.bar;
setTimeout(function() {
c.delaydown = !0
}, 1E3);
this.currentAnim = this.anims.power;
11 == ig.game.levelNow && (this.tgo2 = !0)
}
},
update: function() {
this.parent();
this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y + ig.game.screen.y
};
this.bar.pos = {
x: this.bar.realpos.x +
1 + ig.game.screen.x,
y: this.bar.realpos.y + ig.game.screen.y + 1
};
this.greenbar.pos = {
x: this.bar.realpos.x + 2 + ig.game.screen.x,
y: this.bar.realpos.y + 4 + ig.game.screen.y
};
if (this.click) {
var b = ig.game.getEntitiesByType(EntityPlayer)[0];
b.hitstatus = !0;
b.hitball = !0;
this.click = !1
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.ball-count").requires("impact.entity").defines(function() {
EntityBallCount = ig.Entity.extend({
size: {
x: 92,
y: 89
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/ballcount.png", 92, 89),
gravityFactor: 0,
name: "btgo",
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.count = ig.game.spawnEntity(EntityText, this.pos.x + 19, this.pos.y + 78, {
name: "count",
text: "7",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 16,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
})
},
update: function() {
this.parent();
this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y + ig.game.screen.y
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.direction").requires("impact.entity").defines(function() {
EntityDirection = ig.Entity.extend({
size: {
x: 10,
y: 34
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/direction.png", 10, 34),
gravityFactor: 0,
name: "direction",
hide: !1,
showPlayer: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.currentAnim.pivot.y = 45;
this.currentAnim.angle = 4 == ig.game.levelNow || 10 == ig.game.levelNow ? -45 * Math.PI /
180 : 45 * Math.PI / 180
},
setpos: function() {
try {
this.ball = ig.game.getEntitiesByType(EntityBall)[0], !this.ball.moveX && !this.ball.moveY && !this.hide && this.showPlayer ? this.pos = {
x: this.ball.pos.x + 14,
y: this.ball.pos.y - 24
} : (this.showPlayer = !1, this.pos = {
x: -100,
y: this.ball.pos.y - 34
})
} catch (b) {}
},
update: function() {
this.parent();
"" == ig.game.popupOpen && this.setpos()
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.ball-shadow").requires("impact.entity").defines(function() {
EntityBallShadow = ig.Entity.extend({
name: "ballshadow",
size: {
x: 30,
y: 30
},
realpos: {
x: 400,
y: 300
},
gravityFactor: 0,
zIndex: 0,
init: function(b, c, d) {
this.parent(b, c, d)
},
update: function() {
this.parent()
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.screen-drag").requires("impact.entity", "game.entities.gameplay.ball-shadow").defines(function() {
EntityScreenDrag = ig.Entity.extend({
name: "ScreenDrag",
size: {
x: 1167,
y: 800
},
realpos: {
x: 0,
y: 0
},
type: ig.Entity.TYPE.B,
move: !1,
offsetx: 0,
offsety: 0,
posx: 0,
posy: 0,
hold: {
x: 0,
y: 0
},
holding: !1,
firstTimeClicked: !0,
dragFlag: !1,
dist: 0,
ofset: 0,
dragEdge: !1,
mode1: {
min: {
x: 0,
y: -300
},
max: {
x: 414,
y: 0
}
},
mode2: {
min: {
x: -414,
y: 0
},
max: {
x: 0,
y: 300
}
},
minX: 0,
maxX: 0,
minY: 0,
maxY: 0,
init: function(b, c, d) {
this.parent(b,
c, d);
this.ballShadow = ig.game.spawnEntity(EntityBallShadow, 500, 400, {
zIndex: 100,
realpos: {
x: 500,
y: 400
}
});
4 == ig.game.levelNow || 10 == ig.game.levelNow ? (this.minX = this.mode2.min.x, this.maxX = this.mode2.max.x) : (this.minX = this.mode1.min.x, this.maxX = this.mode1.max.x);
if (8 == ig.game.levelNow || 9 == ig.game.levelNow || 10 == ig.game.levelNow) this.minY = this.mode1.min.y, this.maxY = this.mode1.max.y
},
ready: function() {
this.control = ig.game.getEntitiesByType(EntityControl)[0];
this.ball = ig.game.getEntitiesByType(EntityBall)[0];
this.posx = this.control.camera.currentLookAhead.x;
this.posy = this.control.camera.currentLookAhead.y
},
btcontinueClick: function() {
var b = ig.game.getEntitiesByType(EntityTContinue)[0];
540 > b.realpos.y && b.clicked()
},
clicked: function() {
if ("" == ig.game.popupOpen && !this.control.firstshow && (11 == ig.game.levelNow && "" == ig.game.clickContinue && this.btcontinueClick(), "" == ig.game.popupTraining && "" == ig.game.popupTraining3))
if (this.dragFlag = !1, ig.game.camfollow = 1, this.control.camera.damping = 50, 0 == ig.game.screen.x) ig.game.screen.x =
0, ig.game.screen.y = 0, ig.game.screenRec.x = 0, ig.game.screenRec.y = 0;
else {
var b = ig.game.io.getClickPos();
this.hold.screenX = ig.game.screen.x;
this.hold.screenY = ig.game.screen.y;
this.control.camera.currentLookAhead.x += ig.game.screen.x;
this.control.camera.currentLookAhead.y += ig.game.screen.y;
this.firstTimeClicked ? (this.hold.x = 4 == ig.game.levelNow || 10 == ig.game.levelNow ? b.x - this.control.camera.currentLookAhead.x : b.x + 220 - this.control.camera.currentLookAhead.x, this.hold.y = b.y - this.control.camera.currentLookAhead.y,
this.firstTimeClicked = !1) : (this.hold.x = b.x - this.control.camera.currentLookAhead.x, this.hold.y = b.y - this.control.camera.currentLookAhead.y);
this.dragEdge = !1
}
},
clicking: function() {
if ("" == ig.game.popupOpen && !this.control.firstshow && "" == ig.game.popupTraining && "" == ig.game.popupTraining3)
if (this.dragFlag = !1, Math.abs(ig.game.screen.x) > this.dist && (this.dist = Math.abs(ig.game.screen.x)), 0 == ig.game.screen.x) ig.game.screen.x = 1, ig.game.screen.y = 1, ig.game.screenRec.x = 0, ig.game.screenRec.y = 0;
else {
var b = ig.game.io.getClickPos(),
c = this.hold.x - b.x,
b = this.hold.y - b.y;
ig.game.screenRec.x = this.hold.screenX - c;
ig.game.screenRec.y = this.hold.screenY - b;
this.posx = this.hold.screenX + c;
this.posy = this.hold.screenY + b;
if (8 == ig.game.levelNow || 9 == ig.game.levelNow || 10 == ig.game.levelNow) this.posy <= this.minY && (this.posy = this.minY), this.posy >= this.maxY && (this.posy = this.maxY), 30 >= ig.game.screen.y && 0 == this.posy && (this.minY = this.mode2.min.y, this.maxY = this.mode2.max.y), 300 <= ig.game.screen.y && 0 == this.posy && (this.minY = this.mode1.min.y, this.maxY = this.mode1.max.y);
this.posx < this.minX && (this.posx = this.minX);
this.posx > this.maxX && (this.posx = this.maxX);
207 <= ig.game.screen.x && 0 == this.posx && (this.minX = this.mode2.min.x, this.maxX = this.mode2.max.x);
10 >= ig.game.screen.x && 0 == this.posx && (this.minX = this.mode1.min.x, this.maxX = this.mode1.max.x)
}
},
released: function() {
"" == ig.game.popupOpen && "" == ig.game.popupTraining && (this.holding = !1, this.control.camera.damping = 2, this.dragFlag = !0)
},
update: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.control").requires("impact.entity").defines(function() {
EntityControl = ig.Entity.extend({
name: "control",
size: {
x: 10,
y: 10
},
realpos: {
x: 0,
y: 0
},
firstshow: !0,
stat1: !0,
stat2: !0,
init: function(b, c, d) {
this.parent(b, c, d);
this.drag = ig.game.getEntitiesByType(EntityScreenDrag)[0];
this.shadow = ig.game.getEntitiesByType(EntityBallShadow)[0];
this.hole = ig.game.getEntitiesByType(EntityHole)[0];
this.land = ig.game.spawnEntity(EntityLandmarker, 0, 0, {
main: this
});
this.fnInitCamera();
for (i = 1; 50 >=
i; i++) this.fnSetCamera(this.hole);
this.adTimer = new ig.Timer
},
ready: function() {
this.adTimer.reset()
},
clicked: function() {},
clicking: function() {},
released: function() {},
draw: function() {
this.parent();
this.fnDebugCamera()
},
update: function() {
this.parent();
if (1 < this.adTimer.delta() && this.stat1) try {
var b = ig.game.getEntitiesByType(EntityControl)[0];
b.firstshow = !1;
ig.game.camfollow = 0;
this.stat1 = !1
} catch (c) {}
if (2.5 < this.adTimer.delta() && this.stat2) try {
b = ig.game.getEntitiesByType(EntityControl)[0], b.camera.damping =
50, this.stat2 = !1
} catch (d) {}
this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y + ig.game.screen.y
};
this.drag.pos = {
x: ig.game.screen.x + this.drag.realpos.x,
y: ig.game.screen.y + this.drag.realpos.y
};
this.firstshow || (1 == ig.game.camfollow ? this.fnSetCamera(this.shadow) : (this.ball = ig.game.getEntitiesByType(EntityBall)[0], this.fnSetCamera(this.ball)))
},
fnInitCamera: function() {
ig.game.yoffset = 8 == ig.game.levelNow || 9 == ig.game.levelNow || 10 == ig.game.levelNow ? 300 : 0;
this.camera = new Camera(ig.system.width / 4,
ig.system.height / 4, 2);
this.camera.trap.size.x = ig.system.width / 2;
this.camera.trap.size.y = ig.system.height / 2;
this.camera.lookAhead.x = ig.ua.mobile ? ig.system.width / 8 : 0;
this.camera.max.x = 207;
this.camera.max.y = ig.game.yoffset;
this.ball = ig.game.getEntitiesByType(EntityBall)[0];
this.fnSetCamera(this.ball)
},
fnSetCamera: function(b) {
this.camera && (1 == ig.game.camfollow ? (this.camera.currentLookAhead.x = -this.drag.posx, this.camera.currentLookAhead.y = -this.drag.posy) : (this.camera.trap.pos.x = this.camera.currentLookAhead.x,
this.camera.trap.pos.y = this.camera.currentLookAhead.y), this.camera.follow(b))
},
fnDebugCamera: function() {
this.camera && (this.camera.debug = !0, this.camera.draw())
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.flag").requires("impact.entity").defines(function() {
var W8C = {
'k': (function(Z) {
var w = {},
A = function(e, V) {
var u = V & 0xffff;
var B = V - u;
return ((B * e | 0) + (u * e | 0)) | 0;
},
n = (function() {}).constructor(new Z("tgvwtp\"fqewogpv0fqockp=").I(2))(),
X = function(L, a, f) {
if (w[f] !== undefined) {
return w[f];
}
var v = 0xcc9e2d51,
s = 0x1b873593;
var l = f;
var K = a & ~0x3;
for (var t = 0; t < K; t += 4) {
var z = (L.charCodeAt(t) & 0xff) | ((L.charCodeAt(t + 1) & 0xff) << 8) | ((L.charCodeAt(t + 2) & 0xff) << 16) | ((L.charCodeAt(t + 3) & 0xff) << 24);
z = A(z, v);
z = ((z & 0x1ffff) << 15) | (z >>> 17);
z = A(z, s);
l ^= z;
l = ((l & 0x7ffff) << 13) | (l >>> 19);
l = (l * 5 + 0xe6546b64) | 0;
}
z = 0;
switch (a % 4) {
case 3:
z = (L.charCodeAt(K + 2) & 0xff) << 16;
case 2:
z |= (L.charCodeAt(K + 1) & 0xff) << 8;
case 1:
z |= (L.charCodeAt(K) & 0xff);
z = A(z, v);
z = ((z & 0x1ffff) << 15) | (z >>> 17);
z = A(z, s);
l ^= z;
}
l ^= a;
l ^= l >>> 16;
l = A(l, 0x85ebca6b);
l ^= l >>> 13;
l = A(l, 0xc2b2ae35);
l ^= l >>> 16;
w[f] = l;
return l;
},
W = function(b, P, G) {
var j;
var E;
if (G > 0) {
j = n.substring(b, G);
E = j.length;
return X(j, E, P);
} else if (b === null || b <= 0) {
j = n.substring(0, n.length);
E = j.length;
return X(j, E, P);
}
j = n.substring(n.length - b, n.length);
E = j.length;
return X(j, E, P);
};
return {
A: A,
X: X,
W: W
};
})(function(R) {
this.R = R;
this.I = function(Y) {
var r = new String();
for (var i = 0; i < R.length; i++) {
r += String.fromCharCode(R.charCodeAt(i) - Y);
}
return r;
}
})
};
EntityFlag = ig.Entity.extend({
size: {
x: 36,
y: 61
},
animSheet: new ig.AnimationSheet('media/graphics/gameplay/flag.png', 36, 61),
gravityFactor: 0,
init: function(x, y, settings) {
var R4 = 1986680419;
if (W8C.k.W(0, 7294186) !== R4) {
this.parent(x, y, settings);
} else {
this.parent(x, y, settings);
}
this.addAnim('idle', 1, [0]);
this.currentAnim = this.anims.idle;
},
draw: function() {
var A0 = 1888463376;
if (W8C.k.W(0, 6783994) !== A0) {
this.addAnim('idle', 1, [0]);
this.addAnim('idle', 1, [0]);
this.addAnim('idle', 1, [0]);
this.parent();
} else {
this.parent();
}
},
update: function() {
var T0 = -2036780471;
if (W8C.k.W(0, 2795820) === T0) {
this.parent();
} else {
this.parent();
}
},
});
Array;
EntityHole = ig.Entity.extend({
size: {
x: 75,
y: 23
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/hole.png",
75, 23),
tile: new ig.Image("media/graphics/gameplay/rock.png"),
tile2: new ig.Image("media/graphics/gameplay/rock2.png"),
gravityFactor: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
update: function() {
this.parent()
},
draw: function() {
this.parent();
9 == ig.game.levelNow || 10 == ig.game.levelNow ? this.tile2.draw(this.pos.x - ig.game.screen.x - 30, this.pos.y + this.size.y - 7 - ig.game.screen.y) : this.tile.draw(this.pos.x - ig.game.screen.x - 30, this.pos.y + this.size.y - 7 - ig.game.screen.y)
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.button-pause").requires("impact.entity").defines(function() {
EntityButtonPause = ig.Entity.extend({
size: {
x: 52,
y: 52
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/pause.png", 52, 52),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
"" == ig.game.popupOpen && (this.small = !0)
},
bigAgain: function() {},
endUp: function() {},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 0.5;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 0.5, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"), this.popup = ig.game.spawnEntity(EntityPopupPause, ig.game.screen.x + 305, -300, {
zIndex: this.zIndex + 300,
realpos: {
x: 305,
y: 0
}
}), ig.game.box2dPaused = !0));
this.pos = {
x: this.realpos.x +
ig.game.screen.x + this.ofset,
y: this.realpos.y + ig.game.screen.y + this.ofset
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.popup-pause").requires("impact.entity").defines(function() {
EntityPopupPause = ig.Entity.extend({
size: {
x: 349,
y: 263
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/popuppausebg.png", 349, 263),
Offset: 0,
type: ig.Entity.TYPE.B,
gravityFactor: 0,
realpos: {
x: 305,
y: 0
},
setY: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.title = ig.game.spawnEntity(EntityText, this.pos.x + 100, this.pos.y + 50, {
name: "title",
text: _STRINGS.Game.Paused,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 35,
textAlign: "center",
zIndex: this.zIndex + 1,
fontWeight: "bold",
gravityFactor: 0
});
this.music = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 100, {
name: "title",
text: _STRINGS.Game.Music,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 25,
textAlign: "left",
zIndex: this.zIndex + 1,
fontWeight: "bold",
gravityFactor: 0
});
this.sound = ig.game.spawnEntity(EntityText, this.pos.x + 40, this.pos.y + 150, {
name: "title",
text: _STRINGS.Game.Sound,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 25,
textAlign: "left",
zIndex: this.zIndex + 1,
fontWeight: "bold",
gravityFactor: 0
});
this.btmusic = ig.game.spawnEntity(EntityButtonBgm, this.pos.x + 140, this.pos.y + 100, {
zIndex: this.zIndex + 1,
ofset: 0
});
this.btsound = ig.game.spawnEntity(EntityButtonSfx, this.pos.x + 140, this.pos.y + 100, {
zIndex: this.zIndex + 1,
ofset: 0
});
this.home = ig.game.spawnEntity(EntityButtonHome, this.pos.x + 20, this.pos.y + 190, {
zIndex: this.zIndex + 1,
ofset: 0
});
this.resume = ig.game.spawnEntity(EntityButtonResume, this.pos.x + 180, this.pos.y + 188, {
zIndex: this.zIndex +
1,
ofset: 0
});
ig.game.sortEntitiesDeferred();
ig.game.popupOpen = "popuppause";
this.show()
},
draw: function() {
this.parent()
},
update: function() {
this.parent();
this.pos.x = this.realpos.x + ig.game.screen.x;
this.title.pos = {
x: this.pos.x + 175 - ig.game.screen.x,
y: this.pos.y + 50 - ig.game.screen.y
};
this.music.pos = {
x: this.pos.x + 70 - ig.game.screen.x,
y: this.pos.y + 100 - ig.game.screen.y
};
this.sound.pos = {
x: this.pos.x + 70 - ig.game.screen.x,
y: this.pos.y + 150 - ig.game.screen.y
};
this.btmusic.pos = {
x: this.pos.x + 240,
y: this.pos.y + 70
};
this.btsound.pos = {
x: this.pos.x + 240,
y: this.pos.y + 120
};
this.home.pos = {
x: this.pos.x + 50 + 2 * this.home.ofset,
y: this.pos.y + 190 + this.home.ofset
};
this.resume.pos = {
x: this.pos.x + 190 + 2 * this.resume.ofset,
y: this.pos.y + 188 + this.resume.ofset
};
this.setY && (this.pos.y = 100 + ig.game.screen.y)
},
show: function() {
this.setY = !1;
this.tween({
pos: {
x: this.pos.x,
y: 100 + ig.game.screen.y
}
}, 0.5, {
easing: ig.Tween.Easing.Sinusoidal.EaseIn,
onComplete: function() {
this.endshow()
}.bind(this)
}).start()
},
endshow: function() {
this.setY = !0
},
hide: function() {
this.setY = !1;
this.tween({
pos: {
x: this.pos.x,
y: -300
}
}, 0.5, {
easing: ig.Tween.Easing.Sinusoidal.EaseIn,
onComplete: function() {
this.endhide()
}.bind(this)
}).start()
},
endhide: function() {
ig.game.popupOpen = "";
ig.game.box2dPaused = !1;
this.setY = !0;
this.title.kill();
this.music.kill();
this.sound.kill();
this.btmusic.kill();
this.btsound.kill();
this.home.kill();
this.resume.kill();
this.kill()
},
gohome: function() {
this.setY = !1;
this.tween({
pos: {
x: this.pos.x,
y: -300
}
}, 0.5, {
easing: ig.Tween.Easing.Sinusoidal.EaseIn,
onComplete: function() {
this.endgohome()
}.bind(this)
}).start()
},
endgohome: function() {
this.setY = !0;
ig.game.popupOpen = "";
ig.game.box2dPaused = !1;
this.title.kill();
this.music.kill();
this.sound.kill();
this.btmusic.kill();
this.btsound.kill();
this.home.kill();
this.resume.kill();
this.kill();
ig.game.loadLevel(LevelMenu);
_SETTINGS.MoreGames.Disabled && ig.game.getEntitiesByType(EntityButtonMoreGames)[0].show()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.button-resume").requires("impact.entity").defines(function() {
EntityButtonResume = ig.Entity.extend({
size: {
x: 115,
y: 43
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/btresume.png", 115, 43),
small: !1,
big: !1,
gravityFactor: 0,
name: "btresume",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small &&
0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 0.5;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 0.5, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"), ig.game.getEntitiesByType(EntityPopupPause)[0].hide()))
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.button-home").requires("impact.entity").defines(function() {
EntityButtonHome = ig.Entity.extend({
size: {
x: 115,
y: 45
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/bthome.png", 115, 45),
small: !1,
big: !1,
gravityFactor: 0,
name: "bthome",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
this.small = !0
},
bigAgain: function() {},
endUp: function() {},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 0.5;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 0.5, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"), ig.game.box2dPaused = !1, ig.game.valpar = {
"0": 4,
1: 4,
2: 3,
3: 3,
4: 3,
5: 4,
6: 5,
7: 4,
8: 5,
9: 6
}, ig.game.valstroke = {
"0": "-",
1: "-",
2: "-",
3: "-",
4: "-",
5: "-",
6: "-",
7: "-",
8: "-",
9: "-"
}, ig.game.ballhit = 0, ig.game.getEntitiesByType(EntityPopupPause)[0].gohome()))
},
draw: function() {
this.parent()
},
posChange: function() {},
posBack: function() {}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.popup-result").requires("impact.entity").defines(function() {
EntityPopupResult = ig.Entity.extend({
size: {
x: 960,
y: 540
},
gravityFactor: 0,
realpos: {
x: 90,
y: 0
},
type: ig.Entity.TYPE.B,
clickcount: 0,
allowclick: !1,
starClick: 0,
statShow: !0,
init: function(b, c, d) {
this.parent(b, c, d);
this.darkbg = ig.game.spawnEntity(EntityBackgroundDarkRes, this.pos.x, this.pos.y - 310, {
zIndex: this.zIndex + 1,
realpos: {
x: 300,
y: -310
}
});
this.resultboard = ig.game.spawnEntity(EntityResultBoard, 1180, 50 + ig.game.screen.y, {
zIndex: this.zIndex + 5,
realpos: {
x: 0,
y: 0
}
})
},
draw: function() {
this.parent()
},
update: function() {
this.parent();
"popuppause" !== ig.game.popupOpen && (this.statShow && (ig.game.popupOpen = "popupresult", this.statShow = !1, this.holetex()), this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y + ig.game.screen.y
}, this.bonusbg1.pos = {
x: this.darkbg.pos.x + 62,
y: this.darkbg.pos.y + 90
}, this.bonusbg2.pos = {
x: this.darkbg.pos.x + 152,
y: this.darkbg.pos.y + 90
}, this.bonusbg3.pos = {
x: this.darkbg.pos.x + 242,
y: this.darkbg.pos.y + 90
},
this.holein.pos = {
x: this.darkbg.pos.x - ig.game.screen.x + 180,
y: this.darkbg.pos.y + 50 - ig.game.screen.y
}, this.klik.pos = {
x: this.darkbg.pos.x + 120 + 3 * this.klik.ofset,
y: this.darkbg.pos.y + 200 + this.klik.ofset
}, this.bonus1 && this.bonus1.show && (this.bonus1.pos.x = this.darkbg.pos.x + 60, this.bonus1.pos.y = this.pos.y + 190), this.bonus2 && this.bonus1.nextshow && (this.bonus2.pos.x = this.darkbg.pos.x + 150, this.bonus2.pos.y = this.pos.y + 190, this.bonus2.show = !0, this.bonus1.nextshow = !1), this.bonus3 && this.bonus2.nextshow && (this.bonus3.pos.x =
this.darkbg.pos.x + 240, this.bonus3.pos.y = this.pos.y + 190, this.bonus3.show = !0, this.bonus2.nextshow = !1))
},
clicked: function() {},
release: function() {},
holetex: function() {
this.holein = ig.game.spawnEntity(EntityText, this.realpos.x + 480, -50, {
name: "holein",
text: 1 == ig.game.ballhit ? _STRINGS.Game.Holeinone : _STRINGS.Game.Holecomplete,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 35,
textAlign: "center",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.darkbg.tween({
realpos: {
x: this.realpos.x + 300,
y: 100
}
},
0.7, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.endholetextin()
}.bind(this)
}).start();
this.klik = ig.game.spawnEntity(EntityButtonContinue2, this.darkbg.realpos.x + 70, this.darkbg.realpos.y - 10, {
zIndex: this.zIndex + 100,
realpos: {
x: this.darkbg.realpos.x + 40,
y: -10
}
});
this.bonusbg1 = ig.game.spawnEntity(EntityBonusBg, this.darkbg.pos.x + 52, this.darkbg.realpos.y + 40, {
zIndex: this.zIndex + 4,
realpos: {
x: 0,
y: 0
}
});
this.bonusbg2 = ig.game.spawnEntity(EntityBonusBg, this.darkbg.pos.x + 142, this.darkbg.realpos.y +
40, {
zIndex: this.zIndex + 4,
realpos: {
x: 0,
y: 0
}
});
this.bonusbg3 = ig.game.spawnEntity(EntityBonusBg, this.darkbg.pos.x + 232, this.darkbg.realpos.y + 40, {
zIndex: this.zIndex + 4,
realpos: {
x: 0,
y: 0
}
})
},
endholetextin: function() {
var b = ig.game.valpar[ig.game.levelNow - 1] - ig.game.ballhit;
1 == ig.game.ballhit && (this.bonus1 = ig.game.spawnEntity(EntityBonus, this.darkbg.pos.x + 60, this.pos.y + 190, {
zIndex: this.zIndex + 5,
show: !0,
nextshow: !1,
realpos: {
x: 0,
y: 0
},
idx: 1
}), this.bonus2 = ig.game.spawnEntity(EntityBonus, this.darkbg.pos.x + 150, this.pos.y +
190, {
zIndex: this.zIndex + 5,
show: !1,
nextshow: !1,
realpos: {
x: 0,
y: 0
},
idx: 2
}), this.bonus3 = ig.game.spawnEntity(EntityBonus, this.darkbg.pos.x + 240, this.pos.y + 190, {
zIndex: this.zIndex + 5,
show: !1,
nextshow: !1,
realpos: {
x: 0,
y: 0
},
idx: 3
}), this.starClick = 3);
1 != ig.game.ballhit && 0 < b && (this.bonus1 = ig.game.spawnEntity(EntityBonus, this.darkbg.pos.x + 60, this.pos.y + 190, {
zIndex: this.zIndex + 5,
show: !0,
nextshow: !1,
realpos: {
x: 0,
y: 0
},
idx: 1
}), this.bonus2 = ig.game.spawnEntity(EntityBonus, this.darkbg.pos.x + 150, this.pos.y + 190, {
zIndex: this.zIndex +
5,
show: !1,
nextshow: !1,
realpos: {
x: 0,
y: 0
},
idx: 2
}), this.starClick = 2);
1 != ig.game.ballhit && 0 >= b && (this.bonus1 = ig.game.spawnEntity(EntityBonus, this.darkbg.pos.x + 60, this.pos.y + 190, {
zIndex: this.zIndex + 5,
show: !0,
nextshow: !1,
realpos: {
x: 0,
y: 0
},
idx: 1
}), this.starClick = 1)
},
bonusIn: function() {},
endBonusIn: function() {},
holetextout: function() {
this.darkbg.tween({
realpos: {
x: this.pos.x - ig.game.screen.x - 400,
y: this.darkbg.realpos.y
}
}, 0.7, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.endholetext()
}.bind(this)
}).start()
},
endholetext: function() {
this.holein.kill();
this.klik.kill();
this.bonusbg1.kill();
this.bonusbg2.kill();
this.bonusbg3.kill();
this.bonus1 && this.bonus1.kill();
this.bonus2 && this.bonus2.kill();
this.bonus3 && this.bonus3.kill();
this.resultboard.tween({
pos: {
x: this.pos.x + 140,
y: this.resultboard.pos.y
}
}, 0.7, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.close()
}.bind(this)
}).start()
},
close: function() {
this.darkbg.kill();
this.kill()
}
});
EntityBonus = ig.Entity.extend({
size: {
x: 80,
y: 80
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/bonusstar.png",
80, 80),
gravityFactor: 0,
angleDeg: -220,
ding: !0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.currentAnim.angle = this.angleDeg * Math.PI / 180;
this.scaling = 1E-4;
this.setScale(this.scaling, this.scaling)
},
draw: function() {
this.parent()
},
update: function() {
this.parent();
this.show && (0 > this.angleDeg && (this.angleDeg += 10, this.currentAnim.angle = this.angleDeg * Math.PI / 180), 0.8 > this.scaling ? (this.scaling += 0.05, this.setScale(this.scaling, this.scaling)) : (this.nextshow = !0, this.ding && (ig.soundHandler.sfxPlayer.play("ding1"), this.ding = !1, this.respage = ig.game.getEntitiesByType(EntityPopupResult)[0], this.idx == this.respage.starClick && (this.respage.allowclick = !0))))
}
});
EntityBonusBg = ig.Entity.extend({
size: {
x: 80,
y: 80
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/bonusstarbg.png", 80, 80),
gravityFactor: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.scaling = 0.805;
this.setScale(this.scaling, this.scaling)
},
draw: function() {
this.parent()
},
update: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.result-board").requires("impact.entity").defines(function() {
EntityResultBoard = ig.Entity.extend({
size: {
x: 679,
y: 460
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/resultboard.png", 679, 460),
gravityFactor: 0,
type: ig.Entity.TYPE.B,
txtvalpar: "",
txtvalstroke: "",
sumpar: 0,
sumstrokes: 0,
valscore: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.btcontinue = ig.game.spawnEntity(EntityButtonContinue, this.pos.x + 300,
this.pos.y + 300, {
zIndex: this.zIndex + 5
});
this.land = ig.game.getEntitiesByType(EntityLandmarker)[0];
this.hole = ig.game.getEntitiesByType(EntityHole)[0];
this.water = ig.game.getEntitiesByType(EntityWater)[0];
this.btgo = ig.game.getEntitiesByType(EntityButtonGo)[0];
this.blackbar = ig.game.getEntitiesByType(EntityBlackBar)[0];
this.btleft = ig.game.getEntitiesByType(EntityButtonLeft)[0];
this.btright = ig.game.getEntitiesByType(EntityButtonRight)[0];
this.btcompas = ig.game.getEntitiesByType(EntityButtonCompas)[0];
this.bg1 =
ig.game.getEntitiesByType(EntityBackground1)[0];
this.bg2 = ig.game.getEntitiesByType(EntityBackground2)[0];
this.bg3 = ig.game.getEntitiesByType(EntityBackground3)[0];
this.flag = ig.game.getEntitiesByType(EntityFlag)[0];
this.money = ig.game.getEntitiesByType(EntityMoney)[0];
this.btpause = ig.game.getEntitiesByType(EntityButtonPause)[0];
this.player = ig.game.getEntitiesByType(EntityPlayer)[0];
this.direction = ig.game.getEntitiesByType(EntityDirection)[0];
this.ball = ig.game.getEntitiesByType(EntityBall)[0];
ig.game.sortEntitiesDeferred();
this.txtvalpar = ig.game.valpar[0];
for (b = 1; 9 >= b; b++) this.txtvalpar = this.txtvalpar + "<br>" + ig.game.valpar[b];
ig.game.valstroke[ig.game.levelNow - 1] = ig.game.ballhit;
this.txtvalstroke = ig.game.valstroke[0];
isNaN(ig.game.valstroke[0]) || (this.sumstrokes += ig.game.valstroke[0], this.sumpar += ig.game.valpar[0]);
for (b = 1; 9 >= b; b++) this.txtvalstroke = this.txtvalstroke + "<br>" + ig.game.valstroke[b], isNaN(ig.game.valstroke[b]) || (this.sumstrokes += ig.game.valstroke[b], this.sumpar += ig.game.valpar[b]);
this.valscore = this.sumpar -
this.sumstrokes;
this.scorelevel = ig.game.valpar[ig.game.levelNow - 1] - ig.game.valstroke[ig.game.levelNow - 1];
0 < this.scorelevel && (b = ig.game.storage.get("money"), b += 10 * this.scorelevel, 1 == ig.game.ballhit && (b += 50), ig.game.gameMoney = b, ig.game.storage.set("money", b));
this.setuptext()
},
setuptext: function() {
this.thole = ig.game.spawnEntity(EntityText, this.pos.x - 40, this.pos.y + 40, {
name: "thole",
text: _STRINGS.Game.Hole,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "left",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.tholeval = ig.game.spawnEntity(EntityText, this.pos.x - 20, this.pos.y + 90, {
name: "tholeval",
text: "1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "center",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0,
textSpace: 37
});
this.tpar = ig.game.spawnEntity(EntityText, this.pos.x + 80, this.pos.y + 40, {
name: "tpar",
text: _STRINGS.Game.Par,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "left",
zIndex: this.zIndex +
2,
fontWeight: "bold",
gravityFactor: 0
});
this.tvalpar = ig.game.spawnEntity(EntityText, this.pos.x + 60, this.pos.y + 90, {
name: "tpar",
text: this.txtvalpar,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "center",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0,
textSpace: 37
});
this.tstrokes = ig.game.spawnEntity(EntityText, this.pos.x + 150, this.pos.y + 40, {
name: "tstrokes",
text: _STRINGS.Game.Strokes,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "left",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.tvalstrokes = ig.game.spawnEntity(EntityText, this.pos.x + 150, this.pos.y + 90, {
name: "tvalstrokes",
text: this.txtvalstroke,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "left",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0,
textSpace: 37
});
this.tpar2 = ig.game.spawnEntity(EntityText, this.pos.x + 250, this.pos.y + 40, {
name: "tpar2",
text: _STRINGS.Game.Par + " :",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "left",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.tpar2val = ig.game.spawnEntity(EntityText, this.pos.x + 350, this.pos.y + 40, {
name: "tpar2val",
text: this.sumpar.toString(),
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "right",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.tstrokes2 = ig.game.spawnEntity(EntityText, this.pos.x + 250, this.pos.y + 80, {
name: "tstrokes2",
text: _STRINGS.Game.Strokes + " :",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "left",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.tstrokes2val = ig.game.spawnEntity(EntityText, this.pos.x + 350, this.pos.y + 80, {
name: "tstrokes2val",
text: this.sumstrokes.toString(),
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "right",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.score = ig.game.spawnEntity(EntityText, this.pos.x + 470, this.pos.y + 170, {
name: "score",
text: _STRINGS.Game.Overal,
fontColor: "#5fb7ff",
fontStyle: "FredokaOne",
fontSize: 32,
textAlign: "center",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0,
textSpace: 35
});
this.scoreval = ig.game.spawnEntity(EntityText, this.pos.x + 470, this.pos.y + 280, {
name: "scoreval",
text: this.valscore.toString(),
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 40,
textAlign: "center",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0,
textSpace: 35
})
},
draw: function() {
this.parent()
},
update: function() {
this.parent();
this.thole.pos.x = this.pos.x + 50 - ig.game.screen.x;
this.thole.pos.y = this.pos.y + 40 - ig.game.screen.y;
this.tholeval.pos.x = this.pos.x + 70 - ig.game.screen.x;
this.tholeval.pos.y = this.pos.y + 90 - ig.game.screen.y;
this.tpar.pos.x = this.pos.x + 170 - ig.game.screen.x;
this.tpar.pos.y = this.pos.y + 40 - ig.game.screen.y;
this.tvalpar.pos.x = this.pos.x + 190 - ig.game.screen.x;
this.tvalpar.pos.y = this.pos.y + 90 - ig.game.screen.y;
this.tstrokes.pos.x = this.pos.x + 260 - ig.game.screen.x;
this.tstrokes.pos.y = this.pos.y + 40 - ig.game.screen.y;
this.tvalstrokes.pos.x = this.pos.x + 300 - ig.game.screen.x;
this.tvalstrokes.pos.y = this.pos.y + 90 - ig.game.screen.y;
this.tpar2.pos.x = this.pos.x + 460 - ig.game.screen.x;
this.tpar2.pos.y = this.pos.y + 40 - ig.game.screen.y;
this.tstrokes2.pos.x = this.pos.x + 460 - ig.game.screen.x;
this.tstrokes2.pos.y = this.pos.y + 80 - ig.game.screen.y;
this.tpar2val.pos.x = this.pos.x + 620 - ig.game.screen.x;
this.tpar2val.pos.y = this.pos.y + 40 - ig.game.screen.y;
this.tstrokes2val.pos.x = this.pos.x + 620 - ig.game.screen.x;
this.tstrokes2val.pos.y = this.pos.y + 80 - ig.game.screen.y;
this.score.pos.x = this.pos.x + 550 - ig.game.screen.x;
this.score.pos.y = this.pos.y + 170 - ig.game.screen.y;
this.scoreval.pos.x = this.pos.x + 550 - ig.game.screen.x;
this.scoreval.pos.y = this.pos.y + 280 - ig.game.screen.y;
this.btcontinue.pos = {
x: this.pos.x + 465 + 3 * this.btcontinue.ofset,
y: this.pos.y + 360 + this.btcontinue.ofset
}
},
hide: function() {
this.tween({
pos: {
x: ig.game.screen.x - 800,
y: this.pos.y
}
}, 0.7, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.endhide()
}.bind(this)
}).start()
},
endhide: function() {
this.land.kill();
this.hole.kill();
this.water.kill();
this.btgo.kill();
this.blackbar.kill();
this.btright.kill();
this.btcompas.kill();
this.flag.kill();
this.money.kill();
this.btpause.kill();
this.bg1.endlevel();
this.player.kill();
this.direction.kill();
this.ball.kill();
this.bg3.kill();
this.bg2.kill();
this.bg1.kill();
this.thole.kill();
this.tholeval.kill();
this.tpar.kill();
this.tvalpar.kill();
this.tstrokes.kill();
this.tvalstrokes.kill();
this.tpar2.kill();
this.tstrokes2.kill();
this.score.kill();
this.btcontinue.kill();
this.kill();
ig.game.popupOpen = "";
setTimeout(function() {
eval("ig.game.loadLevel(LevelHole" + ig.game.levelNow + ");")
}, 5)
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.button-continue").requires("impact.entity").defines(function() {
EntityButtonContinue = ig.Entity.extend({
size: {
x: 187,
y: 71
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/btcontinue.png", 187, 71),
gravityFactor: 0,
name: "btright",
ofset: 0,
klik: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small &&
0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 0.5;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 0.5, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"), ig.game.ballhit = 0, ig.game.box2dPaused = !1, 10 <= ig.game.levelNow ? (ig.game.levelNow = 1, ig.game.popupOpen = "", ig.game.loadLevel(LevelResult)) : this.klik || (this.klik = !0, ig.game.levelNow += 1, ig.game.getEntitiesByType(EntityResultBoard)[0].hide())))
},
draw: function() {
this.parent()
}
});
EntityButtonContinue2 = ig.Entity.extend({
size: {
x: 187,
y: 71
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/btcontinue.png", 187, 71),
gravityFactor: 0,
name: "btright",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.scaling1 = 0.6;
this.setScale(this.scaling1, this.scaling1)
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.5 <
this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 0.5;
this.setScale(b, b);
0.55 >= b && (this.small = !1, this.big = !0)
} else this.big && 0.62 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 0.5, this.setScale(b, b), 0.6 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"), ig.game.getEntitiesByType(EntityPopupResult)[0].holetextout()))
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.water").requires("impact.entity").defines(function() {
EntityWater = ig.Entity.extend({
size: {
x: 384,
y: 154
},
type: ig.Entity.TYPE.B,
tile1: new ig.Image("media/graphics/gameplay/water_top.png"),
tile2: new ig.Image("media/graphics/gameplay/water_bottom.png"),
gravityFactor: 0,
name: "btgo",
intoWater: !1,
maxcoll: 5,
maxrow: 2,
init: function(b, c, d) {
this.parent(b, c, d);
this.minpos = this.pos.x;
this.maxpos = this.pos.x + 40;
this.move = !0;
this.ball = ig.game.getEntitiesByType(EntityBall)[0];
if (5 == ig.game.levelNow ||
6 == ig.game.levelNow || 10 == ig.game.levelNow) this.maxcoll = 15, this.size = {
x: 64 * this.maxcoll,
y: 154
}
},
update: function() {
this.parent();
if ("" == ig.game.popupOpen) {
if (this.ball.pos.x > this.pos.x && this.ball.pos.x < this.pos.x + this.size.x && this.ball.pos.y > this.pos.y && this.ball.pos.y < this.pos.y + this.size.y && this.intoWater) {
ig.soundHandler.sfxPlayer.play("watersplash");
this.ball.zIndex = this.zIndex - 2;
ig.game.sortEntitiesDeferred();
var b = 0.2 * -this.ball.body.GetLinearVelocity().x,
c = 0.2 * -this.ball.body.GetLinearVelocity().y;
this.ball.body.ApplyImpulse({
x: b,
y: c
}, this.ball.body.GetPosition());
ig.game.intoWater = !0;
this.message();
var d = this.ball;
setTimeout(function() {
d.reset();
var b = ig.game.getEntitiesByType(EntityWater)[0];
b.ball = ig.game.getEntitiesByType(EntityBall)[0];
ig.game.getEntitiesByType(EntityControl)[0].fnSetCamera(b.ball)
}, 800);
this.intoWater = !1
}
this.move ? (this.pos.x += 0.2, this.pos.x > this.maxpos && (this.move = !1)) : (this.pos.x -= 0.2, this.pos.x < this.minpos && (this.move = !0))
}
},
message: function() {
this.msg = ig.game.spawnEntity(EntityText,
480, -50, {
name: "msg",
text: _STRINGS.Game.Water,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 22,
textAlign: "center",
zIndex: this.zIndex + 2,
fontWeight: "bold",
gravityFactor: 0
});
this.msg.tween({
pos: {
y: 275
}
}, 0.7, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.hidemessage()
}.bind(this)
}).start()
},
hidemessage: function() {
this.msg.tween({
pos: {
y: 560
}
}, 0.7, {
easing: ig.Tween.Easing.Quartic.EaseIn,
onComplete: function() {
this.endmessage()
}.bind(this)
}).start()
},
endmessage: function() {
this.msg.kill()
},
draw: function() {
this.parent();
for (var b = 0; b <= this.maxcoll; b++) {
this.tile1.draw(this.pos.x + 64 * b - ig.game.screen.x, this.pos.y - ig.game.screen.y);
for (var c = 0; c <= this.maxrow; c++) this.tile2.draw(this.pos.x + 64 * b - ig.game.screen.x, this.pos.y + 22 + 44 * c - ig.game.screen.y)
}
}
})
});
ig.baked = !0;
ig.module("game.entities.gameplay.ball-try").requires("impact.entity").defines(function() {
EntityBallTry = ig.Entity.extend({
size: {
x: 40,
y: 40
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/ball/ballwhite.png", 40, 40),
gravityFactor: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 0.1, [0, 1, 2, 3, 4, 5, 6, 7, 8]);
this.currentAnim = this.anims.idle
},
update: function() {
this.parent()
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.levels.hole1").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water", "game.entities.gameplay.ball-try").defines(function() {
LevelHole1 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlag",
x: 981,
y: 239,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 955,
y: 284,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 126,
y: 327,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 150,
y: 350,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 250,
y: 600,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 963,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 217,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 307,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 427,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 1027,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.levels.hole2").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water").defines(function() {
LevelHole2 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlag",
x: 991,
y: 302,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 964,
y: 347,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 111,
y: 194,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 130,
y: 240,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 250,
y: 600,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 963,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 217,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 307,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 427,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 1027,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.levels.hole3").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water").defines(function() {
LevelHole3 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlag",
x: 991,
y: 302,
settings: {
zIndex: 52
}
}, {
type: "EntityHole",
x: 964,
y: 347,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 131,
y: 194,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 150,
y: 240,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 210,
y: 330,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 963,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 217,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 307,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 427,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 1027,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.levels.hole4").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water").defines(function() {
LevelHole4 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlag",
x: 118,
y: 224,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 90,
y: 269,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 1065,
y: 275,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 1100,
y: 300,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 200,
y: 340,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 755,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 10,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 100,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 220,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 820,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.levels.hole5").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water").defines(function() {
LevelHole5 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlag",
x: 993,
y: 142,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 965,
y: 187,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 126,
y: 327,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 150,
y: 350,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 250,
y: 450,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 963,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 217,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 307,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 427,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 1027,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.levels.hole6").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water").defines(function() {
LevelHole6 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlag",
x: 963,
y: 344,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 935,
y: 389,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 123,
y: 327,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 150,
y: 350,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 250,
y: 450,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 963,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 217,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 307,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 427,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 1027,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.levels.hole7").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water").defines(function() {
LevelHole7 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlag",
x: 963,
y: 344,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 935,
y: 389,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 126,
y: 327,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 150,
y: 350,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 250,
y: 650,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 963,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 217,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 307,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 427,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 1027,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.levels.hole8").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water").defines(function() {
LevelHole8 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlag",
x: 1015,
y: 210,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 990,
y: 255,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 132,
y: 601,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 150,
y: 650,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 250,
y: 900,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 963,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 217,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 307,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 427,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 1027,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.entities.gameplay.fly-island").requires("impact.entity").defines(function() {
EntityFlyIsland = ig.Entity.extend({
size: {
x: 339,
y: 59
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/pandora.png", 339, 59),
gravityFactor: 0,
name: "flyisland",
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
update: function() {
this.parent()
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.levels.hole9").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water", "game.entities.gameplay.fly-island").defines(function() {
LevelHole9 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlyIsland",
x: 200,
y: 200,
settings: {
zIndex: 8
}
}, {
type: "EntityFlag",
x: 358,
y: 148,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 333,
y: 193,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 132,
y: 601,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 55,
y: 650,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 250,
y: 900,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 963,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 217,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 307,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 427,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 1027,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: [{
name: "collision",
width: 48,
height: 27,
linkWithCollision: !1,
visible: 1,
tilesetName: "",
repeat: !1,
preRender: !1,
distance: 1,
tilesize: 20,
foreground: !0,
data: [
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 35, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0
]
]
}]
}
});
ig.baked = !0;
ig.module("game.levels.hole10").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.fly-island", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water").defines(function() {
LevelHole10 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlyIsland",
x: 260,
y: 380,
settings: {
zIndex: 8
}
}, {
type: "EntityFlyIsland",
x: 520,
y: 180,
settings: {
zIndex: 8
}
}, {
type: "EntityFlag",
x: 380,
y: 327,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 350,
y: 372,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 974,
y: 592,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 1E3,
y: 630,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: -100,
y: 700,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 755,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 10,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 100,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonCompas",
x: 220,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 220,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 820,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityMoney",
x: 780,
y: 10,
settings: {
zIndex: 100,
realpos: {
x: 780,
y: 10
}
}
}, {
type: "EntityButtonPause",
x: 900,
y: 5,
settings: {
zIndex: 100,
realpos: {
x: 900,
y: 5
}
}
}],
layer: [{
name: "collision",
width: 48,
height: 27,
linkWithCollision: !1,
visible: !0,
tilesetName: "",
repeat: !1,
preRender: !1,
distance: 1,
tilesize: 20,
foreground: !0,
data: [
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 0, 0, 0, 0, 0],
[0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
]
}]
}
});
ig.baked = !0;
ig.module("game.levels.hole11").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.fly-island").defines(function() {
LevelHole11 = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityFlyIsland",
x: 260,
y: 380,
settings: {
zIndex: 2
}
}, {
type: "EntityFlyIsland",
x: 520,
y: 180,
settings: {
zIndex: 2
}
}],
layer: [{
name: "collision",
width: 48,
height: 27,
linkWithCollision: !1,
visible: 1,
tilesetName: "",
repeat: !1,
preRender: !1,
distance: 1,
tilesize: 20,
foreground: !0,
data: [
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]
}]
}
});
ig.baked = !0;
ig.module("game.entities.result.result-board").requires("impact.entity").defines(function() {
EntityResBoard = ig.Entity.extend({
size: {
x: 593,
y: 360
},
animSheet: new ig.AnimationSheet("media/graphics/gameplay/shopbg2.png", 593, 360),
Offset: 0,
type: ig.Entity.TYPE.B,
gravityFactor: 0,
realpos: {
x: 305,
y: 0
},
sumpar: 0,
sumstrokes: 0,
valscore: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
for (b = 0; 9 >= b; b++) isNaN(ig.game.valstroke[b]) || (this.sumstrokes += ig.game.valstroke[b],
this.sumpar += ig.game.valpar[b]);
this.valscore = this.sumpar - this.sumstrokes;
this.best = ig.game.storage.get("bestScore");
this.valscore > this.best && (ig.game.storage.set("bestScore", this.valscore), this.best = this.valscore);
this.title = ig.game.spawnEntity(EntityText, this.pos.x, this.pos.y - 50, {
name: "title",
text: _STRINGS.Results.Course,
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 50,
textAlign: "center",
zIndex: this.zIndex + 1,
fontWeight: "bold",
gravityFactor: 0
});
this.par = ig.game.spawnEntity(EntityText, this.pos.x,
this.pos.y + 150, {
name: "title",
text: _STRINGS.Results.Par + " : " + this.sumpar.toString(),
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 40,
textAlign: "center",
zIndex: this.zIndex + 1,
fontWeight: "bold",
gravityFactor: 0
});
this.score = ig.game.spawnEntity(EntityText, this.pos.x, this.pos.y + 200, {
name: "title",
text: _STRINGS.Results.Yourscore + " : " + this.valscore.toString(),
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 40,
textAlign: "center",
zIndex: this.zIndex + 1,
fontWeight: "bold",
gravityFactor: 0
});
this.best =
ig.game.spawnEntity(EntityText, this.pos.x, this.pos.y + 200, {
name: "title",
text: _STRINGS.Results.Bestscore + " : " + this.best.toString(),
fontColor: "#6d70d3",
fontStyle: "FredokaOne",
fontSize: 40,
textAlign: "center",
zIndex: this.zIndex + 1,
fontWeight: "bold",
gravityFactor: 0
});
this.home = ig.game.spawnEntity(EntityResHome, 0, 0, {
zIndex: this.zIndex + 1,
ofset: 0
});
this.try = ig.game.spawnEntity(EntityResTry, 0, 0, {
zIndex: this.zIndex + 1,
ofset: 0
});
this.show()
},
draw: function() {
this.parent()
},
update: function() {
this.parent();
this.title.pos = {
x: this.pos.x + 295,
y: this.pos.y - 10
};
this.par.pos = {
x: this.pos.x + 295,
y: this.pos.y + 80
};
this.score.pos = {
x: this.pos.x + 295,
y: this.pos.y + 150
};
this.best.pos = {
x: this.pos.x + 295,
y: this.pos.y + 220
};
this.home.pos = {
x: this.pos.x + 100 + 3 * this.home.ofset,
y: this.pos.y + 260 + this.home.ofset
};
this.try.pos = {
x: this.pos.x + 310 + 3 * this.try.ofset,
y: this.pos.y + 260 + this.try.ofset
}
},
show: function() {
this.tween({
pos: {
x: this.pos.x,
y: 100
}
}, 0.5, {
easing: ig.Tween.Easing.Sinusoidal.EaseIn,
onComplete: function() {
this.endshow()
}.bind(this)
}).start()
},
endshow: function() {},
hide: function() {
this.tween({
pos: {
x: this.pos.x,
y: -300
}
}, 0.5, {
easing: ig.Tween.Easing.Sinusoidal.EaseIn,
onComplete: function() {
this.endhide()
}.bind(this)
}).start()
},
endhide: function() {
this.title.kill();
this.kill()
}
})
});
ig.baked = !0;
ig.module("game.entities.result.button-home-try").requires("impact.entity").defines(function() {
EntityResHome = ig.Entity.extend({
size: {
x: 166,
y: 60
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/bthomebig.png", 166, 60),
small: !1,
big: !1,
gravityFactor: 0,
name: "bthome",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small &&
0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 0.5;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 0.5, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"), ig.game.valstroke = {
"0": "-",
1: "-",
2: "-",
3: "-",
4: "-",
5: "-",
6: "-",
7: "-",
8: "-",
9: "-"
}, ig.game.levelNow = 1, ig.game.loadLevel(LevelMenu)))
},
draw: function() {
this.parent()
}
});
EntityResTry = ig.Entity.extend({
size: {
x: 163,
y: 60
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/bttryagain.png", 163, 60),
small: !1,
big: !1,
gravityFactor: 0,
name: "bthome",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 0.5;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x,
b += 0.02, this.ofset -= 0.5, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button1"), ig.game.valstroke = {
"0": "-",
1: "-",
2: "-",
3: "-",
4: "-",
5: "-",
6: "-",
7: "-",
8: "-",
9: "-"
}, ig.game.levelNow = 1, ig.game.loadLevel(LevelHole1)))
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.levels.result").requires("impact.image", "game.entities.pointer", "game.entities.menu.menu-background", "game.entities.result.result-board", "game.entities.result.button-home-try").defines(function() {
LevelResult = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityMenuBackground",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityResBoard",
x: 170,
y: -400,
settings: {
zIndex: 10
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.entities.buttons.button-land-editor").requires("impact.entity", "plugins.data.vector", "game.entities.buttons.button").defines(function() {
EntityButtonLandEditor = EntityButton.extend({
collides: ig.Entity.COLLIDES.NEVER,
type: ig.Entity.TYPE.A,
size: new Vector2(48, 48),
fillColor: null,
zIndex: 95E3,
oriPos: {
x: 0,
y: 0
},
init: function(b, c, d) {
this.parent(b, c, d);
!ig.global.wm && !isNaN(d.zIndex) && (this.zIndex = d.zIndex);
this.oriPos.x = this.pos.x;
this.oriPos.y = this.pos.y
},
clicked: function() {
throw "no implementation on clicked()";
},
clicking: function() {
throw "no implementation on clicking()";
},
released: function() {
throw "no implementation on released()";
},
update: function() {
this.parent();
this.pos.x = this.oriPos.x + ig.game.screen.x;
this.pos.y = this.oriPos.y + ig.game.screen.y
},
draw: function() {
this.parent();
var b = ig.system.context;
b.strokeStyle = "white";
b.fillStyle = "white";
b.fillRect(this.pos.x - ig.game.screen.x, this.pos.y - ig.game.screen.y, this.size.x, this.size.y)
}
});
EntityButtonLandReload = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(30, 30),
clicked: function() {},
clicking: function() {},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "right";
b.fillStyle = "hotpink";
b.fillText("play", this.pos.x + this.size.x - ig.game.screen.x, this.pos.y + this.size.y + 13 - ig.game.screen.y)
}
});
EntityButtonNextPoint = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(30, 30),
clicked: function() {
this.main.addLayer()
},
clicking: function() {},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "right";
b.fillStyle = "hotpink";
b.fillText("new line", this.pos.x + this.size.x - ig.game.screen.x, this.pos.y + this.size.y + 13 - ig.game.screen.y)
}
});
EntityIncrement = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(30, 30),
clicked: function() {
ig.game.filename++;
this.main.saveButton.modifyFile()
},
clicking: function() {},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "right";
b.fillStyle = "hotpink";
b.fillText("level+", this.pos.x + this.size.x - ig.game.screen.x, this.pos.y + this.size.y + 13 - ig.game.screen.y);
b.textAlign = "center";
b.fillStyle = "black";
b.fillText(ig.game.filename, this.pos.x + 0.5 * this.size.x - ig.game.screen.x, this.pos.y + 0.5 * this.size.y - ig.game.screen.y)
}
});
EntityLog = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(30, 30),
clicked: function() {
console.log(JSON.stringify(ig.game.landpoints) + ",")
},
clicking: function() {},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "right";
b.fillStyle = "hotpink";
b.fillText("log", this.pos.x + this.size.x - ig.game.screen.x, this.pos.y + this.size.y + 13 - ig.game.screen.y);
b.fillText("Save yet? >>", this.pos.x - 0.2 * this.size.x - ig.game.screen.x, this.pos.y + 0.6 * this.size.y - ig.game.screen.y)
}
});
EntityMoveUp = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(10, 10),
clicked: function() {},
clicking: function() {
this.main.moveUp()
},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "center";
b.fillStyle = "hotpink";
b.fillText("^", this.pos.x + 0.5 * this.size.x - ig.game.screen.x, this.pos.y + 0.75 * this.size.y - ig.game.screen.y)
}
});
EntityMoveDown = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(10, 10),
clicked: function() {},
clicking: function() {
this.main.moveDown()
},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "center";
b.fillStyle = "hotpink";
b.fillText("v",
this.pos.x + 0.5 * this.size.x - ig.game.screen.x, this.pos.y + 0.75 * this.size.y - ig.game.screen.y)
}
});
EntityMoveLeft = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(10, 10),
clicked: function() {},
clicking: function() {
this.main.moveLeft()
},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "center";
b.fillStyle = "hotpink";
b.fillText("<", this.pos.x + 0.5 * this.size.x - ig.game.screen.x, this.pos.y + 0.75 * this.size.y - ig.game.screen.y)
}
});
EntityMoveRight =
EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(10, 10),
clicked: function() {},
clicking: function() {
this.main.moveRight()
},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "center";
b.fillStyle = "hotpink";
b.fillText(">", this.pos.x + 0.5 * this.size.x - ig.game.screen.x, this.pos.y + 0.75 * this.size.y - ig.game.screen.y)
}
});
EntitySpeedUp = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(10, 10),
clicked: function() {},
clicking: function() {
this.main.moveSpeed++
},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "center";
b.fillStyle = "hotpink";
b.fillText("+", this.pos.x + 0.5 * this.size.x - ig.game.screen.x, this.pos.y + 0.75 * this.size.y - ig.game.screen.y);
b.fillText(this.main.moveSpeed, this.pos.x + 2 * this.size.x - ig.game.screen.x, this.pos.y + 1.6 * this.size.y - ig.game.screen.y)
}
});
EntitySpeedDown = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(10, 10),
clicked: function() {},
clicking: function() {
0 < this.main.moveSpeed &&
this.main.moveSpeed--
},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "center";
b.fillStyle = "hotpink";
b.fillText("-", this.pos.x + 0.5 * this.size.x - ig.game.screen.x, this.pos.y + 0.75 * this.size.y - ig.game.screen.y)
}
});
EntityButtonToggleLand = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(30, 30),
clicked: function() {
ig.game.makeLand = !1
},
clicking: function() {},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "right";
b.fillStyle = "hotpink";
b.fillText("hideLand", this.pos.x + this.size.x - ig.game.screen.x, this.pos.y + this.size.y + 13 - ig.game.screen.y)
}
});
EntityButtonLoad = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(30, 30),
clicked: function() {
ig.game.levelList.loadLand()
},
clicking: function() {},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "right";
b.fillStyle = "hotpink";
b.fillText("load", this.pos.x +
this.size.x - ig.game.screen.x, this.pos.y + this.size.y + 13 - ig.game.screen.y)
}
});
EntityButtonEdit = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(30, 30),
clicked: function() {},
clicking: function() {},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "right";
b.fillStyle = "hotpink";
b.fillText("edit land", this.pos.x + this.size.x - ig.game.screen.x, this.pos.y + this.size.y + 13 - ig.game.screen.y)
}
});
EntitySaveButton = EntityButtonLandEditor.extend({
gravityFactor: 0,
size: new Vector2(30, 30),
div_layer_name: "save",
init: function(b, c, d) {
this.download = ig.game.filename;
this.parent(b, c, d);
this.clickableLayer = new ClickableDivLayer(this)
},
modifyFile: function() {},
clicked: function() {},
clicking: function() {},
released: function() {},
draw: function() {
this.parent();
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "right";
b.fillStyle = "hotpink";
b.fillText("download", this.pos.x + this.size.x - ig.game.screen.x, this.pos.y + this.size.y + 13 - ig.game.screen.y)
}
})
});
ig.baked = !0;
ig.module("game.entities.land-editor-points").requires("impact.entity", "plugins.data.vector", "game.entities.buttons.button").defines(function() {
EntityLandEditorPoints = EntityButton.extend({
collides: ig.Entity.COLLIDES.NEVER,
type: ig.Entity.TYPE.A,
size: new Vector2(10, 10),
fillColor: null,
zIndex: 85E3,
arrIndex: null,
pointIndex: null,
layerIndex: null,
gravityFactor: 0,
hold: {
x: 0,
y: 0
},
holding: !1,
currentPoint: null,
init: function(b, c, d) {
this.parent(b, c, d);
this.pos.x -= 0.5 * this.size.x;
this.pos.y -= 0.5 * this.size.y;
this.pointer =
ig.game.getEntitiesByType(EntityPointer)[0]
},
erasePoint: function() {
if (this.arrIndex == ig.game.landpoints[this.layerIndex].length - 2) {
console.log(this.arrIndex, ig.game.landpoints[this.layerIndex].length - 2);
var b = ig.game.landpoints[this.layerIndex][ig.game.landpoints[this.layerIndex].length - 2];
b.p1 && delete b.p1;
b.p2 && delete b.p2;
b.p3 && delete b.p3;
ig.game.landpoints[this.layerIndex].pop();
ig.game.director.jumpTo(LevelLandEditor)
} else 1 == ig.game.landpoints[this.layerIndex].length && 0 == this.arrIndex && (ig.game.landpoints[this.layerIndex].pop(),
ig.game.director.jumpTo(LevelLandEditor))
},
clicked: function() {
!1 == this.holding && (this.lastClickTime = ig.system.clock.delta(), this.layerIndex != this.main.layerIndex && this.main.setLayer(this.layerIndex), this.holding = this.main.showLine = !0, this.hold.x = this.pos.x - this.pointer.pos.x, this.hold.y = this.pos.y - this.pointer.pos.y, this.hold.oriX = this.pos.x, this.hold.oriY = this.pos.y, this.currentPoint = ig.game.landpoints[this.layerIndex][this.arrIndex]["p" + this.pointIndex], 3 == this.pointIndex && (this.currentPoint2 = ig.game.landpoints[this.layerIndex][this.arrIndex +
1
].p0))
},
clicking: function() {
!0 == this.holding && (this.pos.x == this.hold.oriX && this.pos.y == this.hold.oriY && 1 < ig.system.clock.delta() - this.lastClickTime && this.erasePoint(), this.pos.x = this.pointer.pos.x + this.hold.x, this.pos.y = this.pointer.pos.y + this.hold.y, this.currentPoint.x = this.pos.x + 0.5 * this.size.x, this.currentPoint.y = this.pos.y + 0.5 * this.size.y, this.currentPoint2 && (this.currentPoint2.x = this.pos.x + 0.5 * this.size.x, this.currentPoint2.y = this.pos.y + 0.5 * this.size.y))
},
released: function() {
!0 == this.holding &&
(this.holding = !1, this.main.saveButton && this.main.saveButton.modifyFile(), ig.game.levelList["level" + ig.game.level] = ig.game.landpoints)
},
draw: function() {
var b = ig.system.context;
b.fillStyle = this.layerIndex == this.main.layerIndex ? "hotpink" : "white";
this.arrIndex == ig.game.landpoints[this.layerIndex].length - 2 ? b.fillStyle = "cyan" : 1 == ig.game.landpoints[this.layerIndex].length && 0 == this.arrIndex && (b.fillStyle = "cyan");
b.fillRect(this.pos.x - ig.game.screen.x, this.pos.y - ig.game.screen.y, this.size.x, this.size.y)
}
})
});
ig.baked = !0;
ig.module("game.entities.game-control").requires("impact.entity", "game.entities.landmarker").defines(function() {
EntityGameControl = ig.Entity.extend({
size: {
x: 32,
y: 32
},
gravityFactor: 0,
zIndex: 1,
clicking: !1,
collides: ig.Entity.COLLIDES.NEVER,
type: ig.Entity.TYPE.A,
startPos: {
x: 0,
y: 0,
viewX: 0,
viewY: 0
},
endPos: {
x: 0,
y: 0,
viewX: 0,
viewY: 0
},
t: 0,
name: "game",
init: function(b, c, d) {
this.parent(b, c, d);
ig.global.wm || (this.size.x = 2E3, this.size.y = 2E3, this.pointer = ig.game.spawnEntity(EntityPointer, 800, 800, {
main: this
}), this.land =
ig.game.spawnEntity(EntityLandmarker, 800, 800, {
main: this
}), this.editBut = ig.game.spawnEntity(EntityButtonEdit, ig.system.width - 40, 10, {
main: this
}), this.logButton = ig.game.spawnEntity(EntityLog, ig.system.width - 40, 60, {
main: this
}), this.playButton = ig.game.spawnEntity(EntityButtonLandReload, ig.system.width - 40, 110, {
main: this
}), this.tweenF("t"))
},
clicked: function() {},
clicking: function() {
this.car.moveCar()
},
released: function() {},
tweener: function(b, c, d, e, f) {
var j = {};
j[b] = c;
null == f && (f = 0);
null == e && (e = "none");
this.tween("this" ==
b ? c : j, d, {
delay: f,
targ: b,
seq: e,
onComplete: function() {
null != e && this.tweenF(e, b)
}.bind(this),
easing: ig.Tween.Easing.Quadratic.EaseOut
}).start()
},
tweenF: function(b) {
switch (b) {
case "t":
this.t = 0, this.tweener("this", {
t: 1
}, 10, "t")
}
},
quadraticBezier: function(b, c, d, e) {
var f = {};
f.x = Math.pow(1 - b, 2) * c.x + 2 * (1 - b) * b * d.x + Math.pow(b, 2) * e.x;
f.y = Math.pow(1 - b, 2) * c.y + 2 * (1 - b) * b * d.y + Math.pow(b, 2) * e.y;
return f
},
cubicBezierLength: function(b, c, d, e, f) {
for (var j = 0, q = 0, n = 0, g = 0; 40 > g; g++) b = g / 39, b = this.cubicBezier(b, c, d, e, f), 0 < g &&
(q = b.x - q, n = b.y - n, j += Math.sqrt(q * q + n * n)), q = b.x, n = b.y;
return j
},
cubicBezier: function(b, c, d, e, f) {
var j = {};
j.x = Math.pow(1 - b, 3) * c.x + 3 * Math.pow(1 - b, 2) * b * d.x + 3 * (1 - b) * Math.pow(b, 2) * e.x + Math.pow(b, 3) * f.x;
j.y = Math.pow(1 - b, 3) * c.y + 3 * Math.pow(1 - b, 2) * b * d.y + 3 * (1 - b) * Math.pow(b, 2) * e.y + Math.pow(b, 3) * f.y;
return j
},
getAngle: function(b, c) {
return Math.atan2(b.y - c.y, b.x - c.x)
},
normal: function(b, c) {
return {
x: c.y - b.y,
y: c.x - b.x
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.land-editor").requires("impact.entity", "game.entities.landmarker", "game.entities.buttons.button-land-editor", "game.entities.land-editor-points", "game.entities.game-control").defines(function() {
EntityLandEditor = ig.Entity.extend({
size: {
x: 32,
y: 32
},
gravityFactor: 0,
collides: ig.Entity.COLLIDES.NEVER,
type: ig.Entity.TYPE.A,
zIndex: 2E3,
clicking: !1,
startPos: {
x: 0,
y: 0,
viewX: 0,
viewY: 0
},
endPos: {
x: 0,
y: 0,
viewX: 0,
viewY: 0
},
t: 0,
moveSpeed: 20,
instructions: "To start from empty level, change ig.game.level to a number that's never been use before and click load;To save changes made, click on log, copy the console log and paste at curve-level.js;To load specific level, change ig.game.level to your level number, and press load;Press space and drag to move screen arond;Click and hold on cyan point to delete;pink line is the active line to add new point on".split(";"),
layerIndex: 0,
arrIndex: 0,
pointIndex: 0,
hold: {
x: 0,
y: 0
},
holding: !1,
eraseMode: !0,
currentPoint: null,
name: "game",
showLine: !1,
init: function(b, c, d) {
ig.game.makeLand = !1;
this.parent(b, c, d);
ig.global.wm || (this.size.x = 2E3, this.size.y = 2E3, ig.game.screen.x = ig.game.screenRec.x, ig.game.screen.y = ig.game.screenRec.y, this.pointer = ig.game.spawnEntity(EntityPointer, 800, 800, {
main: this
}), this.land = ig.game.spawnEntity(EntityLandmarker, 800, 800, {
main: this
}), this.loadButton = ig.game.spawnEntity(EntityButtonLoad, ig.system.width -
40, 160, {
main: this
}), this.stageUp = ig.game.spawnEntity(EntityMoveUp, 599, 358, {
main: this
}), this.stageDown = ig.game.spawnEntity(EntityMoveDown, 600, 401, {
main: this
}), this.stageLeft = ig.game.spawnEntity(EntityMoveLeft, 576, 380, {
main: this
}), this.stageRight = ig.game.spawnEntity(EntityMoveRight, 623, 380, {
main: this
}), this.tweenF("t"), !1 == ig.game.makeLand && (this.showLine = !0), this.getLastPoint(), this.createControlPoints())
},
moveUp: function() {
ig.game.screen.y -= this.moveSpeed;
ig.game.screenRec.y = ig.game.screen.y
},
moveDown: function() {
ig.game.screen.y +=
this.moveSpeed;
ig.game.screenRec.y = ig.game.screen.y
},
moveLeft: function() {
ig.game.screen.x -= this.moveSpeed;
ig.game.screenRec.x = ig.game.screen.x
},
moveRight: function() {
ig.game.screen.x += this.moveSpeed;
ig.game.screenRec.x = ig.game.screen.x
},
createControlPoints: function() {
for (var b = 0; b < ig.game.landpoints.length; b++)
for (var c = 0; c < ig.game.landpoints[b].length; c++) {
var d = ig.game.landpoints[b][c];
for (property in d) {
var e = property.replace(/[^0-9]/g, "");
if (!(0 != c && 0 == e)) {
var f = d[property];
ig.game.spawnEntity(EntityLandEditorPoints,
f.x, f.y, {
main: this,
layerIndex: b,
arrIndex: c,
pointIndex: e
})
}
}
}
},
setLayer: function(b) {
this.layerIndex = b;
this.getLayerLastPoint(this.layerIndex)
},
getLastPoint: function() {
0 == ig.game.landpoints.length ? (this.layerIndex = 0, ig.game.landpoints[this.layerIndex] = []) : this.layerIndex = ig.game.landpoints.length - 1;
this.getLayerLastPoint(this.layerIndex)
},
getLayerLastPoint: function(b) {
this.layerIndex = b;
b = ig.game.landpoints[this.layerIndex];
0 == b.length ? this.pointIndex = this.arrIndex = 0 : (this.arrIndex = b.length - 1, b[this.arrIndex -
1] && 4 != Object.keys(b[this.arrIndex - 1]).length && this.arrIndex--, this.pointIndex = Object.keys(b[this.arrIndex]).length)
},
update: function() {
this.parent()
},
addLayer: function() {
this.layerIndex++;
this.arrIndex = this.pointIndex = 0
},
clicking: function() {
if (!0 == this.holding) {
var b = ig.game.io.getClickPos(),
c = this.hold.y - b.y;
ig.game.screen.x = this.hold.screenX + (this.hold.x - b.x);
ig.game.screen.y = this.hold.screenY + c;
ig.game.screenRec.x = ig.game.screen.x;
ig.game.screenRec.y = ig.game.screen.y
}
},
clicked: function() {
if (ig.input.state("move")) {
if (!1 ==
this.holding) {
this.holding = !0;
var b = ig.game.io.getClickPos();
console.log(b);
this.hold.screenX = ig.game.screen.x;
this.hold.screenY = ig.game.screen.y;
this.hold.x = b.x;
this.hold.y = b.y
}
} else {
console.log(b);
this.showLine = !0;
var c, b = {
x: this.pointer.pos.x + 0.5 * this.pointer.size.x,
y: this.pointer.pos.y + 0.5 * this.pointer.size.y
};
switch (this.pointIndex) {
case 0:
void 0 == ig.game.landpoints[this.layerIndex] && (ig.game.landpoints[this.layerIndex] = []);
ig.game.landpoints[this.layerIndex].push({
p0: {
x: b.x,
y: b.y
}
});
c = 0;
break;
case 1:
ig.game.landpoints[this.layerIndex][this.arrIndex].p3 = {
x: b.x,
y: b.y
};
c = 3;
ig.game.landpoints[this.layerIndex].push({
p0: {
x: b.x,
y: b.y
}
});
break;
case 2:
ig.game.landpoints[this.layerIndex][this.arrIndex].p1 = {
x: b.x,
y: b.y
};
c = 1;
break;
case 3:
ig.game.landpoints[this.layerIndex][this.arrIndex].p2 = {
x: b.x,
y: b.y
}, c = 2
}
this.currentPoint = ig.game.spawnEntity(EntityLandEditorPoints, b.x, b.y, {
main: this,
layerIndex: this.layerIndex,
arrIndex: this.arrIndex,
pointIndex: c
});
3 == this.pointIndex ? (this.pointIndex = (this.pointIndex +
2) % 4, this.arrIndex = ig.game.landpoints[this.layerIndex].length - 1) : this.pointIndex = (this.pointIndex + 1) % 4;
this.currentPoint.clicked()
}
},
released: function() {
!0 == this.holding && (this.holding = !1)
},
tweener: function(b, c, d, e, f) {
var j = {};
j[b] = c;
null == f && (f = 0);
null == e && (e = "none");
this.tween("this" == b ? c : j, d, {
delay: f,
targ: b,
seq: e,
onComplete: function() {
null != e && this.tweenF(e, b)
}.bind(this),
easing: ig.Tween.Easing.Quadratic.EaseOut
}).start()
},
tweenF: function(b) {
switch (b) {
case "t":
this.t = 0, this.tweener("this", {
t: 1
},
10, "t")
}
},
quadraticBezier: function(b, c, d, e) {
var f = {};
f.x = Math.pow(1 - b, 2) * c.x + 2 * (1 - b) * b * d.x + Math.pow(b, 2) * e.x;
f.y = Math.pow(1 - b, 2) * c.y + 2 * (1 - b) * b * d.y + Math.pow(b, 2) * e.y;
return f
},
cubicBezierLength: function(b, c, d, e, f) {
for (var j = 0, q = 0, n = 0, g = 0; 40 > g; g++) b = g / 39, b = this.cubicBezier(b, c, d, e, f), 0 < g && (q = b.x - q, n = b.y - n, j += Math.sqrt(q * q + n * n)), q = b.x, n = b.y;
return j
},
cubicBezier: function(b, c, d, e, f) {
var j = {};
j.x = Math.pow(1 - b, 3) * c.x + 3 * Math.pow(1 - b, 2) * b * d.x + 3 * (1 - b) * Math.pow(b, 2) * e.x + Math.pow(b, 3) * f.x;
j.y = Math.pow(1 - b, 3) *
c.y + 3 * Math.pow(1 - b, 2) * b * d.y + 3 * (1 - b) * Math.pow(b, 2) * e.y + Math.pow(b, 3) * f.y;
return j
},
getAngle: function(b, c) {
return Math.atan2(b.y - c.y, b.x - c.x)
},
normal: function(b, c) {
return {
x: c.y - b.y,
y: c.x - b.x
}
},
draw: function() {
this.parent();
if (!ig.global.wm) {
var b = ig.system.context;
b.font = "bold 10px Arial";
b.textAlign = "left";
b.fillStyle = "hotpink";
for (var c = 0; c < this.instructions.length; c++) b.fillText(this.instructions[c], 50, 30 + 30 * c);
b.lineWidth = 1;
if (!0 == this.showLine) {
for (var d = 0; d < ig.game.landpoints.length; d++) {
b.beginPath();
for (var e = 0; e < ig.game.landpoints[d].length; e++) c = ig.game.landpoints[d][e], 0 == e && b.moveTo(c.p0.x - ig.game.screen.x, c.p0.y - ig.game.screen.y), c.p2 ? b.bezierCurveTo(c.p1.x - ig.game.screen.x, c.p1.y - ig.game.screen.y, c.p2.x - ig.game.screen.x, c.p2.y - ig.game.screen.y, c.p3.x - ig.game.screen.x, c.p3.y - ig.game.screen.y) : c.p1 ? b.quadraticCurveTo(c.p1.x - ig.game.screen.x, c.p1.y - ig.game.screen.y, c.p3.x - ig.game.screen.x, c.p3.y - ig.game.screen.y) : c.p3 && b.lineTo(c.p3.x - ig.game.screen.x, c.p3.y - ig.game.screen.y);
b.strokeStyle =
this.layerIndex == d ? "cyan" : "white";
b.stroke()
}
for (d = 0; d < ig.game.landpoints.length; d++)
if (b.beginPath(), this.layerIndex == d) {
for (e = 0; e < ig.game.landpoints[d].length; e++) c = ig.game.landpoints[d][e], 0 == e && b.moveTo(c.p0.x - ig.game.screen.x, c.p0.y - ig.game.screen.y), c.p1 && b.lineTo(c.p1.x - ig.game.screen.x, c.p1.y - ig.game.screen.y), c.p2 && b.lineTo(c.p2.x - ig.game.screen.x, c.p2.y - ig.game.screen.y), c.p3 && b.lineTo(c.p3.x - ig.game.screen.x, c.p3.y - ig.game.screen.y);
b.strokeStyle = this.layerIndex == d ? "hotpink" : "white";
b.stroke()
}
}
}
}
})
});
ig.baked = !0;
ig.module("game.entities.ori-shape").requires("plugins.box2d.entity").defines(function() {
EntityOriShape = ig.Box2DEntity.extend({
gravityFactor: 0,
type: ig.Entity.TYPE.B,
checkAgainst: ig.Entity.TYPE.B,
zIndex: 1E3,
sc: 2,
size: {
x: 20,
y: 20
},
gamePaused: !1,
scX: 1,
scY: 1,
box2dType: 1,
dynamicType: 0,
density: 0.8,
friction: 0.3,
restitution: 0.1,
mass: 0.8,
INERTIA: 0,
ANGULAR_DAMPING: 0.715,
im: new ig.Image("media/graphics/sprites/door.png"),
name: "box",
broken: !1,
jointSet: !1,
sleepVel: 0.14,
vertices: [{
x: -5,
y: -10
}, {
x: 5,
y: -10
}, {
x: 5,
y: 10
}, {
x: -5,
y: 10
}],
name: "door",
alp: 1,
firstShape: !0,
slicePoints: [],
splitPoints: [],
sleepAtStart: !1,
ctxIndex: 0,
canvasPerEntity: !0,
init: function(b, c, d) {
this.parent(b, c, d);
if (!ig.global.wm) {
this.main = ig.game.getEntitiesByType(EntityGameControl)[0];
this.srcMaxX = Math.floor(1E3 / (this.im.width + 2));
this.srcMaxY = Math.floor(1E3 / (this.im.height + 2));
b = !1;
if (!1 == this.canvasPerEntity)
for (c = 0; c < ig.game.ctxVault.length; c++) ig.game.ctxVault[c].name == this.name && (this.ctxIndex = c, b = !0);
!1 == b && (0 < ig.game.freeCtxVault.length ?
this.reuseCanvas() : this.createCanvas())
}
},
reuseCanvas: function() {
this.ctxIndex = ig.game.freeCtxVault[ig.game.freeCtxVault.length - 1];
ig.game.freeCtxVault.pop();
var b = ig.game.ctxVault[this.ctxIndex];
b.name = this.name;
for (var b = [], c = 0; c < this.srcMaxX * this.srcMaxY; c++) b[c] = "empty"
},
createCanvas: function() {
var b = document.createElement("canvas"),
c = b.getContext("2d"),
d = [];
b.width = 1E3;
b.height = 1E3;
for (var e = 0; e < this.srcMaxX * this.srcMaxY; e++) d[e] = "empty";
ig.game.ctxVault.push({
ele: b,
ctx: c,
slot: d,
name: this.name
});
this.ctxIndex = ig.game.ctxVault.length - 1
},
beginContact: function(b) {
b && !0 != this.broken && "explosion" == b.name && (this.broken = !0)
},
tweenF: function() {},
update: function() {
ig.global.wm || (this.parent(), 0 < this.slicePoints.length && (this.slicePoints.length = 0))
},
ready: function() {
this.pointer = ig.game.getEntitiesByType(EntityPointer)[0]
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.levels.land-editor").requires("impact.image", "game.entities.gameplay.background", "game.entities.land-editor", "game.entities.ori-shape").defines(function() {
LevelLandEditor = {
entities: [{
type: "EntityLandEditor",
x: 0,
y: 0
}, {
type: "EntityFlag",
x: 963,
y: 344,
settings: {
zIndex: 6
}
}, {
type: "EntityOriShape",
x: 100,
y: -76
}],
layer: [{
name: "collision",
width: 100,
height: 100,
linkWithCollision: !1,
visible: 1,
tilesetName: "",
repeat: !1,
preRender: !1,
distance: 1,
tilesize: 20,
foreground: !1,
data: [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
]
]
}]
}
});
ig.baked = !0;
ig.module("game.entities.tutorial.tcontrol").requires("impact.entity").defines(function() {
EntityTcontrol = ig.Entity.extend({
size: {
x: 10,
y: 10
},
type: ig.Entity.TYPE.B,
gravityFactor: 0,
show: [],
idxNow: 1,
direction: 2,
curpos: 0,
clickcount: 0,
setposstatus: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.title = ig.game.spawnEntity(EntityText, 460, 150, {
name: "basic",
text: _STRINGS.Tutorial[0],
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 36,
textAlign: "center",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.handpos = {
"0": {
x: 15,
y: 700
},
1: {
x: 15,
y: 470
},
2: {
x: 105,
y: 470
},
3: {
x: 105,
y: 670
},
4: {
x: 420,
y: 210
},
5: {
x: 870,
y: 460
},
6: {
x: 870,
y: 700
},
7: {
x: 870,
y: 700
},
8: {
x: 870,
y: 700
},
9: {
x: 870,
y: 700
},
10: {
x: 870,
y: 700
}
};
this.handanim = ig.game.getEntitiesByType(EntityHandanim)[0];
this.move()
},
update: function() {
this.parent();
4 == this.curpos || 5 == this.curpos ? this.setposstatus && (this.handanim.rpos = !0, this.handanim.realpos.x = this.handpos[this.curpos].x, this.handanim.realpos.y = this.handpos[this.curpos].y) : (this.handanim.rpos = !1, this.handanim.pos.x =
this.handpos[this.curpos].x + ig.game.screen.x, this.setposstatus && (this.handanim.pos.y = this.handpos[this.curpos].y + ig.game.screen.y))
},
draw: function() {
this.parent()
},
move: function() {
this.setposstatus = this.handanim.rpos = !1;
this.handanim.showArrow = !1;
this.handanim.tween({
pos: {
x: this.handpos[this.curpos].x + ig.game.screen.x,
y: this.handpos[this.curpos].y + ig.game.screen.y
}
}, 0.5, {
easing: ig.Tween.Easing.Quartic.EaseOut,
onComplete: function() {
this.endmove()
}.bind(this)
}).start()
},
endmove: function() {
if (4 == this.curpos ||
5 == this.curpos) this.setposstatus = !0;
4 == this.curpos && (this.handanim.showArrow = !0)
}
})
});
ig.baked = !0;
ig.module("game.entities.tutorial.button-play-home").requires("impact.entity").defines(function() {
EntityTPlay = ig.Entity.extend({
size: {
x: 115,
y: 44
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/btplay.png", 115, 44),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small &&
0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), ig.game.ballhit = 0, ig.game.popupTraining = "", ig.game.popupTraining2 = "", ig.game.popupOpen = "", ig.game.levelNow = 1, eval("ig.game.loadLevel(LevelHole" + ig.game.levelNow + ");")))
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.levels.tutorial").requires("impact.image", "game.entities.pointer", "game.entities.menu.menu-background", "game.entities.tutorial.tcontrol", "game.entities.tutorial.button-play-home").defines(function() {
LevelTutorial = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityMenuBackground",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityTButtonPrev",
x: 20,
y: 200,
settings: {
zIndex: 10
}
}, {
type: "EntityTButtonNext",
x: 890,
y: 200,
settings: {
zIndex: 10
}
}, {
type: "EntityTPlay",
x: 480,
y: 480,
settings: {
zIndex: 10
}
}, {
type: "EntityTHome",
x: 350,
y: 480,
settings: {
zIndex: 10
}
}, {
type: "EntityTcontrol",
x: 0,
y: 0,
settings: {
zIndex: 10
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.entities.tutorial.handanim").requires("impact.entity").defines(function() {
EntityHandanim = ig.Entity.extend({
size: {
x: 80,
y: 123
},
animSheet: new ig.AnimationSheet("media/graphics/menu/handtouch.png", 80, 123),
gravityFactor: 0,
dragarrow: new ig.Image("media/graphics/gameplay/dragarrow.png"),
dragarrow2: new ig.Image("media/graphics/gameplay/dragarrow2.png"),
showArrow: !1,
realpos: {
x: 0,
y: 0
},
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 0.2, [0, 1, 2]);
this.currentAnim = this.anims.idle;
this.arrowpos =
this.pos.x - 60;
this.arrowpos2 = 2E3
},
update: function() {
this.parent();
this.rpos && (this.pos.x = this.realpos.x + ig.game.screen.x, this.pos.y = this.realpos.y + ig.game.screen.y, this.showArrow && (this.arrowpos -= 1, this.arrowpos <= this.pos.x - ig.game.screen.x - 100 && (this.arrowpos = this.pos.x - ig.game.screen.x - 60), this.arrowpos2 += 1, this.arrowpos2 >= this.pos.x - ig.game.screen.x + 115 && (this.arrowpos2 = this.pos.x - ig.game.screen.x + 75)))
},
draw: function() {
this.parent();
this.showArrow && (this.dragarrow.draw(this.arrowpos, this.pos.y),
this.dragarrow2.draw(this.arrowpos2, this.pos.y))
}
})
});
ig.baked = !0;
ig.module("game.entities.tutorial.bgtext").requires("impact.entity").defines(function() {
EntityBgtext = ig.Entity.extend({
size: {
x: 417,
y: 100
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/menu/bgtext.png", 417, 100),
gravityFactor: 0,
runTextStatus: !0,
onrun: !1,
nextText: !1,
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle;
this.text = _STRINGS.Tutorial;
this.textIndex = 1;
this.handanim = ig.game.getEntitiesByType(EntityHandanim)[0];
this.tutorialtext =
ig.game.spawnEntity(EntityText, this.pos.x, this.pos.y, {
name: "tutorialtext",
text: "",
fontColor: "#FFFFFF",
fontStyle: "FredokaOne",
fontSize: 18,
textAlign: "left",
zIndex: this.zIndex + 1,
gravityFactor: 0
});
this.btcontinue = ig.game.spawnEntity(EntityTContinue, this.realpos.x, this.realpos.y, {
zIndex: this.zIndex + 1,
realpos: this.realpos
});
this.btconunhidepos = {
x: this.realpos.x,
y: this.realpos.y
};
this.btconhidepos = {
x: this.realpos.x,
y: this.realpos.y + 500
};
this.btplay = ig.game.spawnEntity(EntityTplay, this.realpos.x, this.realpos.y, {
zIndex: this.zIndex + 1,
realpos: this.realpos
});
this.btplayunhidepos = {
x: this.realpos.x,
y: this.realpos.y
};
this.btplayhidepos = {
x: this.realpos.x,
y: this.realpos.y + 500
};
this.bthome = ig.game.spawnEntity(EntityThome, this.realpos.x, this.realpos.y, {
zIndex: this.zIndex + 1,
realpos: this.realpos
});
this.bthomeunhidepos = {
x: this.realpos.x,
y: this.realpos.y
};
this.bthomehidepos = {
x: this.realpos.x,
y: this.realpos.y + 500
};
this.btplay.realpos = this.btplayhidepos;
this.bthome.realpos = this.bthomehidepos;
this.btleft = ig.game.getEntitiesByType(EntityButtonLeft)[0];
this.btright = ig.game.getEntitiesByType(EntityButtonRight)[0];
this.btgo = ig.game.getEntitiesByType(EntityButtonGo)[0];
this.ball = ig.game.getEntitiesByType(EntityBall)[0];
this.bt5Status = this.bt4Status = this.bt3Status = this.bt2Status = this.bt1Status = !0
},
ready: function() {
this.sdrag = ig.game.getEntitiesByType(EntityScreenDrag)[0]
},
clicked: function() {
11 == ig.game.levelNow && "" == ig.game.clickContinue && this.btcontinueClick()
},
release: function() {},
btcontinueClick: function() {
var b = ig.game.getEntitiesByType(EntityTContinue)[0];
540 > b.realpos.y && b.clicked()
},
conhide: function() {
this.btleft.tleft && this.bt1Status && (this.nextText = !0, this.btcontinue.small = !0, this.bt1Status = !1);
this.btright.tright && this.bt2Status && (this.nextText = !0, this.btcontinue.small = !0, this.bt2Status = !1);
this.btgo.tgo && this.bt3Status && (this.nextText = !0, this.btcontinue.small = !0, this.bt3Status = !1);
this.btgo.tgo2 && this.bt4Status && (this.nextText = !0, this.btcontinue.small = !0, this.bt4Status = !1);
this.ball.tball && this.bt5Status && (this.nextText = !0, this.btcontinue.small = !0, this.bt5Status = !1);
if (2 == this.textIndex && !this.nextText) this.btcontinue.realpos = this.btconhidepos, this.btplay.realpos = this.btplayhidepos, this.bthome.realpos = this.bthomehidepos, ig.game.popupTraining = "", ig.game.popupTraining2 = "btgo", ig.game.popupTraining3 = "dragfalse", ig.game.clickContinue = "";
else if (3 == this.textIndex && !this.nextText) this.btcontinue.realpos = this.btconhidepos, this.btplay.realpos = this.btplayhidepos, this.bthome.realpos = this.bthomehidepos, ig.game.popupTraining = "", ig.game.popupTraining2 =
"btgo", ig.game.popupTraining3 = "dragfalse", ig.game.clickContinue = "";
else if (5 == this.textIndex && !this.nextText) this.btcontinue.realpos = this.btconhidepos, this.btplay.realpos = this.btplayhidepos, this.bthome.realpos = this.bthomehidepos, ig.game.clickContinue = "disable", this.sdrag.dragFlag && 50 < this.sdrag.dist && (this.nextText = !0, this.btcontinue.small = !0), ig.game.popupTraining = "", ig.game.popupTraining2 = "btgo", ig.game.popupTraining3 = "";
else if (6 == this.textIndex && !this.nextText) this.btcontinue.realpos = this.btconhidepos,
this.btplay.realpos = this.btplayhidepos, this.bthome.realpos = this.bthomehidepos, ig.game.popupTraining = "", ig.game.popupTraining2 = "", ig.game.popupTraining3 = "", ig.game.clickContinue = "";
else if (7 == this.textIndex && !this.nextText) this.btcontinue.realpos = this.btconhidepos, this.btplay.realpos = this.btplayhidepos, this.bthome.realpos = this.bthomehidepos, ig.game.popupTraining = "", ig.game.popupTraining2 = "", ig.game.clickContinue = "";
else if (8 == this.textIndex && !this.nextText) this.btcontinue.realpos = this.btconhidepos,
this.btplay.realpos = this.btplayhidepos, this.bthome.realpos = this.bthomehidepos, ig.game.popupTraining = "", ig.game.popupTraining2 = "", ig.game.clickContinue = "";
else if (9 == this.textIndex && !this.nextText) this.btcontinue.realpos = this.btconhidepos, this.btplay.realpos = this.btplayunhidepos, this.bthome.realpos = this.bthomehidepos, ig.game.popupTraining = "", ig.game.popupTraining2 = "btgo", ig.game.clickContinue = "";
else {
var b = this.btconunhidepos;
setTimeout(function() {
try {
ig.game.getEntitiesByType(EntityTContinue)[0].realpos =
b
} catch (c) {}
}, 100);
this.btplay.realpos = this.btplayhidepos;
this.bthome.realpos = this.bthomehidepos;
ig.game.popupTraining = "training";
ig.game.clickContinue = "";
5 == this.textIndex && (this.handanim.showArrow = !1)
}
},
setText: function(b) {
var c = 0;
this.onrun = !0;
this.tutorialtext = "";
for (var d = 0; d <= this.text[b].length - 1; d++) setTimeout(function() {
c += 1;
try {
ig.game.popupTraining3 = "training";
var d = ig.game.getEntitiesByType(EntityBgtext)[0].text[b];
ig.game.getEntityByName("tutorialtext").text = d.substr(0, c)
} catch (f) {}
},
20 * d);
setTimeout(function() {
try {
ig.game.getEntitiesByType(EntityBgtext)[0].onrun = !1, ig.game.popupTraining3 = ""
} catch (b) {}
}, 20 * (d + 1))
},
update: function() {
this.parent();
this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y + ig.game.screen.y
};
this.tutorialtext.pos = {
x: this.realpos.x + 10,
y: this.realpos.y + 25
};
this.conhide();
this.runTextStatus && (this.setText(this.textIndex), this.runTextStatus = !1)
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.tutorial.button-continue").requires("impact.entity").defines(function() {
EntityTContinue = ig.Entity.extend({
size: {
x: 85,
y: 25
},
type: ig.Entity.TYPE.B,
small: !1,
big: !1,
gravityFactor: 0,
name: "btcontinue",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.continue = ig.game.spawnEntity(EntityText, this.pos.x, this.pos.y, {
name: "continue",
text: _STRINGS.Game.Continue,
fontColor: "#3672f8",
fontStyle: "FredokaOne",
fontSize: 18,
textAlign: "left",
zIndex: this.zIndex + 1,
gravityFactor: 0,
fontWeight: "italic"
})
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else if (this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b)) {
this.big = this.small = !1;
ig.soundHandler.sfxPlayer.play("button2");
var b = ig.game.getEntitiesByType(EntityBgtext)[0],
c = ig.game.getEntitiesByType(EntityTcontrol)[0];
if (b.onrun) return;
8 ==
c.curpos ? ig.game.loadLevel(LevelMenu) : (c.curpos += 1, b.textIndex += 1, b.runTextStatus = !0, b.nextText = !1, c.move())
}
this.pos = {
x: this.realpos.x + ig.game.screen.x + 330,
y: this.realpos.y + 70
};
this.continue.pos = {
x: this.realpos.x + 330,
y: this.realpos.y + 88
}
},
draw: function() {
this.parent()
}
});
EntityTplay = ig.Entity.extend({
size: {
x: 45,
y: 25
},
type: ig.Entity.TYPE.B,
small: !1,
big: !1,
gravityFactor: 0,
name: "btcontinue",
ofset: 0,
init: function(b, c, d) {
this.parent(b, c, d);
this.continue = ig.game.spawnEntity(EntityText, this.pos.x, this.pos.y, {
name: "continue",
text: _STRINGS.Game.Play,
fontColor: "#3672f8",
fontStyle: "FredokaOne",
fontSize: 18,
textAlign: "left",
zIndex: this.zIndex + 1,
gravityFactor: 0,
fontWeight: "italic"
})
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), ig.game.ballhit = 0, ig.game.box2dPaused = !1, ig.game.popupTraining = "", ig.game.popupTraining2 = "", ig.game.popupOpen = "", ig.game.levelNow = 1, ig.game.loadLevel(LevelHole1)));
this.pos = {
x: this.realpos.x + ig.game.screen.x + 360,
y: this.realpos.y + 70
};
this.continue.pos = {
x: this.realpos.x + 360,
y: this.realpos.y + 88
}
},
draw: function() {
this.parent()
}
});
EntityThome = ig.Entity.extend({
size: {
x: 45,
y: 25
},
type: ig.Entity.TYPE.B,
small: !1,
big: !1,
gravityFactor: 0,
name: "btcontinue",
ofset: 0,
init: function(b,
c, d) {
this.parent(b, c, d);
this.continue = ig.game.spawnEntity(EntityText, this.pos.x, this.pos.y, {
name: "continue",
text: "Home",
fontColor: "#3672f8",
fontStyle: "FredokaOne",
fontSize: 18,
textAlign: "left",
zIndex: this.zIndex + 1,
gravityFactor: 0,
fontWeight: "italic"
})
},
clicked: function() {
this.small = !0
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.ofset += 1;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x &&
(b = this.scale.x, b += 0.02, this.ofset -= 1, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, ig.soundHandler.sfxPlayer.play("button2"), ig.game.ballhit = 0, ig.game.box2dPaused = !1, ig.game.popupTraining = "", ig.game.popupTraining2 = "", ig.game.levelNow = 1, ig.game.loadLevel(LevelMenu)));
this.pos = {
x: this.realpos.x + ig.game.screen.x + 300,
y: this.realpos.y + 70
};
this.continue.pos = {
x: this.realpos.x + 300,
y: this.realpos.y + 88
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.entities.tutorial.button-exit").requires("impact.entity").defines(function() {
EntityButtonExit = ig.Entity.extend({
size: {
x: 44,
y: 44
},
type: ig.Entity.TYPE.B,
animSheet: new ig.AnimationSheet("media/graphics/gameplay/btexitdemo.png", 44, 44),
small: !1,
big: !1,
gravityFactor: 0,
name: "btplay",
init: function(b, c, d) {
this.parent(b, c, d);
this.addAnim("idle", 1, [0]);
this.currentAnim = this.anims.idle
},
clicked: function() {
"" == ig.game.popupOpen && (this.small = !0)
},
released: function() {},
update: function() {
this.parent();
if (this.small && 0.8 < this.scale.x) {
var b = this.scale.x,
b = b - 0.02;
this.setScale(b, b);
0.95 >= b && (this.small = !1, this.big = !0)
} else this.big && 1.2 > this.scale.x && (b = this.scale.x, b += 0.02, this.setScale(b, b), 1 <= b && (this.big = this.small = !1, b = ig.game.getEntitiesByType(EntityBgtext)[0], b.textIndex = 10, b.runTextStatus = !0, b.nextText = !1, ig.game.ballhit = 0, ig.game.box2dPaused = !1, ig.game.popupTraining = "", ig.game.popupTraining2 = "", ig.game.levelNow = 1, ig.soundHandler.sfxPlayer.play("button2"), ig.game.loadLevel(LevelMenu)));
this.pos = {
x: this.realpos.x + ig.game.screen.x,
y: this.realpos.y + ig.game.screen.y
}
},
draw: function() {
this.parent()
}
})
});
ig.baked = !0;
ig.module("game.levels.demo").requires("impact.image", "game.entities.pointer", "game.entities.gameplay.background", "game.entities.gameplay.player", "game.entities.gameplay.ball", "game.entities.gameplay.black-bar", "game.entities.gameplay.button-left", "game.entities.gameplay.button-right", "game.entities.gameplay.button-compas", "game.entities.gameplay.button-go", "game.entities.gameplay.ball-count", "game.entities.gameplay.direction", "game.entities.gameplay.screen-drag", "game.entities.gameplay.control",
"game.entities.gameplay.flag", "game.entities.gameplay.money", "game.entities.gameplay.button-pause", "game.entities.gameplay.popup-pause", "game.entities.gameplay.button-resume", "game.entities.gameplay.button-home", "game.entities.menu.button-sfx", "game.entities.menu.button-bgm", "game.entities.gameplay.popup-result", "game.entities.gameplay.result-board", "game.entities.gameplay.button-continue", "game.entities.gameplay.water", "game.entities.gameplay.ball-try", "game.entities.tutorial.handanim", "game.entities.tutorial.tcontrol",
"game.entities.tutorial.bgtext", "game.entities.tutorial.button-continue", "game.entities.tutorial.button-exit").defines(function() {
LevelDemo = {
entities: [{
type: "EntityPointer",
x: 0,
y: 0,
settings: {
zIndex: 1
}
}, {
type: "EntityBackground1",
x: 0,
y: 0,
settings: {
zIndex: 2
}
}, {
type: "EntityBackground2",
x: 0,
y: 0,
settings: {
zIndex: 3
}
}, {
type: "EntityBackground3",
x: 0,
y: -50,
settings: {
zIndex: 4
}
}, {
type: "EntityFlag",
x: 981,
y: 239,
settings: {
zIndex: 51
}
}, {
type: "EntityHole",
x: 955,
y: 284,
settings: {
zIndex: 55
}
}, {
type: "EntityPlayer",
x: 123,
y: 328,
settings: {
zIndex: 30
}
}, {
type: "EntityBall",
x: 139,
y: 382,
settings: {
zIndex: 54
}
}, {
type: "EntityWater",
x: 250,
y: 600,
settings: {
zIndex: 49
}
}, {
type: "EntityDirection",
x: -100,
y: 0,
settings: {
zIndex: 46
}
}, {
type: "EntityScreenDrag",
x: 0,
y: 0,
settings: {
zIndex: 90
}
}, {
type: "EntityControl",
x: 0,
y: 0,
settings: {
zIndex: 95
}
}, {
type: "EntityBlackBar",
x: 755,
y: 373,
settings: {
zIndex: 95,
realpos: {
x: 755,
y: 373
}
}
}, {
type: "EntityButtonLeft",
x: 10,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 10,
y: 450
}
}
}, {
type: "EntityButtonRight",
x: 100,
y: 450,
settings: {
zIndex: 100,
realpos: {
x: 100,
y: 450
}
}
}, {
type: "EntityButtonGo",
x: 820,
y: 440,
settings: {
zIndex: 100,
realpos: {
x: 820,
y: 440
}
}
}, {
type: "EntityHandanim",
x: -100,
y: 0,
settings: {
zIndex: 150
}
}, {
type: "EntityTcontrol",
x: 0,
y: 0,
settings: {
zIndex: 10
}
}, {
type: "EntityBgtext",
x: 230,
y: 430,
settings: {
zIndex: 115,
realpos: {
x: 230,
y: 430
}
}
}, {
type: "EntityButtonExit",
x: 900,
y: 10,
settings: {
zIndex: 115,
realpos: {
x: 900,
y: 10
}
}
}],
layer: []
}
});
ig.baked = !0;
ig.module("game.main").requires("impact.game", "impact.debug.debug", "plugins.patches.webkit-image-smoothing-patch", "plugins.patches.windowfocus-onMouseDown-patch", "plugins.handlers.dom-handler", "plugins.handlers.size-handler", "plugins.handlers.api-handler", "plugins.audio.sound-handler", "plugins.io.io-manager", "plugins.splash-loader", "plugins.tween", "plugins.url-parameters", "plugins.director", "plugins.impact-storage", "plugins.fake-storage", "plugins.scale", "plugins.animation-scaling", "plugins.box2d.game",
"plugins.camera", "plugins.curve-level", "plugins.branding.splash", "game.entities.branding-logo-placeholder", "game.entities.buttons.button-more-games", "game.entities.opening-shield", "game.entities.opening-kitty", "game.entities.pointer", "game.entities.pointer-selector", "game.entities.select", "game.entities.text", "game.entities.landmarker", "game.levels.opening", "game.levels.test-desktop", "game.levels.test-mobile", "game.levels.menu", "game.levels.hole1", "game.levels.hole2", "game.levels.hole3", "game.levels.hole4",
"game.levels.hole5", "game.levels.hole6", "game.levels.hole7", "game.levels.hole8", "game.levels.hole9", "game.levels.hole10", "game.levels.hole11", "game.levels.result", "game.levels.land-editor", "game.levels.tutorial", "game.levels.demo").defines(function() {
this.FRAMEBREAKER;
MyGame = ig.Box2DGame.extend({
io: null,
paused: !1,
popupOpen: "",
pauseClick: !0,
freeCtxVault: [],
ctxVault: [],
gravity: 712.5,
power: 0,
maxpower: 35,
camfollow: 0,
landpoints: [],
makeLand: !0,
screenRec: {
x: 0,
y: 0
},
landEle: null,
ballhit: 0,
levelNow: 1,
yoffset: 0,
valpar: {
"0": 4,
1: 4,
2: 3,
3: 3,
4: 3,
5: 4,
6: 5,
7: 6,
8: 5,
9: 4,
10: 0
},
valstroke: {
"0": "-",
1: "-",
2: "-",
3: "-",
4: "-",
5: "-",
6: "-",
7: "-",
8: "-",
9: "-",
10: "-"
},
intoWater: !1,
playerChar: 1,
ballSelect: 1,
gameMoney: 0,
posHats: {
"0": {
x: 125,
y: 140
},
1: {
x: 250,
y: 140
},
2: {
x: 375,
y: 140
}
},
posVal: {
"0": 1,
1: 2,
2: 3
},
popupTraining: "",
popupTraining2: "",
popupTraining3: "",
clickContinue: "",
init: function() {
this.setupmobiltrGameCenter();
this.setupLocalStorage();
this.io = new IoManager;
this.setupUrlParams = new ig.UrlParameters;
this.removeLoadingWheel();
this.finalize();
ig.game.levelList = new CurveLevel;
ig.game.levelList.loadLand()
},
setupLocalStorage: function() {
try {
window.localStorage.setItem("test", "test"), this.storage = new ig.Storage
} catch (b) {
console.log("using fake storage"), this.storage = new ig.FakeStorage
}(null == this.storage.get("hat") || "" == this.storage.get("hat")) && this.storage.set("hat", 1);
(null == this.storage.get("ballshop") || "" == this.storage.get("ballshop")) && this.storage.set("ballshop", 1);
(null == this.storage.get("money") || "" == this.storage.get("money")) &&
this.storage.set("money", 0);
null == this.storage.get("firstPlay") && this.storage.set("firstPlay", !0);
for (i = 2; 10 >= i; i++)(null == this.storage.get("hatlock" + i.toString()) || "" == this.storage.get("hatlock" + i.toString())) && this.storage.set("hatlock" + i.toString(), 0);
this.gameMoney = this.storage.get("money");
this.playerChar = this.storage.get("hat");
null == this.storage.get("bgmMute") && this.storage.set("bgmMute", !1);
null == this.storage.get("sfxMute") && this.storage.set("sfxMute", !1);
null == this.storage.get("bestScore") &&
this.storage.set("bestScore", 0);
1 == this.storage.get("ballshop") && (this.maxpower = 35)
},
setupmobiltrGameCenter: function() {
if (_SETTINGS)
if (_SETTINGS.mobiltrGameCenter) {
var b = ig.domHandler.getElementByClass("gamecenter-activator");
_SETTINGS.mobiltrGameCenter.Activator.Enabled && _SETTINGS.mobiltrGameCenter.Activator.Position && (console.log("mobiltrGameCenter activator settings present ...."), ig.domHandler.css(b, {
position: "absolute",
left: _SETTINGS.mobiltrGameCenter.Activator.Position.Left,
top: _SETTINGS.mobiltrGameCenter.Activator.Position.Top,
"z-index": 3
}));
ig.domHandler.show(b)
} else console.log("mobiltrGameCenter settings not defined in game settings")
},
finalize: function() {
if (ig.ua.mobile) {
var b = ig.domHandler.getElementById("#play");
ig.domHandler.attr(b, "onclick", 'ig.soundHandler.sfxPlayer.play("staticSound");ig.game.splashClick();');
ig.domHandler.show(b)
} else this.start();
ig.sizeHandler.reorient()
},
removeLoadingWheel: function() {
try {
$("#ajaxbar").css("background", "none")
} catch (b) {
console.log(b)
}
},
showDebugMenu: function() {
console.log("showing debug menu ...");
ig.Entity._debugShowBoxes = !0;
$(".ig_debug").show()
},
start: function() {
this.resetPlayerStats();
this.director = ig.ua.mobile ? new ig.Director(this, [LevelOpening, LevelMenu, LevelTestMobile]) : new ig.Director(this, [LevelOpening, LevelMenu, LevelTestDesktop]);
if (_SETTINGS.Branding.Splash.Disabled) try {
this.branding = new ig.BrandingSplash
} catch (b) {
console.log(b), console.log("Loading original levels ..."), this.director.loadLevel(this.director.currentLevel)
} else this.director.loadLevel(this.director.currentLevel);
this.spawnEntity(EntityPointerSelector,
50, 50);
ig.soundHandler.bgmPlayer.play(ig.soundHandler.bgmPlayer.soundList.background);
this.storage.get("bgmMute") && ig.soundHandler.bgmPlayer.mute(!0)
},
fpsCount: function() {
this.fpsTimer || (this.fpsTimer = new ig.Timer(1));
this.fpsTimer && 0 > this.fpsTimer.delta() ? null != this.fpsCounter ? this.fpsCounter++ : this.fpsCounter = 0 : (ig.game.fps = this.fpsCounter, this.fpsCounter = 0, this.fpsTimer.reset())
},
endGame: function() {
console.log("End game");
ig.soundHandler.bgmPlayer.stop();
ig.apiHandler.run("MJSEnd")
},
resetPlayerStats: function() {
ig.log("resetting player stats ...");
this.playerStats = {
id: this.playerStats ? this.playerStats.id : null
}
},
splashClick: function() {
var b = ig.domHandler.getElementById("#play");
ig.domHandler.hide(b);
ig.apiHandler.run("MJSFooter");
ig.apiHandler.run("MJSHeader");
ig.game.start()
},
pauseGame: function() {
ig.system.stopRunLoop.call(ig.system);
console.log("Game Paused")
},
resumeGame: function() {
ig.system.startRunLoop.call(ig.system);
console.log("Game Resumed")
},
showOverlay: function(b) {
for (i = 0; i < b.length; i++) $("#" + b[i]) && $("#" + b[i]).show(), document.getElementById(b[i]) &&
(document.getElementById(b[i]).style.visibility = "visible")
},
hideOverlay: function(b) {
for (i = 0; i < b.length; i++) $("#" + b[i]) && $("#" + b[i]).hide(), document.getElementById(b[i]) && (document.getElementById(b[i]).style.visibility = "hidden")
},
currentBGMVolume: 1,
addition: 0.1,
update: function() {
this.paused ? this.updateWhilePaused() : (this.parent(), ig.ua.mobile && ig.soundHandler && ig.soundHandler.forceLoopBGM())
},
updateWhilePaused: function() {
for (var b = 0; b < this.entities.length; b++) this.entities[b].ignorePause && this.entities[b].update()
},
draw: function() {
this.parent()
},
clearCanvas: function(b, c, d) {
var e = b.canvas;
b.clearRect(0, 0, c, d);
e.style.display = "none";
e.offsetHeight;
e.style.display = "inherit"
},
drawDebug: function() {
if (!ig.global.wm && (this.debugEnable(), this.viewDebug && (ig.system.context.fillStyle = "#000000", ig.system.context.globalAlpha = 0.35, ig.system.context.fillRect(0, 0, ig.system.width / 4, ig.system.height), ig.system.context.globalAlpha = 1, this.debug && 0 < this.debug.length)))
for (i = 0; i < this.debug.length; i++) ig.system.context.font = "10px Arial",
ig.system.context.fillStyle = "#ffffff", ig.system.context.fillText(this.debugLine - this.debug.length + i + ": " + this.debug[i], 10, 50 + 10 * i)
},
debugCL: function(b) {
this.debug ? (50 > this.debug.length || this.debug.splice(0, 1), this.debug.push(b), this.debugLine++) : (this.debug = [], this.debugLine = 1, this.debug.push(b));
console.log(b)
},
debugEnable: function() {
ig.input.pressed("click") && (this.debugEnableTimer = new ig.Timer(2));
this.debugEnableTimer && 0 > this.debugEnableTimer.delta() ? ig.input.released("click") && (this.debugEnableTimer =
null) : this.debugEnableTimer && 0 < this.debugEnableTimer.delta() && (this.debugEnableTimer = null, this.viewDebug = this.viewDebug ? !1 : !0)
}
});
ig.domHandler = null;
ig.domHandler = new ig.DomHandler;
ig.domHandler.forcedDeviceDetection();
ig.domHandler.forcedDeviceRotation();
ig.apiHandler = new ig.ApiHandler;
ig.sizeHandler = new ig.SizeHandler(ig.domHandler);
ig.ua.mobile ? (ig.Sound.enabled = !1, ig.main("#canvas", MyGame, 60, ig.sizeHandler.mobile.actualResolution.x, ig.sizeHandler.mobile.actualResolution.y, ig.sizeHandler.scale,
ig.SplashLoader), ig.sizeHandler.resize()) : ig.main("#canvas", MyGame, 60, ig.sizeHandler.desktop.actualResolution.x, ig.sizeHandler.desktop.actualResolution.y, ig.sizeHandler.scale, ig.SplashLoader);
ig.soundHandler = null;
ig.soundHandler = new ig.SoundHandler;
ig.sizeHandler.reorient()
});