-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.f5ff0af234fb6faeaf0b.js
1 lines (1 loc) · 5.07 KB
/
game.f5ff0af234fb6faeaf0b.js
1
!function(){"use strict";var n,e={804:function(n,e,t){var o=t(666),r=t.n(o),i=t(979);function a(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function s(n,e){for(var t=0;t<e.length;t++){var o=e[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(n,o.key,o)}}function c(n,e,t){return e&&s(n.prototype,e),t&&s(n,t),n}var u=function n(){a(this,n),this.rows=128,this.columns=128,this.width=64,this.height=64,console.info("[BOOT] Tilemap")},f=function(){function n(){a(this,n),this.x=0,this.y=0,this.width=320,this.height=240,this.maxX=-1,this.maxY=-1,console.info("[BOOT] Camera")}return c(n,[{key:"move",value:function(n,e){this.x,this.y}}]),n}(),l=function(){function n(e){a(this,n),this.app=e,this.tilemap=new u,this.camera=new f,console.info("[BOOT] World")}return c(n,[{key:"worldToScreen",value:function(n,e){return{x:n-this.camera.x,y:e-this.camera.y}}},{key:"screenToWorld",value:function(n,e){return{x:n+this.camera.x,y:e+this.camera.y}}}]),n}();function h(n,e,t,o,r,i,a){try{var s=n[i](a),c=s.value}catch(n){return void t(n)}s.done?e(c):Promise.resolve(c).then(o,r)}function d(n,e){for(var t=0;t<e.length;t++){var o=e[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(n,o.key,o)}}var p,v=function(){function n(e){(function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")})(this,n),this.assets=[],this.app=e||new i.MxU,this.boot(this.app)}var e,t;return e=n,t=[{key:"boot",value:function(n){console.info("[BOOT] ".concat("Pastel Future"," v").concat(.1)),this.world=new l(n)}},{key:"destroyGameAssets",value:function(){this.assets.forEach((function(n){console.log(n)}))}},{key:"loadGameAssets",value:function(){return(n=r().mark((function n(){return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n,e){var t=i.aNw.shared;console.info("[LOAD] Init"),t.add("pf","assets/assets.json"),t.onComplete.once((function(){console.info("[LOAD] Complete"),n()})),t.onError.once((function(){e("[LOAD] ERR in loadGameAssets()")})),t.onProgress.add((function(n){console.info("[LOAD] ".concat(n.progress,"%"))})),t.load()})));case 1:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(o,r){var i=n.apply(e,t);function a(n){h(i,o,r,a,s,"next",n)}function s(n){h(i,o,r,a,s,"throw",n)}a(void 0)}))})();var n}}],t&&d(e.prototype,t),n}();function w(n,e,t,o,r,i,a){try{var s=n[i](a),c=s.value}catch(n){return void t(n)}s.done?e(c):Promise.resolve(c).then(o,r)}!function(n){n[n.Width=640]="Width",n[n.Height=480]="Height"}(p||(p={}));var y=new i.MxU({backgroundColor:16777215});y.stage.interactive=!0;var m,g=new v(y);console.info(g.screen),window.onload=(m=r().mark((function n(){var e;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,g.loadGameAssets();case 2:document.body.appendChild(y.view),t=void 0,(t=function(){y.renderer.resize(window.innerWidth,window.innerHeight),y.stage.scale.x=window.innerWidth/p.Width,y.stage.scale.y=window.innerHeight/p.Height})(),window.addEventListener("resize",t),o=void 0,(o=new i.KgH([i.xEZ.from("thatguy_1.png"),i.xEZ.from("thatguy_2.png")])).loop=!0,o.animationSpeed=.05,o.play(),o.scale.set(5),(e=o).anchor.set(.5,.5),e.position.set(320,240),y.stage.addChild(e);case 8:case"end":return n.stop()}var t,o}),n)})),function(){var n=this,e=arguments;return new Promise((function(t,o){var r=m.apply(n,e);function i(n){w(r,t,o,i,a,"next",n)}function a(n){w(r,t,o,i,a,"throw",n)}i(void 0)}))})}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.m=e,n=[],o.O=function(e,t,r,i){if(!t){var a=1/0;for(f=0;f<n.length;f++){t=n[f][0],r=n[f][1],i=n[f][2];for(var s=!0,c=0;c<t.length;c++)(!1&i||a>=i)&&Object.keys(o.O).every((function(n){return o.O[n](t[c])}))?t.splice(c--,1):(s=!1,i<a&&(a=i));if(s){n.splice(f--,1);var u=r();void 0!==u&&(e=u)}}return e}i=i||0;for(var f=n.length;f>0&&n[f-1][2]>i;f--)n[f]=n[f-1];n[f]=[t,r,i]},o.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return o.d(e,{a:e}),e},o.d=function(n,e){for(var t in e)o.o(e,t)&&!o.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),o.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},o.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n},function(){var n={179:0};o.O.j=function(e){return 0===n[e]};var e=function(e,t){var r,i,a=t[0],s=t[1],c=t[2],u=0;if(a.some((function(e){return 0!==n[e]}))){for(r in s)o.o(s,r)&&(o.m[r]=s[r]);if(c)var f=c(o)}for(e&&e(t);u<a.length;u++)i=a[u],o.o(n,i)&&n[i]&&n[i][0](),n[i]=0;return o.O(f)},t=self.webpackChunkpixi_typescript_boilerplate=self.webpackChunkpixi_typescript_boilerplate||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))}();var r=o.O(void 0,[325],(function(){return o(804)}));r=o.O(r)}();