BlueGit

blue-star speeltuin

frogloop

timfa wsadhelios · pushed by timfa

Authored 2022-10-20 · 4 years ago

Hash
a3d0f98dd29458f4b53597a253542e5d41bc3f38
Parent
da11b9ef
5 files changed +115 −69
build/framework.js +48 −48
@@ -1,7 +1,7 @@
1 1
2 2 /*
3 3 * Start File:
4 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/game.js
4 * ./framework/engine/game.js
5 5 */
6 6 class Game
7 7 {
@@ -122,12 +122,12 @@ class Game
122 122 }
123 123 /*
124 124 * End File:
125 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/game.js
125 * ./framework/engine/game.js
126 126 */
127 127
128 128 /*
129 129 * Start File:
130 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/gameobject.js
130 * ./framework/engine/gameobject.js
131 131 */
132 132 class GameObject
133 133 {
@@ -170,12 +170,12 @@ class GameObject
170 170 }
171 171 /*
172 172 * End File:
173 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/gameobject.js
173 * ./framework/engine/gameobject.js
174 174 */
175 175
176 176 /*
177 177 * Start File:
178 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/image.js
178 * ./framework/engine/image.js
179 179 */
180 180 class image
181 181 {
@@ -292,12 +292,12 @@ class image
292 292 }
293 293 /*
294 294 * End File:
295 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/image.js
295 * ./framework/engine/image.js
296 296 */
297 297
298 298 /*
299 299 * Start File:
300 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/collider.js
300 * ./framework/engine/objectComponents/collider.js
301 301 */
302 302 class Collider
303 303 {
@@ -405,17 +405,17 @@ class Collider
405 405 //CHECK FROM OBJ PERSPECTIVE
406 406 var points =
407 407 [
408 [this.gameObject.transform.position.x - hw, this.gameObject.transform.position.y - hh], // topleft
409 [this.gameObject.transform.position.x + hw, this.gameObject.transform.position.y - hh], // topright
410 [this.gameObject.transform.position.x - hw, this.gameObject.transform.position.y + hh], // bottomleft
411 [this.gameObject.transform.position.x + hw, this.gameObject.transform.position.y + hh] // bottomright
408 this.gameObject.transform.position.x - hw,
409 this.gameObject.transform.position.x + hw,
410 this.gameObject.transform.position.y - hh,
411 this.gameObject.transform.position.y + hh
412 412 ];
413 413
414 if (points[0][0] >= o2.transform.position.x - ohw && points[0][0] <= o2.transform.position.x + ohw ||
415 points[0][1] >= o2.transform.position.x - ohw && points[0][0] <= o2.transform.position.x + ohw)
414 if (points[0] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw ||
415 points[1] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw)
416 416 {
417 if (points[2][0] > o2.transform.position.y - ohh && points[0][0] <= o2.transform.position.x + ohh ||
418 points[2][1] >= o2.transform.position.y - ohh && points[2][0] <= o2.transform.position.y + ohh)
417 if (points[2] > o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh ||
418 points[3] >= o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh)
419 419 {
420 420 hit = true;
421 421 }
@@ -430,12 +430,12 @@ class Collider
430 430 }
431 431 /*
432 432 * End File:
433 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/collider.js
433 * ./framework/engine/objectComponents/collider.js
434 434 */
435 435
436 436 /*
437 437 * Start File:
438 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/renderer.js
438 * ./framework/engine/objectComponents/renderer.js
439 439 */
440 440 class Renderer
441 441 {
@@ -605,12 +605,12 @@ class Renderer
605 605 }
606 606 /*
607 607 * End File:
608 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/renderer.js
608 * ./framework/engine/objectComponents/renderer.js
609 609 */
610 610
611 611 /*
612 612 * Start File:
613 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/transform.js
613 * ./framework/engine/objectComponents/transform.js
614 614 */
615 615 class Transform
616 616 {
@@ -681,12 +681,12 @@ class Transform
681 681 }
682 682 /*
683 683 * End File:
684 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/transform.js
684 * ./framework/engine/objectComponents/transform.js
685 685 */
686 686
687 687 /*
688 688 * Start File:
689 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/scene.js
689 * ./framework/engine/scene.js
690 690 */
691 691 class Scene
692 692 {
@@ -897,12 +897,12 @@ class Scene
897 897 }
898 898 /*
899 899 * End File:
900 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/scene.js
900 * ./framework/engine/scene.js
901 901 */
902 902
903 903 /*
904 904 * Start File:
905 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/extentions.js
905 * ./framework/extensions/extentions.js
906 906 */
907 907 /**
908 908 * Extending exising functionality
@@ -958,12 +958,12 @@ Array.prototype.random = function ()
958 958 };
959 959 /*
960 960 * End File:
961 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/extentions.js
961 * ./framework/extensions/extentions.js
962 962 */
963 963
964 964 /*
965 965 * Start File:
966 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/polyfills.js
966 * ./framework/extensions/polyfills.js
967 967 */
968 968 if (!Math.sign)
969 969 {
@@ -981,12 +981,12 @@ if (!Math.sign)
981 981 (function (e) { var t = function () { try { return !!Symbol.iterator; } catch (e) { return false; } }; var n = t(); var r = function (e) { var t = { next: function () { var t = e.shift(); return { done: t === void 0, value: t }; } }; if (n) { t[Symbol.iterator] = function () { return t; }; } return t; }; var i = function (e) { return encodeURIComponent(e).replace(/%20/g, "+"); }; var o = function (e) { return decodeURIComponent(e).replace(/\+/g, " "); }; var a = function () { var t = function (e) { Object.defineProperty(this, "_entries", { value: {} }); if (typeof e === "string") { if (e !== "") { e = e.replace(/^\?/, ""); var n = e.split("&"); var r; for (var i = 0; i < n.length; i++) { r = n[i].split("="); this.append(o(r[0]), r.length > 1 ? o(r[1]) : ""); } } } else if (e instanceof t) { var a = this; e.forEach(function (e, t) { a.append(e, t); }); } }; var a = t.prototype; a.append = function (e, t) { if (e in this._entries) { this._entries[e].push(t.toString()); } else { this._entries[e] = [t.toString()]; } }; a.delete = function (e) { delete this._entries[e]; }; a.get = function (e) { return e in this._entries ? this._entries[e][0] : null; }; a.getAll = function (e) { return e in this._entries ? this._entries[e].slice(0) : []; }; a.has = function (e) { return e in this._entries; }; a.set = function (e, t) { this._entries[e] = [t.toString()]; }; a.forEach = function (e, t) { var n; for (var r in this._entries) { if (this._entries.hasOwnProperty(r)) { n = this._entries[r]; for (var i = 0; i < n.length; i++) { e.call(t, n[i], r, this); } } } }; a.keys = function () { var e = []; this.forEach(function (t, n) { e.push(n); }); return r(e); }; a.values = function () { var e = []; this.forEach(function (t) { e.push(t); }); return r(e); }; a.entries = function () { var e = []; this.forEach(function (t, n) { e.push([n, t]); }); return r(e); }; if (n) { a[Symbol.iterator] = a.entries; } a.toString = function () { var e = []; this.forEach(function (t, n) { e.push(i(n) + "=" + i(t)); }); return e.join("&"); }; e.URLSearchParams = t; }; if (!("URLSearchParams" in e) || new URLSearchParams("?a=1").toString() !== "a=1") { a(); } })(typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : this); (function (e) { var t = function () { try { var e = new URL("b", "http://a"); e.pathname = "c%20d"; return e.href === "http://a/c%20d" && e.searchParams; } catch (e) { return false; } }; var n = function () { var t = e.URL; var n = function (e, t) { if (typeof e !== "string") e = String(e); var n = document.implementation.createHTMLDocument(""); window.doc = n; if (t) { var r = n.createElement("base"); r.href = t; n.head.appendChild(r); } var i = n.createElement("a"); i.href = e; n.body.appendChild(i); i.href = i.href; if (i.protocol === ":" || !/:/.test(i.href)) { throw new TypeError("Invalid URL"); } Object.defineProperty(this, "_anchorElement", { value: i }); }; var r = n.prototype; var i = function (e) { Object.defineProperty(r, e, { get: function () { return this._anchorElement[e]; }, set: function (t) { this._anchorElement[e] = t; }, enumerable: true }); };["hash", "host", "hostname", "port", "protocol", "search"].forEach(function (e) { i(e); }); Object.defineProperties(r, { toString: { get: function () { var e = this; return function () { return e.href; }; } }, href: { get: function () { return this._anchorElement.href.replace(/\?$/, ""); }, set: function (e) { this._anchorElement.href = e; }, enumerable: true }, pathname: { get: function () { return this._anchorElement.pathname.replace(/(^\/?)/, "/"); }, set: function (e) { this._anchorElement.pathname = e; }, enumerable: true }, origin: { get: function () { var e = { "http:": 80, "https:": 443, "ftp:": 21 }[this._anchorElement.protocol]; var t = this._anchorElement.port != e && this._anchorElement.port !== ""; return this._anchorElement.protocol + "//" + this._anchorElement.hostname + (t ? ":" + this._anchorElement.port : ""); }, enumerable: true }, password: { get: function () { return ""; }, set: function (e) { }, enumerable: true }, username: { get: function () { return ""; }, set: function (e) { }, enumerable: true }, searchParams: { get: function () { var e = new URLSearchParams(this.search); var t = this;["append", "delete", "set"].forEach(function (n) { var r = e[n]; e[n] = function () { r.apply(e, arguments); t.search = e.toString(); }; }); return e; }, enumerable: true } }); n.createObjectURL = function (e) { return t.createObjectURL.apply(t, arguments); }; n.revokeObjectURL = function (e) { return t.revokeObjectURL.apply(t, arguments); }; e.URL = n; }; if (!t()) { n(); } if (e.location !== void 0 && !("origin" in e.location)) { var r = function () { return e.location.protocol + "//" + e.location.hostname + (e.location.port ? ":" + e.location.port : ""); }; try { Object.defineProperty(e.location, "origin", { get: r, enumerable: true }); } catch (t) { setInterval(function () { e.location.origin = r(); }, 100); } } })(typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : this);
982 982 /*
983 983 * End File:
984 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/polyfills.js
984 * ./framework/extensions/polyfills.js
985 985 */
986 986
987 987 /*
988 988 * Start File:
989 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/thirdparty.js
989 * ./framework/extensions/thirdparty.js
990 990 */
991 991 /*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
992 992 !function (a, b) { "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function (a) { if (!a.document) throw new Error("jQuery requires a window with a document"); return b(a); } : b(a); }("undefined" != typeof window ? window : this, function (a, b)
@@ -1123,12 +1123,12 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1123 1123 var TWEEN = TWEEN || function () { var n = []; return { getAll: function () { return n; }, removeAll: function () { n = []; }, add: function (t) { n.push(t); }, remove: function (t) { var r = n.indexOf(t); -1 !== r && n.splice(r, 1); }, update: function (t, r) { if (0 === n.length) return !1; var i = 0; for (t = void 0 !== t ? t : TWEEN.now(); i < n.length;)n[i].update(t) || r ? i++ : n.splice(i, 1); return !0; } }; }(); !function () { void 0 === this.window && void 0 !== this.process ? TWEEN.now = function () { var n = process.hrtime(); return 1e3 * n[0] + n[1] / 1e3; } : void 0 !== this.window && void 0 !== window.performance && void 0 !== window.performance.now ? TWEEN.now = window.performance.now.bind(window.performance) : void 0 !== Date.now ? TWEEN.now = Date.now : TWEEN.now = function () { return (new Date).getTime(); }; }(), TWEEN.Tween = function (n) { var t = n, r = {}, i = {}, o = {}, u = 1e3, e = 0, a = !1, f = !1, c = !1, s = 0, h = null, l = TWEEN.Easing.Linear.None, E = TWEEN.Interpolation.Linear, p = [], d = null, v = !1, w = null, I = null, M = null, C = null, S = null, ST = null; for (var T in n) r[T] = parseFloat(n[T], 10); this.to = function (n, t) { return void 0 !== t && (u = t), i = n, this; }, this.start = function (n) { TWEEN.add(this), f = !0, v = !1, h = void 0 !== n ? n : TWEEN.now(), h += s; for (var u in i) { if (i[u] instanceof Array) { if (0 === i[u].length) continue; i[u] = [t[u]].concat(i[u]); } void 0 !== r[u] && (r[u] = t[u], r[u] instanceof Array == !1 && (r[u] *= 1), o[u] = r[u] || 0); } return this; }, this.stop = function () { return f ? (TWEEN.remove(this), f = !1, null !== M && M.call(S), this.stopChainedTweens(), this) : this; }, this.stopChainedTweens = function () { for (var n = 0, t = p.length; t > n; n++)p[n].stop(); }, this.delay = function (n) { return s = n, this; }, this.repeat = function (n) { return e = n, this; }, this.yoyo = function (n) { return a = n, this; }, this.easing = function (n) { return l = n, this; }, this.interpolation = function (n) { return E = n, this; }, this.chain = function () { return p = arguments, this; }, this.onStart = function (n, c) { return d = n, ST = c, this; }, this.onUpdate = function (n) { return w = n, this; }, this.onComplete = function (n, c) { return I = n, C = c, this; }, this.onStop = function (n, c) { return M = n, S = c, this; }, this.update = function (n) { var f, M, T; if (h > n) return !0; v === !1 && (null !== d && d.call(ST), v = !0), M = (n - h) / u, M = M > 1 ? 1 : M, T = l(M); for (f in i) if (void 0 !== r[f]) { var N = r[f] || 0, W = i[f]; W instanceof Array ? t[f] = E(W, T) : ("string" == typeof W && (W = "+" === W.charAt(0) || "-" === W.charAt(0) ? N + parseFloat(W, 10) : parseFloat(W, 10)), "number" == typeof W && (t[f] = N + (W - N) * T)); } if (null !== w && w.call(t, T), 1 === M) { if (e > 0) { isFinite(e) && e--; for (f in o) { if ("string" == typeof i[f] && (o[f] = o[f] + parseFloat(i[f], 10)), a) { var O = o[f]; o[f] = i[f], i[f] = O; } r[f] = o[f]; } return a && (c = !c), h = n + s, !0; } null !== I && I.call(C); for (var m = 0, g = p.length; g > m; m++)p[m].start(h + u); return !1; } return !0; }; }, TWEEN.Easing = { Linear: { None: function (n) { return n; } }, Quadratic: { In: function (n) { return n * n; }, Out: function (n) { return n * (2 - n); }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n : -.5 * (--n * (n - 2) - 1); } }, Cubic: { In: function (n) { return n * n * n; }, Out: function (n) { return --n * n * n + 1; }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n * n : .5 * ((n -= 2) * n * n + 2); } }, Quartic: { In: function (n) { return n * n * n * n; }, Out: function (n) { return 1 - --n * n * n * n; }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n * n * n : -.5 * ((n -= 2) * n * n * n - 2); } }, Quintic: { In: function (n) { return n * n * n * n * n; }, Out: function (n) { return --n * n * n * n * n + 1; }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n * n * n * n : .5 * ((n -= 2) * n * n * n * n + 2); } }, Sinusoidal: { In: function (n) { return 1 - Math.cos(n * Math.PI / 2); }, Out: function (n) { return Math.sin(n * Math.PI / 2); }, InOut: function (n) { return .5 * (1 - Math.cos(Math.PI * n)); } }, Exponential: { In: function (n) { return 0 === n ? 0 : Math.pow(1024, n - 1); }, Out: function (n) { return 1 === n ? 1 : 1 - Math.pow(2, -10 * n); }, InOut: function (n) { return 0 === n ? 0 : 1 === n ? 1 : (n *= 2) < 1 ? .5 * Math.pow(1024, n - 1) : .5 * (-Math.pow(2, -10 * (n - 1)) + 2); } }, Circular: { In: function (n) { return 1 - Math.sqrt(1 - n * n); }, Out: function (n) { return Math.sqrt(1 - --n * n); }, InOut: function (n) { return (n *= 2) < 1 ? -.5 * (Math.sqrt(1 - n * n) - 1) : .5 * (Math.sqrt(1 - (n -= 2) * n) + 1); } }, Elastic: { In: function (n) { return 0 === n ? 0 : 1 === n ? 1 : -Math.pow(2, 10 * (n - 1)) * Math.sin(5 * (n - 1.1) * Math.PI); }, Out: function (n) { return 0 === n ? 0 : 1 === n ? 1 : Math.pow(2, -10 * n) * Math.sin(5 * (n - .1) * Math.PI) + 1; }, InOut: function (n) { return 0 === n ? 0 : 1 === n ? 1 : (n *= 2, 1 > n ? -.5 * Math.pow(2, 10 * (n - 1)) * Math.sin(5 * (n - 1.1) * Math.PI) : .5 * Math.pow(2, -10 * (n - 1)) * Math.sin(5 * (n - 1.1) * Math.PI) + 1); } }, Back: { In: function (n) { var t = 1.70158; return n * n * ((t + 1) * n - t); }, Out: function (n) { var t = 1.70158; return --n * n * ((t + 1) * n + t) + 1; }, InOut: function (n) { var t = 2.5949095; return (n *= 2) < 1 ? .5 * (n * n * ((t + 1) * n - t)) : .5 * ((n -= 2) * n * ((t + 1) * n + t) + 2); } }, Bounce: { In: function (n) { return 1 - TWEEN.Easing.Bounce.Out(1 - n); }, Out: function (n) { return 1 / 2.75 > n ? 7.5625 * n * n : 2 / 2.75 > n ? 7.5625 * (n -= 1.5 / 2.75) * n + .75 : 2.5 / 2.75 > n ? 7.5625 * (n -= 2.25 / 2.75) * n + .9375 : 7.5625 * (n -= 2.625 / 2.75) * n + .984375; }, InOut: function (n) { return .5 > n ? .5 * TWEEN.Easing.Bounce.In(2 * n) : .5 * TWEEN.Easing.Bounce.Out(2 * n - 1) + .5; } } }, TWEEN.Interpolation = { Linear: function (n, t) { var r = n.length - 1, i = r * t, o = Math.floor(i), u = TWEEN.Interpolation.Utils.Linear; return 0 > t ? u(n[0], n[1], i) : t > 1 ? u(n[r], n[r - 1], r - i) : u(n[o], n[o + 1 > r ? r : o + 1], i - o); }, Bezier: function (n, t) { for (var r = 0, i = n.length - 1, o = Math.pow, u = TWEEN.Interpolation.Utils.Bernstein, e = 0; i >= e; e++)r += o(1 - t, i - e) * o(t, e) * n[e] * u(i, e); return r; }, CatmullRom: function (n, t) { var r = n.length - 1, i = r * t, o = Math.floor(i), u = TWEEN.Interpolation.Utils.CatmullRom; return n[0] === n[r] ? (0 > t && (o = Math.floor(i = r * (1 + t))), u(n[(o - 1 + r) % r], n[o], n[(o + 1) % r], n[(o + 2) % r], i - o)) : 0 > t ? n[0] - (u(n[0], n[0], n[1], n[1], -i) - n[0]) : t > 1 ? n[r] - (u(n[r], n[r], n[r - 1], n[r - 1], i - r) - n[r]) : u(n[o ? o - 1 : 0], n[o], n[o + 1 > r ? r : o + 1], n[o + 2 > r ? r : o + 2], i - o); }, Utils: { Linear: function (n, t, r) { return (t - n) * r + n; }, Bernstein: function (n, t) { var r = TWEEN.Interpolation.Utils.Factorial; return r(n) / r(t) / r(n - t); }, Factorial: function () { var n = [1]; return function (t) { var r = 1; if (n[t]) return n[t]; for (var i = t; i > 1; i--)r *= i; return n[t] = r, r; }; }(), CatmullRom: function (n, t, r, i, o) { var u = .5 * (r - n), e = .5 * (i - t), a = o * o, f = o * a; return (2 * t - 2 * r + u + e) * f + (-3 * t + 3 * r - 2 * u - e) * a + u * o + t; } } }, function (n) { "function" == typeof define && define.amd ? define([], function () { return TWEEN; }) : "undefined" != typeof module && "object" == typeof exports ? module.exports = TWEEN : void 0 !== n && (n.TWEEN = TWEEN); }(this);
1124 1124 /*
1125 1125 * End File:
1126 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/thirdparty.js
1126 * ./framework/extensions/thirdparty.js
1127 1127 */
1128 1128
1129 1129 /*
1130 1130 * Start File:
1131 * /c/Users/Nick/source/repos/frameworkv3/framework/util/audio.js
1131 * ./framework/util/audio.js
1132 1132 */
1133 1133 var GameAudio =
1134 1134 {
@@ -1180,12 +1180,12 @@ var GameAudio =
1180 1180 };
1181 1181 /*
1182 1182 * End File:
1183 * /c/Users/Nick/source/repos/frameworkv3/framework/util/audio.js
1183 * ./framework/util/audio.js
1184 1184 */
1185 1185
1186 1186 /*
1187 1187 * Start File:
1188 * /c/Users/Nick/source/repos/frameworkv3/framework/util/cookie.js
1188 * ./framework/util/cookie.js
1189 1189 */
1190 1190 var CookieManager =
1191 1191 {
@@ -1235,12 +1235,12 @@ var CookieManager =
1235 1235 };
1236 1236 /*
1237 1237 * End File:
1238 * /c/Users/Nick/source/repos/frameworkv3/framework/util/cookie.js
1238 * ./framework/util/cookie.js
1239 1239 */
1240 1240
1241 1241 /*
1242 1242 * Start File:
1243 * /c/Users/Nick/source/repos/frameworkv3/framework/util/ease.js
1243 * ./framework/util/ease.js
1244 1244 */
1245 1245 //ease functions
1246 1246
@@ -1690,12 +1690,12 @@ var ease = {
1690 1690 };
1691 1691 /*
1692 1692 * End File:
1693 * /c/Users/Nick/source/repos/frameworkv3/framework/util/ease.js
1693 * ./framework/util/ease.js
1694 1694 */
1695 1695
1696 1696 /*
1697 1697 * Start File:
1698 * /c/Users/Nick/source/repos/frameworkv3/framework/util/input.js
1698 * ./framework/util/input.js
1699 1699 */
1700 1700
1701 1701
@@ -1877,12 +1877,12 @@ var GameInput =
1877 1877 };//
1878 1878 /*
1879 1879 * End File:
1880 * /c/Users/Nick/source/repos/frameworkv3/framework/util/input.js
1880 * ./framework/util/input.js
1881 1881 */
1882 1882
1883 1883 /*
1884 1884 * Start File:
1885 * /c/Users/Nick/source/repos/frameworkv3/framework/util/particleEmitter.js
1885 * ./framework/util/particleEmitter.js
1886 1886 */
1887 1887 class ParticleEmitter
1888 1888 {
@@ -2140,12 +2140,12 @@ class Particle
2140 2140 }
2141 2141 /*
2142 2142 * End File:
2143 * /c/Users/Nick/source/repos/frameworkv3/framework/util/particleEmitter.js
2143 * ./framework/util/particleEmitter.js
2144 2144 */
2145 2145
2146 2146 /*
2147 2147 * Start File:
2148 * /c/Users/Nick/source/repos/frameworkv3/framework/util/ray.js
2148 * ./framework/util/ray.js
2149 2149 */
2150 2150 class Ray
2151 2151 {
@@ -2256,12 +2256,12 @@ class Ray
2256 2256 }
2257 2257 /*
2258 2258 * End File:
2259 * /c/Users/Nick/source/repos/frameworkv3/framework/util/ray.js
2259 * ./framework/util/ray.js
2260 2260 */
2261 2261
2262 2262 /*
2263 2263 * Start File:
2264 * /c/Users/Nick/source/repos/frameworkv3/framework/util/signal.js
2264 * ./framework/util/signal.js
2265 2265 */
2266 2266 // Basic event listeners, modeled after Phaser Signals
2267 2267
@@ -2330,12 +2330,12 @@ class signal
2330 2330 }
2331 2331 /*
2332 2332 * End File:
2333 * /c/Users/Nick/source/repos/frameworkv3/framework/util/signal.js
2333 * ./framework/util/signal.js
2334 2334 */
2335 2335
2336 2336 /*
2337 2337 * Start File:
2338 * /c/Users/Nick/source/repos/frameworkv3/framework/util/timingUtil.js
2338 * ./framework/util/timingUtil.js
2339 2339 */
2340 2340 /**
2341 2341 /* Timing utility
@@ -2388,12 +2388,12 @@ timingUtil =
2388 2388 };
2389 2389 /*
2390 2390 * End File:
2391 * /c/Users/Nick/source/repos/frameworkv3/framework/util/timingUtil.js
2391 * ./framework/util/timingUtil.js
2392 2392 */
2393 2393
2394 2394 /*
2395 2395 * Start File:
2396 * /c/Users/Nick/source/repos/frameworkv3/framework/util/urlParams.js
2396 * ./framework/util/urlParams.js
2397 2397 */
2398 2398 var UrlParams =
2399 2399 {
@@ -2417,12 +2417,12 @@ var UrlParams =
2417 2417 };
2418 2418 /*
2419 2419 * End File:
2420 * /c/Users/Nick/source/repos/frameworkv3/framework/util/urlParams.js
2420 * ./framework/util/urlParams.js
2421 2421 */
2422 2422
2423 2423 /*
2424 2424 * Start File:
2425 * /c/Users/Nick/source/repos/frameworkv3/framework/util/vector.js
2425 * ./framework/util/vector.js
2426 2426 */
2427 2427 class vector
2428 2428 {
@@ -2576,5 +2576,5 @@ class vector
2576 2576 };
2577 2577 /*
2578 2578 * End File:
2579 * /c/Users/Nick/source/repos/frameworkv3/framework/util/vector.js
2579 * ./framework/util/vector.js
2580 2580 */
@@ -1,7 +1,7 @@
1
1
2/*
2/*
3 * Start File:
3 * Start File:
4 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/game.js
4 * ./framework/engine/game.js
5 */
5 */
6class Game
6class Game
7{
7{
@@ -122,12 +122,12 @@ class Game
122}
122}
123/*
123/*
124 * End File:
124 * End File:
125 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/game.js
125 * ./framework/engine/game.js
126 */
126 */
127
127
128/*
128/*
129 * Start File:
129 * Start File:
130 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/gameobject.js
130 * ./framework/engine/gameobject.js
131 */
131 */
132class GameObject
132class GameObject
133{
133{
@@ -170,12 +170,12 @@ class GameObject
170}
170}
171/*
171/*
172 * End File:
172 * End File:
173 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/gameobject.js
173 * ./framework/engine/gameobject.js
174 */
174 */
175
175
176/*
176/*
177 * Start File:
177 * Start File:
178 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/image.js
178 * ./framework/engine/image.js
179 */
179 */
180class image
180class image
181{
181{
@@ -292,12 +292,12 @@ class image
292}
292}
293/*
293/*
294 * End File:
294 * End File:
295 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/image.js
295 * ./framework/engine/image.js
296 */
296 */
297
297
298/*
298/*
299 * Start File:
299 * Start File:
300 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/collider.js
300 * ./framework/engine/objectComponents/collider.js
301 */
301 */
302class Collider
302class Collider
303{
303{
@@ -405,17 +405,17 @@ class Collider
405 //CHECK FROM OBJ PERSPECTIVE
405 //CHECK FROM OBJ PERSPECTIVE
406 var points =
406 var points =
407 [
407 [
408 [this.gameObject.transform.position.x - hw, this.gameObject.transform.position.y - hh], // topleft
408 this.gameObject.transform.position.x - hw,
409 [this.gameObject.transform.position.x + hw, this.gameObject.transform.position.y - hh], // topright
409 this.gameObject.transform.position.x + hw,
410 [this.gameObject.transform.position.x - hw, this.gameObject.transform.position.y + hh], // bottomleft
410 this.gameObject.transform.position.y - hh,
411 [this.gameObject.transform.position.x + hw, this.gameObject.transform.position.y + hh] // bottomright
411 this.gameObject.transform.position.y + hh
412 ];
412 ];
413
413
414 if (points[0][0] >= o2.transform.position.x - ohw && points[0][0] <= o2.transform.position.x + ohw ||
414 if (points[0] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw ||
415 points[0][1] >= o2.transform.position.x - ohw && points[0][0] <= o2.transform.position.x + ohw)
415 points[1] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw)
416 {
416 {
417 if (points[2][0] > o2.transform.position.y - ohh && points[0][0] <= o2.transform.position.x + ohh ||
417 if (points[2] > o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh ||
418 points[2][1] >= o2.transform.position.y - ohh && points[2][0] <= o2.transform.position.y + ohh)
418 points[3] >= o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh)
419 {
419 {
420 hit = true;
420 hit = true;
421 }
421 }
@@ -430,12 +430,12 @@ class Collider
430}
430}
431/*
431/*
432 * End File:
432 * End File:
433 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/collider.js
433 * ./framework/engine/objectComponents/collider.js
434 */
434 */
435
435
436/*
436/*
437 * Start File:
437 * Start File:
438 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/renderer.js
438 * ./framework/engine/objectComponents/renderer.js
439 */
439 */
440class Renderer
440class Renderer
441{
441{
@@ -605,12 +605,12 @@ class Renderer
605}
605}
606/*
606/*
607 * End File:
607 * End File:
608 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/renderer.js
608 * ./framework/engine/objectComponents/renderer.js
609 */
609 */
610
610
611/*
611/*
612 * Start File:
612 * Start File:
613 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/transform.js
613 * ./framework/engine/objectComponents/transform.js
614 */
614 */
615class Transform
615class Transform
616{
616{
@@ -681,12 +681,12 @@ class Transform
681}
681}
682/*
682/*
683 * End File:
683 * End File:
684 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/objectComponents/transform.js
684 * ./framework/engine/objectComponents/transform.js
685 */
685 */
686
686
687/*
687/*
688 * Start File:
688 * Start File:
689 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/scene.js
689 * ./framework/engine/scene.js
690 */
690 */
691class Scene
691class Scene
692{
692{
@@ -897,12 +897,12 @@ class Scene
897}
897}
898/*
898/*
899 * End File:
899 * End File:
900 * /c/Users/Nick/source/repos/frameworkv3/framework/engine/scene.js
900 * ./framework/engine/scene.js
901 */
901 */
902
902
903/*
903/*
904 * Start File:
904 * Start File:
905 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/extentions.js
905 * ./framework/extensions/extentions.js
906 */
906 */
907/**
907/**
908 * Extending exising functionality
908 * Extending exising functionality
@@ -958,12 +958,12 @@ Array.prototype.random = function ()
958};
958};
959/*
959/*
960 * End File:
960 * End File:
961 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/extentions.js
961 * ./framework/extensions/extentions.js
962 */
962 */
963
963
964/*
964/*
965 * Start File:
965 * Start File:
966 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/polyfills.js
966 * ./framework/extensions/polyfills.js
967 */
967 */
968if (!Math.sign)
968if (!Math.sign)
969{
969{
@@ -981,12 +981,12 @@ if (!Math.sign)
981(function (e) { var t = function () { try { return !!Symbol.iterator; } catch (e) { return false; } }; var n = t(); var r = function (e) { var t = { next: function () { var t = e.shift(); return { done: t === void 0, value: t }; } }; if (n) { t[Symbol.iterator] = function () { return t; }; } return t; }; var i = function (e) { return encodeURIComponent(e).replace(/%20/g, "+"); }; var o = function (e) { return decodeURIComponent(e).replace(/\+/g, " "); }; var a = function () { var t = function (e) { Object.defineProperty(this, "_entries", { value: {} }); if (typeof e === "string") { if (e !== "") { e = e.replace(/^\?/, ""); var n = e.split("&"); var r; for (var i = 0; i < n.length; i++) { r = n[i].split("="); this.append(o(r[0]), r.length > 1 ? o(r[1]) : ""); } } } else if (e instanceof t) { var a = this; e.forEach(function (e, t) { a.append(e, t); }); } }; var a = t.prototype; a.append = function (e, t) { if (e in this._entries) { this._entries[e].push(t.toString()); } else { this._entries[e] = [t.toString()]; } }; a.delete = function (e) { delete this._entries[e]; }; a.get = function (e) { return e in this._entries ? this._entries[e][0] : null; }; a.getAll = function (e) { return e in this._entries ? this._entries[e].slice(0) : []; }; a.has = function (e) { return e in this._entries; }; a.set = function (e, t) { this._entries[e] = [t.toString()]; }; a.forEach = function (e, t) { var n; for (var r in this._entries) { if (this._entries.hasOwnProperty(r)) { n = this._entries[r]; for (var i = 0; i < n.length; i++) { e.call(t, n[i], r, this); } } } }; a.keys = function () { var e = []; this.forEach(function (t, n) { e.push(n); }); return r(e); }; a.values = function () { var e = []; this.forEach(function (t) { e.push(t); }); return r(e); }; a.entries = function () { var e = []; this.forEach(function (t, n) { e.push([n, t]); }); return r(e); }; if (n) { a[Symbol.iterator] = a.entries; } a.toString = function () { var e = []; this.forEach(function (t, n) { e.push(i(n) + "=" + i(t)); }); return e.join("&"); }; e.URLSearchParams = t; }; if (!("URLSearchParams" in e) || new URLSearchParams("?a=1").toString() !== "a=1") { a(); } })(typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : this); (function (e) { var t = function () { try { var e = new URL("b", "http://a"); e.pathname = "c%20d"; return e.href === "http://a/c%20d" && e.searchParams; } catch (e) { return false; } }; var n = function () { var t = e.URL; var n = function (e, t) { if (typeof e !== "string") e = String(e); var n = document.implementation.createHTMLDocument(""); window.doc = n; if (t) { var r = n.createElement("base"); r.href = t; n.head.appendChild(r); } var i = n.createElement("a"); i.href = e; n.body.appendChild(i); i.href = i.href; if (i.protocol === ":" || !/:/.test(i.href)) { throw new TypeError("Invalid URL"); } Object.defineProperty(this, "_anchorElement", { value: i }); }; var r = n.prototype; var i = function (e) { Object.defineProperty(r, e, { get: function () { return this._anchorElement[e]; }, set: function (t) { this._anchorElement[e] = t; }, enumerable: true }); };["hash", "host", "hostname", "port", "protocol", "search"].forEach(function (e) { i(e); }); Object.defineProperties(r, { toString: { get: function () { var e = this; return function () { return e.href; }; } }, href: { get: function () { return this._anchorElement.href.replace(/\?$/, ""); }, set: function (e) { this._anchorElement.href = e; }, enumerable: true }, pathname: { get: function () { return this._anchorElement.pathname.replace(/(^\/?)/, "/"); }, set: function (e) { this._anchorElement.pathname = e; }, enumerable: true }, origin: { get: function () { var e = { "http:": 80, "https:": 443, "ftp:": 21 }[this._anchorElement.protocol]; var t = this._anchorElement.port != e && this._anchorElement.port !== ""; return this._anchorElement.protocol + "//" + this._anchorElement.hostname + (t ? ":" + this._anchorElement.port : ""); }, enumerable: true }, password: { get: function () { return ""; }, set: function (e) { }, enumerable: true }, username: { get: function () { return ""; }, set: function (e) { }, enumerable: true }, searchParams: { get: function () { var e = new URLSearchParams(this.search); var t = this;["append", "delete", "set"].forEach(function (n) { var r = e[n]; e[n] = function () { r.apply(e, arguments); t.search = e.toString(); }; }); return e; }, enumerable: true } }); n.createObjectURL = function (e) { return t.createObjectURL.apply(t, arguments); }; n.revokeObjectURL = function (e) { return t.revokeObjectURL.apply(t, arguments); }; e.URL = n; }; if (!t()) { n(); } if (e.location !== void 0 && !("origin" in e.location)) { var r = function () { return e.location.protocol + "//" + e.location.hostname + (e.location.port ? ":" + e.location.port : ""); }; try { Object.defineProperty(e.location, "origin", { get: r, enumerable: true }); } catch (t) { setInterval(function () { e.location.origin = r(); }, 100); } } })(typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : this);
981(function (e) { var t = function () { try { return !!Symbol.iterator; } catch (e) { return false; } }; var n = t(); var r = function (e) { var t = { next: function () { var t = e.shift(); return { done: t === void 0, value: t }; } }; if (n) { t[Symbol.iterator] = function () { return t; }; } return t; }; var i = function (e) { return encodeURIComponent(e).replace(/%20/g, "+"); }; var o = function (e) { return decodeURIComponent(e).replace(/\+/g, " "); }; var a = function () { var t = function (e) { Object.defineProperty(this, "_entries", { value: {} }); if (typeof e === "string") { if (e !== "") { e = e.replace(/^\?/, ""); var n = e.split("&"); var r; for (var i = 0; i < n.length; i++) { r = n[i].split("="); this.append(o(r[0]), r.length > 1 ? o(r[1]) : ""); } } } else if (e instanceof t) { var a = this; e.forEach(function (e, t) { a.append(e, t); }); } }; var a = t.prototype; a.append = function (e, t) { if (e in this._entries) { this._entries[e].push(t.toString()); } else { this._entries[e] = [t.toString()]; } }; a.delete = function (e) { delete this._entries[e]; }; a.get = function (e) { return e in this._entries ? this._entries[e][0] : null; }; a.getAll = function (e) { return e in this._entries ? this._entries[e].slice(0) : []; }; a.has = function (e) { return e in this._entries; }; a.set = function (e, t) { this._entries[e] = [t.toString()]; }; a.forEach = function (e, t) { var n; for (var r in this._entries) { if (this._entries.hasOwnProperty(r)) { n = this._entries[r]; for (var i = 0; i < n.length; i++) { e.call(t, n[i], r, this); } } } }; a.keys = function () { var e = []; this.forEach(function (t, n) { e.push(n); }); return r(e); }; a.values = function () { var e = []; this.forEach(function (t) { e.push(t); }); return r(e); }; a.entries = function () { var e = []; this.forEach(function (t, n) { e.push([n, t]); }); return r(e); }; if (n) { a[Symbol.iterator] = a.entries; } a.toString = function () { var e = []; this.forEach(function (t, n) { e.push(i(n) + "=" + i(t)); }); return e.join("&"); }; e.URLSearchParams = t; }; if (!("URLSearchParams" in e) || new URLSearchParams("?a=1").toString() !== "a=1") { a(); } })(typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : this); (function (e) { var t = function () { try { var e = new URL("b", "http://a"); e.pathname = "c%20d"; return e.href === "http://a/c%20d" && e.searchParams; } catch (e) { return false; } }; var n = function () { var t = e.URL; var n = function (e, t) { if (typeof e !== "string") e = String(e); var n = document.implementation.createHTMLDocument(""); window.doc = n; if (t) { var r = n.createElement("base"); r.href = t; n.head.appendChild(r); } var i = n.createElement("a"); i.href = e; n.body.appendChild(i); i.href = i.href; if (i.protocol === ":" || !/:/.test(i.href)) { throw new TypeError("Invalid URL"); } Object.defineProperty(this, "_anchorElement", { value: i }); }; var r = n.prototype; var i = function (e) { Object.defineProperty(r, e, { get: function () { return this._anchorElement[e]; }, set: function (t) { this._anchorElement[e] = t; }, enumerable: true }); };["hash", "host", "hostname", "port", "protocol", "search"].forEach(function (e) { i(e); }); Object.defineProperties(r, { toString: { get: function () { var e = this; return function () { return e.href; }; } }, href: { get: function () { return this._anchorElement.href.replace(/\?$/, ""); }, set: function (e) { this._anchorElement.href = e; }, enumerable: true }, pathname: { get: function () { return this._anchorElement.pathname.replace(/(^\/?)/, "/"); }, set: function (e) { this._anchorElement.pathname = e; }, enumerable: true }, origin: { get: function () { var e = { "http:": 80, "https:": 443, "ftp:": 21 }[this._anchorElement.protocol]; var t = this._anchorElement.port != e && this._anchorElement.port !== ""; return this._anchorElement.protocol + "//" + this._anchorElement.hostname + (t ? ":" + this._anchorElement.port : ""); }, enumerable: true }, password: { get: function () { return ""; }, set: function (e) { }, enumerable: true }, username: { get: function () { return ""; }, set: function (e) { }, enumerable: true }, searchParams: { get: function () { var e = new URLSearchParams(this.search); var t = this;["append", "delete", "set"].forEach(function (n) { var r = e[n]; e[n] = function () { r.apply(e, arguments); t.search = e.toString(); }; }); return e; }, enumerable: true } }); n.createObjectURL = function (e) { return t.createObjectURL.apply(t, arguments); }; n.revokeObjectURL = function (e) { return t.revokeObjectURL.apply(t, arguments); }; e.URL = n; }; if (!t()) { n(); } if (e.location !== void 0 && !("origin" in e.location)) { var r = function () { return e.location.protocol + "//" + e.location.hostname + (e.location.port ? ":" + e.location.port : ""); }; try { Object.defineProperty(e.location, "origin", { get: r, enumerable: true }); } catch (t) { setInterval(function () { e.location.origin = r(); }, 100); } } })(typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : this);
982/*
982/*
983 * End File:
983 * End File:
984 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/polyfills.js
984 * ./framework/extensions/polyfills.js
985 */
985 */
986
986
987/*
987/*
988 * Start File:
988 * Start File:
989 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/thirdparty.js
989 * ./framework/extensions/thirdparty.js
990 */
990 */
991/*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
991/*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
992!function (a, b) { "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function (a) { if (!a.document) throw new Error("jQuery requires a window with a document"); return b(a); } : b(a); }("undefined" != typeof window ? window : this, function (a, b)
992!function (a, b) { "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function (a) { if (!a.document) throw new Error("jQuery requires a window with a document"); return b(a); } : b(a); }("undefined" != typeof window ? window : this, function (a, b)
@@ -1123,12 +1123,12 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1123var TWEEN = TWEEN || function () { var n = []; return { getAll: function () { return n; }, removeAll: function () { n = []; }, add: function (t) { n.push(t); }, remove: function (t) { var r = n.indexOf(t); -1 !== r && n.splice(r, 1); }, update: function (t, r) { if (0 === n.length) return !1; var i = 0; for (t = void 0 !== t ? t : TWEEN.now(); i < n.length;)n[i].update(t) || r ? i++ : n.splice(i, 1); return !0; } }; }(); !function () { void 0 === this.window && void 0 !== this.process ? TWEEN.now = function () { var n = process.hrtime(); return 1e3 * n[0] + n[1] / 1e3; } : void 0 !== this.window && void 0 !== window.performance && void 0 !== window.performance.now ? TWEEN.now = window.performance.now.bind(window.performance) : void 0 !== Date.now ? TWEEN.now = Date.now : TWEEN.now = function () { return (new Date).getTime(); }; }(), TWEEN.Tween = function (n) { var t = n, r = {}, i = {}, o = {}, u = 1e3, e = 0, a = !1, f = !1, c = !1, s = 0, h = null, l = TWEEN.Easing.Linear.None, E = TWEEN.Interpolation.Linear, p = [], d = null, v = !1, w = null, I = null, M = null, C = null, S = null, ST = null; for (var T in n) r[T] = parseFloat(n[T], 10); this.to = function (n, t) { return void 0 !== t && (u = t), i = n, this; }, this.start = function (n) { TWEEN.add(this), f = !0, v = !1, h = void 0 !== n ? n : TWEEN.now(), h += s; for (var u in i) { if (i[u] instanceof Array) { if (0 === i[u].length) continue; i[u] = [t[u]].concat(i[u]); } void 0 !== r[u] && (r[u] = t[u], r[u] instanceof Array == !1 && (r[u] *= 1), o[u] = r[u] || 0); } return this; }, this.stop = function () { return f ? (TWEEN.remove(this), f = !1, null !== M && M.call(S), this.stopChainedTweens(), this) : this; }, this.stopChainedTweens = function () { for (var n = 0, t = p.length; t > n; n++)p[n].stop(); }, this.delay = function (n) { return s = n, this; }, this.repeat = function (n) { return e = n, this; }, this.yoyo = function (n) { return a = n, this; }, this.easing = function (n) { return l = n, this; }, this.interpolation = function (n) { return E = n, this; }, this.chain = function () { return p = arguments, this; }, this.onStart = function (n, c) { return d = n, ST = c, this; }, this.onUpdate = function (n) { return w = n, this; }, this.onComplete = function (n, c) { return I = n, C = c, this; }, this.onStop = function (n, c) { return M = n, S = c, this; }, this.update = function (n) { var f, M, T; if (h > n) return !0; v === !1 && (null !== d && d.call(ST), v = !0), M = (n - h) / u, M = M > 1 ? 1 : M, T = l(M); for (f in i) if (void 0 !== r[f]) { var N = r[f] || 0, W = i[f]; W instanceof Array ? t[f] = E(W, T) : ("string" == typeof W && (W = "+" === W.charAt(0) || "-" === W.charAt(0) ? N + parseFloat(W, 10) : parseFloat(W, 10)), "number" == typeof W && (t[f] = N + (W - N) * T)); } if (null !== w && w.call(t, T), 1 === M) { if (e > 0) { isFinite(e) && e--; for (f in o) { if ("string" == typeof i[f] && (o[f] = o[f] + parseFloat(i[f], 10)), a) { var O = o[f]; o[f] = i[f], i[f] = O; } r[f] = o[f]; } return a && (c = !c), h = n + s, !0; } null !== I && I.call(C); for (var m = 0, g = p.length; g > m; m++)p[m].start(h + u); return !1; } return !0; }; }, TWEEN.Easing = { Linear: { None: function (n) { return n; } }, Quadratic: { In: function (n) { return n * n; }, Out: function (n) { return n * (2 - n); }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n : -.5 * (--n * (n - 2) - 1); } }, Cubic: { In: function (n) { return n * n * n; }, Out: function (n) { return --n * n * n + 1; }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n * n : .5 * ((n -= 2) * n * n + 2); } }, Quartic: { In: function (n) { return n * n * n * n; }, Out: function (n) { return 1 - --n * n * n * n; }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n * n * n : -.5 * ((n -= 2) * n * n * n - 2); } }, Quintic: { In: function (n) { return n * n * n * n * n; }, Out: function (n) { return --n * n * n * n * n + 1; }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n * n * n * n : .5 * ((n -= 2) * n * n * n * n + 2); } }, Sinusoidal: { In: function (n) { return 1 - Math.cos(n * Math.PI / 2); }, Out: function (n) { return Math.sin(n * Math.PI / 2); }, InOut: function (n) { return .5 * (1 - Math.cos(Math.PI * n)); } }, Exponential: { In: function (n) { return 0 === n ? 0 : Math.pow(1024, n - 1); }, Out: function (n) { return 1 === n ? 1 : 1 - Math.pow(2, -10 * n); }, InOut: function (n) { return 0 === n ? 0 : 1 === n ? 1 : (n *= 2) < 1 ? .5 * Math.pow(1024, n - 1) : .5 * (-Math.pow(2, -10 * (n - 1)) + 2); } }, Circular: { In: function (n) { return 1 - Math.sqrt(1 - n * n); }, Out: function (n) { return Math.sqrt(1 - --n * n); }, InOut: function (n) { return (n *= 2) < 1 ? -.5 * (Math.sqrt(1 - n * n) - 1) : .5 * (Math.sqrt(1 - (n -= 2) * n) + 1); } }, Elastic: { In: function (n) { return 0 === n ? 0 : 1 === n ? 1 : -Math.pow(2, 10 * (n - 1)) * Math.sin(5 * (n - 1.1) * Math.PI); }, Out: function (n) { return 0 === n ? 0 : 1 === n ? 1 : Math.pow(2, -10 * n) * Math.sin(5 * (n - .1) * Math.PI) + 1; }, InOut: function (n) { return 0 === n ? 0 : 1 === n ? 1 : (n *= 2, 1 > n ? -.5 * Math.pow(2, 10 * (n - 1)) * Math.sin(5 * (n - 1.1) * Math.PI) : .5 * Math.pow(2, -10 * (n - 1)) * Math.sin(5 * (n - 1.1) * Math.PI) + 1); } }, Back: { In: function (n) { var t = 1.70158; return n * n * ((t + 1) * n - t); }, Out: function (n) { var t = 1.70158; return --n * n * ((t + 1) * n + t) + 1; }, InOut: function (n) { var t = 2.5949095; return (n *= 2) < 1 ? .5 * (n * n * ((t + 1) * n - t)) : .5 * ((n -= 2) * n * ((t + 1) * n + t) + 2); } }, Bounce: { In: function (n) { return 1 - TWEEN.Easing.Bounce.Out(1 - n); }, Out: function (n) { return 1 / 2.75 > n ? 7.5625 * n * n : 2 / 2.75 > n ? 7.5625 * (n -= 1.5 / 2.75) * n + .75 : 2.5 / 2.75 > n ? 7.5625 * (n -= 2.25 / 2.75) * n + .9375 : 7.5625 * (n -= 2.625 / 2.75) * n + .984375; }, InOut: function (n) { return .5 > n ? .5 * TWEEN.Easing.Bounce.In(2 * n) : .5 * TWEEN.Easing.Bounce.Out(2 * n - 1) + .5; } } }, TWEEN.Interpolation = { Linear: function (n, t) { var r = n.length - 1, i = r * t, o = Math.floor(i), u = TWEEN.Interpolation.Utils.Linear; return 0 > t ? u(n[0], n[1], i) : t > 1 ? u(n[r], n[r - 1], r - i) : u(n[o], n[o + 1 > r ? r : o + 1], i - o); }, Bezier: function (n, t) { for (var r = 0, i = n.length - 1, o = Math.pow, u = TWEEN.Interpolation.Utils.Bernstein, e = 0; i >= e; e++)r += o(1 - t, i - e) * o(t, e) * n[e] * u(i, e); return r; }, CatmullRom: function (n, t) { var r = n.length - 1, i = r * t, o = Math.floor(i), u = TWEEN.Interpolation.Utils.CatmullRom; return n[0] === n[r] ? (0 > t && (o = Math.floor(i = r * (1 + t))), u(n[(o - 1 + r) % r], n[o], n[(o + 1) % r], n[(o + 2) % r], i - o)) : 0 > t ? n[0] - (u(n[0], n[0], n[1], n[1], -i) - n[0]) : t > 1 ? n[r] - (u(n[r], n[r], n[r - 1], n[r - 1], i - r) - n[r]) : u(n[o ? o - 1 : 0], n[o], n[o + 1 > r ? r : o + 1], n[o + 2 > r ? r : o + 2], i - o); }, Utils: { Linear: function (n, t, r) { return (t - n) * r + n; }, Bernstein: function (n, t) { var r = TWEEN.Interpolation.Utils.Factorial; return r(n) / r(t) / r(n - t); }, Factorial: function () { var n = [1]; return function (t) { var r = 1; if (n[t]) return n[t]; for (var i = t; i > 1; i--)r *= i; return n[t] = r, r; }; }(), CatmullRom: function (n, t, r, i, o) { var u = .5 * (r - n), e = .5 * (i - t), a = o * o, f = o * a; return (2 * t - 2 * r + u + e) * f + (-3 * t + 3 * r - 2 * u - e) * a + u * o + t; } } }, function (n) { "function" == typeof define && define.amd ? define([], function () { return TWEEN; }) : "undefined" != typeof module && "object" == typeof exports ? module.exports = TWEEN : void 0 !== n && (n.TWEEN = TWEEN); }(this);
1123var TWEEN = TWEEN || function () { var n = []; return { getAll: function () { return n; }, removeAll: function () { n = []; }, add: function (t) { n.push(t); }, remove: function (t) { var r = n.indexOf(t); -1 !== r && n.splice(r, 1); }, update: function (t, r) { if (0 === n.length) return !1; var i = 0; for (t = void 0 !== t ? t : TWEEN.now(); i < n.length;)n[i].update(t) || r ? i++ : n.splice(i, 1); return !0; } }; }(); !function () { void 0 === this.window && void 0 !== this.process ? TWEEN.now = function () { var n = process.hrtime(); return 1e3 * n[0] + n[1] / 1e3; } : void 0 !== this.window && void 0 !== window.performance && void 0 !== window.performance.now ? TWEEN.now = window.performance.now.bind(window.performance) : void 0 !== Date.now ? TWEEN.now = Date.now : TWEEN.now = function () { return (new Date).getTime(); }; }(), TWEEN.Tween = function (n) { var t = n, r = {}, i = {}, o = {}, u = 1e3, e = 0, a = !1, f = !1, c = !1, s = 0, h = null, l = TWEEN.Easing.Linear.None, E = TWEEN.Interpolation.Linear, p = [], d = null, v = !1, w = null, I = null, M = null, C = null, S = null, ST = null; for (var T in n) r[T] = parseFloat(n[T], 10); this.to = function (n, t) { return void 0 !== t && (u = t), i = n, this; }, this.start = function (n) { TWEEN.add(this), f = !0, v = !1, h = void 0 !== n ? n : TWEEN.now(), h += s; for (var u in i) { if (i[u] instanceof Array) { if (0 === i[u].length) continue; i[u] = [t[u]].concat(i[u]); } void 0 !== r[u] && (r[u] = t[u], r[u] instanceof Array == !1 && (r[u] *= 1), o[u] = r[u] || 0); } return this; }, this.stop = function () { return f ? (TWEEN.remove(this), f = !1, null !== M && M.call(S), this.stopChainedTweens(), this) : this; }, this.stopChainedTweens = function () { for (var n = 0, t = p.length; t > n; n++)p[n].stop(); }, this.delay = function (n) { return s = n, this; }, this.repeat = function (n) { return e = n, this; }, this.yoyo = function (n) { return a = n, this; }, this.easing = function (n) { return l = n, this; }, this.interpolation = function (n) { return E = n, this; }, this.chain = function () { return p = arguments, this; }, this.onStart = function (n, c) { return d = n, ST = c, this; }, this.onUpdate = function (n) { return w = n, this; }, this.onComplete = function (n, c) { return I = n, C = c, this; }, this.onStop = function (n, c) { return M = n, S = c, this; }, this.update = function (n) { var f, M, T; if (h > n) return !0; v === !1 && (null !== d && d.call(ST), v = !0), M = (n - h) / u, M = M > 1 ? 1 : M, T = l(M); for (f in i) if (void 0 !== r[f]) { var N = r[f] || 0, W = i[f]; W instanceof Array ? t[f] = E(W, T) : ("string" == typeof W && (W = "+" === W.charAt(0) || "-" === W.charAt(0) ? N + parseFloat(W, 10) : parseFloat(W, 10)), "number" == typeof W && (t[f] = N + (W - N) * T)); } if (null !== w && w.call(t, T), 1 === M) { if (e > 0) { isFinite(e) && e--; for (f in o) { if ("string" == typeof i[f] && (o[f] = o[f] + parseFloat(i[f], 10)), a) { var O = o[f]; o[f] = i[f], i[f] = O; } r[f] = o[f]; } return a && (c = !c), h = n + s, !0; } null !== I && I.call(C); for (var m = 0, g = p.length; g > m; m++)p[m].start(h + u); return !1; } return !0; }; }, TWEEN.Easing = { Linear: { None: function (n) { return n; } }, Quadratic: { In: function (n) { return n * n; }, Out: function (n) { return n * (2 - n); }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n : -.5 * (--n * (n - 2) - 1); } }, Cubic: { In: function (n) { return n * n * n; }, Out: function (n) { return --n * n * n + 1; }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n * n : .5 * ((n -= 2) * n * n + 2); } }, Quartic: { In: function (n) { return n * n * n * n; }, Out: function (n) { return 1 - --n * n * n * n; }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n * n * n : -.5 * ((n -= 2) * n * n * n - 2); } }, Quintic: { In: function (n) { return n * n * n * n * n; }, Out: function (n) { return --n * n * n * n * n + 1; }, InOut: function (n) { return (n *= 2) < 1 ? .5 * n * n * n * n * n : .5 * ((n -= 2) * n * n * n * n + 2); } }, Sinusoidal: { In: function (n) { return 1 - Math.cos(n * Math.PI / 2); }, Out: function (n) { return Math.sin(n * Math.PI / 2); }, InOut: function (n) { return .5 * (1 - Math.cos(Math.PI * n)); } }, Exponential: { In: function (n) { return 0 === n ? 0 : Math.pow(1024, n - 1); }, Out: function (n) { return 1 === n ? 1 : 1 - Math.pow(2, -10 * n); }, InOut: function (n) { return 0 === n ? 0 : 1 === n ? 1 : (n *= 2) < 1 ? .5 * Math.pow(1024, n - 1) : .5 * (-Math.pow(2, -10 * (n - 1)) + 2); } }, Circular: { In: function (n) { return 1 - Math.sqrt(1 - n * n); }, Out: function (n) { return Math.sqrt(1 - --n * n); }, InOut: function (n) { return (n *= 2) < 1 ? -.5 * (Math.sqrt(1 - n * n) - 1) : .5 * (Math.sqrt(1 - (n -= 2) * n) + 1); } }, Elastic: { In: function (n) { return 0 === n ? 0 : 1 === n ? 1 : -Math.pow(2, 10 * (n - 1)) * Math.sin(5 * (n - 1.1) * Math.PI); }, Out: function (n) { return 0 === n ? 0 : 1 === n ? 1 : Math.pow(2, -10 * n) * Math.sin(5 * (n - .1) * Math.PI) + 1; }, InOut: function (n) { return 0 === n ? 0 : 1 === n ? 1 : (n *= 2, 1 > n ? -.5 * Math.pow(2, 10 * (n - 1)) * Math.sin(5 * (n - 1.1) * Math.PI) : .5 * Math.pow(2, -10 * (n - 1)) * Math.sin(5 * (n - 1.1) * Math.PI) + 1); } }, Back: { In: function (n) { var t = 1.70158; return n * n * ((t + 1) * n - t); }, Out: function (n) { var t = 1.70158; return --n * n * ((t + 1) * n + t) + 1; }, InOut: function (n) { var t = 2.5949095; return (n *= 2) < 1 ? .5 * (n * n * ((t + 1) * n - t)) : .5 * ((n -= 2) * n * ((t + 1) * n + t) + 2); } }, Bounce: { In: function (n) { return 1 - TWEEN.Easing.Bounce.Out(1 - n); }, Out: function (n) { return 1 / 2.75 > n ? 7.5625 * n * n : 2 / 2.75 > n ? 7.5625 * (n -= 1.5 / 2.75) * n + .75 : 2.5 / 2.75 > n ? 7.5625 * (n -= 2.25 / 2.75) * n + .9375 : 7.5625 * (n -= 2.625 / 2.75) * n + .984375; }, InOut: function (n) { return .5 > n ? .5 * TWEEN.Easing.Bounce.In(2 * n) : .5 * TWEEN.Easing.Bounce.Out(2 * n - 1) + .5; } } }, TWEEN.Interpolation = { Linear: function (n, t) { var r = n.length - 1, i = r * t, o = Math.floor(i), u = TWEEN.Interpolation.Utils.Linear; return 0 > t ? u(n[0], n[1], i) : t > 1 ? u(n[r], n[r - 1], r - i) : u(n[o], n[o + 1 > r ? r : o + 1], i - o); }, Bezier: function (n, t) { for (var r = 0, i = n.length - 1, o = Math.pow, u = TWEEN.Interpolation.Utils.Bernstein, e = 0; i >= e; e++)r += o(1 - t, i - e) * o(t, e) * n[e] * u(i, e); return r; }, CatmullRom: function (n, t) { var r = n.length - 1, i = r * t, o = Math.floor(i), u = TWEEN.Interpolation.Utils.CatmullRom; return n[0] === n[r] ? (0 > t && (o = Math.floor(i = r * (1 + t))), u(n[(o - 1 + r) % r], n[o], n[(o + 1) % r], n[(o + 2) % r], i - o)) : 0 > t ? n[0] - (u(n[0], n[0], n[1], n[1], -i) - n[0]) : t > 1 ? n[r] - (u(n[r], n[r], n[r - 1], n[r - 1], i - r) - n[r]) : u(n[o ? o - 1 : 0], n[o], n[o + 1 > r ? r : o + 1], n[o + 2 > r ? r : o + 2], i - o); }, Utils: { Linear: function (n, t, r) { return (t - n) * r + n; }, Bernstein: function (n, t) { var r = TWEEN.Interpolation.Utils.Factorial; return r(n) / r(t) / r(n - t); }, Factorial: function () { var n = [1]; return function (t) { var r = 1; if (n[t]) return n[t]; for (var i = t; i > 1; i--)r *= i; return n[t] = r, r; }; }(), CatmullRom: function (n, t, r, i, o) { var u = .5 * (r - n), e = .5 * (i - t), a = o * o, f = o * a; return (2 * t - 2 * r + u + e) * f + (-3 * t + 3 * r - 2 * u - e) * a + u * o + t; } } }, function (n) { "function" == typeof define && define.amd ? define([], function () { return TWEEN; }) : "undefined" != typeof module && "object" == typeof exports ? module.exports = TWEEN : void 0 !== n && (n.TWEEN = TWEEN); }(this);
1124/*
1124/*
1125 * End File:
1125 * End File:
1126 * /c/Users/Nick/source/repos/frameworkv3/framework/extensions/thirdparty.js
1126 * ./framework/extensions/thirdparty.js
1127 */
1127 */
1128
1128
1129/*
1129/*
1130 * Start File:
1130 * Start File:
1131 * /c/Users/Nick/source/repos/frameworkv3/framework/util/audio.js
1131 * ./framework/util/audio.js
1132 */
1132 */
1133var GameAudio =
1133var GameAudio =
1134{
1134{
@@ -1180,12 +1180,12 @@ var GameAudio =
1180};
1180};
1181/*
1181/*
1182 * End File:
1182 * End File:
1183 * /c/Users/Nick/source/repos/frameworkv3/framework/util/audio.js
1183 * ./framework/util/audio.js
1184 */
1184 */
1185
1185
1186/*
1186/*
1187 * Start File:
1187 * Start File:
1188 * /c/Users/Nick/source/repos/frameworkv3/framework/util/cookie.js
1188 * ./framework/util/cookie.js
1189 */
1189 */
1190var CookieManager =
1190var CookieManager =
1191{
1191{
@@ -1235,12 +1235,12 @@ var CookieManager =
1235};
1235};
1236/*
1236/*
1237 * End File:
1237 * End File:
1238 * /c/Users/Nick/source/repos/frameworkv3/framework/util/cookie.js
1238 * ./framework/util/cookie.js
1239 */
1239 */
1240
1240
1241/*
1241/*
1242 * Start File:
1242 * Start File:
1243 * /c/Users/Nick/source/repos/frameworkv3/framework/util/ease.js
1243 * ./framework/util/ease.js
1244 */
1244 */
1245//ease functions
1245//ease functions
1246
1246
@@ -1690,12 +1690,12 @@ var ease = {
1690};
1690};
1691/*
1691/*
1692 * End File:
1692 * End File:
1693 * /c/Users/Nick/source/repos/frameworkv3/framework/util/ease.js
1693 * ./framework/util/ease.js
1694 */
1694 */
1695
1695
1696/*
1696/*
1697 * Start File:
1697 * Start File:
1698 * /c/Users/Nick/source/repos/frameworkv3/framework/util/input.js
1698 * ./framework/util/input.js
1699 */
1699 */
1700
1700
1701
1701
@@ -1877,12 +1877,12 @@ var GameInput =
1877};//
1877};//
1878/*
1878/*
1879 * End File:
1879 * End File:
1880 * /c/Users/Nick/source/repos/frameworkv3/framework/util/input.js
1880 * ./framework/util/input.js
1881 */
1881 */
1882
1882
1883/*
1883/*
1884 * Start File:
1884 * Start File:
1885 * /c/Users/Nick/source/repos/frameworkv3/framework/util/particleEmitter.js
1885 * ./framework/util/particleEmitter.js
1886 */
1886 */
1887class ParticleEmitter
1887class ParticleEmitter
1888{
1888{
@@ -2140,12 +2140,12 @@ class Particle
2140}
2140}
2141/*
2141/*
2142 * End File:
2142 * End File:
2143 * /c/Users/Nick/source/repos/frameworkv3/framework/util/particleEmitter.js
2143 * ./framework/util/particleEmitter.js
2144 */
2144 */
2145
2145
2146/*
2146/*
2147 * Start File:
2147 * Start File:
2148 * /c/Users/Nick/source/repos/frameworkv3/framework/util/ray.js
2148 * ./framework/util/ray.js
2149 */
2149 */
2150class Ray
2150class Ray
2151{
2151{
@@ -2256,12 +2256,12 @@ class Ray
2256}
2256}
2257/*
2257/*
2258 * End File:
2258 * End File:
2259 * /c/Users/Nick/source/repos/frameworkv3/framework/util/ray.js
2259 * ./framework/util/ray.js
2260 */
2260 */
2261
2261
2262/*
2262/*
2263 * Start File:
2263 * Start File:
2264 * /c/Users/Nick/source/repos/frameworkv3/framework/util/signal.js
2264 * ./framework/util/signal.js
2265 */
2265 */
2266// Basic event listeners, modeled after Phaser Signals
2266// Basic event listeners, modeled after Phaser Signals
2267
2267
@@ -2330,12 +2330,12 @@ class signal
2330}
2330}
2331/*
2331/*
2332 * End File:
2332 * End File:
2333 * /c/Users/Nick/source/repos/frameworkv3/framework/util/signal.js
2333 * ./framework/util/signal.js
2334 */
2334 */
2335
2335
2336/*
2336/*
2337 * Start File:
2337 * Start File:
2338 * /c/Users/Nick/source/repos/frameworkv3/framework/util/timingUtil.js
2338 * ./framework/util/timingUtil.js
2339 */
2339 */
2340/**
2340/**
2341 /* Timing utility
2341 /* Timing utility
@@ -2388,12 +2388,12 @@ timingUtil =
2388};
2388};
2389/*
2389/*
2390 * End File:
2390 * End File:
2391 * /c/Users/Nick/source/repos/frameworkv3/framework/util/timingUtil.js
2391 * ./framework/util/timingUtil.js
2392 */
2392 */
2393
2393
2394/*
2394/*
2395 * Start File:
2395 * Start File:
2396 * /c/Users/Nick/source/repos/frameworkv3/framework/util/urlParams.js
2396 * ./framework/util/urlParams.js
2397 */
2397 */
2398var UrlParams =
2398var UrlParams =
2399{
2399{
@@ -2417,12 +2417,12 @@ var UrlParams =
2417};
2417};
2418/*
2418/*
2419 * End File:
2419 * End File:
2420 * /c/Users/Nick/source/repos/frameworkv3/framework/util/urlParams.js
2420 * ./framework/util/urlParams.js
2421 */
2421 */
2422
2422
2423/*
2423/*
2424 * Start File:
2424 * Start File:
2425 * /c/Users/Nick/source/repos/frameworkv3/framework/util/vector.js
2425 * ./framework/util/vector.js
2426 */
2426 */
2427class vector
2427class vector
2428{
2428{
@@ -2576,5 +2576,5 @@ class vector
2576};
2576};
2577/*
2577/*
2578 * End File:
2578 * End File:
2579 * /c/Users/Nick/source/repos/frameworkv3/framework/util/vector.js
2579 * ./framework/util/vector.js
2580 */
2580 */
src/game.js +3 −3
@@ -120,16 +120,16 @@ createMainScene = function (game)
120 120
121 121 createSubScene = function (scene)
122 122 {
123 var subScene = new FrogScene(200, 200, 500, 600, Scene.DisplayModes.absolute);
123 var subScene = new FrogScene(200, 200, 400, 500, Scene.DisplayModes.absolute);
124 124
125 125 subScene.gameSpeed = 2;
126 126
127 127 scene.loadChildScene(subScene);
128 128
129 frog = new Frog(60, 555, game.images.frog_basic, 0);
129 frog = new Frog(60, subScene.real_size.y - 50, game.images.frog_basic, 0);
130 130 for (tx = 10; tx < subScene.real_size.x; tx += 15)
131 131 {
132 subScene.addObject(new FloorTile(tx, 570, game.images.tile_floor_brown, 0));
132 subScene.addObject(new FloorTile(tx, subScene.real_size.y - 30, game.images.tile_floor_brown, 0));
133 133 }
134 134 subScene.addObject(frog);
135 135 };
@@ -120,16 +120,16 @@ createMainScene = function (game)
120
120
121createSubScene = function (scene)
121createSubScene = function (scene)
122{
122{
123 var subScene = new FrogScene(200, 200, 500, 600, Scene.DisplayModes.absolute);
123 var subScene = new FrogScene(200, 200, 400, 500, Scene.DisplayModes.absolute);
124
124
125 subScene.gameSpeed = 2;
125 subScene.gameSpeed = 2;
126
126
127 scene.loadChildScene(subScene);
127 scene.loadChildScene(subScene);
128
128
129 frog = new Frog(60, 555, game.images.frog_basic, 0);
129 frog = new Frog(60, subScene.real_size.y - 50, game.images.frog_basic, 0);
130 for (tx = 10; tx < subScene.real_size.x; tx += 15)
130 for (tx = 10; tx < subScene.real_size.x; tx += 15)
131 {
131 {
132 subScene.addObject(new FloorTile(tx, 570, game.images.tile_floor_brown, 0));
132 subScene.addObject(new FloorTile(tx, subScene.real_size.y - 30, game.images.tile_floor_brown, 0));
133 }
133 }
134 subScene.addObject(frog);
134 subScene.addObject(frog);
135};
135};
src/minigame/frog/frog.js +30 −13
@@ -3,6 +3,8 @@ class Frog extends GameObject
3 3
4 4 speed = 100;
5 5
6 tongue_speed_max = 400;
7
6 8 facing =
7 9 {
8 10 left: -.8,
@@ -40,7 +42,7 @@ class Frog extends GameObject
40 42
41 43 onCollision (obj)
42 44 {
43
45 // todo: todo
44 46 }
45 47
46 48 isFloor ()
@@ -55,7 +57,6 @@ class Frog extends GameObject
55 57
56 58 update (deltaTime)
57 59 {
58 (1 / deltaTime < 50) ? console.log(1 / deltaTime) : null;
59 60 super.update(deltaTime);
60 61
61 62 this.idle = true;
@@ -73,7 +74,7 @@ class Frog extends GameObject
73 74 {
74 75 this.extendTongueLength(deltaTime);
75 76
76 this.checkCollision();
77 this.checkCollision(deltaTime);
77 78 }
78 79 else
79 80 {
@@ -89,6 +90,11 @@ class Frog extends GameObject
89 90 this.tongueLengthBounce = 0;
90 91 this.tongueVector = null;
91 92 this.tongueVectorBounce = null;
93 if (this.tongue_obj_ref)
94 {
95 this.scene.consumeFruit(this.tongue_obj_ref);
96 this.tongue_obj_ref = null;
97 }
92 98 }
93 99 }
94 100
@@ -105,7 +111,7 @@ class Frog extends GameObject
105 111
106 112 }
107 113
108 checkCollision ()
114 checkCollision (deltaTime)
109 115 {
110 116 let collisionVector = this.tongueVectorBounce ? this.tongueVectorBounce : this.tongueVector;
111 117
@@ -114,17 +120,24 @@ class Frog extends GameObject
114 120 return;
115 121 }
116 122
117 let obj = Ray.Cast(this.scene, collisionVector, new vector(this.tongueVectorBounce ? this.currentFacing : this.opposite_facing, -1), 5);
123 //let obj = Ray.Cast(this.scene, collisionVector, new vector(this.tongueVectorBounce ? this.currentFacing : this.opposite_facing, -1), this.tongue_speed * 2 * deltaTime);
118 124
119 if (obj && obj instanceof Fruit)
125 let obj = Ray.Cast(this.scene,
126 collisionVector,
127 new vector(this.tongueVectorBounce ? this.opposite_facing : this.currentFacing, -1),
128 this.tongue_speed * 5 * deltaTime);
129
130 if (obj)
120 131 {
121 console.log(obj);
122 obj.collider.enabled = false;
123 this.tongue_obj_ref = obj;
132 if (obj.hitObj instanceof Fruit)
133 {
134 obj = obj.hitObj;
135 obj.collider.enabled = false;
136 this.tongue_obj_ref = obj;
124 137
125 this.retracting = true;
138 this.retracting = true;
139 }
126 140 }
127
128 141 }
129 142
130 143 calculateTongueVectors ()
@@ -154,6 +167,10 @@ class Frog extends GameObject
154 167 return;
155 168 }
156 169 }
170 else
171 {
172 this.tongueVectorBounce = null;
173 }
157 174 }
158 175
159 176 draw (context)
@@ -173,7 +190,7 @@ class Frog extends GameObject
173 190
174 191 get tongue_speed ()
175 192 {
176 return 150 * this.scene.gameSpeed;
193 return Math.min(this.tongue_speed_max, 150 * (1 + this.scene.gameSpeed * .2));
177 194 }
178 195
179 196 get opposite_facing ()
@@ -247,7 +264,7 @@ class Frog extends GameObject
247 264 {
248 265 if (this.tongue_obj_ref && (this.tongueVectorBounce || this.tongueVector))
249 266 {
250 this.tongue_obj_ref.position = this.tongueVectorBounce ? this.tongueVectorBounce : this.tongueVector;
267 this.tongue_obj_ref.transform.position = this.tongueVectorBounce ? this.tongueVectorBounce : this.tongueVector;
251 268 }
252 269 }
253 270
@@ -3,6 +3,8 @@ class Frog extends GameObject
3
3
4 speed = 100;
4 speed = 100;
5
5
6 tongue_speed_max = 400;
7
6 facing =
8 facing =
7 {
9 {
8 left: -.8,
10 left: -.8,
@@ -40,7 +42,7 @@ class Frog extends GameObject
40
42
41 onCollision (obj)
43 onCollision (obj)
42 {
44 {
43
45 // todo: todo
44 }
46 }
45
47
46 isFloor ()
48 isFloor ()
@@ -55,7 +57,6 @@ class Frog extends GameObject
55
57
56 update (deltaTime)
58 update (deltaTime)
57 {
59 {
58 (1 / deltaTime < 50) ? console.log(1 / deltaTime) : null;
59 super.update(deltaTime);
60 super.update(deltaTime);
60
61
61 this.idle = true;
62 this.idle = true;
@@ -73,7 +74,7 @@ class Frog extends GameObject
73 {
74 {
74 this.extendTongueLength(deltaTime);
75 this.extendTongueLength(deltaTime);
75
76
76 this.checkCollision();
77 this.checkCollision(deltaTime);
77 }
78 }
78 else
79 else
79 {
80 {
@@ -89,6 +90,11 @@ class Frog extends GameObject
89 this.tongueLengthBounce = 0;
90 this.tongueLengthBounce = 0;
90 this.tongueVector = null;
91 this.tongueVector = null;
91 this.tongueVectorBounce = null;
92 this.tongueVectorBounce = null;
93 if (this.tongue_obj_ref)
94 {
95 this.scene.consumeFruit(this.tongue_obj_ref);
96 this.tongue_obj_ref = null;
97 }
92 }
98 }
93 }
99 }
94
100
@@ -105,7 +111,7 @@ class Frog extends GameObject
105
111
106 }
112 }
107
113
108 checkCollision ()
114 checkCollision (deltaTime)
109 {
115 {
110 let collisionVector = this.tongueVectorBounce ? this.tongueVectorBounce : this.tongueVector;
116 let collisionVector = this.tongueVectorBounce ? this.tongueVectorBounce : this.tongueVector;
111
117
@@ -114,17 +120,24 @@ class Frog extends GameObject
114 return;
120 return;
115 }
121 }
116
122
117 let obj = Ray.Cast(this.scene, collisionVector, new vector(this.tongueVectorBounce ? this.currentFacing : this.opposite_facing, -1), 5);
123 //let obj = Ray.Cast(this.scene, collisionVector, new vector(this.tongueVectorBounce ? this.currentFacing : this.opposite_facing, -1), this.tongue_speed * 2 * deltaTime);
118
124
119 if (obj && obj instanceof Fruit)
125 let obj = Ray.Cast(this.scene,
126 collisionVector,
127 new vector(this.tongueVectorBounce ? this.opposite_facing : this.currentFacing, -1),
128 this.tongue_speed * 5 * deltaTime);
129
130 if (obj)
120 {
131 {
121 console.log(obj);
132 if (obj.hitObj instanceof Fruit)
122 obj.collider.enabled = false;
133 {
123 this.tongue_obj_ref = obj;
134 obj = obj.hitObj;
135 obj.collider.enabled = false;
136 this.tongue_obj_ref = obj;
124
137
125 this.retracting = true;
138 this.retracting = true;
139 }
126 }
140 }
127
128 }
141 }
129
142
130 calculateTongueVectors ()
143 calculateTongueVectors ()
@@ -154,6 +167,10 @@ class Frog extends GameObject
154 return;
167 return;
155 }
168 }
156 }
169 }
170 else
171 {
172 this.tongueVectorBounce = null;
173 }
157 }
174 }
158
175
159 draw (context)
176 draw (context)
@@ -173,7 +190,7 @@ class Frog extends GameObject
173
190
174 get tongue_speed ()
191 get tongue_speed ()
175 {
192 {
176 return 150 * this.scene.gameSpeed;
193 return Math.min(this.tongue_speed_max, 150 * (1 + this.scene.gameSpeed * .2));
177 }
194 }
178
195
179 get opposite_facing ()
196 get opposite_facing ()
@@ -247,7 +264,7 @@ class Frog extends GameObject
247 {
264 {
248 if (this.tongue_obj_ref && (this.tongueVectorBounce || this.tongueVector))
265 if (this.tongue_obj_ref && (this.tongueVectorBounce || this.tongueVector))
249 {
266 {
250 this.tongue_obj_ref.position = this.tongueVectorBounce ? this.tongueVectorBounce : this.tongueVector;
267 this.tongue_obj_ref.transform.position = this.tongueVectorBounce ? this.tongueVectorBounce : this.tongueVector;
251 }
268 }
252 }
269 }
253
270
src/minigame/frog/frogScene.js +33 −4
@@ -1,6 +1,5 @@
1 1 class FrogScene extends Scene
2 2 {
3 fruitMax = 10;
4 3
5 4 fruitSpawnRateMin = 1;
6 5 fruitSpawnRateMax = 2;
@@ -10,6 +9,7 @@ class FrogScene extends Scene
10 9
11 10 fruits = [];
12 11 fruitPool = [];
12 eatenFruit = [];
13 13
14 14 gameSpeed = 1;
15 15
@@ -27,6 +27,25 @@ class FrogScene extends Scene
27 27 this.spawnFruits(deltaTime);
28 28 }
29 29
30 increaseDifficulty ()
31 {
32 this.gameSpeed += .1;
33
34 if (this.fruitSpawnRateMax > .1)
35 {
36 this.fruitSpawnRateMax -= .2;
37 }
38 else if (this.fruitSpawnRateMax == .2)
39 {
40 this.fruitSpawnRateMax = .1;
41 }
42 if (this.fruitSpawnRateMin > 0)
43 {
44 this.fruitSpawnRateMin -= .2;
45 }
46 }
47
48
30 49 spawnFruits (deltaTime)
31 50 {
32 51 this.fruitSpawnTimer -= deltaTime;
@@ -36,7 +55,8 @@ class FrogScene extends Scene
36 55 {
37 56 let fruit = this.getFromFruitPoolOrCreate();
38 57 fruit.collider.enabled = true;
39 fruit.transform.position = this.getRandomVectorPosition(fruit);
58 fruit.speed = Math.randomRange(10, 20);
59 fruit.transform.position = this.getRandomVectorPosition();
40 60 this.setRandomSubImage(fruit);
41 61 this.fruits.push(fruit);
42 62
@@ -45,6 +65,15 @@ class FrogScene extends Scene
45 65 }
46 66 }
47 67
68 consumeFruit (fruit)
69 {
70 this.eatenFruit.push(fruit.renderer.subImage);
71
72 this.destroyFruit(fruit);
73
74 this.increaseDifficulty();
75 }
76
48 77 destroyFruit (fruit)
49 78 {
50 79 if (this.fruits.contains(fruit))
@@ -65,7 +94,7 @@ class FrogScene extends Scene
65 94 fruit.renderer.subImage = Math.floor(Math.randomRange(0, fruit.renderer.sprite.subImages));
66 95 }
67 96
68 getRandomVectorPosition (fruit)
97 getRandomVectorPosition ()
69 98 {
70 99 return new vector
71 100 (
@@ -76,6 +105,6 @@ class FrogScene extends Scene
76 105
77 106 shouldSpawn ()
78 107 {
79 return this.fruits.length < this.fruitMax && Math.random() < this.fruitSpawnChance;
108 return Math.random() < this.fruitSpawnChance;
80 109 }
81 110 }
@@ -1,6 +1,5 @@
1class FrogScene extends Scene
1class FrogScene extends Scene
2{
2{
3 fruitMax = 10;
4
3
5 fruitSpawnRateMin = 1;
4 fruitSpawnRateMin = 1;
6 fruitSpawnRateMax = 2;
5 fruitSpawnRateMax = 2;
@@ -10,6 +9,7 @@ class FrogScene extends Scene
10
9
11 fruits = [];
10 fruits = [];
12 fruitPool = [];
11 fruitPool = [];
12 eatenFruit = [];
13
13
14 gameSpeed = 1;
14 gameSpeed = 1;
15
15
@@ -27,6 +27,25 @@ class FrogScene extends Scene
27 this.spawnFruits(deltaTime);
27 this.spawnFruits(deltaTime);
28 }
28 }
29
29
30 increaseDifficulty ()
31 {
32 this.gameSpeed += .1;
33
34 if (this.fruitSpawnRateMax > .1)
35 {
36 this.fruitSpawnRateMax -= .2;
37 }
38 else if (this.fruitSpawnRateMax == .2)
39 {
40 this.fruitSpawnRateMax = .1;
41 }
42 if (this.fruitSpawnRateMin > 0)
43 {
44 this.fruitSpawnRateMin -= .2;
45 }
46 }
47
48
30 spawnFruits (deltaTime)
49 spawnFruits (deltaTime)
31 {
50 {
32 this.fruitSpawnTimer -= deltaTime;
51 this.fruitSpawnTimer -= deltaTime;
@@ -36,7 +55,8 @@ class FrogScene extends Scene
36 {
55 {
37 let fruit = this.getFromFruitPoolOrCreate();
56 let fruit = this.getFromFruitPoolOrCreate();
38 fruit.collider.enabled = true;
57 fruit.collider.enabled = true;
39 fruit.transform.position = this.getRandomVectorPosition(fruit);
58 fruit.speed = Math.randomRange(10, 20);
59 fruit.transform.position = this.getRandomVectorPosition();
40 this.setRandomSubImage(fruit);
60 this.setRandomSubImage(fruit);
41 this.fruits.push(fruit);
61 this.fruits.push(fruit);
42
62
@@ -45,6 +65,15 @@ class FrogScene extends Scene
45 }
65 }
46 }
66 }
47
67
68 consumeFruit (fruit)
69 {
70 this.eatenFruit.push(fruit.renderer.subImage);
71
72 this.destroyFruit(fruit);
73
74 this.increaseDifficulty();
75 }
76
48 destroyFruit (fruit)
77 destroyFruit (fruit)
49 {
78 {
50 if (this.fruits.contains(fruit))
79 if (this.fruits.contains(fruit))
@@ -65,7 +94,7 @@ class FrogScene extends Scene
65 fruit.renderer.subImage = Math.floor(Math.randomRange(0, fruit.renderer.sprite.subImages));
94 fruit.renderer.subImage = Math.floor(Math.randomRange(0, fruit.renderer.sprite.subImages));
66 }
95 }
67
96
68 getRandomVectorPosition (fruit)
97 getRandomVectorPosition ()
69 {
98 {
70 return new vector
99 return new vector
71 (
100 (
@@ -76,6 +105,6 @@ class FrogScene extends Scene
76
105
77 shouldSpawn ()
106 shouldSpawn ()
78 {
107 {
79 return this.fruits.length < this.fruitMax && Math.random() < this.fruitSpawnChance;
108 return Math.random() < this.fruitSpawnChance;
80 }
109 }
81}
110}
src/minigame/frog/fruit.js +1 −1
@@ -25,7 +25,7 @@ class Fruit extends GameObject
25 25 {
26 26 super.update(deltaTime);
27 27
28 this.transform.position.y += this.speed * this.scene.gameSpeed * deltaTime;
28 this.transform.position.y += this.speed * this.scene.gameSpeed * this.scene.gameSpeed * deltaTime;
29 29
30 30 if (this.transform.position.y > this.scene.real_size.y)
31 31 {
@@ -25,7 +25,7 @@ class Fruit extends GameObject
25 {
25 {
26 super.update(deltaTime);
26 super.update(deltaTime);
27
27
28 this.transform.position.y += this.speed * this.scene.gameSpeed * deltaTime;
28 this.transform.position.y += this.speed * this.scene.gameSpeed * this.scene.gameSpeed * deltaTime;
29
29
30 if (this.transform.position.y > this.scene.real_size.y)
30 if (this.transform.position.y > this.scene.real_size.y)
31 {
31 {