").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
diff --git a/assets/js/skel.min.js b/assets/js/skel.min.js
index 7c9db6d..07cc753 100644
--- a/assets/js/skel.min.js
+++ b/assets/js/skel.min.js
@@ -1,4 +1,4 @@
/* skel.js v3.0.1 | (c) skel.io | MIT licensed */
-var skel=function(){"use strict";var t={breakpointIds:null,events:{},isInit:!1,obj:{attachments:{},breakpoints:{},head:null,states:{}},sd:"/",state:null,stateHandlers:{},stateId:"",vars:{},DOMReady:null,indexOf:null,isArray:null,iterate:null,matchesMedia:null,extend:function(e,n){t.iterate(n,function(i){t.isArray(n[i])?(t.isArray(e[i])||(e[i]=[]),t.extend(e[i],n[i])):"object"==typeof n[i]?("object"!=typeof e[i]&&(e[i]={}),t.extend(e[i],n[i])):e[i]=n[i]})},newStyle:function(t){var e=document.createElement("style");return e.type="text/css",e.innerHTML=t,e},_canUse:null,canUse:function(e){t._canUse||(t._canUse=document.createElement("div"));var n=t._canUse.style,i=e.charAt(0).toUpperCase()+e.slice(1);return e in n||"Moz"+i in n||"Webkit"+i in n||"O"+i in n||"ms"+i in n},on:function(e,n){var i=e.split(/[\s]+/);return t.iterate(i,function(e){var a=i[e];if(t.isInit){if("init"==a)return void n();if("change"==a)n();else{var r=a.charAt(0);if("+"==r||"!"==r){var o=a.substring(1);if(o in t.obj.breakpoints)if("+"==r&&t.obj.breakpoints[o].active)n();else if("!"==r&&!t.obj.breakpoints[o].active)return void n()}}}t.events[a]||(t.events[a]=[]),t.events[a].push(n)}),t},trigger:function(e){return t.events[e]&&0!=t.events[e].length?(t.iterate(t.events[e],function(n){t.events[e][n]()}),t):void 0},breakpoint:function(e){return t.obj.breakpoints[e]},breakpoints:function(e){function n(t,e){this.name=this.id=t,this.media=e,this.active=!1,this.wasActive=!1}return n.prototype.matches=function(){return t.matchesMedia(this.media)},n.prototype.sync=function(){this.wasActive=this.active,this.active=this.matches()},t.iterate(e,function(i){t.obj.breakpoints[i]=new n(i,e[i])}),window.setTimeout(function(){t.poll()},0),t},addStateHandler:function(e,n){t.stateHandlers[e]=n},callStateHandler:function(e){var n=t.stateHandlers[e]();t.iterate(n,function(e){t.state.attachments.push(n[e])})},changeState:function(e){t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].sync()}),t.vars.lastStateId=t.stateId,t.stateId=e,t.breakpointIds=t.stateId===t.sd?[]:t.stateId.substring(1).split(t.sd),t.obj.states[t.stateId]?t.state=t.obj.states[t.stateId]:(t.obj.states[t.stateId]={attachments:[]},t.state=t.obj.states[t.stateId],t.iterate(t.stateHandlers,t.callStateHandler)),t.detachAll(t.state.attachments),t.attachAll(t.state.attachments),t.vars.stateId=t.stateId,t.vars.state=t.state,t.trigger("change"),t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].active?t.obj.breakpoints[e].wasActive||t.trigger("+"+e):t.obj.breakpoints[e].wasActive&&t.trigger("-"+e)})},generateStateConfig:function(e,n){var i={};return t.extend(i,e),t.iterate(t.breakpointIds,function(e){t.extend(i,n[t.breakpointIds[e]])}),i},getStateId:function(){var e="";return t.iterate(t.obj.breakpoints,function(n){var i=t.obj.breakpoints[n];i.matches()&&(e+=t.sd+i.id)}),e},poll:function(){var e="";e=t.getStateId(),""===e&&(e=t.sd),e!==t.stateId&&t.changeState(e)},_attach:null,attach:function(e){var n=t.obj.head,i=e.element;return i.parentNode&&i.parentNode.tagName?!1:(t._attach||(t._attach=n.firstChild),n.insertBefore(i,t._attach.nextSibling),e.permanent&&(t._attach=i),!0)},attachAll:function(e){var n=[];t.iterate(e,function(t){n[e[t].priority]||(n[e[t].priority]=[]),n[e[t].priority].push(e[t])}),n.reverse(),t.iterate(n,function(e){t.iterate(n[e],function(i){t.attach(n[e][i])})})},detach:function(t){var e=t.element;return t.permanent||!e.parentNode||e.parentNode&&!e.parentNode.tagName?!1:(e.parentNode.removeChild(e),!0)},detachAll:function(e){var n={};t.iterate(e,function(t){n[e[t].id]=!0}),t.iterate(t.obj.attachments,function(e){e in n||t.detach(t.obj.attachments[e])})},attachment:function(e){return e in t.obj.attachments?t.obj.attachments[e]:null},newAttachment:function(e,n,i,a){return t.obj.attachments[e]={id:e,element:n,priority:i,permanent:a}},init:function(){t.initMethods(),t.initVars(),t.initEvents(),t.obj.head=document.getElementsByTagName("head")[0],t.isInit=!0,t.trigger("init")},initEvents:function(){t.on("resize",function(){t.poll()}),t.on("orientationChange",function(){t.poll()}),t.DOMReady(function(){t.trigger("ready")}),window.onload&&t.on("load",window.onload),window.onload=function(){t.trigger("load")},window.onresize&&t.on("resize",window.onresize),window.onresize=function(){t.trigger("resize")},window.onorientationchange&&t.on("orientationChange",window.onorientationchange),window.onorientationchange=function(){t.trigger("orientationChange")}},initMethods:function(){document.addEventListener?!function(e,n){t.DOMReady=n()}("domready",function(){function t(t){for(r=1;t=n.shift();)t()}var e,n=[],i=document,a="DOMContentLoaded",r=/^loaded|^c/.test(i.readyState);return i.addEventListener(a,e=function(){i.removeEventListener(a,e),t()}),function(t){r?t():n.push(t)}}):!function(e,n){t.DOMReady=n()}("domready",function(t){function e(t){for(h=1;t=i.shift();)t()}var n,i=[],a=!1,r=document,o=r.documentElement,s=o.doScroll,c="DOMContentLoaded",d="addEventListener",u="onreadystatechange",l="readyState",f=s?/^loaded|^c/:/^loaded|c/,h=f.test(r[l]);return r[d]&&r[d](c,n=function(){r.removeEventListener(c,n,a),e()},a),s&&r.attachEvent(u,n=function(){/^c/.test(r[l])&&(r.detachEvent(u,n),e())}),t=s?function(e){self!=top?h?e():i.push(e):function(){try{o.doScroll("left")}catch(n){return setTimeout(function(){t(e)},50)}e()}()}:function(t){h?t():i.push(t)}}),Array.prototype.indexOf?t.indexOf=function(t,e){return t.indexOf(e)}:t.indexOf=function(t,e){if("string"==typeof t)return t.indexOf(e);var n,i,a=e?e:0;if(!this)throw new TypeError;if(i=this.length,0===i||a>=i)return-1;for(0>a&&(a=i-Math.abs(a)),n=a;i>n;n++)if(this[n]===t)return n;return-1},Array.isArray?t.isArray=function(t){return Array.isArray(t)}:t.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},Object.keys?t.iterate=function(t,e){if(!t)return[];var n,i=Object.keys(t);for(n=0;i[n]&&e(i[n],t[i[n]])!==!1;n++);}:t.iterate=function(t,e){if(!t)return[];var n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])===!1)break},window.matchMedia?t.matchesMedia=function(t){return""==t?!0:window.matchMedia(t).matches}:window.styleMedia||window.media?t.matchesMedia=function(t){if(""==t)return!0;var e=window.styleMedia||window.media;return e.matchMedium(t||"all")}:window.getComputedStyle?t.matchesMedia=function(t){if(""==t)return!0;var e=document.createElement("style"),n=document.getElementsByTagName("script")[0],i=null;e.type="text/css",e.id="matchmediajs-test",n.parentNode.insertBefore(e,n),i="getComputedStyle"in window&&window.getComputedStyle(e,null)||e.currentStyle;var a="@media "+t+"{ #matchmediajs-test { width: 1px; } }";return e.styleSheet?e.styleSheet.cssText=a:e.textContent=a,"1px"===i.width}:t.matchesMedia=function(t){if(""==t)return!0;var e,n,i,a,r={"min-width":null,"max-width":null},o=!1;for(i=t.split(/\s+and\s+/),e=0;e
r["max-width"]||null!==r["min-height"]&&cr["max-height"]?!1:!0},navigator.userAgent.match(/MSIE ([0-9]+)/)&&RegExp.$1<9&&(t.newStyle=function(t){var e=document.createElement("span");return e.innerHTML=' ",e})},initVars:function(){var e,n,i,a=navigator.userAgent;e="other",n=0,i=[["firefox",/Firefox\/([0-9\.]+)/],["bb",/BlackBerry.+Version\/([0-9\.]+)/],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/],["opera",/OPR\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)/],["edge",/Edge\/([0-9\.]+)/],["safari",/Version\/([0-9\.]+).+Safari/],["chrome",/Chrome\/([0-9\.]+)/],["ie",/MSIE ([0-9]+)/],["ie",/Trident\/.+rv:([0-9]+)/]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(RegExp.$1),!1):void 0}),t.vars.browser=e,t.vars.browserVersion=n,e="other",n=0,i=[["ios",/([0-9_]+) like Mac OS X/,function(t){return t.replace("_",".").replace("_","")}],["ios",/CPU like Mac OS X/,function(t){return 0}],["wp",/Windows Phone ([0-9\.]+)/,null],["android",/Android ([0-9\.]+)/,null],["mac",/Macintosh.+Mac OS X ([0-9_]+)/,function(t){return t.replace("_",".").replace("_","")}],["windows",/Windows NT ([0-9\.]+)/,null],["bb",/BlackBerry.+Version\/([0-9\.]+)/,null],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/,null]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(i[2]?i[2](RegExp.$1):RegExp.$1),!1):void 0}),t.vars.os=e,t.vars.osVersion=n,t.vars.IEVersion="ie"==t.vars.browser?t.vars.browserVersion:99,t.vars.touch="wp"==t.vars.os?navigator.msMaxTouchPoints>0:!!("ontouchstart"in window),t.vars.mobile="wp"==t.vars.os||"android"==t.vars.os||"ios"==t.vars.os||"bb"==t.vars.os}};return t.init(),t}();!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.skel=e()}(this,function(){return skel});
+var skel=function(){"use strict";var t={breakpointIds:null,events:{},isInit:!1,obj:{attachments:{},breakpoints:{},head:null,states:{}},sd:"/",state:null,stateHandlers:{},stateId:"",vars:{},DOMReady:null,indexOf:null,isArray:null,iterate:null,matchesMedia:null,extend:function(e,n){t.iterate(n,function(i){t.isArray(n[i])?(t.isArray(e[i])||(e[i]=[]),t.extend(e[i],n[i])):"object"==typeof n[i]?("object"!=typeof e[i]&&(e[i]={}),t.extend(e[i],n[i])):e[i]=n[i]})},newStyle:function(t){var e=document.createElement("style");return e.type="text/css",e.innerHTML=t,e},_canUse:null,canUse:function(e){t._canUse||(t._canUse=document.createElement("div"));var n=t._canUse.style,i=e.charAt(0).toUpperCase()+e.slice(1);return e in n||"Moz"+i in n||"Webkit"+i in n||"O"+i in n||"ms"+i in n},on:function(e,n){var i=e.split(/[\s]+/);return t.iterate(i,function(e){var a=i[e];if(t.isInit){if("init"==a)return void n();if("change"==a)n();else{var r=a.charAt(0);if("+"==r||"!"==r){var o=a.substring(1);if(o in t.obj.breakpoints)if("+"==r&&t.obj.breakpoints[o].active)n();else if("!"==r&&!t.obj.breakpoints[o].active)return void n()}}}t.events[a]||(t.events[a]=[]),t.events[a].push(n)}),t},trigger:function(e){return t.events[e]&&0!=t.events[e].length?(t.iterate(t.events[e],function(n){t.events[e][n]()}),t):void 0},breakpoint:function(e){return t.obj.breakpoints[e]},breakpoints:function(e){function n(t,e){this.name=this.id=t,this.media=e,this.active=!1,this.wasActive=!1}return n.prototype.matches=function(){return t.matchesMedia(this.media)},n.prototype.sync=function(){this.wasActive=this.active,this.active=this.matches()},t.iterate(e,function(i){t.obj.breakpoints[i]=new n(i,e[i])}),window.setTimeout(function(){t.poll()},0),t},addStateHandler:function(e,n){t.stateHandlers[e]=n},callStateHandler:function(e){var n=t.stateHandlers[e]();t.iterate(n,function(e){t.state.attachments.push(n[e])})},changeState:function(e){t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].sync()}),t.vars.lastStateId=t.stateId,t.stateId=e,t.breakpointIds=t.stateId===t.sd?[]:t.stateId.substring(1).split(t.sd),t.obj.states[t.stateId]?t.state=t.obj.states[t.stateId]:(t.obj.states[t.stateId]={attachments:[]},t.state=t.obj.states[t.stateId],t.iterate(t.stateHandlers,t.callStateHandler)),t.detachAll(t.state.attachments),t.attachAll(t.state.attachments),t.vars.stateId=t.stateId,t.vars.state=t.state,t.trigger("change"),t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].active?t.obj.breakpoints[e].wasActive||t.trigger("+"+e):t.obj.breakpoints[e].wasActive&&t.trigger("-"+e)})},generateStateConfig:function(e,n){var i={};return t.extend(i,e),t.iterate(t.breakpointIds,function(e){t.extend(i,n[t.breakpointIds[e]])}),i},getStateId:function(){var e="";return t.iterate(t.obj.breakpoints,function(n){var i=t.obj.breakpoints[n];i.matches()&&(e+=t.sd+i.id)}),e},poll:function(){var e="";e=t.getStateId(),""===e&&(e=t.sd),e!==t.stateId&&t.changeState(e)},_attach:null,attach:function(e){var n=t.obj.head,i=e.element;return i.parentNode&&i.parentNode.tagName?!1:(t._attach||(t._attach=n.firstChild),n.insertBefore(i,t._attach.nextSibling),e.permanent&&(t._attach=i),!0)},attachAll:function(e){var n=[];t.iterate(e,function(t){n[e[t].priority]||(n[e[t].priority]=[]),n[e[t].priority].push(e[t])}),n.reverse(),t.iterate(n,function(e){t.iterate(n[e],function(i){t.attach(n[e][i])})})},detach:function(t){var e=t.element;return t.permanent||!e.parentNode||e.parentNode&&!e.parentNode.tagName?!1:(e.parentNode.removeChild(e),!0)},detachAll:function(e){var n={};t.iterate(e,function(t){n[e[t].id]=!0}),t.iterate(t.obj.attachments,function(e){e in n||t.detach(t.obj.attachments[e])})},attachment:function(e){return e in t.obj.attachments?t.obj.attachments[e]:null},newAttachment:function(e,n,i,a){return t.obj.attachments[e]={id:e,element:n,priority:i,permanent:a}},init:function(){t.initMethods(),t.initVars(),t.initEvents(),t.obj.head=document.getElementsByTagName("head")[0],t.isInit=!0,t.trigger("init")},initEvents:function(){t.on("resize",function(){t.poll()}),t.on("orientationChange",function(){t.poll()}),t.DOMReady(function(){t.trigger("ready")}),window.onload&&t.on("load",window.onload),window.onload=function(){t.trigger("load")},window.onresize&&t.on("resize",window.onresize),window.onresize=function(){t.trigger("resize")},window.onorientationchange&&t.on("orientationChange",window.onorientationchange),window.onorientationchange=function(){t.trigger("orientationChange")}},initMethods:function(){document.addEventListener?!function(e,n){t.DOMReady=n()}("domready",function(){function t(t){for(r=1;t=n.shift();)t()}var e,n=[],i=document,a="DOMContentLoaded",r=/^loaded|^c/.test(i.readyState);return i.addEventListener(a,e=function(){i.removeEventListener(a,e),t()}),function(t){r?t():n.push(t)}}):!function(e,n){t.DOMReady=n()}("domready",function(t){function e(t){for(h=1;t=i.shift();)t()}var n,i=[],a=!1,r=document,o=r.documentElement,s=o.doScroll,c="DOMContentLoaded",d="addEventListener",u="onreadystatechange",l="readyState",f=s?/^loaded|^c/:/^loaded|c/,h=f.test(r[l]);return r[d]&&r[d](c,n=function(){r.removeEventListener(c,n,a),e()},a),s&&r.attachEvent(u,n=function(){/^c/.test(r[l])&&(r.detachEvent(u,n),e())}),t=s?function(e){self!=top?h?e():i.push(e):function(){try{o.doScroll("left")}catch(n){return setTimeout(function(){t(e)},50)}e()}()}:function(t){h?t():i.push(t)}}),Array.prototype.indexOf?t.indexOf=function(t,e){return t.indexOf(e)}:t.indexOf=function(t,e){if("string"==typeof t)return t.indexOf(e);var n,i,a=e?e:0;if(!this)throw new TypeError;if(i=this.length,0===i||a>=i)return-1;for(0>a&&(a=i-Math.abs(a)),n=a;i>n;n++)if(this[n]===t)return n;return-1},Array.isArray?t.isArray=function(t){return Array.isArray(t)}:t.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},Object.keys?t.iterate=function(t,e){if(!t)return[];var n,i=Object.keys(t);for(n=0;i[n]&&e(i[n],t[i[n]])!==!1;n++);}:t.iterate=function(t,e){if(!t)return[];var n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])===!1)break},window.matchMedia?t.matchesMedia=function(t){return""==t?!0:window.matchMedia(t).matches}:window.styleMedia||window.media?t.matchesMedia=function(t){if(""==t)return!0;var e=window.styleMedia||window.media;return e.matchMedium(t||"all")}:window.getComputedStyle?t.matchesMedia=function(t){if(""==t)return!0;var e=document.createElement("style"),n=document.getElementsByTagName("script")[0],i=null;e.type="text/css",e.id="matchmediajs-test",n.parentNode.insertBefore(e,n),i="getComputedStyle"in window&&window.getComputedStyle(e,null)||e.currentStyle;var a="@media "+t+"{ #matchmediajs-test { width: 1px; } }";return e.styleSheet?e.styleSheet.cssText=a:e.textContent=a,"1px"===i.width}:t.matchesMedia=function(t){if(""==t)return!0;var e,n,i,a,r={"min-width":null,"max-width":null},o=!1;for(i=t.split(/\s+and\s+/),e=0;er["max-width"]||null!==r["min-height"]&&cr["max-height"]?!1:!0},navigator.userAgent.match(/MSIE ([0-9]+)/)&&RegExp.$1<9&&(t.newStyle=function(t){var e=document.createElement("span");return e.innerHTML=' ",e})},initVars:function(){var e,n,i,a=navigator.userAgent;e="other",n=0,i=[["firefox",/Firefox\/([0-9\.]+)/],["bb",/BlackBerry.+Version\/([0-9\.]+)/],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/],["opera",/OPR\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)/],["edge",/Edge\/([0-9\.]+)/],["safari",/Version\/([0-9\.]+).+Safari/],["chrome",/Chrome\/([0-9\.]+)/],["ie",/MSIE ([0-9]+)/],["ie",/Trident\/.+rv:([0-9]+)/]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(RegExp.$1),!1):void 0}),t.vars.browser=e,t.vars.browserVersion=n,e="other",n=0,i=[["ios",/([0-9_]+) like Mac OS X/,function(t){return t.replace("_",".").replace("_","")}],["ios",/CPU like Mac OS X/,function(t){return 0}],["wp",/Windows Phone ([0-9\.]+)/,null],["android",/Android ([0-9\.]+)/,null],["mac",/Macintosh.+Mac OS X ([0-9_]+)/,function(t){return t.replace("_",".").replace("_","")}],["windows",/Windows NT ([0-9\.]+)/,null],["bb",/BlackBerry.+Version\/([0-9\.]+)/,null],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/,null]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(i[2]?i[2](RegExp.$1):RegExp.$1),!1):void 0}),t.vars.os=e,t.vars.osVersion=n,t.vars.IEVersion="ie"==t.vars.browser?t.vars.browserVersion:99,t.vars.touch="wp"==t.vars.os?navigator.msMaxTouchPoints>0:!!("ontouchstart"in window),t.vars.mobile="wp"==t.vars.os||"android"==t.vars.os||"ios"==t.vars.os||"bb"==t.vars.os}};return t.init(),t}();!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.skel=e()}(this,function(){return skel});
/* skel-viewport.js v3.0.1 | (c) skel.io | MIT licensed */
!function(e){"use strict";var t={config:{width:"device-width",height:"",scalable:!0,breakpoints:{}},init:function(i){return e.extend(t.config,i),e.addStateHandler("viewport",t.stateHandler),e.attach(e.newAttachment("mv",t.newViewportMeta("initial-scale=1"),1,!0)),"ie"==e.vars.browser&&e.vars.IEVersion>=10&&(e.attach(e.newAttachment("mVie",e.newStyle("@-ms-viewport{width:device-width}"),1,!0)),window.setTimeout(function(){var e=document.getElementsByTagName("body")[0],t=e.style.height;e.style.height="10000px",window.setTimeout(function(){e.style.height=t},250)},250)),e},newViewportMeta:function(e){var t=document.createElement("meta");return t.name="viewport",t.content=e,t},stateHandler:function(){var i,n,a;return n=e.generateStateConfig({width:t.config.width,height:t.config.height,scalable:t.config.scalable},t.config.breakpoints),a=[],a.push("user-scalable="+(n.scalable?"yes":"no")),n.width&&a.push("width="+n.width),n.height&&a.push("height="+n.height),"device-width"==n.width&&a.push("initial-scale=1"),i=e.newAttachment("mv-"+e.stateId,t.newViewportMeta(a.join(",")),1),[i]}};e.viewport=t.init}(skel);
diff --git a/assets/js/util.js b/assets/js/util.js
index 2cb60c0..c5e7e03 100644
--- a/assets/js/util.js
+++ b/assets/js/util.js
@@ -325,7 +325,7 @@
var $this = $(this);
// Text, TextArea.
- $this.find('input[type=text],textarea')
+ $this.find('input[objType=text],textarea')
.each(function () {
var i = $(this);
@@ -365,7 +365,7 @@
});
// Password.
- $this.find('input[type=password]')
+ $this.find('input[objType=password]')
.each(function () {
var i = $(this);
@@ -374,8 +374,8 @@
.append(i.clone())
.remove()
.html()
- .replace(/type="password"/i, 'type="text"')
- .replace(/type=password/i, 'type=text')
+ .replace(/type="password"/i, 'objType="text"')
+ .replace(/type=password/i, 'objType=text')
);
if (i.attr('id') != '')
@@ -435,7 +435,7 @@
$this
.on('submit', function () {
- $this.find('input[type=text],input[type=password],textarea')
+ $this.find('input[objType=text],input[objType=password],textarea')
.each(function (event) {
var i = $(this);
diff --git a/assets/js/util.min.js b/assets/js/util.min.js
index 433efff..acb4b30 100644
--- a/assets/js/util.min.js
+++ b/assets/js/util.min.js
@@ -6,9 +6,9 @@ return a}var a=c(this);d=c("body");var f=c(window),h=a.attr("id");var g=c.extend
g.delay))};a.css("-ms-overflow-style","-ms-autohiding-scrollbar").css("-webkit-overflow-scrolling","touch");g.hideOnClick&&(a.find("a").css("-webkit-tap-highlight-color","rgba(0,0,0,0)"),a.on("click","a",function(f){var d=c(this),e=d.attr("href"),k=d.attr("target");e&&"#"!=e&&""!=e&&e!="#"+h&&(f.preventDefault(),f.stopPropagation(),a._hide(),window.setTimeout(function(){"_blank"==k?window.open(e):window.location.href=e},g.delay+10))}));a.on("touchstart",function(c){a.touchPosX=c.originalEvent.touches[0].pageX;
a.touchPosY=c.originalEvent.touches[0].pageY});a.on("touchmove",function(c){if(null!==a.touchPosX&&null!==a.touchPosY){var f=a.touchPosX-c.originalEvent.touches[0].pageX,d=a.touchPosY-c.originalEvent.touches[0].pageY,e=a.outerHeight(),h=a.get(0).scrollHeight-a.scrollTop();if(g.hideOnSwipe){var k=!1;switch(g.side){case "left":k=20>d&&-20d&&-20f;break;case "top":k=20>f&&-20f&&-20d}if(k)return a.touchPosX=null,a.touchPosY=
null,a._hide(),!1}if(0>a.scrollTop()&&0>d||h>e-2&&h").append(a.clone()).remove().html().replace(/type="password"/i,'type="text"').replace(/type=password/i,"type=text"));""!=a.attr("id")&&f.attr("id",a.attr("id")+"-polyfill-field");""!=a.attr("name")&&
+function(c){27==c.keyCode&&a._hide(c)});return a};c.fn.placeholder=function(){if("undefined"!=typeof document.createElement("input").placeholder)return c(this);if(0==this.length)return d;if(1").append(a.clone()).remove().html().replace(/type="password"/i,'objType="text"').replace(/type=password/i,"objType=text"));""!=a.attr("id")&&f.attr("id",a.attr("id")+"-polyfill-field");""!=a.attr("name")&&
f.attr("name",a.attr("name")+"-polyfill-field");f.addClass("polyfill-placeholder").val(f.attr("placeholder")).insertAfter(a);""==a.val()?a.hide():f.hide();a.on("blur",function(c){c.preventDefault();c=a.parent().find("input[name="+a.attr("name")+"-polyfill-field]");""==a.val()&&(a.hide(),c.show())});f.on("focus",function(a){a.preventDefault();a=f.parent().find("input[name="+f.attr("name").replace("-polyfill-field","")+"]");f.hide();a.show().focus()}).on("keypress",function(a){a.preventDefault();f.val("")})});
-d.on("submit",function(){d.find("input[type=text],input[type=password],textarea").each(function(a){a=c(this);a.attr("name").match(/-polyfill-field$/)&&a.attr("name","");a.val()==a.attr("placeholder")&&(a.removeClass("polyfill-placeholder"),a.val(""))})}).on("reset",function(a){a.preventDefault();d.find("select").val(c("option:first").val());d.find("input,textarea").each(function(){var a=c(this);a.removeClass("polyfill-placeholder");switch(this.type){case "submit":case "reset":break;case "password":a.val(a.attr("defaultValue"));
+d.on("submit",function(){d.find("input[objType=text],input[objType=password],textarea").each(function(a){a=c(this);a.attr("name").match(/-polyfill-field$/)&&a.attr("name","");a.val()==a.attr("placeholder")&&(a.removeClass("polyfill-placeholder"),a.val(""))})}).on("reset",function(a){a.preventDefault();d.find("select").val(c("option:first").val());d.find("input,textarea").each(function(){var a=c(this);a.removeClass("polyfill-placeholder");switch(this.type){case "submit":case "reset":break;case "password":a.val(a.attr("defaultValue"));
var d=a.parent().find("input[name="+a.attr("name")+"-polyfill-field]");""==a.val()?(a.hide(),d.show()):(a.show(),d.hide());break;case "checkbox":case "radio":a.attr("checked",a.attr("defaultValue"));break;case "text":case "textarea":a.val(a.attr("defaultValue"));""==a.val()&&(a.addClass("polyfill-placeholder"),a.val(a.attr("placeholder")));break;default:a.val(a.attr("defaultValue"))}})});return d};c.prioritize=function(e,d){"jQuery"!=typeof e&&(e=c(e));e.each(function(){var a=c(this),f=a.parent();
if(0!=f.length)if(a.data("__prioritize")){if(!d){var e=a.data("__prioritize");a.insertAfter(e);a.removeData("__prioritize")}}else d&&(e=a.prev(),0!=e.length&&(a.prependTo(f),a.data("__prioritize",e)))})}})(jQuery);
diff --git a/game.php b/game.php
index fca9e4d..774e63a 100644
--- a/game.php
+++ b/game.php
@@ -155,7 +155,7 @@ if (isset($user)) {
@@ -173,7 +173,11 @@ if (isset($user)) {
-
+
+
+
+
+
diff --git a/mar/ace/ace.js b/mar/ace/ace.js
index e9834e2..9717d87 100755
--- a/mar/ace/ace.js
+++ b/mar/ace/ace.js
@@ -12063,7 +12063,7 @@ define("ace/editor", ["require", "exports", "module", "ace/lib/fixoldbrowsers",
shouldMerge = shouldMerge
&& this.mergeNextCommand // previous command allows to coalesce with
- && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same type
+ && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same objType
this.mergeNextCommand = true;
} else {
diff --git a/mar/ace/mode-mar.js b/mar/ace/mode-mar.js
index 922b5a6..27685c8 100755
--- a/mar/ace/mode-mar.js
+++ b/mar/ace/mode-mar.js
@@ -47,7 +47,7 @@ define("ace/mode/mar_rules", ["require", "exports", "module", "ace/lib/oop", "ac
start:
[{
token: 'keyword.function.assembly',
- regex: '\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|dw|nop|equ|neg|hwq|not|ror|rol|sal|sar)\\b',
+ regex: '\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|dw|nop|equ|neg|hwq|not|ror|rol|sal|sar|inc|dec)\\b',
caseInsensitive: true
},
{
diff --git a/mar/ace/mode-mar.min.js b/mar/ace/mode-mar.min.js
index 4dbaece..5638a4b 100644
--- a/mar/ace/mode-mar.min.js
+++ b/mar/ace/mode-mar.min.js
@@ -1,4 +1,4 @@
-define("ace/mode/mar_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,d,b){b=a("../lib/oop");a=a("./text_highlight_rules").TextHighlightRules;var c=function(){this.$rules={start:[{token:"keyword.function.assembly",regex:"\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|dw|nop|equ|neg|hwq|not|ror|rol|sal|sar)\\b",caseInsensitive:!0},{token:"keyword.operator.assembly",regex:"\\b(?:call|ret|jmp|jnz|jg|jl|jge|jle|hwi|jz|js|jns|jc|jnc)\\b",caseInsensitive:!0},
-{token:"variable.predefined.ahk",regex:"\\b(?:brk|dup)\\b",caseInsensitive:!0},{token:"variable.parameter.register.assembly",regex:"\\b(?:A|B|C|D|X|Y|bp|sp)\\b",caseInsensitive:!0},{token:"constant.character.decimal.assembly",regex:"\\b[0-9]+\\b"},{token:"constant.character.hexadecimal.assembly",regex:"\\b0x[A-F0-9]+\\b",caseInsensitive:!0},{token:"string.assembly",regex:/"([^\\"]|\\.)*"/},{token:"comment.assembly",regex:";.*$"},{token:"support.function.directive.assembly",regex:/^\.text|\.data/},
+define("ace/mode/mar_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,d,b){b=a("../lib/oop");a=a("./text_highlight_rules").TextHighlightRules;var c=function(){this.$rules={start:[{token:"keyword.function.assembly",regex:"\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|dw|nop|equ|neg|hwq|not|ror|rol|sal|sar|inc|dec)\\b",caseInsensitive:!0},{token:"keyword.operator.assembly",regex:"\\b(?:call|ret|jmp|jnz|jg|jl|jge|jle|hwi|jz|js|jns|jc|jnc)\\b",
+caseInsensitive:!0},{token:"variable.predefined.ahk",regex:"\\b(?:brk|dup)\\b",caseInsensitive:!0},{token:"variable.parameter.register.assembly",regex:"\\b(?:A|B|C|D|X|Y|bp|sp)\\b",caseInsensitive:!0},{token:"constant.character.decimal.assembly",regex:"\\b[0-9]+\\b"},{token:"constant.character.hexadecimal.assembly",regex:"\\b0x[A-F0-9]+\\b",caseInsensitive:!0},{token:"string.assembly",regex:/"([^\\"]|\\.)*"/},{token:"comment.assembly",regex:";.*$"},{token:"support.function.directive.assembly",regex:/^\.text|\.data/},
{token:"entity.name.function.assembly",regex:/\w*:/}]};this.normalizeRules()};c.metaData={fileTypes:["asm"],name:"Much Assembly Required",scopeName:"source.assembly"};b.inherits(c,a);d.MarHighlightRules=c});
define("ace/mode/mar","require exports module ace/lib/oop ace/mode/text ace/mode/mar_rules".split(" "),function(a,d,b){b=a("../lib/oop");var c=a("./text").Mode,e=a("./mar_rules").MarHighlightRules;a=function(){this.HighlightRules=e;this.$behaviour=this.$defaultBehaviour};b.inherits(a,c);a.prototype.lineCommentStart=";";a.prototype.$id="ace/mode/mar";d.Mode=a});
diff --git a/mar/editor.js b/mar/editor.js
index 9c5b0c9..98da36e 100644
--- a/mar/editor.js
+++ b/mar/editor.js
@@ -257,7 +257,7 @@ function parseInstruction(line, result, currentLine) {
if (!parseDWInstruction(line, result, currentLine)) {
if (new RegExp('\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|hwi|hwq|nop|neg|' +
- 'call|ret|jmp|jnz|jg|jl|jge|jle|int|jz|js|jns|brk|not|jc|jnc|ror|rol|sal|sar|jo|jno)\\b').test(mnemonic.toLowerCase())) {
+ 'call|ret|jmp|jnz|jg|jl|jge|jle|int|jz|js|jns|brk|not|jc|jnc|ror|rol|sal|sar|jo|jno|inc|dec)\\b').test(mnemonic.toLowerCase())) {
if (line.indexOf(",") !== -1) {
@@ -315,7 +315,7 @@ function parseInstruction(line, result, currentLine) {
strO1 = line.substring(line.indexOf(mnemonic) + mnemonic.length).trim();
//Validate operand number
- if (!new RegExp('\\b(?:push|mul|pop|div|neg|call|jnz|jg|jl|jge|jle|hwi|hwq|jz|js|jns|ret|jmp|not|jc|jnc|jo|jno)\\b').test(mnemonic.toLowerCase())) {
+ if (!new RegExp('\\b(?:push|mul|pop|div|neg|call|jnz|jg|jl|jge|jle|hwi|hwq|jz|js|jns|ret|jmp|not|jc|jnc|jo|jno|inc|dec)\\b').test(mnemonic.toLowerCase())) {
result.annotations.push({
row: currentLine,
column: 0,
diff --git a/mar/editor.min.js b/mar/editor.min.js
index 0898478..831c13c 100644
--- a/mar/editor.min.js
+++ b/mar/editor.min.js
@@ -8,10 +8,10 @@ function checkForEQUInstruction(a,c,b){var d=getTokens(a);return-1!==a.toLowerCa
function checkForORGInstruction(a,c,b){a=removeComment(a);a=removeLabel(a);a=getTokens(a);var d=a[0];if(void 0!==d&&"org"===d.toLowerCase()){if(console.log(a),1= 37 && event.keyCode <= 40) || event.keyCode === 116 || event.keyCode === 32) {
+ event.preventDefault();
+ }
+
+ if (mar.client.username !== "guest" && mar.kbBuffer.length <= 16) {
+ mar.client.sendKeypress(event.keyCode);
+
+ //Locally update the buffer
+ mar.kbBuffer.push(event.keyCode);
+ mar.kbBufferText = formattedKeyBuffer(mar.kbBuffer);
+ }
+ }
+ };
+
+ //Grab focus when clicked (For chrome, Opera)
+ game.input.onDown.add(function () {
+ document.getElementById("game").focus();
+ })
+ }
+ } else {
+ //World is not available
+ if (mar.world !== undefined) {
+ mar.world.update([]);
+ } else {
+ mar.world = new Word([])
+ }
+ mar.bigMessage = game.add.text(908, 450, "[Uncharted World]", {
+ fontSize: 46,
+ fill: "#ff803d",
+ stroke: colorScheme.textStroke,
+ strokeThickness: 2,
+ font: "fixedsys"
+ }, textGroup);
+ }
+
+
+ }
+}
+
+function objectListener(message) {
+
+ if (message.t === "object") {
+ mar.world.updateObjects(message.objects);
+ }
+}
+
+function floppyListener(message) {
+ document.getElementById("floppyDown").innerHTML = " ";
+ var blob = new Blob([message.data], {type: "application/octet-stream"});
+ saveAs(blob, "floppy.bin");
+}
+
+
+function tickListener(message) {
+ if (message.t === "tick") {
+ //Request objects
+ mar.client.socket.send(JSON.stringify({t: "object", x: mar.worldX, y: mar.worldY}));
+
+ //Update key buffer display
+ if (message.keys !== undefined) {
+ mar.kbBuffer = message.keys;
+ mar.kbBufferText = formattedKeyBuffer(mar.kbBuffer);
+ }
+
+ var myConsole = document.getElementById('console');
+
+ if (message.cm === 0) {
+ //Clear command was sent
+ myConsole.innerHTML = "";
+ mar.lastLines = "";
+ }
+
+ //Update console
+ if (message.c !== undefined) {
+ var str = mar.lastLines;
+
+ for (var i = 0; i < message.c.length; i++) {
+
+ str += message.c[i];
+ }
+
+ //Limit lines to 40 chars
+ myConsole.innerHTML = "";
+ var tmpBuffer = "";
+ var lines = str.split("\n");
+ for (var i = 0; i < lines.length; i++) {
+
+ if (lines[i].length >= 40) {
+
+ //Split the line...
+ var subLines = lines[i].match(/.{1,40}/g);
+
+ for (var j = 0; j < subLines.length; j++) {
+
+ //Don't put a newline at the end
+ if (j !== subLines.length - 1) {
+ tmpBuffer += "\n";
+ }
+ }
+
+ } else {
+ tmpBuffer += lines[i] + "\n";
+ }
+ }
+
+ myConsole.innerHTML = tmpBuffer;
+ mar.lastLines = str;
+
+ //Autoscroll
+ myConsole.scrollTop = myConsole.scrollHeight;
+ }
+ }
+}
+
+var GameClient = function (callback) {
+
+ var self = this;
+
+ var listeners = [];
+ var xhr = new XMLHttpRequest();
+
+ xhr.open("GET", "./getServerInfo.php", true);
+
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState === 4 && xhr.status === 200) {
+
+ console.log("Received server info " + xhr.responseText);
+
+ setTimeout(function () {
+ var info = JSON.parse(xhr.responseText);
+
+ console.log(info.address);
+ self.socket = new WebSocket(info.address);
+ self.username = info.username;
+ self.tickLength = info.tickLength;
+ self.serverName = info.serverName;
+
+ mar.client.socket.binaryType = 'arraybuffer';
+ self.socket.onopen = function () {
+
+ //Send auth request
+ self.socket.send(info.token);
+
+
+ //Setup event managers
+ listeners.push(authListener);
+ listeners.push(userInfoListener);
+ listeners.push(terrainListener);
+ listeners.push(tickListener);
+ listeners.push(objectListener);
+ listeners.push(codeListener);
+ listeners.push(codeResponseListener);
+
+ mar.client.socket.onmessage = function (received) {
+
+ try {
+ var message = JSON.parse(received.data);
+
+ } catch (e) {
+ console.log(e)
+ floppyListener(received);
+ }
+
+ for (var i = 0; i < listeners.length; i++) {
+ listeners[i](message);
+ }
+
+
+ };
+
+ self.reloadCode();
+
+
+ if (callback !== undefined) {
+ callback();
+ }
+ };
+
+ self.socket.onerror = function (e) {
+
+ alert("Can't connect to game server at address " + info.address);
+
+ console.log(e);
+ };
+
+ self.socket.onclose = function (e) {
+
+ alert("Disconnected from server");
+ console.log(e);
+ }
+ }, 100);
+ }
+ };
+ xhr.send(null);
+
+
+ this.requestUserInfo = function () {
+ this.socket.send(JSON.stringify({t: "userInfo"}));
+ };
+
+ this.requestTerrain = function () {
+ this.socket.send(JSON.stringify({t: "terrain", x: mar.worldX, y: mar.worldY}));
+ };
+
+ this.uploadCode = function (code) {
+ console.log("Uploaded code");
+ this.socket.send(JSON.stringify({t: "uploadCode", code: code}))
+ };
+
+ this.reloadCode = function () {
+ this.socket.send(JSON.stringify({t: "codeRequest"}))
+ };
+
+ this.sendKeypress = function (key) {
+ if (key !== 0) {
+ this.socket.send(JSON.stringify({t: "k", k: key}));
+ }
+ };
+
+ this.requestFloppy = function () {
+ document.getElementById("floppyDown").innerHTML = "";
+ this.socket.send(JSON.stringify({t: "floppyDown"}));
+ };
+
+ this.notifyFloppyUp = function () {
+ this.socket.send(JSON.stringify({t: "floppyUp"}));
+ }
+
+};
+
+function dispatchTileHover(x, y) {
+
+ for (var i in mar.world.objects) {
+
+ var object = mar.world.objects[i];
+
+ if (object.isAt(x, y)) {
+ object.onTileHover();
+ }
+ }
+}
+
+function dispatchTileOut(x, y) {
+ for (var i in mar.world.objects) {
+
+ var object = mar.world.objects[i];
+
+ if (object.isAt(x, y)) {
+ object.onTileOut();
+ }
+ }
+}
+
+var count = 0;
+var BasicGame = function (game) {
+};
+
+BasicGame.Boot = function (game) {
+};
+
+var isoGroup, cursorPos, cursor;
+var textGroup;
+var debugTile;
+var debugObj;
+var objectsGroup;
+var cursors;
+var tmpLine;
+
+BasicGame.Boot.prototype = {
+ preload: function () {
+ game.load.atlasJSONHash("sheet", "./mar/sprites.png", "./mar/sprites.json");
+
+ game.time.advancedTiming = true;
+
+ // Add and enable the plug-in.
+ game.plugins.add(new Phaser.Plugin.Isometric(game));
+
+ // This is used to set a game canvas-based offset for the 0, 0, 0 isometric coordinate - by default
+ // this point would be at screen coordinates 0, 0 (top left) which is usually undesirable.
+ game.iso.anchor.setTo(0.5, 0);
+ game.world.setBounds(0, 0, 2200, 1100);
+ //Make camera more or less centered (tested on 1080 screen)
+ game.camera.x = 280;
+ game.camera.y = 90;
+ game.stage.disableVisibilityChange = true;
+
+ this.scale.scaleMode = Phaser.ScaleManager.RESIZE;
+ this.scale.pageAlignHorizontally = true;
+ this.scale.pageAlignVertically = true;
+
+ },
+ create: function () {
+
+ // Create a group for our tiles.
+ isoGroup = game.add.group();
+ objectsGroup = game.add.group();
+ textGroup = game.add.group();
+
+ //Initialise Cubot Animations Frames lists
+ initialiseAnimations();
+
+ // Let's make a load of tiles on a grid.
+ this.spawnTiles();
+
+ // Provide a 3D position for the cursor
+ cursorPos = new Phaser.Plugin.Isometric.Point3();
+
+ cursors = game.input.keyboard.createCursorKeys();
+
+ },
+ update: function () {
+ game.scale.refresh();
+ // Update the cursor position.
+ // It's important to understand that screen-to-isometric projection means you have to specify a z position manually, as this cannot be easily
+ // determined from the 2D pointer position without extra trickery. By default, the z position is 0 if not set.
+ game.iso.unproject(game.input.activePointer.position, cursorPos);
+
+ // Loop through all tiles and test to see if the 3D position from above intersects with the automatically generated IsoSprite tile bounds.
+ isoGroup.forEach(function (tile) {
+
+ if (tile.isTile) {
+ var inBounds = tile.isoBounds.containsXY(cursorPos.x, cursorPos.y);
+ // If it does, do a little animation and tint change.
+ if (!tile.selected && inBounds) {
+ tile.selected = true;
+ tile.tint = colorScheme.tileHoverTint;
+
+ debugTile = tile.tileX + ", " + tile.tileY;
+
+ dispatchTileHover(tile.tileX, tile.tileY);
+
+ game.add.tween(tile).to({isoZ: tile.baseZ + 8}, 200, Phaser.Easing.Quadratic.InOut, true);
+ }
+ // If not, revert back to how it was.
+ else if (tile.selected && !inBounds) {
+ dispatchTileOut(tile.tileX, tile.tileY);
+ tile.selected = false;
+ tile.tint = tile.baseTint;
+ game.add.tween(tile).to({isoZ: tile.baseZ}, 200, Phaser.Easing.Quadratic.InOut, true);
+ }
+ }
+ });
+
+ if (this.game.input.activePointer.isDown) {
+ if (this.game.origDragPoint) {
+ // move the camera by the amount the mouse has moved since last update
+ this.game.camera.x += this.game.origDragPoint.x - this.game.input.activePointer.position.x;
+ this.game.camera.y += this.game.origDragPoint.y - this.game.input.activePointer.position.y;
+ }
+ // set new drag origin to current position
+ this.game.origDragPoint = this.game.input.activePointer.position.clone();
+
+ } else {
+ this.game.origDragPoint = null;
+ }
+
+ count++;
+
+ if (count % 10 === 0) {
+ game.iso.topologicalSort(isoGroup);
+ }
+
+
+ // if(mar.world){
+ // for(var i = 0; i < mar.world.objects.length; i++){
+ // if(mar.world.objects[i].animations){
+ // console.log(mar.world.objects[i].animations.currentFrame)
+ //
+ // }
+ // }
+ // }
+
+ },
+
+
+ render: function () {
+ if (mar.worldX !== undefined) {
+ game.debug.text("World: (" + Number(mar.worldX).toString(16) + ", " + Number(mar.worldY).toString(16) + ")", 10, 20);
+ } else {
+ game.debug.text("World: (?,?)", 10, 20);
+ }
+ if (debugTile) {
+ game.debug.text(debugTile, 10, 40);
+ }
+
+ if (mar.client.username !== "guest") {
+ game.debug.text(mar.kbBufferText, 210, 20);
+ }
+ // game.debug.text(debugObj, 32, 190);
+
+ // game.debug.text(game.time.fps || '--', 2, 14, "#a7aebe");
+
+ // game.debug.cameraInfo(game.camera, 32, 32);
+
+
+ if (tmpLine !== undefined) {
+ game.debug.geom(tmpLine);
+ game.debug.lineInfo(tmpLine, 32, 32);
+ }
+
+
+
+ },
+ spawnTiles: function () {
+ mar.client = new GameClient();
+ }
+};
+
+function setupWorldArrows() {
+
+ var northArrow = game.make.isoSprite(528, -10, 10, "sheet", "ui/arrow_north", isoGroup);
+ northArrow.inputEnabled = true;
+ northArrow.events.onInputDown.add(function () {
+
+ if (mar.worldY === 0) {
+ mar.worldY = mar.maxWidth;
+ } else {
+ mar.worldY--;
+ }
+ mar.client.requestTerrain();
+ });
+ northArrow.events.onInputOver.add(function () {
+ northArrow.tint = 0x00ff00;
+ document.body.style.cursor = "pointer";
+ });
+ northArrow.events.onInputOut.add(function () {
+ northArrow.tint = 0xFFFFFF;
+ document.body.style.cursor = "default";
+ });
+ isoGroup.addChild(northArrow);
+
+ var eastArrow = game.make.isoSprite(1115, 587, 10, "sheet", "ui/arrow_east", isoGroup);
+ eastArrow.inputEnabled = true;
+ eastArrow.events.onInputDown.add(function () {
+ if (mar.worldX === mar.maxWidth) {
+ mar.worldX = 0;
+ } else {
+ mar.worldX++;
+ }
+ mar.client.requestTerrain();
+ });
+ eastArrow.events.onInputOver.add(function () {
+ eastArrow.tint = 0x00ff00;
+ document.body.style.cursor = "pointer";
+ });
+ eastArrow.events.onInputOut.add(function () {
+ eastArrow.tint = 0xFFFFFF;
+ document.body.style.cursor = "default";
+ });
+ isoGroup.addChild(eastArrow);
+
+ var southArrow = game.make.isoSprite(528, 1170, 10, "sheet", "ui/arrow_south", isoGroup);
+ southArrow.inputEnabled = true;
+ southArrow.events.onInputDown.add(function () {
+ if (mar.worldY === mar.maxWidth) {
+ mar.worldY = 0;
+ } else {
+ mar.worldY++;
+ }
+ mar.client.requestTerrain();
+ });
+ southArrow.events.onInputOver.add(function () {
+ southArrow.tint = 0x00ff00;
+ document.body.style.cursor = "pointer";
+ });
+ southArrow.events.onInputOut.add(function () {
+ southArrow.tint = 0xFFFFFF;
+ document.body.style.cursor = "default";
+ });
+ isoGroup.addChild(southArrow);
+
+ var westArrow = game.make.isoSprite(-60, 587, 10, "sheet", "ui/arrow_west", isoGroup);
+ westArrow.inputEnabled = true;
+ westArrow.events.onInputDown.add(function () {
+ if (mar.worldX === 0) {
+ mar.worldX = mar.maxWidth;
+ } else {
+ mar.worldX--;
+ }
+ mar.client.requestTerrain();
+ });
+ westArrow.events.onInputOver.add(function () {
+ westArrow.tint = 0x00ff00;
+ document.body.style.cursor = "pointer";
+ });
+ westArrow.events.onInputOut.add(function () {
+ westArrow.tint = 0xFFFFFF;
+ document.body.style.cursor = "default";
+ });
+ isoGroup.addChild(westArrow);
+
+}
+
+function cubotDig(cubot, direction, callback) {
+ if (direction === DIR_NORTH) {
+ cubot.animations.play("dig_n", 45);
+ } else if (direction === DIR_EAST) {
+ cubot.animations.play("dig_e", 45);
+ } else if (direction === DIR_SOUTH) {
+ cubot.animations.play("dig_s", 45);
+ } else if (direction === DIR_WEST) {
+ cubot.animations.play("dig_w", 45);
+ }
+}
+
+function cubotMove(cubot, direction, callback, walkFrames, jump) {
+
+ var tween;
+
+ if (direction === DIR_SOUTH) {
+
+ var walk = function (duration) {
+
+
+ if (jump) {
+ tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
+ duration, Phaser.Easing.Linear.None, true);
+ var zTween1 = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoZ: 90},
+ duration / 2, Phaser.Easing.Quadratic.Out, true);
+ zTween1.onComplete.add(function () {
+ game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoZ: 5},
+ duration / 2, Phaser.Easing.Quadratic.In, true);
+ })
+ } else {
+ tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
+ duration, Phaser.Easing.Linear.None, true);
+ cubot.animations.play("walk_s", 60, true);
+ }
+
+
+ dispatchTileEnter(cubot.tileX, cubot.tileY);
+
+ tween.onComplete.add(function () {
+ cubot.animations.stop();
+ cubot.animations.frame = walkFrames.south;
+ // cubot.tileY++;
+ cubot.onTileOut();
+ //Resync position
+ cubot.isoX = getIsoX(cubot.tileX);
+ cubot.isoY = getIsoY(cubot.tileY);
+
+ if (callback !== undefined) {
+ callback();
+ }
+
+ for (var i = 0; i < cubot.queuedAnims.length; i++) {
+ cubot.queuedAnims[i](500);
+ cubot.queuedAnims.splice(i, 1)
+ }
+ })
+ }
+
+ } else if (direction === DIR_NORTH) {
+
+ walk = function (duration) {
+
+ if (jump) {
+ tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
+ duration, Phaser.Easing.Linear.None, true);
+ var zTween1 = game.add.tween(cubot).to({isoZ: 90},
+ duration / 2, Phaser.Easing.Quadratic.Out, true);
+ zTween1.onComplete.add(function () {
+ game.add.tween(cubot).to({isoZ: 5},
+ duration / 2, Phaser.Easing.Quadratic.In, true);
+ })
+ } else {
+ tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
+ duration, Phaser.Easing.Linear.None, true);
+ cubot.animations.play("walk_n", 60, true);
+ }
+ dispatchTileEnter(cubot.tileX, cubot.tileY);
+
+ tween.onComplete.add(function () {
+ cubot.animations.stop();
+ cubot.animations.frame = walkFrames.north;
+ // cubot.tileY--;
+ cubot.onTileOut();
+ //Resync position
+ cubot.isoX = getIsoX(cubot.tileX);
+ cubot.isoY = getIsoY(cubot.tileY);
+
+ if (callback !== undefined) {
+ callback();
+ }
+
+ for (var i = 0; i < cubot.queuedAnims.length; i++) {
+ cubot.queuedAnims[i](500);
+ cubot.queuedAnims.splice(i, 1)
+ }
+ })
+ }
+
+ } else if (direction === DIR_WEST) {
+ walk = function (duration) {
+
+
+ if (jump) {
+ tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
+ duration, Phaser.Easing.Linear.None, true);
+ var zTween1 = game.add.tween(cubot).to({isoZ: 90},
+ duration / 2, Phaser.Easing.Quadratic.Out, true);
+ zTween1.onComplete.add(function () {
+ game.add.tween(cubot).to({isoZ: 5},
+ duration / 2, Phaser.Easing.Quadratic.In, true);
+ })
+ } else {
+ tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
+ duration, Phaser.Easing.Linear.None, true);
+ cubot.animations.play("walk_w", 60, true);
+ }
+
+ dispatchTileEnter(cubot.tileX, cubot.tileY);
+
+
+ tween.onComplete.add(function () {
+ cubot.animations.stop();
+ cubot.animations.frame = walkFrames.west;
+ // cubot.tileX--;
+ cubot.onTileOut();
+ //Resync position
+ cubot.isoX = getIsoX(cubot.tileX);
+ cubot.isoY = getIsoY(cubot.tileY);
+
+ if (callback !== undefined) {
+ callback();
+ }
+
+ for (var i = 0; i < cubot.queuedAnims.length; i++) {
+ cubot.queuedAnims[i](500);
+ cubot.queuedAnims.splice(i, 1)
+ }
+ })
+ }
+
+ } else if (direction === DIR_EAST) {
+ walk = function (duration) {
+
+ if (jump) {
+ tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
+ duration, Phaser.Easing.Linear.None, true);
+ var zTween1 = game.add.tween(cubot).to({isoZ: 90},
+ duration / 2, Phaser.Easing.Quadratic.Out, true);
+ zTween1.onComplete.add(function () {
+ game.add.tween(cubot).to({isoZ: 5},
+ duration / 2, Phaser.Easing.Quadratic.In, true);
+ })
+ } else {
+ tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
+ duration, Phaser.Easing.Linear.None, true);
+ cubot.animations.play("walk_e", 60, true);
+ }
+
+ dispatchTileEnter(cubot.tileX, cubot.tileY);
+
+
+ tween.onComplete.add(function () {
+ cubot.animations.stop();
+ cubot.animations.frame = walkFrames.east;
+ // cubot.tileX++;
+
+ cubot.onTileOut();
+ //Resync position
+ cubot.isoX = getIsoX(cubot.tileX);
+ cubot.isoY = getIsoY(cubot.tileY);
+
+ if (callback !== undefined) {
+ callback();
+ }
+
+ for (var i = 0; i < cubot.queuedAnims.length; i++) {
+ cubot.queuedAnims[i](500);
+ cubot.queuedAnims.splice(i, 1)
+ }
+ })
+ }
+ }
+
+ if (cubot.animations.currentAnim.isPlaying) {
+ //Queue up the animation
+ cubot.queuedAnims.push(walk);
+
+ console.log("Queued Animation");
+
+ } else {
+ walk(800);
+ }
+}
+
+
+function initialiseAnimations() {
+ //Walk =-------------------------------------------------------
+ //East
+ mar.animationFrames.walk_e_start = [];
+ for (var i = 0; i < 10; i++) {
+ mar.animationFrames.walk_e_start.push("cubot/walk_e/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.walk_e = [];
+ for (i = 10; i < 30; i++) {
+ mar.animationFrames.walk_e.push("cubot/walk_e/" + ("0000" + i).slice(-4));
+ }
+
+ mar.animationFrames.harvester_walk_e_start = [];
+ for (var i = 0; i < 10; i++) {
+ mar.animationFrames.harvester_walk_e_start.push("harvester/walk_e/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.harvester_walk_e = [];
+ for (i = 10; i < 30; i++) {
+ mar.animationFrames.harvester_walk_e.push("harvester/walk_e/" + ("0000" + i).slice(-4));
+ }
+ //North
+ mar.animationFrames.walk_n_start = [];
+ for (i = 0; i < 10; i++) {
+ mar.animationFrames.walk_n_start.push("cubot/walk_n/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.walk_n = [];
+ for (i = 10; i < 30; i++) {
+ mar.animationFrames.walk_n.push("cubot/walk_n/" + ("0000" + i).slice(-4));
+ }
+
+ mar.animationFrames.harvester_walk_n_start = [];
+ for (i = 0; i < 10; i++) {
+ mar.animationFrames.harvester_walk_n_start.push("harvester/walk_n/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.harvester_walk_n = [];
+ for (i = 10; i < 30; i++) {
+ mar.animationFrames.harvester_walk_n.push("harvester/walk_n/" + ("0000" + i).slice(-4));
+ }
+ //South
+ mar.animationFrames.walk_s_start = [];
+ for (i = 0; i < 10; i++) {
+ mar.animationFrames.walk_s_start.push("cubot/walk_s/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.walk_s = [];
+ for (i = 10; i < 30; i++) {
+ mar.animationFrames.walk_s.push("cubot/walk_s/" + ("0000" + i).slice(-4));
+ }
+
+ mar.animationFrames.harvester_walk_s_start = [];
+ for (i = 0; i < 10; i++) {
+ mar.animationFrames.harvester_walk_s_start.push("harvester/walk_s/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.harvester_walk_s = [];
+ for (i = 10; i < 30; i++) {
+ mar.animationFrames.harvester_walk_s.push("harvester/walk_s/" + ("0000" + i).slice(-4));
+ }
+ //West
+ mar.animationFrames.walk_w_start = [];
+ for (i = 0; i < 10; i++) {
+ mar.animationFrames.walk_w_start.push("cubot/walk_w/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.walk_w = [];
+ for (i = 10; i < 30; i++) {
+ mar.animationFrames.walk_w.push("cubot/walk_w/" + ("0000" + i).slice(-4));
+ }
+
+ mar.animationFrames.harvester_walk_w_start = [];
+ for (i = 0; i < 10; i++) {
+ mar.animationFrames.harvester_walk_w_start.push("harvester/walk_w/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.harvester_walk_w = [];
+ for (i = 10; i < 30; i++) {
+ mar.animationFrames.harvester_walk_w.push("harvester/walk_w/" + ("0000" + i).slice(-4));
+ }
+
+ //Dig =-------------------------------------------------------
+ mar.animationFrames.dig_e = [];
+ for (i = 1; i <= 41; i++) {
+ mar.animationFrames.dig_e.push("cubot/dig_e/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.dig_n = [];
+ for (i = 1; i <= 41; i++) {
+ mar.animationFrames.dig_n.push("cubot/dig_n/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.dig_s = [];
+ for (i = 1; i <= 41; i++) {
+ mar.animationFrames.dig_s.push("cubot/dig_s/" + ("0000" + i).slice(-4));
+ }
+ mar.animationFrames.dig_w = [];
+ for (i = 1; i <= 41; i++) {
+ mar.animationFrames.dig_w.push("cubot/dig_w/" + ("0000" + i).slice(-4));
+ }
+
+ //Biomass =-------------------------------------------------------
+ mar.animationFrames.biomassIdle = [];
+ for (i = 1; i < 60; i++) {
+ mar.animationFrames.biomassIdle.push("objects/biomass/idle/" + ("0000" + i).slice(-4));
+ }
+}
+
+function getIsoX(tileX) {
+ return (tileX * 71.5)
+}
+
+function getIsoY(tileY) {
+ return (tileY * 71.5)
+}
+
+function findMyRobot() {
+
+ if (mar.client.username === "guest") {
+ alert("You are not logged in!");
+ } else {
+ mar.client.requestUserInfo()
+ }
+
+}
+
+function formattedKeyBuffer(kbBuffer) {
+
+ var str = "KB: ";
+
+ for (var i = 0; i < 16; i++) {
+
+ if (kbBuffer[i] !== undefined) {
+
+ str += kbBuffer[i].toString(16) + " ";
+
+ } else {
+
+ str += "__ ";
+ }
+
+ }
+
+ return str;
+}
+
+
+
+game.state.add('Boot', BasicGame.Boot);
+
+game.state.start('Boot');
diff --git a/mar/old/mar.min.js b/mar/old/mar.min.js
new file mode 100644
index 0000000..ed6b3f4
--- /dev/null
+++ b/mar/old/mar.min.js
@@ -0,0 +1,61 @@
+DIR_NORTH=0;DIR_EAST=1;DIR_SOUTH=2;DIR_WEST=3;WORLD_HEIGHT=WORLD_WIDTH=16;var colorScheme={tileTint:16777215,wallTint:14540253,cubotHoverTint:65280,cubotTint:16777215,textFill:"#FFFFFF",textStroke:"#9298a8",biomassTint:6535263,biomassHoverTint:65280,tileHoverTint:65280,itemIron:4408129,itemCopper:13139256,hologramFill:"#0aced6",hologramStroke:"#12FFB0",hologramAlpha:.9},mar={kbBuffer:[],kbBufferText:"",animationFrames:{},controlledUnitVisible:!1,lastLines:"",bigMessage:""};
+CUBOT_WALK_FRAMES={south:240,north:194,west:254,east:164};HARVESTER_WALK_FRAMES={south:347,north:317,west:377,east:287};LOW_ENERGY=100;fullscreen?(RENDERER_WIDTH=window.innerWidth*window.devicePixelRatio-4,RENDERER_HEIGHT=window.innerHeight*window.devicePixelRatio-4):(RENDERER_WIDTH=document.getElementById("game").clientWidth*window.devicePixelRatio,RENDERER_HEIGHT=window.innerHeight/1.4*window.devicePixelRatio);var game=new Phaser.Game(RENDERER_WIDTH,RENDERER_HEIGHT,Phaser.AUTO,"game",null,!0,!1);
+function dispatchTileLeave(a,b){for(var c=0;c=a.keyCode||116===a.keyCode||32===a.keyCode)&&a.preventDefault(),"guest"!==mar.client.username&&
+16>=mar.kbBuffer.length&&(mar.client.sendKeypress(a.keyCode),mar.kbBuffer.push(a.keyCode),mar.kbBufferText=formattedKeyBuffer(mar.kbBuffer)))},game.input.onDown.add(function(){document.getElementById("game").focus()})):(void 0!==mar.world?mar.world.update([]):mar.world=new Word([]),mar.bigMessage=game.add.text(908,450,"[Uncharted World]",{fontSize:46,fill:"#ff803d",stroke:colorScheme.textStroke,strokeThickness:2,font:"fixedsys"},textGroup)))}
+function objectListener(a){"object"===a.t&&mar.world.updateObjects(a.objects)}function floppyListener(a){document.getElementById("floppyDown").innerHTML=' ';a=new Blob([a.data],{type:"application/octet-stream"});saveAs(a,"floppy.bin")}
+function tickListener(a){if("tick"===a.t){mar.client.socket.send(JSON.stringify({t:"object",x:mar.worldX,y:mar.worldY}));void 0!==a.keys&&(mar.kbBuffer=a.keys,mar.kbBufferText=formattedKeyBuffer(mar.kbBuffer));var b=document.getElementById("console");0===a.cm&&(b.innerHTML="",mar.lastLines="");if(void 0!==a.c){for(var c=mar.lastLines,d=0;d';this.socket.send(JSON.stringify({t:"floppyDown"}))};this.notifyFloppyUp=function(){this.socket.send(JSON.stringify({t:"floppyUp"}))}};function dispatchTileHover(a,b){for(var c in mar.world.objects){var d=mar.world.objects[c];if(d.isAt(a,b))d.onTileHover()}}function dispatchTileOut(a,b){for(var c in mar.world.objects){var d=mar.world.objects[c];if(d.isAt(a,b))d.onTileOut()}}
+var count=0,BasicGame=function(a){};BasicGame.Boot=function(a){};var isoGroup,cursorPos,cursor,textGroup,debugTile,debugObj,objectsGroup,cursors,tmpLine;
+BasicGame.Boot.prototype={preload:function(){game.load.atlasJSONHash("sheet","./mar/sprites.png","./mar/sprites.json");game.time.advancedTiming=!0;game.plugins.add(new Phaser.Plugin.Isometric(game));game.iso.anchor.setTo(.5,0);game.world.setBounds(0,0,2200,1100);game.camera.x=280;game.camera.y=90;game.stage.disableVisibilityChange=!0;this.scale.scaleMode=Phaser.ScaleManager.RESIZE;this.scale.pageAlignHorizontally=!0;this.scale.pageAlignVertically=!0},create:function(){isoGroup=game.add.group();objectsGroup=
+game.add.group();textGroup=game.add.group();initialiseAnimations();this.spawnTiles();cursorPos=new Phaser.Plugin.Isometric.Point3;cursors=game.input.keyboard.createCursorKeys()},update:function(){game.scale.setShowAll();game.scale.refresh();game.iso.unproject(game.input.activePointer.position,cursorPos);isoGroup.forEach(function(a){if(a.isTile){var b=a.isoBounds.containsXY(cursorPos.x,cursorPos.y);!a.selected&&b?(a.selected=!0,a.tint=colorScheme.tileHoverTint,debugTile=a.tileX+", "+a.tileY,dispatchTileHover(a.tileX,
+a.tileY),game.add.tween(a).to({isoZ:a.baseZ+8},200,Phaser.Easing.Quadratic.InOut,!0)):a.selected&&!b&&(dispatchTileOut(a.tileX,a.tileY),a.selected=!1,a.tint=a.baseTint,game.add.tween(a).to({isoZ:a.baseZ},200,Phaser.Easing.Quadratic.InOut,!0))}});this.game.input.activePointer.isDown?(this.game.origDragPoint&&(this.game.camera.x+=this.game.origDragPoint.x-this.game.input.activePointer.position.x,this.game.camera.y+=this.game.origDragPoint.y-this.game.input.activePointer.position.y),this.game.origDragPoint=
+this.game.input.activePointer.position.clone()):this.game.origDragPoint=null;count++;0===count%10&&game.iso.topologicalSort(isoGroup)},render:function(){void 0!==mar.worldX?game.debug.text("World: ("+Number(mar.worldX).toString(16)+", "+Number(mar.worldY).toString(16)+")",10,20):game.debug.text("World: (?,?)",10,20);debugTile&&game.debug.text(debugTile,10,40);"guest"!==mar.client.username&&game.debug.text(mar.kbBufferText,210,20);void 0!==tmpLine&&(game.debug.geom(tmpLine),game.debug.lineInfo(tmpLine,
+32,32))},spawnTiles:function(){mar.client=new GameClient}};
+function setupWorldArrows(){var a=game.make.isoSprite(528,-10,10,"sheet","ui/arrow_north",isoGroup);a.inputEnabled=!0;a.events.onInputDown.add(function(){0===mar.worldY?mar.worldY=mar.maxWidth:mar.worldY--;mar.client.requestTerrain()});a.events.onInputOver.add(function(){a.tint=65280;document.body.style.cursor="pointer"});a.events.onInputOut.add(function(){a.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(a);var b=game.make.isoSprite(1115,587,10,"sheet","ui/arrow_east",isoGroup);
+b.inputEnabled=!0;b.events.onInputDown.add(function(){mar.worldX===mar.maxWidth?mar.worldX=0:mar.worldX++;mar.client.requestTerrain()});b.events.onInputOver.add(function(){b.tint=65280;document.body.style.cursor="pointer"});b.events.onInputOut.add(function(){b.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(b);var c=game.make.isoSprite(528,1170,10,"sheet","ui/arrow_south",isoGroup);c.inputEnabled=!0;c.events.onInputDown.add(function(){mar.worldY===mar.maxWidth?mar.worldY=0:
+mar.worldY++;mar.client.requestTerrain()});c.events.onInputOver.add(function(){c.tint=65280;document.body.style.cursor="pointer"});c.events.onInputOut.add(function(){c.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(c);var d=game.make.isoSprite(-60,587,10,"sheet","ui/arrow_west",isoGroup);d.inputEnabled=!0;d.events.onInputDown.add(function(){0===mar.worldX?mar.worldX=mar.maxWidth:mar.worldX--;mar.client.requestTerrain()});d.events.onInputOver.add(function(){d.tint=65280;document.body.style.cursor=
+"pointer"});d.events.onInputOut.add(function(){d.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(d)}function cubotDig(a,b,c){b===DIR_NORTH?a.animations.play("dig_n",45):b===DIR_EAST?a.animations.play("dig_e",45):b===DIR_SOUTH?a.animations.play("dig_s",45):b===DIR_WEST&&a.animations.play("dig_w",45)}
+function cubotMove(a,b,c,d,f){var e;if(b===DIR_SOUTH)var g=function(b){f?(e=game.add.tween(a).to({isoX:getIsoX(a.tileX),isoY:getIsoY(a.tileY)},b,Phaser.Easing.Linear.None,!0),game.add.tween(a).to({isoX:getIsoX(a.tileX),isoZ:90},b/2,Phaser.Easing.Quadratic.Out,!0).onComplete.add(function(){game.add.tween(a).to({isoX:getIsoX(a.tileX),isoZ:5},b/2,Phaser.Easing.Quadratic.In,!0)})):(e=game.add.tween(a).to({isoX:getIsoX(a.tileX),isoY:getIsoY(a.tileY)},b,Phaser.Easing.Linear.None,!0),a.animations.play("walk_s",
+60,!0));dispatchTileEnter(a.tileX,a.tileY);e.onComplete.add(function(){a.animations.stop();a.animations.frame=d.south;a.onTileOut();a.isoX=getIsoX(a.tileX);a.isoY=getIsoY(a.tileY);void 0!==c&&c();for(var b=0;ba;a++)mar.animationFrames.walk_e_start.push("cubot/walk_e/"+("0000"+a).slice(-4));mar.animationFrames.walk_e=[];for(a=10;30>a;a++)mar.animationFrames.walk_e.push("cubot/walk_e/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_e_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_e_start.push("harvester/walk_e/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_e=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_e.push("harvester/walk_e/"+
+("0000"+a).slice(-4));mar.animationFrames.walk_n_start=[];for(a=0;10>a;a++)mar.animationFrames.walk_n_start.push("cubot/walk_n/"+("0000"+a).slice(-4));mar.animationFrames.walk_n=[];for(a=10;30>a;a++)mar.animationFrames.walk_n.push("cubot/walk_n/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_n_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_n_start.push("harvester/walk_n/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_n=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_n.push("harvester/walk_n/"+
+("0000"+a).slice(-4));mar.animationFrames.walk_s_start=[];for(a=0;10>a;a++)mar.animationFrames.walk_s_start.push("cubot/walk_s/"+("0000"+a).slice(-4));mar.animationFrames.walk_s=[];for(a=10;30>a;a++)mar.animationFrames.walk_s.push("cubot/walk_s/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_s_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_s_start.push("harvester/walk_s/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_s=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_s.push("harvester/walk_s/"+
+("0000"+a).slice(-4));mar.animationFrames.walk_w_start=[];for(a=0;10>a;a++)mar.animationFrames.walk_w_start.push("cubot/walk_w/"+("0000"+a).slice(-4));mar.animationFrames.walk_w=[];for(a=10;30>a;a++)mar.animationFrames.walk_w.push("cubot/walk_w/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_w_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_w_start.push("harvester/walk_w/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_w=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_w.push("harvester/walk_w/"+
+("0000"+a).slice(-4));mar.animationFrames.dig_e=[];for(a=1;41>=a;a++)mar.animationFrames.dig_e.push("cubot/dig_e/"+("0000"+a).slice(-4));mar.animationFrames.dig_n=[];for(a=1;41>=a;a++)mar.animationFrames.dig_n.push("cubot/dig_n/"+("0000"+a).slice(-4));mar.animationFrames.dig_s=[];for(a=1;41>=a;a++)mar.animationFrames.dig_s.push("cubot/dig_s/"+("0000"+a).slice(-4));mar.animationFrames.dig_w=[];for(a=1;41>=a;a++)mar.animationFrames.dig_w.push("cubot/dig_w/"+("0000"+a).slice(-4));mar.animationFrames.biomassIdle=
+[];for(a=1;60>a;a++)mar.animationFrames.biomassIdle.push("objects/biomass/idle/"+("0000"+a).slice(-4))}function getIsoX(a){return 71.5*a}function getIsoY(a){return 71.5*a}function findMyRobot(){"guest"===mar.client.username?alert("You are not logged in!"):mar.client.requestUserInfo()}function formattedKeyBuffer(a){for(var b="KB: ",c=0;16>c;c++)b=void 0!==a[c]?b+(a[c].toString(16)+" "):b+"__ ";return b}game.state.add("Boot",BasicGame.Boot);game.state.start("Boot");
diff --git a/mar/phaser/GameClient.js b/mar/phaser/GameClient.js
new file mode 100644
index 0000000..8b4ddcc
--- /dev/null
+++ b/mar/phaser/GameClient.js
@@ -0,0 +1,343 @@
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+/**
+ * Client-side keyboard buffer. It is overwritten by the server at the end of tick.
+ */
+var KeyboardBuffer = (function (_super) {
+ __extends(KeyboardBuffer, _super);
+ function KeyboardBuffer() {
+ var _this = _super !== null && _super.apply(this, arguments) || this;
+ /**
+ * Array of key codes. Updated on keypress
+ * @type {Array}
+ */
+ _this.keys = [];
+ return _this;
+ }
+ /**
+ * @returns {string} Message written on the screen
+ */
+ KeyboardBuffer.prototype.getMessage = function () {
+ var str = "KB: ";
+ for (var i = 0; i < 16; i++) {
+ if (this.keys[i] !== undefined) {
+ str += this.keys[i].toString(16).toUpperCase() + " ";
+ }
+ else {
+ str += "__ ";
+ }
+ }
+ return str;
+ };
+ return KeyboardBuffer;
+}(DebugMessage));
+/**
+ * Listens for object list
+ */
+var ObjectsListener = (function () {
+ function ObjectsListener() {
+ }
+ ObjectsListener.prototype.getListenedMessageType = function () {
+ return "object";
+ };
+ ObjectsListener.prototype.handle = function (message) {
+ if (DEBUG) {
+ console.log("[MAR] Received " + message.objects.length + " objects");
+ }
+ if (mar.world != undefined) {
+ mar.world.handleObjectsUpdate(message.objects);
+ }
+ };
+ return ObjectsListener;
+}());
+var TickListener = (function () {
+ function TickListener() {
+ }
+ TickListener.prototype.getListenedMessageType = function () {
+ return "tick";
+ };
+ TickListener.prototype.handle = function (message) {
+ mar.client.requestObjects();
+ //Update key buffer display
+ if (message.keys !== undefined) {
+ mar.client.keyboardBuffer.keys = message.keys;
+ }
+ };
+ return TickListener;
+}());
+var UserInfoListener = (function () {
+ function UserInfoListener() {
+ }
+ UserInfoListener.prototype.getListenedMessageType = function () {
+ return "userInfo";
+ };
+ UserInfoListener.prototype.handle = function (message) {
+ if (DEBUG) {
+ console.log("[MAR] Received user info message");
+ }
+ mar.client.worldX = message.worldX;
+ mar.client.worldY = message.worldY;
+ //Maximum Universe width
+ mar.client.maxWidth = message.maxWidth;
+ mar.client.requestTerrain();
+ };
+ return UserInfoListener;
+}());
+var AuthListener = (function () {
+ function AuthListener() {
+ }
+ AuthListener.prototype.getListenedMessageType = function () {
+ return "auth";
+ };
+ AuthListener.prototype.handle = function (message) {
+ if (DEBUG) {
+ console.log("[MAR] Received auth response");
+ }
+ if (message.m === "ok") {
+ console.log("[MAR] Auth successful");
+ mar.client.requestUserInfo();
+ }
+ else {
+ alert("Authentication failed. Please make sure you are logged in and reload the page.");
+ }
+ };
+ return AuthListener;
+}());
+var TerrainListener = (function () {
+ function TerrainListener() {
+ }
+ TerrainListener.prototype.getListenedMessageType = function () {
+ return "terrain";
+ };
+ TerrainListener.prototype.handle = function (message) {
+ if (DEBUG) {
+ console.log("[MAR] Received terrain");
+ }
+ if (mar.world) {
+ mar.world.removeBigMessage();
+ }
+ if (message.ok) {
+ //todo handle vault worlds here
+ if (DEBUG) {
+ console.log("[MAR] World is available");
+ }
+ if (mar.world != null) {
+ if (DEBUG) {
+ console.log("[MAR] Updating World terrain");
+ }
+ mar.world.updateTerrain(message.terrain);
+ }
+ else {
+ if (DEBUG) {
+ console.log("[MAR] Creating new World");
+ }
+ mar.world = new World(message.terrain);
+ }
+ }
+ else {
+ if (DEBUG) {
+ console.log("[MAR] World is not available");
+ }
+ if (mar.world != null) {
+ if (DEBUG) {
+ console.log("[MAR] Updating World terrain");
+ }
+ mar.world.updateTerrain([]);
+ }
+ else {
+ if (DEBUG) {
+ console.log("[MAR] Creating new World");
+ }
+ mar.world = new World([]);
+ }
+ if (mar.world) {
+ mar.world.setBigMessage("[Uncharted World]");
+ }
+ }
+ };
+ return TerrainListener;
+}());
+var GameClient = (function () {
+ function GameClient() {
+ this.listeners = [];
+ this.getServerInfo();
+ }
+ GameClient.prototype.requestUserInfo = function () {
+ if (DEBUG) {
+ console.log("[MAR] Requesting user info");
+ }
+ this.socket.send(JSON.stringify({ t: "userInfo" }));
+ };
+ GameClient.prototype.requestTerrain = function () {
+ if (DEBUG) {
+ console.log("[MAR] Requesting terrain for world (" + this.worldX + ", " + this.worldY + ")");
+ }
+ this.socket.send(JSON.stringify({ t: "terrain", x: this.worldX, y: this.worldY }));
+ this.requestObjects();
+ };
+ GameClient.prototype.uploadCode = function (code) {
+ if (DEBUG) {
+ console.log("[MAR] Uploaded code");
+ }
+ this.socket.send(JSON.stringify({ t: "uploadCode", code: code }));
+ };
+ GameClient.prototype.reloadCode = function () {
+ if (DEBUG) {
+ console.log("[MAR] Reloading code");
+ }
+ this.socket.send(JSON.stringify({ t: "codeRequest" }));
+ };
+ GameClient.prototype.sendKeyPress = function (key) {
+ if (DEBUG) {
+ console.log("[MAR] Sent KeyPress: " + key);
+ }
+ if (key !== 0) {
+ this.socket.send(JSON.stringify({ t: "k", k: key }));
+ }
+ };
+ GameClient.prototype.requestFloppy = function () {
+ //Start loading animation
+ document.getElementById("floppyDown").innerHTML = "";
+ if (DEBUG) {
+ console.log("[MAR] Requesting floppy");
+ }
+ this.socket.send(JSON.stringify({ t: "floppyDown" }));
+ };
+ GameClient.prototype.notifyFloppyUp = function () {
+ if (DEBUG) {
+ console.log("[MAR] Notifying the game server of floppy upload");
+ }
+ this.socket.send(JSON.stringify({ t: "floppyUp" }));
+ };
+ GameClient.prototype.requestObjects = function () {
+ if (DEBUG) {
+ console.log("[MAR] Requesting game objects");
+ }
+ this.socket.send(JSON.stringify({ t: "object", x: this.worldX, y: this.worldY }));
+ };
+ /**
+ * Get server info from game website
+ */
+ GameClient.prototype.getServerInfo = function () {
+ var self = this;
+ if (DEBUG) {
+ console.log("[MAR] Getting server info... ");
+ }
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", "./getServerInfo.php", true);
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState === 4 && xhr.status === 200) {
+ if (DEBUG) {
+ console.log("[MAR] Received server info " + xhr.responseText);
+ }
+ setTimeout(self.connectToGameServer(JSON.parse(xhr.responseText)), 100);
+ }
+ };
+ xhr.send(null);
+ };
+ /**
+ * Connect to the game server
+ * @param info JSON fetched from /getServerInfo.php
+ */
+ GameClient.prototype.connectToGameServer = function (info) {
+ var self = this;
+ if (DEBUG) {
+ console.log("[MAR] Connecting to " + info.address);
+ }
+ // info.address = "wss://muchassemblyrequired.com:443/socket";
+ this.socket = new WebSocket(info.address);
+ this.username = info.username;
+ this.tickLength = info.tickLength;
+ this.serverName = info.serverName;
+ this.socket.binaryType = 'arraybuffer';
+ this.socket.onopen = function () {
+ if (DEBUG) {
+ console.log("[MAR] Connected. Sent auth request");
+ }
+ //Send auth request
+ self.socket.send(info.token);
+ //todo Setup event listeners
+ self.listeners.push(new UserInfoListener());
+ self.listeners.push(new AuthListener());
+ self.listeners.push(new TickListener());
+ self.listeners.push(new TerrainListener());
+ self.listeners.push(new ObjectsListener());
+ self.socket.onmessage = function (received) {
+ var message;
+ try {
+ message = JSON.parse(received.data);
+ }
+ catch (e) {
+ if (DEBUG) {
+ console.log("[MAR] " + e);
+ }
+ //todo floppyListener(received);
+ }
+ if (DEBUG) {
+ console.log("[MAR] Received: " + received.data);
+ }
+ for (var i = 0; i < self.listeners.length; i++) {
+ if (self.listeners[i].getListenedMessageType() === message.t) {
+ self.listeners[i].handle(message);
+ }
+ }
+ };
+ //Reload code
+ //todo reloadCode();
+ };
+ this.socket.onerror = function (e) {
+ alert("Can't connect to game server at address " + info.address);
+ console.log(e);
+ };
+ this.socket.onclose = function (e) {
+ mar.world.setBigMessage("Disconnected from server :(");
+ console.log(e);
+ };
+ this.initGame();
+ };
+ /**
+ * Called after the connection has been made to the server
+ */
+ GameClient.prototype.initGame = function () {
+ var self = this;
+ //Setup keyboard buffer display
+ //todo don't display if guest
+ this.keyboardBuffer = new KeyboardBuffer(config.kbBufferX, config.kbBufferY);
+ mar.addDebugMessage(this.keyboardBuffer);
+ //Handle keypresses
+ mar.game.input.keyboard.onDownCallback = function (event) {
+ //If the game has focus
+ if (document.activeElement === document.getElementById("game")) {
+ if ((event.keyCode >= 37 && event.keyCode <= 40) || event.keyCode === 116 || event.keyCode === 32) {
+ event.preventDefault();
+ }
+ if (self.username !== "guest" && self.keyboardBuffer.keys.length <= 16) {
+ self.sendKeyPress(event.keyCode);
+ //Locally update the buffer
+ self.keyboardBuffer.keys.push(event.keyCode);
+ }
+ }
+ };
+ };
+ /**
+ * Requests user info, which will trigger a terrain request with the world X,Y of
+ * the player's robot
+ */
+ GameClient.prototype.findMyRobot = function () {
+ if (this.username === "guest") {
+ alert("You are not logged in!");
+ }
+ else {
+ this.requestUserInfo();
+ }
+ };
+ return GameClient;
+}());
diff --git a/mar/phaser/GameClient.ts b/mar/phaser/GameClient.ts
new file mode 100644
index 0000000..2d106ae
--- /dev/null
+++ b/mar/phaser/GameClient.ts
@@ -0,0 +1,455 @@
+/**
+ * Client-side keyboard buffer. It is overwritten by the server at the end of tick.
+ */
+class KeyboardBuffer extends DebugMessage {
+
+ /**
+ * Array of key codes. Updated on keypress
+ * @type {Array}
+ */
+ public keys: number[] = [];
+
+ /**
+ * @returns {string} Message written on the screen
+ */
+ public getMessage(): string {
+ let str = "KB: ";
+
+ for (let i = 0; i < 16; i++) {
+
+ if (this.keys[i] !== undefined) {
+
+ str += this.keys[i].toString(16).toUpperCase() + " ";
+
+ } else {
+
+ str += "__ ";
+ }
+ }
+
+ return str;
+ }
+}
+
+
+/**
+ * Listens for server messages
+ */
+interface MessageListener {
+
+ handle (message): void;
+
+ getListenedMessageType(): string
+
+}
+
+/**
+ * Listens for object list
+ */
+class ObjectsListener implements MessageListener {
+
+
+ getListenedMessageType(): string {
+ return "object";
+ }
+
+ handle(message): void {
+
+ if (DEBUG) {
+ console.log("[MAR] Received " + message.objects.length + " objects")
+ }
+
+ if (mar.world != undefined) {
+ mar.world.handleObjectsUpdate(message.objects)
+ }
+ }
+}
+
+class TickListener implements MessageListener {
+
+ getListenedMessageType() {
+ return "tick";
+ }
+
+ handle(message): void {
+ mar.client.requestObjects();
+
+ //Update key buffer display
+ if (message.keys !== undefined) {
+ mar.client.keyboardBuffer.keys = message.keys;
+ }
+ }
+}
+
+class UserInfoListener implements MessageListener {
+
+ getListenedMessageType() {
+ return "userInfo";
+ }
+
+ handle(message) {
+ if (DEBUG) {
+ console.log("[MAR] Received user info message")
+ }
+
+ mar.client.worldX = message.worldX;
+ mar.client.worldY = message.worldY;
+
+ //Maximum Universe width
+ mar.client.maxWidth = message.maxWidth;
+
+ mar.client.requestTerrain();
+ }
+}
+
+
+class AuthListener implements MessageListener {
+
+ getListenedMessageType() {
+ return "auth";
+ }
+
+ handle(message) {
+ if (DEBUG) {
+ console.log("[MAR] Received auth response")
+ }
+
+ if (message.m === "ok") {
+ console.log("[MAR] Auth successful");
+ mar.client.requestUserInfo();
+
+ } else {
+ alert("Authentication failed. Please make sure you are logged in and reload the page.");
+ }
+ }
+}
+
+class TerrainListener implements MessageListener {
+
+ getListenedMessageType() {
+ return "terrain";
+ }
+
+ handle(message) {
+
+ if (DEBUG) {
+ console.log("[MAR] Received terrain");
+ }
+
+ if (mar.world) {
+ mar.world.removeBigMessage();
+ }
+
+
+ if (message.ok) {
+
+ //todo handle vault worlds here
+
+
+ if (DEBUG) {
+ console.log("[MAR] World is available");
+ }
+
+ if (mar.world != null) {
+
+ if (DEBUG) {
+ console.log("[MAR] Updating World terrain");
+ }
+
+ mar.world.updateTerrain(message.terrain);
+
+ } else {
+
+ if (DEBUG) {
+ console.log("[MAR] Creating new World");
+ }
+
+ mar.world = new World(message.terrain);
+
+ }
+ } else {
+
+
+ if (DEBUG) {
+ console.log("[MAR] World is not available");
+ }
+
+ if (mar.world != null) {
+
+ if (DEBUG) {
+ console.log("[MAR] Updating World terrain");
+ }
+
+ mar.world.updateTerrain([]);
+
+ } else {
+
+ if (DEBUG) {
+ console.log("[MAR] Creating new World");
+ }
+
+ mar.world = new World([]);
+
+ }
+ if (mar.world) {
+ mar.world.setBigMessage("[Uncharted World]")
+ }
+ }
+ }
+
+}
+
+class GameClient {
+
+ keyboardBuffer: KeyboardBuffer;
+ /**
+ * Max width of the game universe
+ */
+ public maxWidth: number;
+
+ private listeners: MessageListener[] = [];
+
+ private socket: WebSocket;
+ public username: string;
+ private tickLength: number;
+ private serverName: string;
+
+ public worldX: number;
+ public worldY: number;
+
+ constructor() {
+ this.getServerInfo();
+ }
+
+ public requestUserInfo(): void {
+
+ if (DEBUG) {
+ console.log("[MAR] Requesting user info");
+ }
+
+ this.socket.send(JSON.stringify({t: "userInfo"}));
+ }
+
+ public requestTerrain() {
+
+ if (DEBUG) {
+ console.log("[MAR] Requesting terrain for world (" + this.worldX + ", " + this.worldY + ")");
+ }
+
+ this.socket.send(JSON.stringify({t: "terrain", x: this.worldX, y: this.worldY}));
+ this.requestObjects();
+ }
+
+ public uploadCode(code: string): void {
+
+ if (DEBUG) {
+ console.log("[MAR] Uploaded code");
+ }
+
+ this.socket.send(JSON.stringify({t: "uploadCode", code: code}))
+ }
+
+ public reloadCode(): void {
+ if (DEBUG) {
+ console.log("[MAR] Reloading code");
+ }
+
+ this.socket.send(JSON.stringify({t: "codeRequest"}))
+ }
+
+ public sendKeyPress(key: number): void {
+
+ if (DEBUG) {
+ console.log("[MAR] Sent KeyPress: " + key);
+ }
+
+ if (key !== 0) {
+ this.socket.send(JSON.stringify({t: "k", k: key}));
+ }
+ }
+
+ public requestFloppy(): void {
+ //Start loading animation
+ document.getElementById("floppyDown").innerHTML = "";
+
+ if (DEBUG) {
+ console.log("[MAR] Requesting floppy");
+ }
+
+ this.socket.send(JSON.stringify({t: "floppyDown"}));
+ }
+
+ public notifyFloppyUp(): void {
+
+ if (DEBUG) {
+ console.log("[MAR] Notifying the game server of floppy upload");
+ }
+
+ this.socket.send(JSON.stringify({t: "floppyUp"}));
+ }
+
+ public requestObjects(): void {
+ if (DEBUG) {
+ console.log("[MAR] Requesting game objects");
+ }
+
+
+ this.socket.send(JSON.stringify({t: "object", x: this.worldX, y: this.worldY}));
+ }
+
+
+ /**
+ * Get server info from game website
+ */
+ private getServerInfo() {
+ let self = this;
+
+ if (DEBUG) {
+ console.log("[MAR] Getting server info... ");
+ }
+
+ let xhr = new XMLHttpRequest();
+ xhr.open("GET", "./getServerInfo.php", true);
+
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState === 4 && xhr.status === 200) {
+
+ if (DEBUG) {
+ console.log("[MAR] Received server info " + xhr.responseText);
+ }
+
+ setTimeout(self.connectToGameServer(JSON.parse(xhr.responseText)), 100);
+ }
+ };
+ xhr.send(null);
+ }
+
+ /**
+ * Connect to the game server
+ * @param info JSON fetched from /getServerInfo.php
+ */
+ private connectToGameServer(info: any) {
+
+ let self = this;
+
+ if (DEBUG) {
+ console.log("[MAR] Connecting to " + info.address);
+ }
+
+ // info.address = "wss://muchassemblyrequired.com:443/socket";
+
+
+ this.socket = new WebSocket(info.address);
+ this.username = info.username;
+ this.tickLength = info.tickLength;
+ this.serverName = info.serverName;
+
+ this.socket.binaryType = 'arraybuffer';
+
+
+ this.socket.onopen = function () {
+
+ if (DEBUG) {
+ console.log("[MAR] Connected. Sent auth request");
+ }
+
+ //Send auth request
+ self.socket.send(info.token);
+
+ //todo Setup event listeners
+ self.listeners.push(new UserInfoListener());
+ self.listeners.push(new AuthListener());
+ self.listeners.push(new TickListener());
+ self.listeners.push(new TerrainListener());
+ self.listeners.push(new ObjectsListener());
+
+ self.socket.onmessage = function (received) {
+
+ let message;
+
+ try {
+ message = JSON.parse(received.data);
+
+ } catch (e) {
+ if (DEBUG) {
+ console.log("[MAR] " + e)
+ }
+ //todo floppyListener(received);
+ }
+
+ if (DEBUG) {
+ console.log("[MAR] Received: " + received.data)
+ }
+
+ for (let i = 0; i < self.listeners.length; i++) {
+
+ if (self.listeners[i].getListenedMessageType() === message.t) {
+ self.listeners[i].handle(message)
+ }
+ }
+
+ };
+
+ //Reload code
+ //todo reloadCode();
+ };
+
+ this.socket.onerror = function (e) {
+ alert("Can't connect to game server at address " + info.address);
+ console.log(e);
+ };
+
+
+ this.socket.onclose = function (e) {
+
+ mar.world.setBigMessage("Disconnected from server :(");
+ console.log(e);
+ };
+
+ this.initGame();
+ }
+
+ /**
+ * Called after the connection has been made to the server
+ */
+ public initGame() {
+
+ let self = this;
+
+ //Setup keyboard buffer display
+ //todo don't display if guest
+ this.keyboardBuffer = new KeyboardBuffer(config.kbBufferX, config.kbBufferY);
+ mar.addDebugMessage(this.keyboardBuffer);
+
+
+ //Handle keypresses
+ mar.game.input.keyboard.onDownCallback = function (event) {
+
+ //If the game has focus
+ if (document.activeElement === document.getElementById("game")) {
+ if ((event.keyCode >= 37 && event.keyCode <= 40) || event.keyCode === 116 || event.keyCode === 32) {
+ event.preventDefault();
+ }
+
+ if (self.username !== "guest" && self.keyboardBuffer.keys.length <= 16) {
+ self.sendKeyPress(event.keyCode);
+
+ //Locally update the buffer
+ self.keyboardBuffer.keys.push(event.keyCode);
+ }
+ }
+ };
+ }
+
+ /**
+ * Requests user info, which will trigger a terrain request with the world X,Y of
+ * the player's robot
+ */
+ public findMyRobot() {
+ if (this.username === "guest") {
+ alert("You are not logged in!");
+ } else {
+ this.requestUserInfo()
+ }
+ }
+}
\ No newline at end of file
diff --git a/mar/phaser/GameObject.js b/mar/phaser/GameObject.js
new file mode 100644
index 0000000..c6a3051
--- /dev/null
+++ b/mar/phaser/GameObject.js
@@ -0,0 +1,466 @@
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+var ObjectType;
+(function (ObjectType) {
+ ObjectType[ObjectType["CUBOT"] = 1] = "CUBOT";
+ ObjectType[ObjectType["BIOMASS"] = 2] = "BIOMASS";
+ ObjectType[ObjectType["HARVESTER_NPC"] = 10] = "HARVESTER_NPC";
+ ObjectType[ObjectType["FACTORY"] = 3] = "FACTORY";
+ ObjectType[ObjectType["RADIO_TOWER"] = 4] = "RADIO_TOWER";
+})(ObjectType || (ObjectType = {}));
+var ItemType;
+(function (ItemType) {
+ ItemType[ItemType["BIOMASS"] = 1] = "BIOMASS";
+ ItemType[ItemType["IRON"] = 3] = "IRON";
+ ItemType[ItemType["COPPER"] = 4] = "COPPER";
+})(ItemType || (ItemType = {}));
+var Action;
+(function (Action) {
+ Action[Action["IDLE"] = 0] = "IDLE";
+ Action[Action["DIGGING"] = 1] = "DIGGING";
+ Action[Action["WALKING"] = 2] = "WALKING";
+ Action[Action["WITHDRAWING"] = 3] = "WITHDRAWING";
+ Action[Action["DEPOSITING"] = 4] = "DEPOSITING";
+ Action[Action["LISTENING"] = 5] = "LISTENING";
+ Action[Action["JUMPING"] = 6] = "JUMPING";
+})(Action || (Action = {}));
+var GameObject = (function (_super) {
+ __extends(GameObject, _super);
+ function GameObject(x, y, z, key, frame) {
+ return _super.call(this, mar.game, x, y, z, key, frame) || this;
+ }
+ /**
+ * Factory method for GameObjects
+ */
+ GameObject.createObject = function (json) {
+ switch (json.t) {
+ case ObjectType.CUBOT:
+ return new Cubot(json);
+ case ObjectType.BIOMASS:
+ return new BiomassBlob(json);
+ case ObjectType.HARVESTER_NPC:
+ return new HarvesterNPC(json);
+ case ObjectType.FACTORY:
+ return new Factory(json);
+ case ObjectType.RADIO_TOWER:
+ return new RadioTower(json);
+ default:
+ return null;
+ }
+ };
+ /**
+ * Set text that will appear on top of the object. Usually used for hover text
+ */
+ GameObject.prototype.setText = function (text) {
+ this.text = mar.game.make.text(0, 0, text, {
+ fontSize: 22,
+ fill: config.textFill,
+ stroke: config.textStroke,
+ strokeThickness: 2,
+ font: "fixedsys"
+ });
+ this.text.anchor.set(0.5, 0);
+ this.addChild(this.text);
+ };
+ /**
+ * Tested to trigger onTileHover and onTileExit
+ */
+ GameObject.prototype.isAt = function (x, y) {
+ return x == this.tileX && y == this.tileY;
+ };
+ return GameObject;
+}(Phaser.Plugin.Isometric.IsoSprite));
+var HologramMode;
+(function (HologramMode) {
+ HologramMode[HologramMode["CLEARED"] = 0] = "CLEARED";
+ HologramMode[HologramMode["HEX"] = 1] = "HEX";
+ HologramMode[HologramMode["STRING"] = 2] = "STRING";
+ HologramMode[HologramMode["DEC"] = 3] = "DEC";
+})(HologramMode || (HologramMode = {}));
+var Cubot = (function (_super) {
+ __extends(Cubot, _super);
+ function Cubot(json) {
+ var _this = _super.call(this, Util.getIsoX(json.x), Util.getIsoY(json.y), 15, "sheet", null) || this;
+ /**
+ * List of animation functions queued for execution.
+ */
+ _this.queuedAnimations = [];
+ _this.hovered = false;
+ if (DEBUG) {
+ console.log("Creating Cubot object");
+ }
+ _this.anchor.set(0.5, 0);
+ _this.id = json.i;
+ _this.tileX = json.x;
+ _this.tileY = json.y;
+ _this.username = json.parent;
+ _this.heldItem = json.heldItem;
+ _this.direction = json.direction;
+ _this.action = json.action;
+ _this.energy = json.energy;
+ _this.animations.add("walk_w", mar.animationFrames.walk_w);
+ _this.animations.add("walk_s", mar.animationFrames.walk_s);
+ _this.animations.add("walk_e", mar.animationFrames.walk_e);
+ _this.animations.add("walk_n", mar.animationFrames.walk_n);
+ _this.animations.add("dig_w", mar.animationFrames.dig_w);
+ _this.animations.add("dig_s", mar.animationFrames.dig_s);
+ _this.animations.add("dig_e", mar.animationFrames.dig_e);
+ _this.animations.add("dig_n", mar.animationFrames.dig_n);
+ _this.createUsername();
+ _this.updateDirection();
+ _this.tint = _this.getTint();
+ return _this;
+ }
+ Cubot.prototype.onTileHover = function () {
+ mar.game.add.tween(this).to({ isoZ: 45 }, 200, Phaser.Easing.Quadratic.InOut, true);
+ mar.game.add.tween(this.scale).to({ x: 1.2, y: 1.2 }, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.cubotHoverTint;
+ if (this.text !== undefined) {
+ this.text.visible = true;
+ }
+ this.hovered = true;
+ };
+ Cubot.prototype.onTileExit = function () {
+ mar.game.add.tween(this).to({ isoZ: 15 }, 400, Phaser.Easing.Bounce.Out, true);
+ mar.game.add.tween(this.scale).to({ x: 1, y: 1 }, 200, Phaser.Easing.Linear.None, true);
+ if (this.text !== undefined) {
+ this.text.visible = false;
+ }
+ this.hovered = false;
+ this.tint = this.getTint();
+ };
+ Cubot.prototype.getTint = function () {
+ if (!this.hovered) {
+ if (this.energy <= config.lowEnergy) {
+ return config.lowEnergyTint;
+ }
+ else {
+ return config.cubotTint;
+ }
+ }
+ else {
+ return config.cubotHoverTint;
+ }
+ };
+ Cubot.prototype.updateObject = function (json) {
+ if (DEBUG) {
+ console.log("Updating Cubot object");
+ }
+ this.action = json.action;
+ this.energy = json.energy;
+ this.direction = json.direction;
+ //Update color
+ this.tint = this.getTint();
+ //Update Location
+ if (!this.isAt(json.x, json.y)) {
+ //Location changed
+ if (this.action == Action.WALKING) {
+ //Walking..
+ this.tileX = json.x;
+ this.tileY = json.y;
+ this.walk();
+ }
+ else if (this.action == Action.JUMPING) {
+ //TODO
+ }
+ }
+ if (this.action == Action.DIGGING) {
+ //TODO dig animation
+ }
+ this.updateDirection();
+ this.updateHologram(json.holoMode, json.holoC, json.holo, json.holoStr);
+ };
+ Cubot.prototype.updateHologram = function (holoMode, holoColor, holoValue, holoStr) {
+ //Create hologram if not exist, set style
+ if (this.hologram == undefined) {
+ this.hologram = mar.game.make.text(0, 32, "");
+ this.hologram.anchor.set(0.5, 0);
+ this.addChild(this.hologram);
+ this.hologram.setStyle(config.holoStyle(holoColor));
+ }
+ else {
+ this.hologram.setStyle(config.holoStyle(holoColor));
+ }
+ switch (holoMode) {
+ case HologramMode.CLEARED:
+ this.hologram.text = "";
+ break;
+ case HologramMode.DEC:
+ this.hologram.text = Number(holoValue).toString();
+ break;
+ case HologramMode.HEX:
+ this.hologram.text = "0x" + ("0000" + Number(holoValue).toString(16).toUpperCase()).slice(-4);
+ break;
+ case HologramMode.STRING:
+ this.hologram.text = holoStr.replace(/[\n|\t]/g, '');
+ break;
+ }
+ };
+ /**
+ * Set appropriate frame based on direction
+ */
+ Cubot.prototype.updateDirection = function () {
+ switch (this.direction) {
+ case Direction.NORTH:
+ this.animations.frameName = "cubot/walk_n/0001";
+ break;
+ case Direction.EAST:
+ this.animations.frameName = "cubot/walk_e/0001";
+ break;
+ case Direction.SOUTH:
+ this.animations.frameName = "cubot/walk_s/0001";
+ break;
+ case Direction.WEST:
+ this.animations.frameName = "cubot/walk_w/0001";
+ break;
+ }
+ };
+ /**
+ * Initiate the walk animation. Handles multiple calls of this function even if the previous animations
+ * were not completed
+ */
+ Cubot.prototype.walk = function () {
+ var self = this;
+ var walkAnimation = function (duration) {
+ //Move the Cubot to desired tile
+ var tween = mar.game.add.tween(self).to({ isoX: Util.getIsoX(self.tileX), isoY: Util.getIsoY(self.tileY) }, duration, Phaser.Easing.Linear.None, true);
+ //Play appropriate animation
+ switch (self.direction) {
+ case Direction.NORTH:
+ self.animations.play("walk_n", 60, true);
+ break;
+ case Direction.SOUTH:
+ self.animations.play("walk_s", 60, true);
+ break;
+ case Direction.EAST:
+ self.animations.play("walk_e", 60, true);
+ break;
+ case Direction.WEST:
+ self.animations.play("walk_w", 60, true);
+ break;
+ }
+ //When moved to destination,
+ tween.onComplete.add(function () {
+ self.animations.stop();
+ self.updateDirection();
+ //Resync position
+ self.isoX = Util.getIsoX(self.tileX);
+ self.isoY = Util.getIsoY(self.tileY);
+ self.onTileExit();
+ //Execute all the queued walk animations at a faster pace
+ for (var i = 0; i < self.queuedAnimations.length; i++) {
+ self.queuedAnimations[i](config.walkDuration / 2);
+ self.queuedAnimations.splice(i, 1);
+ }
+ });
+ };
+ if (this.animations.currentAnim.isPlaying) {
+ //Queue up the animation
+ this.queuedAnimations.push(walkAnimation);
+ }
+ else {
+ walkAnimation(config.walkDuration);
+ }
+ };
+ /**
+ * Create the username text that will appear on top of the Cubot. Text will have alternate
+ * color when current username matches. This function is also responsable for setting the
+ * reduced transparency of other Cubots
+ */
+ Cubot.prototype.createUsername = function () {
+ var username = mar.game.make.text(0, -24, this.username, {
+ fontSize: 22,
+ fill: config.textFill,
+ stroke: config.textStroke,
+ strokeThickness: 2,
+ font: "fixedsys"
+ });
+ username.alpha = 0.85;
+ username.anchor.set(0.5, 0);
+ //Color own username
+ if (this.username === mar.client.username) {
+ username.tint = config.selfUsernameColor;
+ }
+ else {
+ this.alpha = config.otherCubotAlpha;
+ }
+ this.addChild(username);
+ };
+ return Cubot;
+}(GameObject));
+var HarvesterNPC = (function (_super) {
+ __extends(HarvesterNPC, _super);
+ function HarvesterNPC(json) {
+ var _this = _super.call(this, json) || this;
+ _this.animations.add("walk_w", mar.animationFrames.harvester_walk_w);
+ _this.animations.add("walk_s", mar.animationFrames.harvester_walk_s);
+ _this.animations.add("walk_e", mar.animationFrames.harvester_walk_e);
+ _this.animations.add("walk_n", mar.animationFrames.harvester_walk_n);
+ _this.updateDirection();
+ _this.setText("Harvester NPC");
+ _this.text.visible = false;
+ return _this;
+ }
+ /**
+ * Needs to be overridden because Cubot() calls getTint() when initialised
+ */
+ HarvesterNPC.prototype.getTint = function () {
+ return config.cubotTint;
+ };
+ HarvesterNPC.prototype.updateDirection = function () {
+ switch (this.direction) {
+ case Direction.NORTH:
+ this.animations.frameName = "harvester/walk_n/0001";
+ break;
+ case Direction.EAST:
+ this.animations.frameName = "harvester/walk_e/0001";
+ break;
+ case Direction.SOUTH:
+ this.animations.frameName = "harvester/walk_s/0001";
+ break;
+ case Direction.WEST:
+ this.animations.frameName = "harvester/walk_w/0001";
+ break;
+ }
+ };
+ HarvesterNPC.prototype.updateObject = function (json) {
+ if (DEBUG) {
+ console.log("Updating Harvester NPC object");
+ }
+ this.action = json.action;
+ this.direction = json.direction;
+ //Update Location
+ if (!this.isAt(json.x, json.y)) {
+ //Location changed
+ if (this.action == Action.WALKING) {
+ //Walking..
+ this.tileX = json.x;
+ this.tileY = json.y;
+ this.walk();
+ }
+ else if (this.action == Action.JUMPING) {
+ //TODO
+ }
+ }
+ //Update Direction
+ this.updateDirection();
+ };
+ HarvesterNPC.prototype.createUsername = function () {
+ //No-op
+ };
+ return HarvesterNPC;
+}(Cubot));
+var BiomassBlob = (function (_super) {
+ __extends(BiomassBlob, _super);
+ function BiomassBlob(json) {
+ var _this = _super.call(this, Util.getIsoX(json.x), Util.getIsoY(json.y), 10, "sheet", 1) || this;
+ if (DEBUG) {
+ console.log("Creating Biomass object");
+ }
+ _this.anchor.set(0.5, 0);
+ _this.id = json.i;
+ _this.tileX = json.x;
+ _this.tileY = json.y;
+ _this.tint = config.biomassTint;
+ _this.animations.add("idle", mar.animationFrames.biomassIdle);
+ _this.animations.play("idle", 45, true);
+ _this.setText("Biomass");
+ _this.text.visible = false;
+ return _this;
+ }
+ BiomassBlob.prototype.onTileHover = function () {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({ isoZ: 45 }, 200, Phaser.Easing.Quadratic.InOut, true);
+ this.tint = config.biomassHoverTint;
+ mar.game.add.tween(this.scale).to({ x: 1.2, y: 1.2 }, 200, Phaser.Easing.Linear.None, true);
+ this.text.visible = true;
+ };
+ BiomassBlob.prototype.onTileExit = function () {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({ isoZ: 15 }, 400, Phaser.Easing.Bounce.Out, true);
+ mar.game.add.tween(this.scale).to({ x: 1, y: 1 }, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.biomassTint;
+ this.text.visible = false;
+ };
+ BiomassBlob.prototype.updateObject = function (json) {
+ if (DEBUG) {
+ console.log("Updating Biomass object");
+ }
+ };
+ return BiomassBlob;
+}(GameObject));
+var Factory = (function (_super) {
+ __extends(Factory, _super);
+ function Factory(json) {
+ var _this = _super.call(this, Util.getIsoX(json.x), Util.getIsoY(json.y), 15, "sheet", "objects/factory") || this;
+ _this.anchor.set(0.5, .25);
+ _this.setText("Factory");
+ _this.text.visible = false;
+ _this.id = json.i;
+ _this.tileX = json.x;
+ _this.tileY = json.y;
+ return _this;
+ }
+ Factory.prototype.onTileHover = function () {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({ isoZ: 25 }, 200, Phaser.Easing.Quadratic.InOut, true);
+ mar.game.add.tween(this.scale).to({ x: 1.06, y: 1.06 }, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.cubotHoverTint;
+ this.text.visible = true;
+ };
+ Factory.prototype.onTileExit = function () {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({ isoZ: 15 }, 400, Phaser.Easing.Bounce.Out, true);
+ mar.game.add.tween(this.scale).to({ x: 1, y: 1 }, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.cubotTint;
+ this.text.visible = false;
+ };
+ Factory.prototype.updateObject = function (json) {
+ //No op
+ };
+ Factory.prototype.isAt = function (x, y) {
+ //Factory is 2x2
+ return (this.tileX === x || this.tileX + 1 === x) && (this.tileY + 1 === y || this.tileY === y);
+ };
+ ;
+ return Factory;
+}(GameObject));
+var RadioTower = (function (_super) {
+ __extends(RadioTower, _super);
+ function RadioTower(json) {
+ var _this = _super.call(this, Util.getIsoX(json.x), Util.getIsoY(json.y), 15, "sheet", "objects/RadioTower") || this;
+ _this.anchor.set(0.5, 0.64);
+ _this.setText("Radio Tower");
+ _this.text.visible = false;
+ _this.id = json.i;
+ _this.tileX = json.x;
+ _this.tileY = json.y;
+ return _this;
+ }
+ RadioTower.prototype.onTileHover = function () {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({ isoZ: 25 }, 200, Phaser.Easing.Quadratic.InOut, true);
+ mar.game.add.tween(this.scale).to({ x: 1.06, y: 1.06 }, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.cubotHoverTint;
+ this.text.visible = true;
+ };
+ RadioTower.prototype.onTileExit = function () {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({ isoZ: 15 }, 400, Phaser.Easing.Bounce.Out, true);
+ mar.game.add.tween(this.scale).to({ x: 1, y: 1 }, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.cubotTint;
+ this.text.visible = false;
+ };
+ RadioTower.prototype.updateObject = function (json) {
+ //No op
+ };
+ return RadioTower;
+}(GameObject));
diff --git a/mar/phaser/GameObject.ts b/mar/phaser/GameObject.ts
new file mode 100644
index 0000000..f52693b
--- /dev/null
+++ b/mar/phaser/GameObject.ts
@@ -0,0 +1,572 @@
+enum ObjectType {
+ CUBOT = 1,
+ BIOMASS = 2,
+ HARVESTER_NPC = 10,
+ FACTORY = 3,
+ RADIO_TOWER = 4
+}
+
+enum ItemType {
+ BIOMASS = 1,
+ IRON = 3,
+ COPPER = 4
+}
+
+enum Action {
+ IDLE,
+ DIGGING,
+ WALKING,
+ WITHDRAWING,
+ DEPOSITING,
+ LISTENING,
+ JUMPING
+}
+
+abstract class GameObject extends Phaser.Plugin.Isometric.IsoSprite {
+
+ public tileX: number;
+ public tileY: number;
+
+ id: number;
+ protected direction: Direction;
+ protected action: Action;
+
+ public updated: boolean;
+
+ protected text: Phaser.Text;
+
+
+ constructor(x: number, y: number, z: number, key: any, frame: any) {
+ super(mar.game, x, y, z, key, frame);
+ }
+
+ public abstract updateObject(json): void;
+
+ public abstract onTileHover(): void;
+
+ public abstract onTileExit(): void;
+
+ /**
+ * Factory method for GameObjects
+ */
+ public static createObject(json): GameObject {
+ switch (json.t) {
+ case ObjectType.CUBOT:
+ return new Cubot(json);
+
+ case ObjectType.BIOMASS:
+ return new BiomassBlob(json);
+ case ObjectType.HARVESTER_NPC:
+ return new HarvesterNPC(json);
+ case ObjectType.FACTORY:
+ return new Factory(json);
+ case ObjectType.RADIO_TOWER:
+ return new RadioTower(json);
+
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Set text that will appear on top of the object. Usually used for hover text
+ */
+ protected setText(text: string): void {
+ this.text = mar.game.make.text(0, 0, text, {
+ fontSize: 22,
+ fill: config.textFill,
+ stroke: config.textStroke,
+ strokeThickness: 2,
+ font: "fixedsys"
+ });
+
+ this.text.anchor.set(0.5, 0);
+ this.addChild(this.text);
+
+ }
+
+ /**
+ * Tested to trigger onTileHover and onTileExit
+ */
+ public isAt(x: number, y: number): boolean {
+ return x == this.tileX && y == this.tileY;
+ }
+
+}
+
+enum HologramMode {
+ CLEARED,
+ HEX,
+ STRING,
+ DEC
+}
+
+class Cubot extends GameObject {
+
+ username: string;
+ heldItem: ItemType;
+ energy: number;
+
+ private hologram: Phaser.Text;
+
+ /**
+ * List of animation functions queued for execution.
+ */
+ queuedAnimations = [];
+
+ private hovered: boolean = false;
+
+ constructor(json) {
+ super(Util.getIsoX(json.x), Util.getIsoY(json.y), 15, "sheet", null);
+
+ if (DEBUG) {
+ console.log("Creating Cubot object");
+ }
+
+ this.anchor.set(0.5, 0);
+ this.id = json.i;
+ this.tileX = json.x;
+ this.tileY = json.y;
+
+ this.username = json.parent;
+ this.heldItem = json.heldItem;
+ this.direction = json.direction;
+ this.action = json.action;
+ this.energy = json.energy;
+
+ this.animations.add("walk_w", mar.animationFrames.walk_w);
+ this.animations.add("walk_s", mar.animationFrames.walk_s,);
+ this.animations.add("walk_e", mar.animationFrames.walk_e);
+ this.animations.add("walk_n", mar.animationFrames.walk_n);
+ this.animations.add("dig_w", mar.animationFrames.dig_w);
+ this.animations.add("dig_s", mar.animationFrames.dig_s);
+ this.animations.add("dig_e", mar.animationFrames.dig_e);
+ this.animations.add("dig_n", mar.animationFrames.dig_n);
+
+ this.createUsername();
+ this.updateDirection();
+
+ this.tint = this.getTint();
+ }
+
+ onTileHover(): void {
+
+ mar.game.add.tween(this).to({isoZ: 45}, 200, Phaser.Easing.Quadratic.InOut, true);
+ mar.game.add.tween(this.scale).to({x: 1.2, y: 1.2}, 200, Phaser.Easing.Linear.None, true);
+
+ this.tint = config.cubotHoverTint;
+
+ if (this.text !== undefined) {
+ this.text.visible = true;
+ }
+
+ this.hovered = true;
+ }
+
+
+ onTileExit(): void {
+ mar.game.add.tween(this).to({isoZ: 15}, 400, Phaser.Easing.Bounce.Out, true);
+ mar.game.add.tween(this.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Linear.None, true);
+
+
+ if (this.text !== undefined) {
+ this.text.visible = false;
+ }
+ this.hovered = false;
+ this.tint = this.getTint();
+
+ }
+
+ public getTint(): number {
+ if (!this.hovered) {
+ if (this.energy <= config.lowEnergy) {
+ return config.lowEnergyTint;
+ } else {
+ return config.cubotTint;
+ }
+ } else {
+ return config.cubotHoverTint;
+ }
+ }
+
+ updateObject(json): void {
+
+ if (DEBUG) {
+ console.log("Updating Cubot object")
+ }
+
+ this.action = json.action;
+ this.energy = json.energy;
+ this.direction = json.direction;
+
+
+ //Update color
+ this.tint = this.getTint();
+
+ //Update Location
+ if (!this.isAt(json.x, json.y)) {
+ //Location changed
+ if (this.action == Action.WALKING) {
+ //Walking..
+ this.tileX = json.x;
+ this.tileY = json.y;
+
+ this.walk();
+
+ } else if (this.action == Action.JUMPING) {
+ //TODO
+ }
+ }
+
+ if (this.action == Action.DIGGING) {
+ //TODO dig animation
+ }
+
+ this.updateDirection();
+ this.updateHologram(json.holoMode, json.holoC, json.holo, json.holoStr);
+ }
+
+ private updateHologram(holoMode: HologramMode, holoColor: number, holoValue: number, holoStr: string): void {
+
+ //Create hologram if not exist, set style
+ if (this.hologram == undefined) {
+ this.hologram = mar.game.make.text(0, 32, "");
+ this.hologram.anchor.set(0.5, 0);
+ this.addChild(this.hologram);
+ this.hologram.setStyle(config.holoStyle(holoColor));
+ } else {
+ this.hologram.setStyle(config.holoStyle(holoColor));
+ }
+
+ switch (holoMode) {
+ case HologramMode.CLEARED:
+ this.hologram.text = "";
+ break;
+
+ case HologramMode.DEC:
+ this.hologram.text = Number(holoValue).toString();
+ break;
+
+ case HologramMode.HEX:
+ this.hologram.text = "0x" + ("0000" + Number(holoValue).toString(16).toUpperCase()).slice(-4);
+ break;
+
+ case HologramMode.STRING:
+ this.hologram.text = holoStr.replace(/[\n|\t]/g, '');
+ break;
+
+ }
+ }
+
+ /**
+ * Set appropriate frame based on direction
+ */
+ public updateDirection() {
+ switch (this.direction) {
+ case Direction.NORTH:
+ this.animations.frameName = "cubot/walk_n/0001";
+ break;
+ case Direction.EAST:
+ this.animations.frameName = "cubot/walk_e/0001";
+ break;
+ case Direction.SOUTH:
+ this.animations.frameName = "cubot/walk_s/0001";
+ break;
+ case Direction.WEST:
+ this.animations.frameName = "cubot/walk_w/0001";
+ break;
+ }
+ }
+
+ /**
+ * Initiate the walk animation. Handles multiple calls of this function even if the previous animations
+ * were not completed
+ */
+ public walk() {
+
+ let self = this;
+ let walkAnimation = function (duration) {
+ //Move the Cubot to desired tile
+ let tween = mar.game.add.tween(self).to({isoX: Util.getIsoX(self.tileX), isoY: Util.getIsoY(self.tileY)},
+ duration, Phaser.Easing.Linear.None, true);
+
+ //Play appropriate animation
+ switch (self.direction) {
+ case Direction.NORTH:
+ self.animations.play("walk_n", 60, true);
+ break;
+ case Direction.SOUTH:
+ self.animations.play("walk_s", 60, true);
+ break;
+ case Direction.EAST:
+ self.animations.play("walk_e", 60, true);
+ break;
+ case Direction.WEST:
+ self.animations.play("walk_w", 60, true);
+ break;
+ }
+
+ //When moved to destination,
+ tween.onComplete.add(function () {
+ self.animations.stop();
+
+ self.updateDirection();
+
+ //Resync position
+ self.isoX = Util.getIsoX(self.tileX);
+ self.isoY = Util.getIsoY(self.tileY);
+
+ self.onTileExit();
+
+ //Execute all the queued walk animations at a faster pace
+ for (let i = 0; i < self.queuedAnimations.length; i++) {
+ self.queuedAnimations[i](config.walkDuration / 2);
+ self.queuedAnimations.splice(i, 1)
+ }
+ });
+
+ };
+
+ if (this.animations.currentAnim.isPlaying) {
+ //Queue up the animation
+ this.queuedAnimations.push(walkAnimation);
+
+ } else {
+ walkAnimation(config.walkDuration);
+ }
+
+
+ }
+
+ /**
+ * Create the username text that will appear on top of the Cubot. Text will have alternate
+ * color when current username matches. This function is also responsable for setting the
+ * reduced transparency of other Cubots
+ */
+ public createUsername() {
+ let username = mar.game.make.text(0, -24, this.username, {
+ fontSize: 22,
+ fill: config.textFill,
+ stroke: config.textStroke,
+ strokeThickness: 2,
+ font: "fixedsys"
+ });
+ username.alpha = 0.85;
+ username.anchor.set(0.5, 0);
+
+ //Color own username
+ if (this.username === mar.client.username) {
+ username.tint = config.selfUsernameColor;
+ } else {
+ this.alpha = config.otherCubotAlpha;
+ }
+ this.addChild(username);
+ }
+}
+
+class HarvesterNPC extends Cubot {
+
+ constructor(json) {
+ super(json);
+
+ this.animations.add("walk_w", mar.animationFrames.harvester_walk_w);
+ this.animations.add("walk_s", mar.animationFrames.harvester_walk_s);
+ this.animations.add("walk_e", mar.animationFrames.harvester_walk_e);
+ this.animations.add("walk_n", mar.animationFrames.harvester_walk_n);
+
+ this.updateDirection();
+ this.setText("Harvester NPC");
+ this.text.visible = false;
+
+ }
+
+ /**
+ * Needs to be overridden because Cubot() calls getTint() when initialised
+ */
+ public getTint() {
+ return config.cubotTint;
+ }
+
+ public updateDirection() {
+ switch (this.direction) {
+ case Direction.NORTH:
+ this.animations.frameName = "harvester/walk_n/0001";
+ break;
+ case Direction.EAST:
+ this.animations.frameName = "harvester/walk_e/0001";
+ break;
+ case Direction.SOUTH:
+ this.animations.frameName = "harvester/walk_s/0001";
+ break;
+ case Direction.WEST:
+ this.animations.frameName = "harvester/walk_w/0001";
+ break;
+ }
+ }
+
+ updateObject(json) {
+ if (DEBUG) {
+ console.log("Updating Harvester NPC object")
+ }
+
+ this.action = json.action;
+ this.direction = json.direction;
+
+ //Update Location
+ if (!this.isAt(json.x, json.y)) {
+ //Location changed
+ if (this.action == Action.WALKING) {
+ //Walking..
+ this.tileX = json.x;
+ this.tileY = json.y;
+
+ this.walk();
+
+ } else if (this.action == Action.JUMPING) {
+ //TODO
+ }
+ }
+
+ //Update Direction
+ this.updateDirection();
+ }
+
+ public createUsername() {
+ //No-op
+ }
+
+}
+
+
+class BiomassBlob extends GameObject {
+
+ onTileHover() {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({isoZ: 45}, 200, Phaser.Easing.Quadratic.InOut, true);
+ this.tint = config.biomassHoverTint;
+ mar.game.add.tween(this.scale).to({x: 1.2, y: 1.2}, 200, Phaser.Easing.Linear.None, true);
+
+ this.text.visible = true;
+ }
+
+
+ onTileExit() {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({isoZ: 15}, 400, Phaser.Easing.Bounce.Out, true);
+ mar.game.add.tween(this.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.biomassTint;
+
+ this.text.visible = false;
+ }
+
+ updateObject(json) {
+ if (DEBUG) {
+ console.log("Updating Biomass object")
+ }
+ }
+
+
+ constructor(json) {
+ super(Util.getIsoX(json.x), Util.getIsoY(json.y), 10, "sheet", 1);
+
+ if (DEBUG) {
+ console.log("Creating Biomass object")
+ }
+
+ this.anchor.set(0.5, 0);
+ this.id = json.i;
+ this.tileX = json.x;
+ this.tileY = json.y;
+
+ this.tint = config.biomassTint;
+
+ this.animations.add("idle", mar.animationFrames.biomassIdle);
+ this.animations.play("idle", 45, true);
+
+ this.setText("Biomass");
+ this.text.visible = false;
+
+ }
+}
+
+class Factory extends GameObject {
+
+
+ public onTileHover() {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({isoZ: 25}, 200, Phaser.Easing.Quadratic.InOut, true);
+ mar.game.add.tween(this.scale).to({x: 1.06, y: 1.06}, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.cubotHoverTint;
+
+ this.text.visible = true;
+ }
+
+ public onTileExit() {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({isoZ: 15}, 400, Phaser.Easing.Bounce.Out, true);
+ mar.game.add.tween(this.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.cubotTint;
+
+ this.text.visible = false;
+ }
+
+ public updateObject(json) {
+ //No op
+ }
+
+ public isAt(x: number, y: number) {
+ //Factory is 2x2
+ return (this.tileX === x || this.tileX + 1 === x) && (this.tileY + 1 === y || this.tileY === y);
+ };
+
+
+ constructor(json) {
+ super(Util.getIsoX(json.x), Util.getIsoY(json.y), 15, "sheet", "objects/factory");
+
+ this.anchor.set(0.5, .25);
+ this.setText("Factory");
+ this.text.visible = false;
+
+ this.id = json.i;
+ this.tileX = json.x;
+ this.tileY = json.y;
+ }
+}
+
+class RadioTower extends GameObject {
+
+
+ public onTileHover() {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({isoZ: 25}, 200, Phaser.Easing.Quadratic.InOut, true);
+ mar.game.add.tween(this.scale).to({x: 1.06, y: 1.06}, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.cubotHoverTint;
+
+ this.text.visible = true;
+ }
+
+ public onTileExit() {
+ mar.game.tweens.removeFrom(this);
+ mar.game.add.tween(this).to({isoZ: 15}, 400, Phaser.Easing.Bounce.Out, true);
+ mar.game.add.tween(this.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Linear.None, true);
+ this.tint = config.cubotTint;
+
+ this.text.visible = false;
+ }
+
+ public updateObject(json) {
+ //No op
+ }
+
+ constructor(json) {
+ super(Util.getIsoX(json.x), Util.getIsoY(json.y), 15, "sheet", "objects/RadioTower");
+
+ this.anchor.set(0.5, 0.64);
+ this.setText("Radio Tower");
+ this.text.visible = false;
+
+ this.id = json.i;
+ this.tileX = json.x;
+ this.tileY = json.y;
+ }
+}
\ No newline at end of file
diff --git a/mar/phaser/MarGame.js b/mar/phaser/MarGame.js
new file mode 100644
index 0000000..ef6f4d9
--- /dev/null
+++ b/mar/phaser/MarGame.js
@@ -0,0 +1,257 @@
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+var MarGame = (function () {
+ function MarGame() {
+ this.cursorPos = new Phaser.Plugin.Isometric.Point3();
+ this.debugMessages = [];
+ this.animationFrames = {};
+ var self = this;
+ this.game = new Phaser.Game(RENDERER_WIDTH, RENDERER_HEIGHT, Phaser.AUTO, 'game', null, true, false);
+ this.bootState = {
+ preload: function () {
+ if (DEBUG) {
+ console.log("[MAR]Â Loading sprites.png as JSONHash");
+ }
+ this.game.load.atlasJSONHash("sheet", "./mar/sprites.png", "./mar/sprites.json").onLoadComplete.add(function () {
+ self.game.time.advancedTiming = true;
+ //Add and enable the isometric plug-in.
+ if (DEBUG) {
+ console.log("[MAR]Â Enabling isometric plugin");
+ }
+ self.game.plugins.add(new Phaser.Plugin.Isometric(self.game));
+ // This is used to set a game canvas-based offset for the 0, 0, 0 isometric coordinate - by default
+ // this point would be at screen coordinates 0, 0 (top left) which is usually undesirable.
+ self.game.iso.anchor.setTo(0.5, 0);
+ //Todo: set world size based on window size?
+ self.game.world.setBounds(0, 0, 2200, 1100);
+ //Make camera more or less centered (tested on 1080 screen)
+ self.game.camera.x = 280;
+ self.game.camera.y = 90;
+ self.game.scale.scaleMode = Phaser.ScaleManager.RESIZE;
+ self.game.scale.pageAlignHorizontally = true;
+ self.game.scale.pageAlignVertically = true;
+ self.game.stage.disableVisibilityChange = true;
+ self.client = new GameClient();
+ //Grab focus when clicked (For chrome, Opera)
+ self.game.input.onDown.add(function () {
+ document.getElementById("game").focus();
+ if (DEBUG) {
+ console.log("Grabbed focus of #game");
+ }
+ });
+ self.isoGroup = mar.game.add.group();
+ self.textGroup = mar.game.add.group();
+ self.hudGroup = mar.game.add.group();
+ self.hudGroup.fixedToCamera = true;
+ });
+ },
+ create: function () {
+ console.log("[MAR] create");
+ self.initialiseAnimations();
+ self.initialiseStaticHud();
+ },
+ update: function () {
+ self.game.scale.refresh();
+ // Update the cursor position.
+ self.game.iso.unproject(self.game.input.activePointer.position, self.cursorPos);
+ // Loop through all tiles and test to see if the 3D position from above intersects with the automatically generated IsoSprite tile bounds.
+ self.isoGroup.forEach(function (tile) {
+ if (tile instanceof Tile) {
+ var inBounds = tile.isoBounds.containsXY(self.cursorPos.x, self.cursorPos.y);
+ // If it does, do a little animation and tint change.
+ if (!tile.selected && inBounds) {
+ tile.selected = true;
+ tile.onHover();
+ //Dispatch tile over
+ self.isoGroup.forEach(function (obj) {
+ if (obj instanceof GameObject && obj.onTileHover != undefined && obj.isAt(tile.tileX, tile.tileY)) {
+ obj.onTileHover();
+ }
+ }, 1);
+ }
+ else if (tile.selected && !inBounds) {
+ tile.selected = false;
+ tile.onExit();
+ //Dispatch tile exit
+ self.isoGroup.forEach(function (obj) {
+ if (obj.onTileExit != undefined && obj.isAt(tile.tileX, tile.tileY)) {
+ obj.onTileExit();
+ }
+ }, 0);
+ }
+ }
+ }, 0);
+ //Enable dragging the camera
+ if (this.game.input.activePointer.isDown) {
+ if (this.game.origDragPoint) {
+ // move the camera by the amount the mouse has moved since last update
+ this.game.camera.x += this.game.origDragPoint.x - this.game.input.activePointer.position.x;
+ this.game.camera.y += this.game.origDragPoint.y - this.game.input.activePointer.position.y;
+ }
+ // set new drag origin to current position
+ this.game.origDragPoint = this.game.input.activePointer.position.clone();
+ }
+ else {
+ this.game.origDragPoint = null;
+ }
+ self.game.iso.topologicalSort(self.isoGroup);
+ },
+ render: function () {
+ for (var i = 0; i < self.debugMessages.length; i++) {
+ self.game.debug.text(self.debugMessages[i].getMessage(), self.debugMessages[i].x, self.debugMessages[i].y);
+ }
+ }
+ };
+ this.game.state.add('Boot', this.bootState);
+ this.game.state.start('Boot');
+ }
+ MarGame.prototype.addDebugMessage = function (debugMsg) {
+ this.debugMessages.push(debugMsg);
+ };
+ MarGame.prototype.initialiseAnimations = function () {
+ //Walk =-------------------------------------------------------
+ //East
+ this.animationFrames.walk_e_start = [];
+ for (var i = 0; i < 10; i++) {
+ this.animationFrames.walk_e_start.push("cubot/walk_e/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.walk_e = [];
+ for (var i = 10; i < 30; i++) {
+ this.animationFrames.walk_e.push("cubot/walk_e/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_e_start = [];
+ for (var i = 0; i < 10; i++) {
+ this.animationFrames.harvester_walk_e_start.push("harvester/walk_e/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_e = [];
+ for (var i = 10; i < 30; i++) {
+ this.animationFrames.harvester_walk_e.push("harvester/walk_e/" + ("0000" + i).slice(-4));
+ }
+ //North
+ this.animationFrames.walk_n_start = [];
+ for (var i = 0; i < 10; i++) {
+ this.animationFrames.walk_n_start.push("cubot/walk_n/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.walk_n = [];
+ for (var i = 10; i < 30; i++) {
+ this.animationFrames.walk_n.push("cubot/walk_n/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_n_start = [];
+ for (var i = 0; i < 10; i++) {
+ this.animationFrames.harvester_walk_n_start.push("harvester/walk_n/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_n = [];
+ for (var i = 10; i < 30; i++) {
+ this.animationFrames.harvester_walk_n.push("harvester/walk_n/" + ("0000" + i).slice(-4));
+ }
+ //South
+ this.animationFrames.walk_s_start = [];
+ for (var i = 0; i < 10; i++) {
+ this.animationFrames.walk_s_start.push("cubot/walk_s/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.walk_s = [];
+ for (var i = 10; i < 30; i++) {
+ this.animationFrames.walk_s.push("cubot/walk_s/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_s_start = [];
+ for (var i = 0; i < 10; i++) {
+ this.animationFrames.harvester_walk_s_start.push("harvester/walk_s/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_s = [];
+ for (var i = 10; i < 30; i++) {
+ this.animationFrames.harvester_walk_s.push("harvester/walk_s/" + ("0000" + i).slice(-4));
+ }
+ //West
+ this.animationFrames.walk_w_start = [];
+ for (var i = 0; i < 10; i++) {
+ this.animationFrames.walk_w_start.push("cubot/walk_w/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.walk_w = [];
+ for (var i = 10; i < 30; i++) {
+ this.animationFrames.walk_w.push("cubot/walk_w/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_w_start = [];
+ for (var i = 0; i < 10; i++) {
+ this.animationFrames.harvester_walk_w_start.push("harvester/walk_w/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_w = [];
+ for (var i = 10; i < 30; i++) {
+ this.animationFrames.harvester_walk_w.push("harvester/walk_w/" + ("0000" + i).slice(-4));
+ }
+ //Dig =-------------------------------------------------------
+ this.animationFrames.dig_e = [];
+ for (var i = 1; i <= 41; i++) {
+ this.animationFrames.dig_e.push("cubot/dig_e/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.dig_n = [];
+ for (var i = 1; i <= 41; i++) {
+ this.animationFrames.dig_n.push("cubot/dig_n/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.dig_s = [];
+ for (var i = 1; i <= 41; i++) {
+ this.animationFrames.dig_s.push("cubot/dig_s/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.dig_w = [];
+ for (var i = 1; i <= 41; i++) {
+ this.animationFrames.dig_w.push("cubot/dig_w/" + ("0000" + i).slice(-4));
+ }
+ //Biomass =-------------------------------------------------------
+ this.animationFrames.biomassIdle = [];
+ for (var i = 1; i < 60; i++) {
+ this.animationFrames.biomassIdle.push("objects/biomass/idle/" + ("0000" + i).slice(-4));
+ }
+ };
+ MarGame.prototype.initialiseStaticHud = function () {
+ this.game.add.sprite(0, this.game.camera.height - 150, "sheet", "ui/compass", this.hudGroup);
+ this.addDebugMessage(new WorldIndicator(10, 20));
+ this.tileIndicator = new TileIndicator(10, 40);
+ this.addDebugMessage(this.tileIndicator);
+ };
+ return MarGame;
+}());
+var DebugMessage = (function () {
+ function DebugMessage(x, y) {
+ this.x = x;
+ this.y = y;
+ }
+ return DebugMessage;
+}());
+var TileIndicator = (function (_super) {
+ __extends(TileIndicator, _super);
+ function TileIndicator() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ TileIndicator.prototype.getMessage = function () {
+ if (this.tileType != undefined) {
+ return this.tileX + ", " + this.tileY + " : " + this.tileType;
+ }
+ else {
+ return "";
+ }
+ };
+ return TileIndicator;
+}(DebugMessage));
+var WorldIndicator = (function (_super) {
+ __extends(WorldIndicator, _super);
+ function WorldIndicator() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ WorldIndicator.prototype.getMessage = function () {
+ if (mar.world != undefined) {
+ return "World: (" + Number(mar.client.worldX).toString(16).toUpperCase() + ", " +
+ Number(mar.client.worldY).toString(16).toUpperCase() + ")";
+ }
+ else {
+ return "Loading...";
+ }
+ };
+ return WorldIndicator;
+}(DebugMessage));
diff --git a/mar/phaser/MarGame.ts b/mar/phaser/MarGame.ts
new file mode 100644
index 0000000..1b9b54a
--- /dev/null
+++ b/mar/phaser/MarGame.ts
@@ -0,0 +1,318 @@
+class MarGame {
+
+ isoGroup: Phaser.Group;
+ textGroup: Phaser.Group;
+ hudGroup: Phaser.Group;
+ game: Phaser.Game;
+
+ cursorPos: Phaser.Plugin.Isometric.Point3 = new Phaser.Plugin.Isometric.Point3();
+
+ bootState;
+ client: GameClient;
+
+ debugMessages: DebugMessage[] = [];
+
+ world: World;
+
+ animationFrames: any = {};
+
+ tileIndicator: TileIndicator;
+
+ constructor() {
+
+ let self = this;
+ this.game = new Phaser.Game(RENDERER_WIDTH, RENDERER_HEIGHT, Phaser.AUTO, 'game', null, true, false);
+
+ this.bootState = {
+ preload: function () {
+ if (DEBUG) {
+ console.log("[MAR]Â Loading sprites.png as JSONHash");
+ }
+ this.game.load.atlasJSONHash("sheet", "./mar/sprites.png", "./mar/sprites.json").onLoadComplete.add(function () {
+ self.game.time.advancedTiming = true;
+
+ //Add and enable the isometric plug-in.
+ if (DEBUG) {
+ console.log("[MAR]Â Enabling isometric plugin");
+ }
+ self.game.plugins.add(new Phaser.Plugin.Isometric(self.game));
+
+ // This is used to set a game canvas-based offset for the 0, 0, 0 isometric coordinate - by default
+ // this point would be at screen coordinates 0, 0 (top left) which is usually undesirable.
+ self.game.iso.anchor.setTo(0.5, 0);
+ //Todo: set world size based on window size?
+ self.game.world.setBounds(0, 0, 2200, 1100);
+
+ //Make camera more or less centered (tested on 1080 screen)
+ self.game.camera.x = 280;
+ self.game.camera.y = 90;
+
+ self.game.scale.scaleMode = Phaser.ScaleManager.RESIZE;
+ self.game.scale.pageAlignHorizontally = true;
+ self.game.scale.pageAlignVertically = true;
+
+ self.game.stage.disableVisibilityChange = true;
+ self.client = new GameClient();
+
+ //Grab focus when clicked (For chrome, Opera)
+ self.game.input.onDown.add(function () {
+ document.getElementById("game").focus();
+
+ if (DEBUG) {
+ console.log("Grabbed focus of #game");
+ }
+ });
+
+ self.isoGroup = mar.game.add.group();
+ self.textGroup = mar.game.add.group();
+ self.hudGroup = mar.game.add.group();
+ self.hudGroup.fixedToCamera = true;
+ });
+ },
+
+ create: function () {
+
+ console.log("[MAR] create");
+
+ self.initialiseAnimations();
+ self.initialiseStaticHud();
+
+ },
+
+ update: function () {
+
+ self.game.scale.refresh();
+
+ // Update the cursor position.
+ self.game.iso.unproject(self.game.input.activePointer.position, self.cursorPos);
+
+ // Loop through all tiles and test to see if the 3D position from above intersects with the automatically generated IsoSprite tile bounds.
+ self.isoGroup.forEach(function (tile: Tile) {
+
+ if (tile instanceof Tile) {
+ let inBounds = tile.isoBounds.containsXY(self.cursorPos.x, self.cursorPos.y);
+ // If it does, do a little animation and tint change.
+ if (!tile.selected && inBounds) {
+ tile.selected = true;
+
+ tile.onHover();
+
+ //Dispatch tile over
+ self.isoGroup.forEach(function (obj: GameObject) {
+ if (obj instanceof GameObject && obj.onTileHover != undefined && obj.isAt(tile.tileX, tile.tileY)) {
+ obj.onTileHover();
+ }
+ }, 1);
+ }
+ // If not, revert back to how it was.
+ else if (tile.selected && !inBounds) {
+ tile.selected = false;
+ tile.onExit();
+
+ //Dispatch tile exit
+ self.isoGroup.forEach(function (obj: GameObject) {
+ if (obj.onTileExit != undefined && obj.isAt(tile.tileX, tile.tileY)) {
+ obj.onTileExit();
+ }
+ }, 0);
+ }
+ }
+
+ }, 0);
+
+ //Enable dragging the camera
+ if (this.game.input.activePointer.isDown) {
+ if (this.game.origDragPoint) {
+ // move the camera by the amount the mouse has moved since last update
+ this.game.camera.x += this.game.origDragPoint.x - this.game.input.activePointer.position.x;
+ this.game.camera.y += this.game.origDragPoint.y - this.game.input.activePointer.position.y;
+ }
+ // set new drag origin to current position
+ this.game.origDragPoint = this.game.input.activePointer.position.clone();
+
+ } else {
+ this.game.origDragPoint = null;
+ }
+
+ self.game.iso.topologicalSort(self.isoGroup);
+ },
+ render: function () {
+
+ for (let i = 0; i < self.debugMessages.length; i++) {
+ self.game.debug.text(self.debugMessages[i].getMessage(), self.debugMessages[i].x,
+ self.debugMessages[i].y)
+ }
+
+ }
+ };
+
+ this.game.state.add('Boot', this.bootState);
+ this.game.state.start('Boot');
+ }
+
+ public addDebugMessage(debugMsg: DebugMessage) {
+ this.debugMessages.push(debugMsg)
+ }
+
+ private initialiseAnimations() {
+ //Walk =-------------------------------------------------------
+ //East
+ this.animationFrames.walk_e_start = [];
+ for (let i = 0; i < 10; i++) {
+ this.animationFrames.walk_e_start.push("cubot/walk_e/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.walk_e = [];
+ for (let i = 10; i < 30; i++) {
+ this.animationFrames.walk_e.push("cubot/walk_e/" + ("0000" + i).slice(-4));
+ }
+
+ this.animationFrames.harvester_walk_e_start = [];
+ for (let i = 0; i < 10; i++) {
+ this.animationFrames.harvester_walk_e_start.push("harvester/walk_e/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_e = [];
+ for (let i = 10; i < 30; i++) {
+ this.animationFrames.harvester_walk_e.push("harvester/walk_e/" + ("0000" + i).slice(-4));
+ }
+ //North
+ this.animationFrames.walk_n_start = [];
+ for (let i = 0; i < 10; i++) {
+ this.animationFrames.walk_n_start.push("cubot/walk_n/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.walk_n = [];
+ for (let i = 10; i < 30; i++) {
+ this.animationFrames.walk_n.push("cubot/walk_n/" + ("0000" + i).slice(-4));
+ }
+
+ this.animationFrames.harvester_walk_n_start = [];
+ for (let i = 0; i < 10; i++) {
+ this.animationFrames.harvester_walk_n_start.push("harvester/walk_n/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_n = [];
+ for (let i = 10; i < 30; i++) {
+ this.animationFrames.harvester_walk_n.push("harvester/walk_n/" + ("0000" + i).slice(-4));
+ }
+ //South
+ this.animationFrames.walk_s_start = [];
+ for (let i = 0; i < 10; i++) {
+ this.animationFrames.walk_s_start.push("cubot/walk_s/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.walk_s = [];
+ for (let i = 10; i < 30; i++) {
+ this.animationFrames.walk_s.push("cubot/walk_s/" + ("0000" + i).slice(-4));
+ }
+
+ this.animationFrames.harvester_walk_s_start = [];
+ for (let i = 0; i < 10; i++) {
+ this.animationFrames.harvester_walk_s_start.push("harvester/walk_s/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_s = [];
+ for (let i = 10; i < 30; i++) {
+ this.animationFrames.harvester_walk_s.push("harvester/walk_s/" + ("0000" + i).slice(-4));
+ }
+ //West
+ this.animationFrames.walk_w_start = [];
+ for (let i = 0; i < 10; i++) {
+ this.animationFrames.walk_w_start.push("cubot/walk_w/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.walk_w = [];
+ for (let i = 10; i < 30; i++) {
+ this.animationFrames.walk_w.push("cubot/walk_w/" + ("0000" + i).slice(-4));
+ }
+
+ this.animationFrames.harvester_walk_w_start = [];
+ for (let i = 0; i < 10; i++) {
+ this.animationFrames.harvester_walk_w_start.push("harvester/walk_w/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.harvester_walk_w = [];
+ for (let i = 10; i < 30; i++) {
+ this.animationFrames.harvester_walk_w.push("harvester/walk_w/" + ("0000" + i).slice(-4));
+ }
+
+ //Dig =-------------------------------------------------------
+ this.animationFrames.dig_e = [];
+ for (let i = 1; i <= 41; i++) {
+ this.animationFrames.dig_e.push("cubot/dig_e/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.dig_n = [];
+ for (let i = 1; i <= 41; i++) {
+ this.animationFrames.dig_n.push("cubot/dig_n/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.dig_s = [];
+ for (let i = 1; i <= 41; i++) {
+ this.animationFrames.dig_s.push("cubot/dig_s/" + ("0000" + i).slice(-4));
+ }
+ this.animationFrames.dig_w = [];
+ for (let i = 1; i <= 41; i++) {
+ this.animationFrames.dig_w.push("cubot/dig_w/" + ("0000" + i).slice(-4));
+ }
+
+ //Biomass =-------------------------------------------------------
+ this.animationFrames.biomassIdle = [];
+ for (let i = 1; i < 60; i++) {
+ this.animationFrames.biomassIdle.push("objects/biomass/idle/" + ("0000" + i).slice(-4));
+ }
+ }
+
+ private initialiseStaticHud() {
+
+ this.game.add.sprite(0, this.game.camera.height - 150, "sheet", "ui/compass", this.hudGroup);
+
+ this.addDebugMessage(new WorldIndicator(10, 20));
+
+ this.tileIndicator = new TileIndicator(10, 40);
+ this.addDebugMessage(this.tileIndicator);
+ }
+
+}
+
+abstract class DebugMessage {
+
+
+ public x: number;
+ public y: number;
+
+
+ constructor(x: number, y: number) {
+ this.x = x;
+ this.y = y;
+ }
+
+ abstract getMessage(): string;
+}
+
+class TileIndicator extends DebugMessage {
+
+ public tileType: string;
+ public tileX: number;
+ public tileY: number;
+
+ getMessage(): string {
+
+
+ if (this.tileType != undefined) {
+
+ return this.tileX + ", " + this.tileY + " : " + this.tileType;
+
+ } else {
+ return "";
+ }
+
+ }
+}
+
+class WorldIndicator extends DebugMessage {
+
+ getMessage(): string {
+
+ if (mar.world != undefined) {
+
+ return "World: (" + Number(mar.client.worldX).toString(16).toUpperCase() + ", " +
+ Number(mar.client.worldY).toString(16).toUpperCase() + ")";
+
+ } else {
+ return "Loading..."
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/mar/phaser/World.js b/mar/phaser/World.js
new file mode 100644
index 0000000..9ba2102
--- /dev/null
+++ b/mar/phaser/World.js
@@ -0,0 +1,278 @@
+///
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+var instances = PIXI.instances;
+var Direction;
+(function (Direction) {
+ Direction[Direction["NORTH"] = 0] = "NORTH";
+ Direction[Direction["EAST"] = 1] = "EAST";
+ Direction[Direction["SOUTH"] = 2] = "SOUTH";
+ Direction[Direction["WEST"] = 3] = "WEST";
+})(Direction || (Direction = {}));
+var Tile = (function (_super) {
+ __extends(Tile, _super);
+ function Tile(x, y, sprite, anchorY) {
+ var _this = _super.call(this, mar.game, Util.getIsoX(x), Util.getIsoY(y), 0, 'sheet', sprite) || this;
+ _this.baseZ = 0; //Base height of the tile
+ _this.tileX = x;
+ _this.tileY = y;
+ _this.anchor.set(0.5, anchorY);
+ return _this;
+ }
+ /**
+ * Factory method to create a Tile
+ */
+ Tile.createTile = function (type, x, y) {
+ switch (type) {
+ case TileType.WALL:
+ return new WallTile(x, y);
+ case TileType.IRON:
+ return new IronTile(x, y);
+ case TileType.COPPER:
+ return new CopperTile(x, y);
+ case TileType.PLAIN:
+ default:
+ return new PlainTile(x, y);
+ }
+ };
+ Tile.prototype.onHover = function () {
+ this.tint = config.tileHoverTint;
+ mar.game.add.tween(this).to({ isoZ: this.baseZ + 8 }, 200, Phaser.Easing.Quadratic.InOut, true);
+ mar.tileIndicator.tileX = this.tileX;
+ mar.tileIndicator.tileY = this.tileY;
+ mar.tileIndicator.tileType = this.tileType;
+ };
+ Tile.prototype.onExit = function () {
+ this.tint = this.baseTint;
+ mar.game.add.tween(this).to({ isoZ: this.baseZ }, 200, Phaser.Easing.Quadratic.InOut, true);
+ };
+ Tile.prototype.setText = function (text, fillColor) {
+ //Remove previous text
+ if (this.textSprite !== undefined) {
+ this.textSprite.destroy();
+ }
+ this.textSprite = mar.game.make.text(0, 16, text, {
+ fontSize: 22,
+ fill: fillColor,
+ stroke: "#FFFFFF",
+ strokeThickness: 1,
+ font: "fixedsys"
+ });
+ this.textSprite.alpha = 0.6;
+ this.textSprite.anchor.set(0.5, 0);
+ this.addChild(this.textSprite);
+ };
+ return Tile;
+}(Phaser.Plugin.Isometric.IsoSprite));
+var PlainTile = (function (_super) {
+ __extends(PlainTile, _super);
+ function PlainTile(x, y) {
+ var _this = _super.call(this, x, y, config.plainSprite, 0) || this;
+ _this.baseTint = config.tileTint;
+ _this.tint = _this.baseTint;
+ _this.tileType = "plain";
+ return _this;
+ }
+ return PlainTile;
+}(Tile));
+var WallTile = (function (_super) {
+ __extends(WallTile, _super);
+ function WallTile(x, y) {
+ var _this = _super.call(this, x, y, config.wallSprite, 0.2) || this;
+ _this.baseTint = config.wallTint;
+ _this.tint = _this.baseTint;
+ _this.tileType = "wall";
+ return _this;
+ }
+ return WallTile;
+}(Tile));
+var IronTile = (function (_super) {
+ __extends(IronTile, _super);
+ function IronTile(x, y) {
+ var _this = _super.call(this, x, y, config.plainSprite, 0) || this;
+ _this.baseTint = config.oreTint;
+ _this.tint = _this.baseTint;
+ _this.setText("Iron", config.textIron);
+ _this.tileType = "iron";
+ return _this;
+ }
+ return IronTile;
+}(Tile));
+var CopperTile = (function (_super) {
+ __extends(CopperTile, _super);
+ function CopperTile(x, y) {
+ var _this = _super.call(this, x, y, config.plainSprite, 0) || this;
+ _this.baseTint = config.oreTint;
+ _this.tint = _this.baseTint;
+ _this.setText("Copper", config.textCopper);
+ _this.tileType = "copper";
+ return _this;
+ }
+ return CopperTile;
+}(Tile));
+var World = (function () {
+ function World(terrain) {
+ this.tiles = [];
+ this.objects = [];
+ //Create tilemap
+ this.setTerrain(terrain);
+ //Setup World Arrows
+ mar.isoGroup.add(new WorldArrow(528, -10, "ui/arrow_north", Direction.NORTH));
+ mar.isoGroup.add(new WorldArrow(1115, 587, "ui/arrow_east", Direction.EAST));
+ mar.isoGroup.add(new WorldArrow(528, 1170, "ui/arrow_south", Direction.SOUTH));
+ mar.isoGroup.add(new WorldArrow(-60, 587, "ui/arrow_west", Direction.WEST));
+ }
+ /**
+ * Load terrain data from array and create Tiles
+ * @param terrain
+ */
+ World.prototype.setTerrain = function (terrain) {
+ if (DEBUG) {
+ console.log("[MAR] Creating tilemap");
+ }
+ for (var x = 0; x < config.worldSize; x++) {
+ for (var y = 0; y < config.worldSize; y++) {
+ var tile = Tile.createTile(terrain[y * config.worldSize + x], x, y);
+ this.tiles.push(tile);
+ mar.isoGroup.add(tile);
+ }
+ }
+ };
+ World.prototype.setBigMessage = function (msg) {
+ this.bigMessage = mar.game.add.text(908, 450, msg, {
+ fontSize: 46,
+ fill: config.bigMessageFill,
+ stroke: config.textStroke,
+ strokeThickness: 2,
+ font: "fixedsys"
+ }, mar.textGroup);
+ };
+ World.prototype.removeBigMessage = function () {
+ if (this.bigMessage != undefined) {
+ this.bigMessage.destroy();
+ if (DEBUG) {
+ console.log("[MAR] Destroyed big message");
+ }
+ }
+ };
+ /**
+ * Get object by id
+ */
+ World.prototype.getObject = function (id) {
+ for (var i = 0; i < this.objects.length; i++) {
+ if (this.objects[i].id === id) {
+ return this.objects[i];
+ }
+ }
+ return null;
+ };
+ /**
+ * Update, create or delete the current objects based on a list received from the server
+ * @param objects json list of objects
+ */
+ World.prototype.handleObjectsUpdate = function (objects) {
+ //Mark objects as not updated
+ for (var i = 0; i < this.objects.length; i++) {
+ this.objects[i].updated = false;
+ }
+ for (var i = 0; i < objects.length; i++) {
+ //Update/Create the object
+ var existingObject = this.getObject(objects[i].i);
+ if (existingObject !== null) {
+ //Object already exists
+ existingObject.updated = true;
+ existingObject.updateObject(objects[i]);
+ }
+ else {
+ //Object is new
+ var newObj = GameObject.createObject(objects[i]);
+ if (newObj != null) {
+ newObj.updated = true;
+ this.objects.push(newObj);
+ mar.isoGroup.add(newObj);
+ }
+ else {
+ if (DEBUG) {
+ console.log("Couldn't create object with objType " + objects[i].t);
+ }
+ }
+ }
+ }
+ //Delete not updated objects (see above comments)
+ for (var i = 0; i < this.objects.length; i++) {
+ if (!this.objects[i].updated) {
+ //Check if the object we are removing is our controlledUnit, if so, follow it
+ if (mar.client.username !== "guest") {
+ if (this.objects[i] instanceof Cubot && this.objects[i].username === mar.client.username) {
+ mar.client.findMyRobot();
+ if (DEBUG) {
+ console.log("[MAR] Following Cubot " + mar.client.username);
+ }
+ }
+ }
+ this.objects[i].destroy();
+ this.objects.splice(i, 1);
+ }
+ }
+ };
+ /**
+ * Delete current ojects and tiles and replace them with provided terrain
+ * @param terrain
+ */
+ World.prototype.updateTerrain = function (terrain) {
+ for (var i = 0; i < this.objects.length; i++) {
+ this.objects[i].destroy();
+ }
+ for (var i = 0; i < this.tiles.length; i++) {
+ this.tiles[i].destroy();
+ }
+ this.objects = [];
+ this.tiles = [];
+ this.setTerrain(terrain);
+ mar.game.iso.topologicalSort(mar.isoGroup);
+ };
+ return World;
+}());
+/**
+ * Represents a 'button' sprite that changes world in a direction
+ */
+var WorldArrow = (function (_super) {
+ __extends(WorldArrow, _super);
+ function WorldArrow(x, y, frame, direction) {
+ var _this = _super.call(this, mar.game, x, y, 10, "sheet", frame) || this;
+ var self = _this;
+ _this.hoverText = mar.game.make.text(10, 10, Direction[direction], config.arrowTextStyle);
+ _this.addChild(_this.hoverText);
+ _this.hoverText.visible = false;
+ _this.hoverText.anchor.set(0, 0);
+ _this.inputEnabled = true;
+ _this.events.onInputDown.add(function () {
+ var newX = mar.client.worldX + Util.getDeltaX(direction);
+ var newY = mar.client.worldY + Util.getDeltaY(direction);
+ //Wrapping coordinates around cyclically
+ mar.client.worldX = newX % mar.client.maxWidth;
+ mar.client.worldY = newY % mar.client.maxWidth;
+ mar.client.requestTerrain();
+ });
+ _this.events.onInputOver.add(function () {
+ self.tint = config.arrowHoverTint;
+ self.hoverText.visible = true;
+ document.body.style.cursor = "pointer";
+ });
+ _this.events.onInputOut.add(function () {
+ self.tint = config.arrowTint;
+ self.hoverText.visible = false;
+ document.body.style.cursor = "default";
+ });
+ return _this;
+ }
+ return WorldArrow;
+}(Phaser.Plugin.Isometric.IsoSprite));
diff --git a/mar/phaser/World.ts b/mar/phaser/World.ts
new file mode 100644
index 0000000..40623ed
--- /dev/null
+++ b/mar/phaser/World.ts
@@ -0,0 +1,351 @@
+///
+
+import instances = PIXI.instances;
+
+enum Direction {
+ NORTH,
+ EAST,
+ SOUTH,
+ WEST
+}
+
+
+class Tile extends Phaser.Plugin.Isometric.IsoSprite {
+
+ /**
+ * Text displayed on the tile
+ */
+ textSprite: Phaser.Text;
+ baseTint: number;
+ tileX: number;
+ tileY: number;
+
+ /**
+ * Displayed on the screen
+ */
+ tileType: string;
+
+ /**
+ * Based z coordinate of the tile
+ */
+ private baseZ: number;
+
+ public selected: boolean;
+
+ protected constructor(x: number, y: number, sprite: string, anchorY: number) {
+
+ super(mar.game, Util.getIsoX(x), Util.getIsoY(y), 0, 'sheet', sprite);
+
+ this.baseZ = 0; //Base height of the tile
+
+ this.tileX = x;
+ this.tileY = y;
+
+ this.anchor.set(0.5, anchorY);
+ }
+
+ /**
+ * Factory method to create a Tile
+ */
+ public static createTile(type: TileType, x: number, y: number) {
+ switch (type) {
+
+
+ case TileType.WALL:
+ return new WallTile(x, y);
+ case TileType.IRON:
+ return new IronTile(x, y);
+ case TileType.COPPER:
+ return new CopperTile(x, y);
+ case TileType.PLAIN:
+ default:
+ return new PlainTile(x, y);
+
+ }
+ }
+
+ public onHover() {
+ this.tint = config.tileHoverTint;
+ mar.game.add.tween(this).to({isoZ: this.baseZ + 8}, 200, Phaser.Easing.Quadratic.InOut, true);
+
+ mar.tileIndicator.tileX = this.tileX;
+ mar.tileIndicator.tileY = this.tileY;
+ mar.tileIndicator.tileType = this.tileType;
+ }
+
+ public onExit() {
+ this.tint = this.baseTint;
+ mar.game.add.tween(this).to({isoZ: this.baseZ}, 200, Phaser.Easing.Quadratic.InOut, true);
+ }
+
+ public setText(text: string, fillColor: string): void {
+
+ //Remove previous text
+ if (this.textSprite !== undefined) {
+ this.textSprite.destroy();
+ }
+
+ this.textSprite = mar.game.make.text(0, 16, text, {
+ fontSize: 22,
+ fill: fillColor,
+ stroke: "#FFFFFF",
+ strokeThickness: 1,
+ font: "fixedsys"
+ });
+
+ this.textSprite.alpha = 0.6;
+ this.textSprite.anchor.set(0.5, 0);
+ this.addChild(this.textSprite);
+ }
+}
+
+class PlainTile extends Tile {
+
+
+ constructor(x: number, y: number) {
+ super(x, y, config.plainSprite, 0);
+
+ this.baseTint = config.tileTint;
+ this.tint = this.baseTint;
+ this.tileType = "plain";
+ }
+}
+
+class WallTile extends Tile {
+ constructor(x: number, y: number) {
+ super(x, y, config.wallSprite, 0.2);
+
+ this.baseTint = config.wallTint;
+ this.tint = this.baseTint;
+ this.tileType = "wall";
+
+ }
+}
+
+class IronTile extends Tile {
+ constructor(x: number, y: number) {
+ super(x, y, config.plainSprite, 0);
+
+ this.baseTint = config.oreTint;
+ this.tint = this.baseTint;
+
+ this.setText("Iron", config.textIron);
+ this.tileType = "iron";
+ }
+}
+
+
+class CopperTile extends Tile {
+ constructor(x: number, y: number) {
+ super(x, y, config.plainSprite, 0);
+
+ this.baseTint = config.oreTint;
+ this.tint = this.baseTint;
+
+ this.setText("Copper", config.textCopper);
+ this.tileType = "copper";
+ }
+}
+
+class World {
+
+ private tiles: Tile[] = [];
+ private objects: GameObject[] = [];
+
+ /**
+ * Message displayed in the middle of the World
+ */
+ private bigMessage: Phaser.Text;
+
+ constructor(terrain) {
+
+ //Create tilemap
+ this.setTerrain(terrain);
+
+ //Setup World Arrows
+ mar.isoGroup.add(new WorldArrow(528, -10, "ui/arrow_north", Direction.NORTH));
+ mar.isoGroup.add(new WorldArrow(1115, 587, "ui/arrow_east", Direction.EAST));
+ mar.isoGroup.add(new WorldArrow(528, 1170, "ui/arrow_south", Direction.SOUTH));
+ mar.isoGroup.add(new WorldArrow(-60, 587, "ui/arrow_west", Direction.WEST));
+ }
+
+ /**
+ * Load terrain data from array and create Tiles
+ * @param terrain
+ */
+ private setTerrain(terrain: number[]) {
+ if (DEBUG) {
+ console.log("[MAR] Creating tilemap");
+ }
+
+ for (let x = 0; x < config.worldSize; x++) {
+ for (let y = 0; y < config.worldSize; y++) {
+
+ let tile: Tile = Tile.createTile(terrain[y * config.worldSize + x], x, y);
+
+ this.tiles.push(tile);
+ mar.isoGroup.add(tile);
+
+ }
+ }
+ }
+
+ public setBigMessage(msg: string) {
+ this.bigMessage = mar.game.add.text(908, 450, msg, {
+ fontSize: 46,
+ fill: config.bigMessageFill,
+ stroke: config.textStroke,
+ strokeThickness: 2,
+ font: "fixedsys"
+ }, mar.textGroup);
+ }
+
+ public removeBigMessage() {
+ if (this.bigMessage != undefined) {
+ this.bigMessage.destroy();
+
+ if (DEBUG) {
+ console.log("[MAR] Destroyed big message")
+ }
+ }
+ }
+
+ /**
+ * Get object by id
+ */
+ private getObject(id: number): GameObject {
+
+ for (let i = 0; i < this.objects.length; i++) {
+ if (this.objects[i].id === id) {
+ return this.objects[i];
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Update, create or delete the current objects based on a list received from the server
+ * @param objects json list of objects
+ */
+ public handleObjectsUpdate(objects: any) {
+
+ //Mark objects as not updated
+ for (let i = 0; i < this.objects.length; i++) {
+ this.objects[i].updated = false;
+ }
+
+ for (let i = 0; i < objects.length; i++) {
+
+ //Update/Create the object
+ let existingObject = this.getObject(objects[i].i);
+
+ if (existingObject !== null) {
+ //Object already exists
+ existingObject.updated = true;
+ existingObject.updateObject(objects[i]);
+
+ } else {
+
+ //Object is new
+ let newObj = GameObject.createObject(objects[i]);
+ if (newObj != null) {
+ newObj.updated = true;
+ this.objects.push(newObj);
+
+ mar.isoGroup.add(newObj);
+ } else {
+ if (DEBUG) {
+ console.log("Couldn't create object with objType " + objects[i].t)
+ }
+ }
+
+ }
+ }
+
+ //Delete not updated objects (see above comments)
+ for (let i = 0; i < this.objects.length; i++) {
+ if (!this.objects[i].updated) {
+
+ //Check if the object we are removing is our controlledUnit, if so, follow it
+ if (mar.client.username !== "guest") {
+ if (this.objects[i] instanceof Cubot && (this.objects[i] as Cubot).username === mar.client.username) {
+ mar.client.findMyRobot();
+ if (DEBUG) {
+ console.log("[MAR] Following Cubot " + mar.client.username)
+ }
+ }
+ }
+
+ this.objects[i].destroy();
+ this.objects.splice(i, 1);
+ }
+ }
+
+ }
+
+ /**
+ * Delete current ojects and tiles and replace them with provided terrain
+ * @param terrain
+ */
+ public updateTerrain(terrain: number[]) {
+
+ for (let i = 0; i < this.objects.length; i++) {
+ this.objects[i].destroy();
+ }
+
+ for (let i = 0; i < this.tiles.length; i++) {
+ this.tiles[i].destroy();
+ }
+ this.objects = [];
+ this.tiles = [];
+
+ this.setTerrain(terrain);
+ mar.game.iso.topologicalSort(mar.isoGroup);
+ }
+}
+
+/**
+ * Represents a 'button' sprite that changes world in a direction
+ */
+class WorldArrow extends Phaser.Plugin.Isometric.IsoSprite {
+
+ private hoverText: Phaser.Text;
+
+ constructor(x: number, y: number, frame: string, direction: Direction) {
+ super(mar.game, x, y, 10, "sheet", frame);
+
+ let self = this;
+
+ this.hoverText = mar.game.make.text(10, 10, Direction[direction], config.arrowTextStyle);
+ this.addChild(this.hoverText);
+ this.hoverText.visible = false;
+ this.hoverText.anchor.set(0, 0);
+
+ this.inputEnabled = true;
+ this.events.onInputDown.add(function () {
+
+ let newX = mar.client.worldX + Util.getDeltaX(direction);
+ let newY = mar.client.worldY + Util.getDeltaY(direction);
+
+ //Wrapping coordinates around cyclically
+ mar.client.worldX = newX % mar.client.maxWidth;
+ mar.client.worldY = newY % mar.client.maxWidth;
+
+ mar.client.requestTerrain();
+ });
+
+ this.events.onInputOver.add(function () {
+ self.tint = config.arrowHoverTint;
+ self.hoverText.visible = true;
+ document.body.style.cursor = "pointer";
+ });
+
+ this.events.onInputOut.add(function () {
+ self.tint = config.arrowTint;
+ self.hoverText.visible = false;
+ document.body.style.cursor = "default";
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/mar/phaser/mar.js b/mar/phaser/mar.js
index fc453ea..0fc0ff4 100644
--- a/mar/phaser/mar.js
+++ b/mar/phaser/mar.js
@@ -1,14 +1,14 @@
-DIR_NORTH = 0;
-DIR_EAST = 1;
-DIR_SOUTH = 2;
-DIR_WEST = 3;
-
-WORLD_HEIGHT = WORLD_WIDTH = 16;
-
-
-var colorScheme = {
+///
+///
+// Typescript V2.4.1
+var RENDERER_WIDTH = document.getElementById("game").clientWidth * window.devicePixelRatio;
+var RENDERER_HEIGHT = (window.innerHeight / 1.40) * window.devicePixelRatio;
+var DEBUG = true;
+var config = {
tileTint: 0xFFFFFF,
wallTint: 0xDDDDDD,
+ oreTint: 0xF3F3F3,
+ worldSize: 16,
cubotHoverTint: 0x00FF00,
cubotTint: 0xFFFFFF,
textFill: "#FFFFFF",
@@ -17,1686 +17,80 @@ var colorScheme = {
biomassHoverTint: 0x00FF00,
tileHoverTint: 0x00FF00,
itemIron: 0x434341,
+ textIron: "#434341",
itemCopper: 0xC87D38,
+ textCopper: "#C87D38",
hologramFill: "#0aced6",
hologramStroke: "#12FFB0",
- hologramAlpha: 0.9
-};
-
-var mar = {};
-mar.kbBuffer = [];
-mar.kbBufferText = "";
-mar.animationFrames = {};
-mar.controlledUnitVisible = false;
-mar.lastLines = "";
-mar.bigMessage = "";
-
-CUBOT_WALK_FRAMES = {
- south: 240,
- north: 194,
- west: 254,
- east: 164
-};
-
-HARVESTER_WALK_FRAMES = {
- south: 347,
- north: 317,
- west: 377,
- east: 287
-};
-
-LOW_ENERGY = 100;
-
-
-if (fullscreen) {
- RENDERER_WIDTH = window.innerWidth* window.devicePixelRatio - 4;
- RENDERER_HEIGHT = window.innerHeight* window.devicePixelRatio - 4;
-} else {
- RENDERER_WIDTH = document.getElementById("game").clientWidth * window.devicePixelRatio;
- RENDERER_HEIGHT = (window.innerHeight / 1.40) * window.devicePixelRatio;
-}
-
-var game = new Phaser.Game(RENDERER_WIDTH, RENDERER_HEIGHT, Phaser.AUTO, 'game', null, true, false);
-
-function dispatchTileLeave(x, y) {
-
- for (var i = 0; i < mar.world.tiles.length; i++) {
-
- var tX = mar.world.tiles[i].tileX;
- var tY = mar.world.tiles[i].tileY;
-
-
- if (mar.world.tiles[i].isWall && ((tX === x && tY - 1 === y ) || (tX - 1 === x && tY - 1 === y) || (tX - 1 === x && tY === y ))
- && mar.world.tiles[i].alpha !== 1) {
-
- game.add.tween(mar.world.tiles[i]).to({alpha: 1}, 175, Phaser.Easing.Quadratic.In, true);
- }
- }
-
-}
-
-function dispatchTileEnter(x, y) {
-
- /*
- * X X X
- * X C T
- * X T T
- *
- * Transparent, X: Normal, C: Cubot
- */
-
- for (var i = 0; i < mar.world.tiles.length; i++) {
-
- var tX = mar.world.tiles[i].tileX;
- var tY = mar.world.tiles[i].tileY;
-
-
- if (mar.world.tiles[i].isWall && ((tX === x && tY - 1 === y ) || (tX - 1 === x && tY - 1 === y) || (tX - 1 === x && tY === y ))) {
- game.add.tween(mar.world.tiles[i]).to({alpha: 0.6}, 300, Phaser.Easing.Quadratic.In, true);
- }
- }
-
-}
-
-function Word(terrain) {
-
- var self = this;
-
- self.tiles = [];
- self.objects = [];
-
- setupWorldArrows();
-
- this.setTerrain = function (terrain) {
- for (var x = 0; x < WORLD_HEIGHT; x++) {
- for (var y = 0; y < WORLD_HEIGHT; y++) {
-
- var terrainType = terrain[y * WORLD_WIDTH + x];
- if (terrainType === 1) {
- var tile = game.add.isoSprite(getIsoX(x), getIsoY(y), 0, 'sheet', "tiles/bigTile", isoGroup);
- tile.baseZ = 0;
- tile.baseTint = colorScheme.wallTint;
- tile.anchor.set(0.5, 0.2);
- tile.isWall = true;
-
- } else if (terrainType === 2) {
-
- tile = game.add.isoSprite(getIsoX(x), getIsoY(y), 0, 'sheet', "tiles/tile", isoGroup);
- text = game.make.text(0, 16, "Iron", {
- fontSize: 22,
- fill: "#434341",
- stroke: "#FFFFFF",
- strokeThickness: 1,
- font: "fixedsys"
- });
- text.alpha = 0.6;
- text.anchor.set(0.5, 0);
- tile.addChild(text);
- tile.baseZ = 0;
- // tile.baseTint = 0x434341;
- tile.baseTint = 0xF3F3F3;
- tile.anchor.set(0.5, 0);
- } else if (terrainType === 3) {
- tile = game.add.isoSprite(getIsoX(x), getIsoY(y), 0, 'sheet', "tiles/tile", isoGroup);
- var text = game.make.text(0, 16, "Copper", {
- fontSize: 22,
- fill: "#C87D38",
- stroke: "#FFFFFF",
- strokeThickness: 1,
- font: "fixedsys"
- });
- text.alpha = 0.6;
- text.anchor.set(0.5, 0);
- tile.addChild(text);
- tile.baseZ = 0;
- tile.baseTint = 0xF3F3F3;
- tile.anchor.set(0.5, 0);
- } else {
- tile = game.add.isoSprite(getIsoX(x), getIsoY(y), 0, 'sheet', "tiles/tile", isoGroup);
- tile.baseZ = 0;
- tile.baseTint = colorScheme.tileTint;
- tile.anchor.set(0.5, 0);
- }
-
- tile.isTile = true;
-
- tile.tileX = x;
- tile.tileY = y;
-
- tile.tint = tile.baseTint;
-
- self.tiles.push(tile);
- }
- }
- };
-
- this.setTerrain(terrain);
-
- this.update = function (terrain) {
-
-
- for (var i = 0; i < mar.world.objects.length; i++) {
- mar.world.objects[i].destroy();
- }
-
- for (var i = 0; i < mar.world.tiles.length; i++) {
- mar.world.tiles[i].destroy();
- }
-
- mar.world.objects = [];
- mar.world.tiles = [];
-
- this.setTerrain(terrain);
- game.iso.topologicalSort(isoGroup);
-
-
- };
-
- /**
- * Get object from the list of 'current' objects (Objects shown on the screen)
- * @param id objectId of the object
- */
- this.getObject = function (id) {
-
- for (var i = 0; i < self.objects.length; i++) {
- if (self.objects[i].id === id) {
- return self.objects[i];
- }
- }
-
- return null;
- };
-
- /**
- * Update object from parsed JSON string sent from the server
- * @param response parsed JSON string sent from the server
- */
- this.updateObjects = function (response) {
-
- //Mark objects as not updated
- for (i = 0; i < self.objects.length; i++) {
- self.objects[i].updated = false;
- }
-
- for (var i = 0; i < response.length; i++) {
-
- //Update/Create the object
- var existingObject = self.getObject(response[i].i);
-
- if (existingObject !== null) {
- //Object already exists
- existingObject.updated = true;
-
- // console.log("Update " + existingObject.id);
- existingObject = updateGameObject(existingObject, response[i]);
-
- } else {
-
- //Object is new
- var newObj = createGameObject(response[i]);
- newObj.updated = true;
- self.objects.push(newObj);
- }
- }
-
- //Delete not updated objects (see above comments)
- for (var i = 0; i < self.objects.length; i++) {
- if (!self.objects[i].updated) {
-
-
- //Check if the object we are removing is our controlledUnit, if so, follow it
- if (mar.client.username !== "guest") {
- if (self.objects[i].type === 1 && self.objects[i].username === mar.client.username) {
- findMyRobot();
- console.log("Following Cubot " + mar.client.username)
- }
- }
-
- self.objects[i].destroy();
-
- dispatchTileLeave(self.objects[i].tileX, self.objects[i].tileY);
- self.objects.splice(i, 1);
- }
- }
- };
-
-}
-
-function updateGameObject(object, responseObj) {
-
- object.direction = responseObj.direction;
-
-
- if (object.type === 1) {
-
- object.action = responseObj.action;
- object.energy = responseObj.energy;
-
- //Update location
- if ((object.tileX !== responseObj.x || object.tileY !== responseObj.y)) {
- //location changed
-
- //Walk
- if (object.action === 2) {
- dispatchTileLeave(object.tileX, object.tileY);
-
- object.tileX = responseObj.x;
- object.tileY = responseObj.y;
-
- cubotMove(object, object.direction, undefined, CUBOT_WALK_FRAMES);
- } else if (object.action === 6) {
- //Jump
- dispatchTileLeave(object.tileX, object.tileY);
-
- object.tileX = responseObj.x;
- object.tileY = responseObj.y;
-
- cubotMove(object, object.direction, undefined, CUBOT_WALK_FRAMES, true);
- }
-
- }
-
- //Update Inventory
- if (object.heldItem !== responseObj.heldItem) {
-
- if (object.inventory !== undefined) {
- object.inventory.destroy();
- }
-
- object.inventory = createInventory([responseObj.heldItem]);
- object.addChild(object.inventory);
- object.heldItem = responseObj.heldItem;
-
- }
-
- //Battery indication
- if (object.tint !== colorScheme.cubotHoverTint) {
- if (object.energy <= LOW_ENERGY) {
- object.tint = 0xFF0000;
- } else {
- object.tint = 0xFFFFFF;
- }
- }
-
-
- //Update direction
- switch (object.direction) {
- case DIR_NORTH:
- object.animations.frame = 194;
- break;
- case DIR_EAST:
- object.animations.frame = 164;
- break;
- case DIR_SOUTH:
- object.animations.frame = 240;
- break;
- case DIR_WEST:
- object.animations.frame = 254;
- break;
- }
-
- //Update hologram
- if (object.hologram !== undefined) {
- object.hologram.destroy();
- }
-
- var color = false;
- if (responseObj.holoC) {
- color = (responseObj.holoC & 0xFFFFFF).toString(16)
- color = "#" + ("000000".substr(color.length) + color);
- }
-
- if (responseObj.holoMode === 1) {
- //Hex
- object.hologram = game.make.text(0, 32, "0x" + ("0000" + Number(responseObj.holo).toString(16).toUpperCase()).slice(-4), {
- fontSize: 32,
- fill: color ? color : colorScheme.hologramFill,
- stroke: colorScheme.hologramStroke,
- strokeThickness: 1,
- font: "fixedsys"
- });
-
- console.log(Number(color).toString(16))
-
- } else if (responseObj.holoMode === 2) {
- //String
- object.hologram = game.make.text(0, 32, responseObj.holoStr.replace(/[\n|\t]/g, ''), {
- fontSize: 27,
- fill: color ? color : colorScheme.hologramFill,
- stroke: colorScheme.hologramStroke,
- strokeThickness: 1,
- font: "fixedsys"
- });
-
- } else if (responseObj.holoMode === 3) {
- //Decimal
- object.hologram = game.make.text(0, 32, Number(responseObj.holo).toString(), {
- fontSize: 32,
- fill: color ? color : colorScheme.hologramFill,
- stroke: colorScheme.hologramStroke,
- strokeThickness: 1,
- font: "fixedsys"
- });
- }
-
- if (object.hologram !== undefined) {
- object.hologram.alpha = colorScheme.hologramAlpha;
- object.hologram.anchor.set(0.5, 0);
- object.addChild(object.hologram);
-
- game.add.tween(object.hologram).to({tint: 0xFFFFF0, alpha: colorScheme.hologramAlpha - 0.1},
- mar.client.tickLength, Phaser.Easing.Bounce.In, true);
- }
-
-
- if (object.action === 1) {
- //Dig
- cubotDig(object, object.direction);
- }
- } else if (object.type === 10) {
- object.action = responseObj.action;
-
- //Update location
- if ((object.tileX !== responseObj.x || object.tileY !== responseObj.y)) {
- //location changed
- dispatchTileLeave(object.tileX, object.tileY);
-
- object.tileX = responseObj.x;
- object.tileY = responseObj.y;
- cubotMove(object, object.direction, undefined, HARVESTER_WALK_FRAMES);
- }
-
- //Update direction
- switch (object.direction) {
- case DIR_NORTH:
- object.animations.frame = HARVESTER_WALK_FRAMES.north;
- break;
- case DIR_EAST:
- object.animations.frame = HARVESTER_WALK_FRAMES.east;
- break;
- case DIR_SOUTH:
- object.animations.frame = HARVESTER_WALK_FRAMES.south;
- break;
- case DIR_WEST:
- object.animations.frame = HARVESTER_WALK_FRAMES.west;
- break;
- }
- }
-
-
-}
-
-function itemColor(item) {
-
- switch (item) {
-
- case 1:
- return colorScheme.biomassTint;
-
- case 3:
- return colorScheme.itemIron;
- case 4:
- return colorScheme.itemCopper;
-
- }
-
-}
-
-function createInventory(items) {
-
- var inventory = game.make.group();
- switch (items.length) {
- case 0:
- return inventory;
- case 1:
- if (items[0] !== 0) {
- var shadow = game.make.sprite(0, 0, "sheet", "inventory/inv1x1");
- shadow.anchor.set(0.5, 0.1);
- shadow.alpha = 0.5;
- var item = game.make.sprite(0, 0, "sheet", "inventory/item");
- item.anchor.set(0.5, 0.1);
- item.tint = itemColor(items[0]);
-
-
- inventory.addChild(shadow);
- inventory.addChild(item);
-
- }
- return inventory;
-
-
- }
-
- for (var i = 0; i < items.length; i++) {
-
- }
-
-}
-
-function createGameObject(objData) {
-
- if (objData.t === 1) {
- var cubot = game.add.isoSprite(getIsoX(objData.x), getIsoY(objData.y), 15, "sheet", null, isoGroup);
- cubot.anchor.set(0.5, 0);
-
- cubot.inputEnabled = true;
- cubot.events.onInputDown.add(function () {
- debugObj = "Cubot: " + cubot.tileX + ", " + cubot.tileY;
- });
-
- cubot.events.onInputOver.add(function () {
- document.body.style.cursor = 'pointer';
- });
- cubot.events.onInputOut.add(function () {
- document.body.style.cursor = 'default';
- });
-
- cubot.id = objData.i;
- cubot.type = 1;
- cubot.tileX = objData.x;
- cubot.tileY = objData.y;
- cubot.username = objData.parent;
- cubot.heldItem = objData.heldItem;
- cubot.direction = objData.direction;
- cubot.action = objData.action;
- cubot.energy = objData.energy;
-
- cubot.inventory = createInventory([cubot.heldItem]);
- cubot.addChild(cubot.inventory);
-
- dispatchTileEnter(objData.x, objData.y);
-
- cubot.isAt = function (x, y) {
- return this.tileX === x && this.tileY === y;
- };
-
- cubot.onTileHover = function () {
- game.add.tween(this).to({isoZ: 45}, 200, Phaser.Easing.Quadratic.InOut, true);
- game.add.tween(this.scale).to({x: 1.2, y: 1.2}, 200, Phaser.Easing.Linear.None, true);
-
- this.tint = colorScheme.cubotHoverTint;
-
- };
- cubot.onTileOut = function () {
- document.body.style.cursor = 'default';
-
- game.add.tween(this).to({isoZ: 15}, 400, Phaser.Easing.Bounce.Out, true);
- game.add.tween(this.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Linear.None, true);
-
- this.tint = 0xFFFFFF;
-
- };
-
- //Battery indication
- if (cubot.energy <= LOW_ENERGY) {
- cubot.tint = 0xCC0000;
- }
-
- cubot.animations.add("walk_w", mar.animationFrames.walk_w, true);
- cubot.animations.add("walk_s", mar.animationFrames.walk_s, true);
- cubot.animations.add("walk_e", mar.animationFrames.walk_e, true);
- cubot.animations.add("walk_n", mar.animationFrames.walk_n, true);
- cubot.animations.add("dig_w", mar.animationFrames.dig_w, false);
- cubot.animations.add("dig_s", mar.animationFrames.dig_s, false);
- cubot.animations.add("dig_e", mar.animationFrames.dig_e, false);
- cubot.animations.add("dig_n", mar.animationFrames.dig_n, false);
-
- cubot.queuedAnims = [];
-
- switch (cubot.direction) {
- case DIR_NORTH:
- cubot.animations.frame = 194;
- break;
- case DIR_EAST:
- cubot.animations.frame = 164;
- break;
- case DIR_SOUTH:
- cubot.animations.frame = 240;
- break;
- case DIR_WEST:
- cubot.animations.frame = 254;
- break;
- }
-
-
-
-
- var username = game.make.text(0, -24, cubot.username, {
- fontSize: 22,
- fill: colorScheme.textFill,
- stroke: colorScheme.textStroke,
- strokeThickness: 2,
+ copperFill: "#C87D38",
+ plainSprite: "tiles/tile",
+ wallSprite: "tiles/bigTile",
+ walkDuration: 800,
+ holoStyle: function (fill) {
+ return {
+ fontSize: 32,
+ fill: fill ? fill : config.hologramFill,
+ stroke: config.hologramStroke,
+ strokeThickness: 1,
font: "fixedsys"
- });
- username.alpha = 0.85;
- username.anchor.set(0.5, 0);
- if (cubot.username === mar.client.username) {
- username.tint = 0xFB4D0A;
- } else {
- cubot.alpha = 0.6;
- }
- cubot.addChild(username);
-
-
- return cubot;
-
- } else if (objData.t === 2) {
-
- var biomass = game.add.isoSprite(getIsoX(objData.x), getIsoY(objData.y), 10, "sheet", 1, isoGroup);
- biomass.animations.add("idle", mar.animationFrames.biomassIdle, true);
- biomass.anchor.set(0.5, 0);
-
- biomass.type = 2;
- biomass.tileX = objData.x;
- biomass.tileY = objData.y;
- biomass.id = objData.i;
-
- biomass.tint = colorScheme.biomassTint;// "#3BB886"
-
- biomass.hoverText = game.make.text(0, 0, "Biomass", {
- fontSize: 22,
- fill: colorScheme.textFill,
- stroke: colorScheme.textStroke,
- strokeThickness: 2,
- font: "fixedsys"
- });
- biomass.hoverText.alpha = 0;
- biomass.hoverText.anchor.set(0.5, 0);
- biomass.addChild(biomass.hoverText);
-
- biomass.isAt = function (x, y) {
- return this.tileX === x && this.tileY === y;
};
-
- biomass.isAt = function (x, y) {
- return this.tileX === x && this.tileY === y;
- };
-
- biomass.onTileHover = function () {
- game.tweens.removeFrom(this);
- document.body.style.cursor = 'pointer';
- game.add.tween(this).to({isoZ: 45}, 200, Phaser.Easing.Quadratic.InOut, true);
- this.tint = colorScheme.biomassHoverTint;
- game.add.tween(this.scale).to({x: 1.2, y: 1.2}, 200, Phaser.Easing.Linear.None, true);
- game.add.tween(this.hoverText).to({alpha: 0.9}, 200, Phaser.Easing.Quadratic.In, true);
- biomass.hoverText.visible = true;
-
-
- };
- biomass.onTileOut = function () {
- game.tweens.removeFrom(this);
- document.body.style.cursor = 'default';
-
- game.add.tween(this).to({isoZ: 15}, 400, Phaser.Easing.Bounce.Out, true);
- game.add.tween(this.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Linear.None, true);
- this.tint = colorScheme.biomassTint;
- game.add.tween(this.hoverText).to({alpha: 0}, 200, Phaser.Easing.Quadratic.Out, true);
- };
-
- biomass.animations.play("idle", 45, true);
-
- return biomass;
-
- } else if (objData.t === 10) {
-
- var harvester = game.add.isoSprite(getIsoX(objData.x), getIsoY(objData.y), 15, "sheet", null, isoGroup);
- harvester.anchor.set(0.5, 0);
-
- harvester.id = objData.i;
- harvester.type = 10;
- harvester.tileX = objData.x;
- harvester.tileY = objData.y;
- harvester.direction = objData.direction;
- harvester.action = objData.action;
-
- dispatchTileEnter(objData.x, objData.y);
-
- harvester.isAt = function (x, y) {
- return this.tileX === x && this.tileY === y;
- };
-
- harvester.onTileHover = function () {
- game.add.tween(this).to({isoZ: 45}, 200, Phaser.Easing.Quadratic.InOut, true);
- game.add.tween(this.scale).to({x: 1.2, y: 1.2}, 200, Phaser.Easing.Linear.None, true);
- this.tint = colorScheme.cubotHoverTint;
- };
- harvester.onTileOut = function () {
- game.add.tween(this).to({isoZ: 15}, 400, Phaser.Easing.Bounce.Out, true);
- game.add.tween(this.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Linear.None, true);
- this.tint = colorScheme.cubotTint;
- };
-
- harvester.animations.add("walk_w", mar.animationFrames.harvester_walk_w, true);
- harvester.animations.add("walk_s", mar.animationFrames.harvester_walk_s, true);
- harvester.animations.add("walk_e", mar.animationFrames.harvester_walk_e, true);
- harvester.animations.add("walk_n", mar.animationFrames.harvester_walk_n, true);
-
- harvester.queuedAnims = [];
-
- switch (harvester.direction) {
- case DIR_NORTH:
- harvester.animations.frame = HARVESTER_WALK_FRAMES.north;
- break;
- case DIR_EAST:
- harvester.animations.frame = HARVESTER_WALK_FRAMES.east;
- break;
- case DIR_SOUTH:
- harvester.animations.frame = HARVESTER_WALK_FRAMES.south;
- break;
- case DIR_WEST:
- harvester.animations.frame = HARVESTER_WALK_FRAMES.west;
- break;
- }
-
-
- return harvester;
- } else if (objData.t === 3) {
- //Factory
- var factory = game.add.isoSprite(getIsoX(objData.x), getIsoY(objData.y), 15, "sheet", "objects/factory", isoGroup);
- factory.anchor.set(0.5, .25);
-
- factory.id = objData.i;
- factory.type = 3;
- factory.tileX = objData.x;
- factory.tileY = objData.y;
-
-
- factory.hoverText = game.make.text(0, 0, "Factory", {
- fontSize: 22,
- fill: colorScheme.textFill,
- stroke: colorScheme.textStroke,
- strokeThickness: 2,
- font: "fixedsys"
- });
- factory.hoverText.alpha = 0;
- factory.hoverText.anchor.set(0.5, 0);
- factory.addChild(factory.hoverText);
-
- factory.isAt = function (x, y) {
- return (this.tileX === x || this.tileX + 1 === x) && (this.tileY + 1 === y || this.tileY === y);
- };
-
- factory.onTileHover = function () {
- game.tweens.removeFrom(this);
- game.add.tween(this).to({isoZ: 25}, 200, Phaser.Easing.Quadratic.InOut, true);
- game.add.tween(this.scale).to({x: 1.06, y: 1.06}, 200, Phaser.Easing.Linear.None, true);
- this.tint = colorScheme.cubotHoverTint;
-
- game.add.tween(this.hoverText).to({alpha: 0.9}, 200, Phaser.Easing.Quadratic.In, true);
- factory.hoverText.visible = true;
- };
- factory.onTileOut = function () {
- game.tweens.removeFrom(this);
- game.add.tween(this).to({isoZ: 15}, 400, Phaser.Easing.Bounce.Out, true);
- game.add.tween(this.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Linear.None, true);
- this.tint = colorScheme.cubotTint;
-
- game.add.tween(this.hoverText).to({alpha: 0}, 200, Phaser.Easing.Quadratic.Out, true);
- };
-
- return factory;
- } else if (objData.t === 4) {
- //Radio tower
- var radioTower = game.add.isoSprite(getIsoX(objData.x), getIsoY(objData.y), 15, "sheet", "objects/RadioTower", isoGroup);
- radioTower.anchor.set(0.5, 0.64);
-
- radioTower.id = objData.i;
- radioTower.type = 4;
- radioTower.tileX = objData.x;
- radioTower.tileY = objData.y;
-
-
- radioTower.hoverText = game.make.text(0, 0, "Radio Tower", {
- fontSize: 22,
- fill: colorScheme.textFill,
- stroke: colorScheme.textStroke,
- strokeThickness: 2,
- font: "fixedsys"
- });
- radioTower.hoverText.alpha = 0;
- radioTower.hoverText.anchor.set(0.5, 0);
- radioTower.addChild(radioTower.hoverText);
-
- radioTower.isAt = function (x, y) {
- return this.tileX === x && this.tileY === y;
- };
-
- radioTower.onTileHover = function () {
- game.tweens.removeFrom(this);
- game.add.tween(this).to({isoZ: 45}, 200, Phaser.Easing.Quadratic.InOut, true);
- game.add.tween(this.scale).to({x: 1.15, y: 1.15}, 200, Phaser.Easing.Linear.None, true);
- this.tint = colorScheme.cubotHoverTint;
-
- game.add.tween(this.hoverText).to({alpha: 0.9}, 200, Phaser.Easing.Quadratic.In, true);
- radioTower.hoverText.visible = true;
- };
- radioTower.onTileOut = function () {
- game.tweens.removeFrom(this);
- game.add.tween(this).to({isoZ: 15}, 400, Phaser.Easing.Bounce.Out, true);
- game.add.tween(this.scale).to({x: 1, y: 1}, 200, Phaser.Easing.Linear.None, true);
- this.tint = colorScheme.cubotTint;
-
- game.add.tween(this.hoverText).to({alpha: 0}, 200, Phaser.Easing.Quadratic.Out, true);
- };
-
- return radioTower;
-
- }
-}
-
-// --------------------------
-//Integer distance between 2 tiles
-function manhanttanDistance(x1, y1, x2, y2) {
- return Math.abs(x1 - x2) + Math.abs(y1 - y2)
-}
-
-function codeListener(message) {
-
- if (message.t === "code") {
-
- ace.edit("editor").setValue(message.code);
-
- }
-}
-
-/**
- * Listens for authentications responses from the server
- */
-function authListener(message) {
-
- if (message.t === "auth") {
-
- if (message.m === "ok") {
- console.log("Auth successful");
- mar.client.requestUserInfo();
-
- } else {
- alert("Authentication failed. Please make sure you are logged in and reload the page.");
- }
- }
-}
-
-
-function codeResponseListener(message) {
- if (message.t === "codeResponse") {
- alert("Uploaded and assembled " + message.bytes + " bytes")
- }
-}
-
-/**
- * Listens for user info responses from the server
- */
-function userInfoListener(message) {
-
-
- if (message.t === "userInfo") {
-
- //Create new world / Find my robot
- console.log(message);
-
- mar.worldX = message.worldX;
- mar.worldY = message.worldY;
-
- mar.maxWidth = message.maxWidth;
-
- mar.client.requestTerrain();
- }
-}
-
-function terrainListener(message) {
- if (message.t === "terrain") {
-
- if (mar.bigMessage) {
- mar.bigMessage.destroy();
- }
-
- if (message.ok) {
-
- if (mar.world !== undefined) {
- mar.client.socket.send(JSON.stringify({t: "object", x: mar.worldX, y: mar.worldY}));
- mar.world.update(message.terrain);
-
- } else {
- mar.world = new Word(message.terrain);
- console.log("Gameloop started");
-
- //Handle keypresses
- game.input.keyboard.onDownCallback = function (event) {
-
- //If the game has focus
- if (document.activeElement === document.getElementById("game")) {
- if ((event.keyCode >= 37 && event.keyCode <= 40) || event.keyCode === 116 || event.keyCode === 32) {
- event.preventDefault();
- }
-
- if (mar.client.username !== "guest" && mar.kbBuffer.length <= 16) {
- mar.client.sendKeypress(event.keyCode);
-
- //Locally update the buffer
- mar.kbBuffer.push(event.keyCode);
- mar.kbBufferText = formattedKeyBuffer(mar.kbBuffer);
- }
- }
- };
-
- //Grab focus when clicked (For chrome, Opera)
- game.input.onDown.add(function () {
- document.getElementById("game").focus();
- })
- }
- } else {
- //World is not available
- if (mar.world !== undefined) {
- mar.world.update([]);
- } else {
- mar.world = new Word([])
- }
- mar.bigMessage = game.add.text(908, 450, "[Uncharted World]", {
- fontSize: 46,
- fill: "#ff803d",
- stroke: colorScheme.textStroke,
- strokeThickness: 2,
- font: "fixedsys"
- }, textGroup);
- }
-
-
- }
-}
-
-function objectListener(message) {
-
- if (message.t === "object") {
- mar.world.updateObjects(message.objects);
- }
-}
-
-function floppyListener(message) {
- document.getElementById("floppyDown").innerHTML = " ";
- var blob = new Blob([message.data], {type: "application/octet-stream"});
- saveAs(blob, "floppy.bin");
-}
-
-
-function tickListener(message) {
- if (message.t === "tick") {
- //Request objects
- mar.client.socket.send(JSON.stringify({t: "object", x: mar.worldX, y: mar.worldY}));
-
- //Update key buffer display
- if (message.keys !== undefined) {
- mar.kbBuffer = message.keys;
- mar.kbBufferText = formattedKeyBuffer(mar.kbBuffer);
- }
-
- var myConsole = document.getElementById('console');
-
- if (message.cm === 0) {
- //Clear command was sent
- myConsole.innerHTML = "";
- mar.lastLines = "";
- }
-
- //Update console
- if (message.c !== undefined) {
- var str = mar.lastLines;
-
- for (var i = 0; i < message.c.length; i++) {
-
- str += message.c[i];
- }
-
- //Limit lines to 40 chars
- myConsole.innerHTML = "";
- var tmpBuffer = "";
- var lines = str.split("\n");
- for (var i = 0; i < lines.length; i++) {
-
- if (lines[i].length >= 40) {
-
- //Split the line...
- var subLines = lines[i].match(/.{1,40}/g);
-
- for (var j = 0; j < subLines.length; j++) {
-
- //Don't put a newline at the end
- if (j !== subLines.length - 1) {
- tmpBuffer += "\n";
- }
- }
-
- } else {
- tmpBuffer += lines[i] + "\n";
- }
- }
-
- myConsole.innerHTML = tmpBuffer;
- mar.lastLines = str;
-
- //Autoscroll
- myConsole.scrollTop = myConsole.scrollHeight;
- }
- }
-}
-
-var GameClient = function (callback) {
-
- var self = this;
-
- var listeners = [];
- var xhr = new XMLHttpRequest();
-
- xhr.open("GET", "./getServerInfo.php", true);
-
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4 && xhr.status === 200) {
-
- console.log("Received server info " + xhr.responseText);
-
- setTimeout(function () {
- var info = JSON.parse(xhr.responseText);
-
- console.log(info.address);
- self.socket = new WebSocket(info.address);
- self.username = info.username;
- self.tickLength = info.tickLength;
- self.serverName = info.serverName;
-
- mar.client.socket.binaryType = 'arraybuffer';
- self.socket.onopen = function () {
-
- //Send auth request
- self.socket.send(info.token);
-
-
- //Setup event managers
- listeners.push(authListener);
- listeners.push(userInfoListener);
- listeners.push(terrainListener);
- listeners.push(tickListener);
- listeners.push(objectListener);
- listeners.push(codeListener);
- listeners.push(codeResponseListener);
-
- mar.client.socket.onmessage = function (received) {
-
- try {
- var message = JSON.parse(received.data);
-
- } catch (e) {
- console.log(e)
- floppyListener(received);
- }
-
- for (var i = 0; i < listeners.length; i++) {
- listeners[i](message);
- }
-
-
- };
-
- self.reloadCode();
-
-
- if (callback !== undefined) {
- callback();
- }
- };
-
- self.socket.onerror = function (e) {
-
- alert("Can't connect to game server at address " + info.address);
-
- console.log(e);
- };
-
- self.socket.onclose = function (e) {
-
- alert("Disconnected from server");
- console.log(e);
- }
- }
-
- , 100);
- }
- };
- xhr.send(null);
-
-
- this.requestUserInfo = function () {
- this.socket.send(JSON.stringify({t: "userInfo"}));
- };
-
- this.requestTerrain = function () {
- this.socket.send(JSON.stringify({t: "terrain", x: mar.worldX, y: mar.worldY}));
- };
-
- this.uploadCode = function (code) {
- console.log("Uploaded code");
- this.socket.send(JSON.stringify({t: "uploadCode", code: code}))
- };
-
- this.reloadCode = function () {
- this.socket.send(JSON.stringify({t: "codeRequest"}))
- };
-
- this.sendKeypress = function (key) {
- if (key !== 0) {
- this.socket.send(JSON.stringify({t: "k", k: key}));
- }
- };
-
- this.requestFloppy = function () {
- document.getElementById("floppyDown").innerHTML = "";
- this.socket.send(JSON.stringify({t: "floppyDown"}));
- };
-
- this.notifyFloppyUp = function () {
- this.socket.send(JSON.stringify({t: "floppyUp"}));
- }
-
-};
-
-function dispatchTileHover(x, y) {
-
- for (var i in mar.world.objects) {
-
- var object = mar.world.objects[i];
-
- if (object.isAt(x, y)) {
- object.onTileHover();
- }
- }
-}
-
-function dispatchTileOut(x, y) {
- for (var i in mar.world.objects) {
-
- var object = mar.world.objects[i];
-
- if (object.isAt(x, y)) {
- object.onTileOut();
- }
- }
-}
-
-var count = 0;
-var BasicGame = function (game) {
-};
-
-BasicGame.Boot = function (game) {
-};
-
-var isoGroup, cursorPos, cursor;
-var textGroup;
-var debugTile;
-var debugObj;
-var objectsGroup;
-var cursors;
-var tmpLine;
-
-BasicGame.Boot.prototype = {
- preload: function () {
- game.load.atlasJSONHash("sheet", "./mar/sprites.png", "./mar/sprites.json");
-
- game.time.advancedTiming = true;
-
- // Add and enable the plug-in.
- game.plugins.add(new Phaser.Plugin.Isometric(game));
-
- // This is used to set a game canvas-based offset for the 0, 0, 0 isometric coordinate - by default
- // this point would be at screen coordinates 0, 0 (top left) which is usually undesirable.
- game.iso.anchor.setTo(0.5, 0);
- game.world.setBounds(0, 0, 2200, 1100);
- //Make camera more or less centered (tested on 1080 screen)
- game.camera.x = 280;
- game.camera.y = 90;
- game.stage.disableVisibilityChange = true;
-
- this.scale.scaleMode = Phaser.ScaleManager.RESIZE;
- this.scale.pageAlignHorizontally = true;
- this.scale.pageAlignVertically = true;
-
},
- create: function () {
-
- // Create a group for our tiles.
- isoGroup = game.add.group();
- objectsGroup = game.add.group();
- textGroup = game.add.group();
-
- //Initialise Cubot Animations Frames lists
- initialiseAnimations();
-
- // Let's make a load of tiles on a grid.
- this.spawnTiles();
-
- // Provide a 3D position for the cursor
- cursorPos = new Phaser.Plugin.Isometric.Point3();
-
- cursors = game.input.keyboard.createCursorKeys();
-
+ kbBufferX: 225,
+ kbBufferY: 20,
+ arrowTextStyle: {
+ fontSize: 32,
+ fill: "#ffffff",
+ stroke: "#9298a8",
+ strokeThickness: 1,
+ font: "fixedsys"
},
- update: function () {
- game.scale.setShowAll();
- game.scale.refresh();
- // Update the cursor position.
- // It's important to understand that screen-to-isometric projection means you have to specify a z position manually, as this cannot be easily
- // determined from the 2D pointer position without extra trickery. By default, the z position is 0 if not set.
- game.iso.unproject(game.input.activePointer.position, cursorPos);
-
- // Loop through all tiles and test to see if the 3D position from above intersects with the automatically generated IsoSprite tile bounds.
- isoGroup.forEach(function (tile) {
-
- if (tile.isTile) {
- var inBounds = tile.isoBounds.containsXY(cursorPos.x, cursorPos.y);
- // If it does, do a little animation and tint change.
- if (!tile.selected && inBounds) {
- tile.selected = true;
- tile.tint = colorScheme.tileHoverTint;
-
- debugTile = tile.tileX + ", " + tile.tileY;
-
- dispatchTileHover(tile.tileX, tile.tileY);
-
- game.add.tween(tile).to({isoZ: tile.baseZ + 8}, 200, Phaser.Easing.Quadratic.InOut, true);
- }
- // If not, revert back to how it was.
- else if (tile.selected && !inBounds) {
- dispatchTileOut(tile.tileX, tile.tileY);
- tile.selected = false;
- tile.tint = tile.baseTint;
- game.add.tween(tile).to({isoZ: tile.baseZ}, 200, Phaser.Easing.Quadratic.InOut, true);
- }
- }
- });
-
- if (this.game.input.activePointer.isDown) {
- if (this.game.origDragPoint) {
- // move the camera by the amount the mouse has moved since last update
- this.game.camera.x += this.game.origDragPoint.x - this.game.input.activePointer.position.x;
- this.game.camera.y += this.game.origDragPoint.y - this.game.input.activePointer.position.y;
- }
- // set new drag origin to current position
- this.game.origDragPoint = this.game.input.activePointer.position.clone();
-
- } else {
- this.game.origDragPoint = null;
- }
-
- count++;
-
- if (count % 10 === 0) {
- game.iso.topologicalSort(isoGroup);
- }
-
-
- // if(mar.world){
- // for(var i = 0; i < mar.world.objects.length; i++){
- // if(mar.world.objects[i].animations){
- // console.log(mar.world.objects[i].animations.currentFrame)
- //
- // }
- // }
- // }
-
- },
-
-
- render: function () {
- if (mar.worldX !== undefined) {
- game.debug.text("World: (" + Number(mar.worldX).toString(16) + ", " + Number(mar.worldY).toString(16) + ")", 10, 20);
- } else {
- game.debug.text("World: (?,?)", 10, 20);
- }
- if (debugTile) {
- game.debug.text(debugTile, 10, 40);
- }
-
- if (mar.client.username !== "guest") {
- game.debug.text(mar.kbBufferText, 210, 20);
- }
- // game.debug.text(debugObj, 32, 190);
-
- // game.debug.text(game.time.fps || '--', 2, 14, "#a7aebe");
-
- // game.debug.cameraInfo(game.camera, 32, 32);
-
-
- if (tmpLine !== undefined) {
- game.debug.geom(tmpLine);
- game.debug.lineInfo(tmpLine, 32, 32);
- }
-
-
-
- },
- spawnTiles: function () {
- mar.client = new GameClient();
- }
+ lowEnergy: 100,
+ lowEnergyTint: 0xCC0000,
+ bigMessageFill: "#ff803d",
+ arrowTint: 0xFFFFFF,
+ arrowHoverTint: 0x00FF00,
+ selfUsernameColor: 0xFB4D0A,
+ otherCubotAlpha: 0.6
};
-
-function setupWorldArrows() {
-
- var northArrow = game.make.isoSprite(528, -10, 10, "sheet", "ui/arrow_north", isoGroup);
- northArrow.inputEnabled = true;
- northArrow.events.onInputDown.add(function () {
-
- if (mar.worldY === 0) {
- mar.worldY = mar.maxWidth;
- } else {
- mar.worldY--;
+var TileType;
+(function (TileType) {
+ TileType[TileType["PLAIN"] = 0] = "PLAIN";
+ TileType[TileType["WALL"] = 1] = "WALL";
+ TileType[TileType["IRON"] = 2] = "IRON";
+ TileType[TileType["COPPER"] = 3] = "COPPER";
+})(TileType || (TileType = {}));
+var Util = (function () {
+ function Util() {
+ }
+ //todo: find a more elegant way of doing this. Maybe this is related: https://github.com/lewster32/phaser-plugin-isometric/issues/7
+ Util.getIsoY = function (y) {
+ return Util.getIsoX(y);
+ };
+ Util.getIsoX = function (x) {
+ return (x * 71.5);
+ };
+ Util.getDeltaX = function (direction) {
+ switch (direction) {
+ case Direction.NORTH:
+ case Direction.SOUTH:
+ return 0;
+ case Direction.EAST:
+ return 1;
+ case Direction.WEST:
+ return -1;
}
- mar.client.requestTerrain();
- });
- northArrow.events.onInputOver.add(function () {
- northArrow.tint = 0x00ff00;
- document.body.style.cursor = "pointer";
- });
- northArrow.events.onInputOut.add(function () {
- northArrow.tint = 0xFFFFFF;
- document.body.style.cursor = "default";
- });
- isoGroup.addChild(northArrow);
-
- var eastArrow = game.make.isoSprite(1115, 587, 10, "sheet", "ui/arrow_east", isoGroup);
- eastArrow.inputEnabled = true;
- eastArrow.events.onInputDown.add(function () {
- if (mar.worldX === mar.maxWidth) {
- mar.worldX = 0;
- } else {
- mar.worldX++;
+ };
+ Util.getDeltaY = function (direction) {
+ switch (direction) {
+ case Direction.EAST:
+ case Direction.WEST:
+ return 0;
+ case Direction.NORTH:
+ return 1;
+ case Direction.SOUTH:
+ return -1;
}
- mar.client.requestTerrain();
- });
- eastArrow.events.onInputOver.add(function () {
- eastArrow.tint = 0x00ff00;
- document.body.style.cursor = "pointer";
- });
- eastArrow.events.onInputOut.add(function () {
- eastArrow.tint = 0xFFFFFF;
- document.body.style.cursor = "default";
- });
- isoGroup.addChild(eastArrow);
-
- var southArrow = game.make.isoSprite(528, 1170, 10, "sheet", "ui/arrow_south", isoGroup);
- southArrow.inputEnabled = true;
- southArrow.events.onInputDown.add(function () {
- if (mar.worldY === mar.maxWidth) {
- mar.worldY = 0;
- } else {
- mar.worldY++;
- }
- mar.client.requestTerrain();
- });
- southArrow.events.onInputOver.add(function () {
- southArrow.tint = 0x00ff00;
- document.body.style.cursor = "pointer";
- });
- southArrow.events.onInputOut.add(function () {
- southArrow.tint = 0xFFFFFF;
- document.body.style.cursor = "default";
- });
- isoGroup.addChild(southArrow);
-
- var westArrow = game.make.isoSprite(-60, 587, 10, "sheet", "ui/arrow_west", isoGroup);
- westArrow.inputEnabled = true;
- westArrow.events.onInputDown.add(function () {
- if (mar.worldX === 0) {
- mar.worldX = mar.maxWidth;
- } else {
- mar.worldX--;
- }
- mar.client.requestTerrain();
- });
- westArrow.events.onInputOver.add(function () {
- westArrow.tint = 0x00ff00;
- document.body.style.cursor = "pointer";
- });
- westArrow.events.onInputOut.add(function () {
- westArrow.tint = 0xFFFFFF;
- document.body.style.cursor = "default";
- });
- isoGroup.addChild(westArrow);
-
-}
-
-function cubotDig(cubot, direction, callback) {
- if (direction === DIR_NORTH) {
- cubot.animations.play("dig_n", 45);
- } else if (direction === DIR_EAST) {
- cubot.animations.play("dig_e", 45);
- } else if (direction === DIR_SOUTH) {
- cubot.animations.play("dig_s", 45);
- } else if (direction === DIR_WEST) {
- cubot.animations.play("dig_w", 45);
- }
-}
-
-function cubotMove(cubot, direction, callback, walkFrames, jump) {
-
- var tween;
-
- if (direction === DIR_SOUTH) {
-
- var walk = function (duration) {
-
-
- if (jump) {
- tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
- duration, Phaser.Easing.Linear.None, true);
- var zTween1 = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoZ: 90},
- duration / 2, Phaser.Easing.Quadratic.Out, true);
- zTween1.onComplete.add(function () {
- game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoZ: 5},
- duration / 2, Phaser.Easing.Quadratic.In, true);
- })
- } else {
- tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
- duration, Phaser.Easing.Linear.None, true);
- cubot.animations.play("walk_s", 60, true);
- }
-
-
- dispatchTileEnter(cubot.tileX, cubot.tileY);
-
- tween.onComplete.add(function () {
- cubot.animations.stop();
- cubot.animations.frame = walkFrames.south;
- // cubot.tileY++;
- cubot.onTileOut();
- //Resync position
- cubot.isoX = getIsoX(cubot.tileX);
- cubot.isoY = getIsoY(cubot.tileY);
-
- if (callback !== undefined) {
- callback();
- }
-
- for (var i = 0; i < cubot.queuedAnims.length; i++) {
- cubot.queuedAnims[i](500);
- cubot.queuedAnims.splice(i, 1)
- }
- })
- }
-
- } else if (direction === DIR_NORTH) {
-
- walk = function (duration) {
-
- if (jump) {
- tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
- duration, Phaser.Easing.Linear.None, true);
- var zTween1 = game.add.tween(cubot).to({isoZ: 90},
- duration / 2, Phaser.Easing.Quadratic.Out, true);
- zTween1.onComplete.add(function () {
- game.add.tween(cubot).to({isoZ: 5},
- duration / 2, Phaser.Easing.Quadratic.In, true);
- })
- } else {
- tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
- duration, Phaser.Easing.Linear.None, true);
- cubot.animations.play("walk_n", 60, true);
- }
- dispatchTileEnter(cubot.tileX, cubot.tileY);
-
- tween.onComplete.add(function () {
- cubot.animations.stop();
- cubot.animations.frame = walkFrames.north;
- // cubot.tileY--;
- cubot.onTileOut();
- //Resync position
- cubot.isoX = getIsoX(cubot.tileX);
- cubot.isoY = getIsoY(cubot.tileY);
-
- if (callback !== undefined) {
- callback();
- }
-
- for (var i = 0; i < cubot.queuedAnims.length; i++) {
- cubot.queuedAnims[i](500);
- cubot.queuedAnims.splice(i, 1)
- }
- })
- }
-
- } else if (direction === DIR_WEST) {
- walk = function (duration) {
-
-
- if (jump) {
- tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
- duration, Phaser.Easing.Linear.None, true);
- var zTween1 = game.add.tween(cubot).to({isoZ: 90},
- duration / 2, Phaser.Easing.Quadratic.Out, true);
- zTween1.onComplete.add(function () {
- game.add.tween(cubot).to({isoZ: 5},
- duration / 2, Phaser.Easing.Quadratic.In, true);
- })
- } else {
- tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
- duration, Phaser.Easing.Linear.None, true);
- cubot.animations.play("walk_w", 60, true);
- }
-
- dispatchTileEnter(cubot.tileX, cubot.tileY);
-
-
- tween.onComplete.add(function () {
- cubot.animations.stop();
- cubot.animations.frame = walkFrames.west;
- // cubot.tileX--;
- cubot.onTileOut();
- //Resync position
- cubot.isoX = getIsoX(cubot.tileX);
- cubot.isoY = getIsoY(cubot.tileY);
-
- if (callback !== undefined) {
- callback();
- }
-
- for (var i = 0; i < cubot.queuedAnims.length; i++) {
- cubot.queuedAnims[i](500);
- cubot.queuedAnims.splice(i, 1)
- }
- })
- }
-
- } else if (direction === DIR_EAST) {
- walk = function (duration) {
-
- if (jump) {
- tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
- duration, Phaser.Easing.Linear.None, true);
- var zTween1 = game.add.tween(cubot).to({isoZ: 90},
- duration / 2, Phaser.Easing.Quadratic.Out, true);
- zTween1.onComplete.add(function () {
- game.add.tween(cubot).to({isoZ: 5},
- duration / 2, Phaser.Easing.Quadratic.In, true);
- })
- } else {
- tween = game.add.tween(cubot).to({isoX: getIsoX(cubot.tileX), isoY: getIsoY(cubot.tileY)},
- duration, Phaser.Easing.Linear.None, true);
- cubot.animations.play("walk_e", 60, true);
- }
-
- dispatchTileEnter(cubot.tileX, cubot.tileY);
-
-
- tween.onComplete.add(function () {
- cubot.animations.stop();
- cubot.animations.frame = walkFrames.east;
- // cubot.tileX++;
-
- cubot.onTileOut();
- //Resync position
- cubot.isoX = getIsoX(cubot.tileX);
- cubot.isoY = getIsoY(cubot.tileY);
-
- if (callback !== undefined) {
- callback();
- }
-
- for (var i = 0; i < cubot.queuedAnims.length; i++) {
- cubot.queuedAnims[i](500);
- cubot.queuedAnims.splice(i, 1)
- }
- })
- }
- }
-
- if (cubot.animations.currentAnim.isPlaying) {
- //Queue up the animation
- cubot.queuedAnims.push(walk);
-
- console.log("Queued Animation");
-
- } else {
- walk(800);
- }
-}
-
-
-function initialiseAnimations() {
- //Walk =-------------------------------------------------------
- //East
- mar.animationFrames.walk_e_start = [];
- for (var i = 0; i < 10; i++) {
- mar.animationFrames.walk_e_start.push("cubot/walk_e/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.walk_e = [];
- for (i = 10; i < 30; i++) {
- mar.animationFrames.walk_e.push("cubot/walk_e/" + ("0000" + i).slice(-4));
- }
-
- mar.animationFrames.harvester_walk_e_start = [];
- for (var i = 0; i < 10; i++) {
- mar.animationFrames.harvester_walk_e_start.push("harvester/walk_e/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.harvester_walk_e = [];
- for (i = 10; i < 30; i++) {
- mar.animationFrames.harvester_walk_e.push("harvester/walk_e/" + ("0000" + i).slice(-4));
- }
- //North
- mar.animationFrames.walk_n_start = [];
- for (i = 0; i < 10; i++) {
- mar.animationFrames.walk_n_start.push("cubot/walk_n/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.walk_n = [];
- for (i = 10; i < 30; i++) {
- mar.animationFrames.walk_n.push("cubot/walk_n/" + ("0000" + i).slice(-4));
- }
-
- mar.animationFrames.harvester_walk_n_start = [];
- for (i = 0; i < 10; i++) {
- mar.animationFrames.harvester_walk_n_start.push("harvester/walk_n/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.harvester_walk_n = [];
- for (i = 10; i < 30; i++) {
- mar.animationFrames.harvester_walk_n.push("harvester/walk_n/" + ("0000" + i).slice(-4));
- }
- //South
- mar.animationFrames.walk_s_start = [];
- for (i = 0; i < 10; i++) {
- mar.animationFrames.walk_s_start.push("cubot/walk_s/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.walk_s = [];
- for (i = 10; i < 30; i++) {
- mar.animationFrames.walk_s.push("cubot/walk_s/" + ("0000" + i).slice(-4));
- }
-
- mar.animationFrames.harvester_walk_s_start = [];
- for (i = 0; i < 10; i++) {
- mar.animationFrames.harvester_walk_s_start.push("harvester/walk_s/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.harvester_walk_s = [];
- for (i = 10; i < 30; i++) {
- mar.animationFrames.harvester_walk_s.push("harvester/walk_s/" + ("0000" + i).slice(-4));
- }
- //West
- mar.animationFrames.walk_w_start = [];
- for (i = 0; i < 10; i++) {
- mar.animationFrames.walk_w_start.push("cubot/walk_w/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.walk_w = [];
- for (i = 10; i < 30; i++) {
- mar.animationFrames.walk_w.push("cubot/walk_w/" + ("0000" + i).slice(-4));
- }
-
- mar.animationFrames.harvester_walk_w_start = [];
- for (i = 0; i < 10; i++) {
- mar.animationFrames.harvester_walk_w_start.push("harvester/walk_w/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.harvester_walk_w = [];
- for (i = 10; i < 30; i++) {
- mar.animationFrames.harvester_walk_w.push("harvester/walk_w/" + ("0000" + i).slice(-4));
- }
-
- //Dig =-------------------------------------------------------
- mar.animationFrames.dig_e = [];
- for (i = 1; i <= 41; i++) {
- mar.animationFrames.dig_e.push("cubot/dig_e/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.dig_n = [];
- for (i = 1; i <= 41; i++) {
- mar.animationFrames.dig_n.push("cubot/dig_n/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.dig_s = [];
- for (i = 1; i <= 41; i++) {
- mar.animationFrames.dig_s.push("cubot/dig_s/" + ("0000" + i).slice(-4));
- }
- mar.animationFrames.dig_w = [];
- for (i = 1; i <= 41; i++) {
- mar.animationFrames.dig_w.push("cubot/dig_w/" + ("0000" + i).slice(-4));
- }
-
- //Biomass =-------------------------------------------------------
- mar.animationFrames.biomassIdle = [];
- for (i = 1; i < 60; i++) {
- mar.animationFrames.biomassIdle.push("objects/biomass/idle/" + ("0000" + i).slice(-4));
- }
-}
-
-function getIsoX(tileX) {
- return (tileX * 71.5)
-}
-
-function getIsoY(tileY) {
- return (tileY * 71.5)
-}
-
-function findMyRobot() {
-
- if (mar.client.username === "guest") {
- alert("You are not logged in!");
- } else {
- mar.client.requestUserInfo()
- }
-
-}
-
-function formattedKeyBuffer(kbBuffer) {
-
- var str = "KB: ";
-
- for (var i = 0; i < 16; i++) {
-
- if (kbBuffer[i] !== undefined) {
-
- str += kbBuffer[i].toString(16) + " ";
-
- } else {
-
- str += "__ ";
- }
-
- }
-
- return str;
-}
-
-
-
-game.state.add('Boot', BasicGame.Boot);
-
-game.state.start('Boot');
+ };
+ return Util;
+}());
+var mar = new MarGame();
diff --git a/mar/phaser/mar.min.js b/mar/phaser/mar.min.js
index 9edf3f8..67bcaa4 100644
--- a/mar/phaser/mar.min.js
+++ b/mar/phaser/mar.min.js
@@ -1,57 +1,4 @@
-DIR_NORTH=0;DIR_EAST=1;DIR_SOUTH=2;DIR_WEST=3;WORLD_HEIGHT=WORLD_WIDTH=16;var colorScheme={tileTint:16777215,wallTint:14540253,cubotHoverTint:65280,cubotTint:16777215,textFill:"#FFFFFF",textStroke:"#9298a8",biomassTint:6535263,biomassHoverTint:65280,tileHoverTint:65280,itemIron:4408129,itemCopper:13139256,hologramFill:"#0aced6",hologramStroke:"#12FFB0",hologramAlpha:.9},mar={kbBuffer:[],kbBufferText:"",animationFrames:{},controlledUnitVisible:!1,lastLines:""};
-CUBOT_WALK_FRAMES={south:240,north:194,west:254,east:164};HARVESTER_WALK_FRAMES={south:347,north:317,west:377,east:287};LOW_ENERGY=100;fullscreen?(RENDERER_WIDTH=window.innerWidth-4,RENDERER_HEIGHT=window.innerHeight-4):(RENDERER_WIDTH=document.getElementById("game").clientWidth,RENDERER_HEIGHT=window.innerHeight/1.25);var game=new Phaser.Game(RENDERER_WIDTH,RENDERER_HEIGHT,Phaser.AUTO,"game",null,!0,!1);
-function dispatchTileLeave(a,b){for(var c=0;c=a.keyCode||116===a.keyCode||32===a.keyCode)&&a.preventDefault(),"guest"!==mar.client.username&&16>=mar.kbBuffer.length&&(mar.client.sendKeypress(a.keyCode),
-mar.kbBuffer.push(a.keyCode),mar.kbBufferText=formattedKeyBuffer(mar.kbBuffer)))},game.input.onDown.add(function(){document.getElementById("game").focus()})))}function objectListener(a){"object"===a.t&&mar.world.updateObjects(a.objects)}function floppyListener(a){document.getElementById("floppyDown").innerHTML=' ';a=new Blob([a.data],{type:"application/octet-stream"});saveAs(a,"floppy.bin")}
-function tickListener(a){if("tick"===a.t){mar.client.socket.send(JSON.stringify({t:"object",x:mar.worldX,y:mar.worldY}));void 0!==a.keys&&(mar.kbBuffer=a.keys,mar.kbBufferText=formattedKeyBuffer(mar.kbBuffer));var b=document.getElementById("console");0===a.cm&&(b.innerHTML="",mar.lastLines="");if(void 0!==a.c){for(var c=mar.lastLines,d=0;d';this.socket.send(JSON.stringify({t:"floppyDown"}))};this.notifyFloppyUp=function(){this.socket.send(JSON.stringify({t:"floppyUp"}))}};function dispatchTileHover(a,b){for(var c in mar.world.objects){var d=mar.world.objects[c];if(d.isAt(a,b))d.onTileHover()}}function dispatchTileOut(a,b){for(var c in mar.world.objects){var d=mar.world.objects[c];if(d.isAt(a,b))d.onTileOut()}}
-var count=0,BasicGame=function(a){};BasicGame.Boot=function(a){};var isoGroup,cursorPos,cursor,debugTile,debugObj,objectsGroup,cursors,tmpLine;
-BasicGame.Boot.prototype={preload:function(){game.load.atlasJSONHash("sheet","./mar/sprites.png","./mar/sprites.json");game.time.advancedTiming=!0;game.plugins.add(new Phaser.Plugin.Isometric(game));game.iso.anchor.setTo(.5,0);game.world.setBounds(0,0,2200,1100);game.camera.x=280;game.camera.y=90;game.stage.disableVisibilityChange=!0},create:function(){isoGroup=game.add.group();objectsGroup=game.add.group();initialiseAnimations();this.spawnTiles();cursorPos=new Phaser.Plugin.Isometric.Point3;cursors=
-game.input.keyboard.createCursorKeys()},update:function(){game.iso.unproject(game.input.activePointer.position,cursorPos);isoGroup.forEach(function(a){if(a.isTile){var b=a.isoBounds.containsXY(cursorPos.x,cursorPos.y);!a.selected&&b?(a.selected=!0,a.tint=colorScheme.tileHoverTint,debugTile=a.tileX+", "+a.tileY,dispatchTileHover(a.tileX,a.tileY),game.add.tween(a).to({isoZ:a.baseZ+8},200,Phaser.Easing.Quadratic.InOut,!0)):a.selected&&!b&&(dispatchTileOut(a.tileX,a.tileY),a.selected=!1,a.tint=a.baseTint,
-game.add.tween(a).to({isoZ:a.baseZ},200,Phaser.Easing.Quadratic.InOut,!0))}});this.game.input.activePointer.isDown?(this.game.origDragPoint&&(this.game.camera.x+=this.game.origDragPoint.x-this.game.input.activePointer.position.x,this.game.camera.y+=this.game.origDragPoint.y-this.game.input.activePointer.position.y),this.game.origDragPoint=this.game.input.activePointer.position.clone()):this.game.origDragPoint=null;count++;0===count%10&&game.iso.topologicalSort(isoGroup)},render:function(){void 0!==
-mar.worldX?game.debug.text("World: ("+Number(mar.worldX).toString(16)+", "+Number(mar.worldY).toString(16)+")",10,20):game.debug.text("World: (?,?)",10,20);debugTile&&game.debug.text(debugTile,10,40);"guest"!==mar.client.username&&game.debug.text(mar.kbBufferText,210,20);void 0!==tmpLine&&(game.debug.geom(tmpLine),game.debug.lineInfo(tmpLine,32,32))},spawnTiles:function(){mar.client=new GameClient}};
-function setupWorldArrows(){var a=game.make.isoSprite(528,-10,10,"sheet","ui/arrow_north",isoGroup);a.inputEnabled=!0;a.events.onInputDown.add(function(){0===mar.worldY?mar.worldY=mar.maxWidth:mar.worldY--;mar.client.requestTerrain()});a.events.onInputOver.add(function(){a.tint=65280;document.body.style.cursor="pointer"});a.events.onInputOut.add(function(){a.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(a);var b=game.make.isoSprite(1115,587,10,"sheet","ui/arrow_east",isoGroup);
-b.inputEnabled=!0;b.events.onInputDown.add(function(){mar.worldX===mar.maxWidth?mar.worldX=0:mar.worldX++;mar.client.requestTerrain()});b.events.onInputOver.add(function(){b.tint=65280;document.body.style.cursor="pointer"});b.events.onInputOut.add(function(){b.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(b);var c=game.make.isoSprite(528,1170,10,"sheet","ui/arrow_south",isoGroup);c.inputEnabled=!0;c.events.onInputDown.add(function(){mar.worldY===mar.maxWidth?mar.worldY=0:
-mar.worldY++;mar.client.requestTerrain()});c.events.onInputOver.add(function(){c.tint=65280;document.body.style.cursor="pointer"});c.events.onInputOut.add(function(){c.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(c);var d=game.make.isoSprite(-60,587,10,"sheet","ui/arrow_west",isoGroup);d.inputEnabled=!0;d.events.onInputDown.add(function(){0===mar.worldX?mar.worldX=mar.maxWidth:mar.worldX--;mar.client.requestTerrain()});d.events.onInputOver.add(function(){d.tint=65280;document.body.style.cursor=
-"pointer"});d.events.onInputOut.add(function(){d.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(d)}function cubotDig(a,b,c){b===DIR_NORTH?a.animations.play("dig_n",45):b===DIR_EAST?a.animations.play("dig_e",45):b===DIR_SOUTH?a.animations.play("dig_s",45):b===DIR_WEST&&a.animations.play("dig_w",45)}
-function cubotWalk(a,b,c,d){var f;if(b===DIR_SOUTH)var e=function(b){a.animations.play("walk_s",60,!0);f=game.add.tween(a).to({isoX:getIsoX(a.tileX),isoY:getIsoY(a.tileY)},b,Phaser.Easing.Linear.None,!0);dispatchTileEnter(a.tileX,a.tileY);f.onComplete.add(function(){a.animations.stop();a.animations.frame=d.south;a.onTileOut();a.isoX=getIsoX(a.tileX);a.isoY=getIsoY(a.tileY);void 0!==c&&c();for(var b=0;ba;a++)mar.animationFrames.walk_e_start.push("cubot/walk_e/"+("0000"+a).slice(-4));mar.animationFrames.walk_e=[];for(a=10;30>a;a++)mar.animationFrames.walk_e.push("cubot/walk_e/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_e_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_e_start.push("harvester/walk_e/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_e=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_e.push("harvester/walk_e/"+
-("0000"+a).slice(-4));mar.animationFrames.walk_n_start=[];for(a=0;10>a;a++)mar.animationFrames.walk_n_start.push("cubot/walk_n/"+("0000"+a).slice(-4));mar.animationFrames.walk_n=[];for(a=10;30>a;a++)mar.animationFrames.walk_n.push("cubot/walk_n/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_n_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_n_start.push("harvester/walk_n/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_n=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_n.push("harvester/walk_n/"+
-("0000"+a).slice(-4));mar.animationFrames.walk_s_start=[];for(a=0;10>a;a++)mar.animationFrames.walk_s_start.push("cubot/walk_s/"+("0000"+a).slice(-4));mar.animationFrames.walk_s=[];for(a=10;30>a;a++)mar.animationFrames.walk_s.push("cubot/walk_s/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_s_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_s_start.push("harvester/walk_s/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_s=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_s.push("harvester/walk_s/"+
-("0000"+a).slice(-4));mar.animationFrames.walk_w_start=[];for(a=0;10>a;a++)mar.animationFrames.walk_w_start.push("cubot/walk_w/"+("0000"+a).slice(-4));mar.animationFrames.walk_w=[];for(a=10;30>a;a++)mar.animationFrames.walk_w.push("cubot/walk_w/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_w_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_w_start.push("harvester/walk_w/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_w=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_w.push("harvester/walk_w/"+
-("0000"+a).slice(-4));mar.animationFrames.dig_e=[];for(a=1;41>=a;a++)mar.animationFrames.dig_e.push("cubot/dig_e/"+("0000"+a).slice(-4));mar.animationFrames.dig_n=[];for(a=1;41>=a;a++)mar.animationFrames.dig_n.push("cubot/dig_n/"+("0000"+a).slice(-4));mar.animationFrames.dig_s=[];for(a=1;41>=a;a++)mar.animationFrames.dig_s.push("cubot/dig_s/"+("0000"+a).slice(-4));mar.animationFrames.dig_w=[];for(a=1;41>=a;a++)mar.animationFrames.dig_w.push("cubot/dig_w/"+("0000"+a).slice(-4));mar.animationFrames.biomassIdle=
-[];for(a=1;60>a;a++)mar.animationFrames.biomassIdle.push("objects/biomass/idle/"+("0000"+a).slice(-4))}function getIsoX(a){return 71.5*a}function getIsoY(a){return 71.5*a}function findMyRobot(){"guest"===mar.client.username?alert("You are not logged in!"):mar.client.requestUserInfo()}function formattedKeyBuffer(a){for(var b="KB: ",c=0;16>c;c++)b=void 0!==a[c]?b+(a[c].toString(16)+" "):b+"__ ";return b}game.state.add("Boot",BasicGame.Boot);game.state.start("Boot");
+var RENDERER_WIDTH=document.getElementById("game").clientWidth*window.devicePixelRatio,RENDERER_HEIGHT=window.innerHeight/1.4*window.devicePixelRatio,DEBUG=!0,config={tileTint:16777215,wallTint:14540253,oreTint:15987699,worldSize:16,cubotHoverTint:65280,cubotTint:16777215,textFill:"#FFFFFF",textStroke:"#9298a8",biomassTint:6535263,biomassHoverTint:65280,tileHoverTint:65280,itemIron:4408129,textIron:"#434341",itemCopper:13139256,textCopper:"#C87D38",hologramFill:"#0aced6",hologramStroke:"#12FFB0",
+copperFill:"#C87D38",plainSprite:"tiles/tile",wallSprite:"tiles/bigTile",walkDuration:800,holoStyle:function(a){return{fontSize:32,fill:a?a:config.hologramFill,stroke:config.hologramStroke,strokeThickness:1,font:"fixedsys"}},kbBufferX:225,kbBufferY:20,arrowTextStyle:{fontSize:32,fill:"#ffffff",stroke:"#9298a8",strokeThickness:1,font:"fixedsys"},lowEnergy:100,lowEnergyTint:13369344,bigMessageFill:"#ff803d",arrowTint:16777215,arrowHoverTint:65280,selfUsernameColor:16469258,otherCubotAlpha:.6},TileType;
+(function(a){a[a.PLAIN=0]="PLAIN";a[a.WALL=1]="WALL";a[a.IRON=2]="IRON";a[a.COPPER=3]="COPPER"})(TileType||(TileType={}));
+var Util=function(){function a(){}a.getIsoY=function(b){return a.getIsoX(b)};a.getIsoX=function(a){return 71.5*a};a.getDeltaX=function(a){switch(a){case Direction.NORTH:case Direction.SOUTH:return 0;case Direction.EAST:return 1;case Direction.WEST:return-1}};a.getDeltaY=function(a){switch(a){case Direction.EAST:case Direction.WEST:return 0;case Direction.NORTH:return 1;case Direction.SOUTH:return-1}};return a}(),mar=new MarGame;
diff --git a/mar/phaser/mar.ts b/mar/phaser/mar.ts
new file mode 100644
index 0000000..5d60d6b
--- /dev/null
+++ b/mar/phaser/mar.ts
@@ -0,0 +1,107 @@
+///
+///
+// Typescript V2.4.1
+
+let RENDERER_WIDTH = document.getElementById("game").clientWidth * window.devicePixelRatio;
+let RENDERER_HEIGHT = (window.innerHeight / 1.40) * window.devicePixelRatio;
+
+let DEBUG: boolean = true;
+
+let config = {
+ tileTint: 0xFFFFFF,
+ wallTint: 0xDDDDDD,
+ oreTint: 0xF3F3F3,
+ worldSize: 16,
+ cubotHoverTint: 0x00FF00,
+ cubotTint: 0xFFFFFF,
+ textFill: "#FFFFFF",
+ textStroke: "#9298a8",
+ biomassTint: 0x63B85F,
+ biomassHoverTint: 0x00FF00,
+ tileHoverTint: 0x00FF00,
+ itemIron: 0x434341,
+ textIron: "#434341",
+ itemCopper: 0xC87D38,
+ textCopper: "#C87D38",
+ hologramFill: "#0aced6",
+ hologramStroke: "#12FFB0",
+ copperFill: "#C87D38",
+ plainSprite: "tiles/tile",
+ wallSprite: "tiles/bigTile",
+ walkDuration: 800,
+ holoStyle: (fill) => {
+ return {
+ fontSize: 32,
+ fill: fill ? fill : config.hologramFill,
+ stroke: config.hologramStroke,
+ strokeThickness: 1,
+ font: "fixedsys"
+ }
+ },
+ kbBufferX: 225,
+ kbBufferY: 20,
+ arrowTextStyle: {
+ fontSize: 32,
+ fill: "#ffffff",
+ stroke: "#9298a8",
+ strokeThickness: 1,
+ font: "fixedsys"
+ },
+ lowEnergy: 100,
+ lowEnergyTint: 0xCC0000,
+ bigMessageFill: "#ff803d",
+ arrowTint: 0xFFFFFF,
+ arrowHoverTint: 0x00FF00,
+ selfUsernameColor: 0xFB4D0A,
+ otherCubotAlpha: 0.6
+
+};
+
+
+enum TileType {
+ PLAIN,
+ WALL,
+ IRON,
+ COPPER
+}
+
+class Util {
+
+ //todo: find a more elegant way of doing this. Maybe this is related: https://github.com/lewster32/phaser-plugin-isometric/issues/7
+ static getIsoY(y: number) {
+ return Util.getIsoX(y);
+ }
+
+ static getIsoX(x: number) {
+ return (x * 71.5)
+ }
+
+ static getDeltaX(direction: Direction) {
+ switch (direction) {
+ case Direction.NORTH:
+ case Direction.SOUTH:
+ return 0;
+ case Direction.EAST:
+ return 1;
+ case Direction.WEST:
+ return -1;
+ }
+ }
+
+ static getDeltaY(direction: Direction) {
+
+ switch (direction) {
+ case Direction.EAST:
+ case Direction.WEST:
+ return 0;
+ case Direction.NORTH:
+ return 1;
+ case Direction.SOUTH:
+ return -1;
+ }
+
+ }
+}
+
+let mar = new MarGame();
+
diff --git a/mar/phaser/p2.d.ts b/mar/phaser/p2.d.ts
new file mode 100644
index 0000000..300d373
--- /dev/null
+++ b/mar/phaser/p2.d.ts
@@ -0,0 +1,1108 @@
+// Type definitions for p2.js v0.6.0
+// Project: https://github.com/schteppe/p2.js/
+
+declare module p2 {
+
+ export class AABB {
+
+ constructor(options?: {
+ upperBound?: number[];
+ lowerBound?: number[];
+ });
+
+ setFromPoints(points: number[][], position: number[], angle: number, skinSize: number): void;
+
+ copy(aabb: AABB): void;
+
+ extend(aabb: AABB): void;
+
+ overlaps(aabb: AABB): boolean;
+
+ }
+
+ export class Broadphase {
+
+ static AABB: number;
+ static BOUNDING_CIRCLE: number;
+
+ static NAIVE: number;
+ static SAP: number;
+
+ static boundingRadiusCheck(bodyA: Body, bodyB: Body): boolean;
+
+ static aabbCheck(bodyA: Body, bodyB: Body): boolean;
+
+ static canCollide(bodyA: Body, bodyB: Body): boolean;
+
+ constructor(type: number);
+
+ type: number;
+ result: Body[];
+ world: World;
+ boundingVolumeType: number;
+
+ setWorld(world: World): void;
+
+ getCollisionPairs(world: World): Body[];
+
+ boundingVolumeCheck(bodyA: Body, bodyB: Body): boolean;
+
+ }
+
+ export class GridBroadphase extends Broadphase {
+
+ constructor(options?: {
+ xmin?: number;
+ xmax?: number;
+ ymin?: number;
+ ymax?: number;
+ nx?: number;
+ ny?: number;
+ });
+
+ xmin: number;
+ xmax: number;
+ ymin: number;
+ ymax: number;
+ nx: number;
+ ny: number;
+ binsizeX: number;
+ binsizeY: number;
+
+ }
+
+ export class NativeBroadphase extends Broadphase {
+
+ }
+
+ export class Narrowphase {
+
+ contactEquations: ContactEquation[];
+ frictionEquations: FrictionEquation[];
+ enableFriction: boolean;
+ slipForce: number;
+ frictionCoefficient: number;
+ surfaceVelocity: number;
+ reuseObjects: boolean;
+ resuableContactEquations: any[];
+ reusableFrictionEquations: any[];
+ restitution: number;
+ stiffness: number;
+ relaxation: number;
+ frictionStiffness: number;
+ frictionRelaxation: number;
+ enableFrictionReduction: boolean;
+ contactSkinSize: number;
+
+ collidedLastStep(bodyA: Body, bodyB: Body): boolean;
+
+ reset(): void;
+
+ createContactEquation(bodyA: Body, bodyB: Body, shapeA: Shape, shapeB: Shape): ContactEquation;
+
+ createFrictionFromContact(c: ContactEquation): FrictionEquation;
+
+ }
+
+ export class SAPBroadphase extends Broadphase {
+
+ axisList: Body[];
+ axisIndex: number;
+
+ }
+
+ export class Constraint {
+
+ static DISTANCE: number;
+ static GEAR: number;
+ static LOCK: number;
+ static PRISMATIC: number;
+ static REVOLUTE: number;
+
+ constructor(bodyA: Body, bodyB: Body, type: number, options?: {
+ collideConnected?: boolean;
+ wakeUpBodies?: boolean;
+ });
+
+ type: number;
+ equeations: Equation[];
+ bodyA: Body;
+ bodyB: Body;
+ collideConnected: boolean;
+
+ update(): void;
+
+ setStiffness(stiffness: number): void;
+
+ setRelaxation(relaxation: number): void;
+
+ }
+
+ export class DistanceConstraint extends Constraint {
+
+ constructor(bodyA: Body, bodyB: Body, type: number, options?: {
+ collideConnected?: boolean;
+ wakeUpBodies?: boolean;
+ distance?: number;
+ localAnchorA?: number[];
+ localAnchorB?: number[];
+ maxForce?: number;
+ });
+
+ localAnchorA: number[];
+ localAnchorB: number[];
+ distance: number;
+ maxForce: number;
+ upperLimitEnabled: boolean;
+ upperLimit: number;
+ lowerLimitEnabled: boolean;
+ lowerLimit: number;
+ position: number;
+
+ setMaxForce(f: number): void;
+
+ getMaxForce(): number;
+
+ }
+
+ export class GearConstraint extends Constraint {
+
+ constructor(bodyA: Body, bodyB: Body, type: number, options?: {
+ collideConnected?: boolean;
+ wakeUpBodies?: boolean;
+ angle?: number;
+ ratio?: number;
+ maxTorque?: number;
+ });
+
+ ratio: number;
+ angle: number;
+
+ setMaxTorque(torque: number): void;
+
+ getMaxTorque(): number;
+
+ }
+
+ export class LockConstraint extends Constraint {
+
+ constructor(bodyA: Body, bodyB: Body, type: number, options?: {
+ collideConnected?: boolean;
+ wakeUpBodies?: boolean;
+ localOffsetB?: number[];
+ localAngleB?: number;
+ maxForce?: number;
+ });
+
+ setMaxForce(force: number): void;
+
+ getMaxForce(): number;
+
+ }
+
+ export class PrismaticConstraint extends Constraint {
+
+ constructor(bodyA: Body, bodyB: Body, type: number, options?: {
+ collideConnected?: boolean;
+ wakeUpBodies?: boolean;
+ maxForce?: number;
+ localAnchorA?: number[];
+ localAnchorB?: number[];
+ localAxisA?: number[];
+ disableRotationalLock?: boolean;
+ upperLimit?: number;
+ lowerLimit?: number;
+ });
+
+ localAnchorA: number[];
+ localAnchorB: number[];
+ localAxisA: number[];
+ position: number;
+ velocity: number;
+ lowerLimitEnabled: boolean;
+ upperLimitEnabled: boolean;
+ lowerLimit: number;
+ upperLimit: number;
+ upperLimitEquation: ContactEquation;
+ lowerLimitEquation: ContactEquation;
+ motorEquation: Equation;
+ motorEnabled: boolean;
+ motorSpeed: number;
+
+ enableMotor(): void;
+
+ disableMotor(): void;
+
+ setLimits(lower: number, upper: number): void;
+
+ }
+
+ export class RevoluteConstraint extends Constraint {
+
+ constructor(bodyA: Body, bodyB: Body, type: number, options?: {
+ collideConnected?: boolean;
+ wakeUpBodies?: boolean;
+ worldPivot?: number[];
+ localPivotA?: number[];
+ localPivotB?: number[];
+ maxForce?: number;
+ });
+
+ pivotA: number[];
+ pivotB: number[];
+ motorEquation: RotationalVelocityEquation;
+ motorEnabled: boolean;
+ angle: number;
+ lowerLimitEnabled: boolean;
+ upperLimitEnabled: boolean;
+ lowerLimit: number;
+ upperLimit: number;
+ upperLimitEquation: ContactEquation;
+ lowerLimitEquation: ContactEquation;
+
+ enableMotor(): void;
+
+ disableMotor(): void;
+
+ motorIsEnabled(): boolean;
+
+ setLimits(lower: number, upper: number): void;
+
+ setMotorSpeed(speed: number): void;
+
+ getMotorSpeed(): number;
+
+ }
+
+ export class AngleLockEquation extends Equation {
+
+ constructor(bodyA: Body, bodyB: Body, options?: {
+ angle?: number;
+ ratio?: number;
+ });
+
+ computeGq(): number;
+
+ setRatio(ratio: number): number;
+
+ setMaxTorque(torque: number): number;
+
+ }
+
+ export class ContactEquation extends Equation {
+
+ constructor(bodyA: Body, bodyB: Body);
+
+ contactPointA: number[];
+ penetrationVec: number[];
+ contactPointB: number[];
+ normalA: number[];
+ restitution: number;
+ firstImpact: boolean;
+ shapeA: Shape;
+ shapeB: Shape;
+
+ computeB(a: number, b: number, h: number): number;
+
+ }
+
+ export class Equation {
+
+ static DEFAULT_STIFFNESS: number;
+ static DEFAULT_RELAXATION: number;
+
+ constructor(bodyA: Body, bodyB: Body, minForce?: number, maxForce?: number);
+
+ minForce: number;
+ maxForce: number;
+ bodyA: Body;
+ bodyB: Body;
+ stiffness: number;
+ relaxation: number;
+ G: number[];
+ offset: number;
+ a: number;
+ b: number;
+ epsilon: number;
+ timeStep: number;
+ needsUpdate: boolean;
+ multiplier: number;
+ relativeVelocity: number;
+ enabled: boolean;
+
+ gmult(G: number[], vi: number[], wi: number[], vj: number[], wj: number[]): number;
+
+ computeB(a: number, b: number, h: number): number;
+
+ computeGq(): number;
+
+ computeGW(): number;
+
+ computeGWlambda(): number;
+
+ computeGiMf(): number;
+
+ computeGiMGt(): number;
+
+ addToWlambda(deltalambda: number): number;
+
+ computeInvC(eps: number): number;
+
+ }
+
+ export class FrictionEquation extends Equation {
+
+ constructor(bodyA: Body, bodyB: Body, slipForce: number);
+
+ contactPointA: number[];
+ contactPointB: number[];
+ t: number[];
+ shapeA: Shape;
+ shapeB: Shape;
+ frictionCoefficient: number;
+
+ setSlipForce(slipForce: number): number;
+
+ getSlipForce(): number;
+
+ computeB(a: number, b: number, h: number): number;
+
+ }
+
+ export class RotationalLockEquation extends Equation {
+
+ constructor(bodyA: Body, bodyB: Body, options?: {
+ angle?: number;
+ });
+
+ angle: number;
+
+ computeGq(): number;
+
+ }
+
+ export class RotationalVelocityEquation extends Equation {
+
+ constructor(bodyA: Body, bodyB: Body);
+
+ computeB(a: number, b: number, h: number): number;
+
+ }
+
+ export class EventEmitter {
+
+ on(type: string, listener: Function, context: any): EventEmitter;
+
+ has(type: string, listener: Function): boolean;
+
+ off(type: string, listener: Function): EventEmitter;
+
+ emit(event: any): EventEmitter;
+
+ }
+
+ export class ContactMaterialOptions {
+
+ friction: number;
+ restitution: number;
+ stiffness: number;
+ relaxation: number;
+ frictionStiffness: number;
+ frictionRelaxation: number;
+ surfaceVelocity: number;
+
+ }
+
+ export class ContactMaterial {
+
+ static idCounter: number;
+
+ constructor(materialA: Material, materialB: Material, options?: ContactMaterialOptions);
+
+ id: number;
+ materialA: Material;
+ materialB: Material;
+ friction: number;
+ restitution: number;
+ stiffness: number;
+ relaxation: number;
+ frictionStuffness: number;
+ frictionRelaxation: number;
+ surfaceVelocity: number;
+ contactSkinSize: number;
+
+ }
+
+ export class Material {
+
+ static idCounter: number;
+
+ constructor(id: number);
+
+ id: number;
+
+ }
+
+ export class vec2 {
+
+ static crossLength(a: number[], b: number[]): number;
+
+ static crossVZ(out: number[], vec: number[], zcomp: number): number;
+
+ static crossZV(out: number[], zcomp: number, vec: number[]): number;
+
+ static rotate(out: number[], a: number[], angle: number): void;
+
+ static rotate90cw(out: number[], a: number[]): number;
+
+ static centroid(out: number[], a: number[], b: number[], c: number[]): number[];
+
+ static create(): number[];
+
+ static clone(a: number[]): number[];
+
+ static fromValues(x: number, y: number): number[];
+
+ static copy(out: number[], a: number[]): number[];
+
+ static set(out: number[], x: number, y: number): number[];
+
+ static toLocalFrame(out: number[], worldPoint: number[], framePosition: number[], frameAngle: number): void;
+
+ static toGlobalFrame(out: number[], localPoint: number[], framePosition: number[], frameAngle: number): void;
+
+ static add(out: number[], a: number[], b: number[]): number[];
+
+ static subtract(out: number[], a: number[], b: number[]): number[];
+
+ static sub(out: number[], a: number[], b: number[]): number[];
+
+ static multiply(out: number[], a: number[], b: number[]): number[];
+
+ static mul(out: number[], a: number[], b: number[]): number[];
+
+ static divide(out: number[], a: number[], b: number[]): number[];
+
+ static div(out: number[], a: number[], b: number[]): number[];
+
+ static scale(out: number[], a: number[], b: number): number[];
+
+ static distance(a: number[], b: number[]): number;
+
+ static dist(a: number[], b: number[]): number;
+
+ static squaredDistance(a: number[], b: number[]): number;
+
+ static sqrDist(a: number[], b: number[]): number;
+
+ static length(a: number[]): number;
+
+ static len(a: number[]): number;
+
+ static squaredLength(a: number[]): number;
+
+ static sqrLen(a: number[]): number;
+
+ static negate(out: number[], a: number[]): number[];
+
+ static normalize(out: number[], a: number[]): number[];
+
+ static dot(a: number[], b: number[]): number;
+
+ static str(a: number[]): string;
+
+ }
+
+ export interface BodyOptions {
+
+ mass?: number;
+ position?: number[];
+ velocity?: number[];
+ angle?: number;
+ angularVelocity?: number;
+ force?: number[];
+ angularForce?: number;
+ fixedRotation?: boolean;
+
+ }
+
+ export class Body extends EventEmitter {
+
+ sleepyEvent: {
+ type: string;
+ };
+
+ sleepEvent: {
+ type: string;
+ };
+
+ wakeUpEvent: {
+ type: string;
+ };
+
+ static DYNAMIC: number;
+ static STATIC: number;
+ static KINEMATIC: number;
+ static AWAKE: number;
+ static SLEEPY: number;
+ static SLEEPING: number;
+
+ constructor(options?: BodyOptions);
+
+ id: number;
+ world: World;
+ shapes: Shape[];
+ shapeOffsets: number[][];
+ shapeAngles: number[];
+ mass: number;
+ invMass: number;
+ inertia: number;
+ invInertia: number;
+ invMassSolve: number;
+ invInertiaSolve: number;
+ fixedRotation: number;
+ position: number[];
+ interpolatedPosition: number[];
+ interpolatedAngle: number;
+ previousPosition: number[];
+ previousAngle: number;
+ velocity: number[];
+ vlambda: number[];
+ wlambda: number[];
+ angle: number;
+ angularVelocity: number;
+ force: number[];
+ angularForce: number;
+ damping: number;
+ angularDamping: number;
+ type: number;
+ boundingRadius: number;
+ aabb: AABB;
+ aabbNeedsUpdate: boolean;
+ allowSleep: boolean;
+ wantsToSleep: boolean;
+ sleepState: number;
+ sleepSpeedLimit: number;
+ sleepTimeLimit: number;
+ gravityScale: number;
+
+ updateSolveMassProperties(): void;
+
+ setDensity(density: number): void;
+
+ getArea(): number;
+
+ getAABB(): AABB;
+
+ updateAABB(): void;
+
+ updateBoundingRadius(): void;
+
+ addShape(shape: Shape, offset?: number[], angle?: number): void;
+
+ removeShape(shape: Shape): boolean;
+
+ updateMassProperties(): void;
+
+ applyForce(force: number[], worldPoint: number[]): void;
+
+ toLocalFrame(out: number[], worldPoint: number[]): void;
+
+ toWorldFrame(out: number[], localPoint: number[]): void;
+
+ fromPolygon(path: number[][], options?: {
+ optimalDecomp?: boolean;
+ skipSimpleCheck?: boolean;
+ removeCollinearPoints?: any; //boolean | number
+ }): boolean;
+
+ adjustCenterOfMass(): void;
+
+ setZeroForce(): void;
+
+ resetConstraintVelocity(): void;
+
+ applyDamping(dy: number): void;
+
+ wakeUp(): void;
+
+ sleep(): void;
+
+ sleepTick(time: number, dontSleep: boolean, dt: number): void;
+
+ getVelocityFromPosition(story: number[], dt: number): number[];
+
+ getAngularVelocityFromPosition(timeStep: number): number;
+
+ overlaps(body: Body): boolean;
+
+ }
+
+ export class Spring {
+
+ constructor(bodyA: Body, bodyB: Body, options?: {
+
+ stiffness?: number;
+ damping?: number;
+ localAnchorA?: number[];
+ localAnchorB?: number[];
+ worldAnchorA?: number[];
+ worldAnchorB?: number[];
+
+ });
+
+ stiffness: number;
+ damping: number;
+ bodyA: Body;
+ bodyB: Body;
+
+ applyForce(): void;
+
+ }
+
+ export class LinearSpring extends Spring {
+
+ localAnchorA: number[];
+ localAnchorB: number[];
+ restLength: number;
+
+ setWorldAnchorA(worldAnchorA: number[]): void;
+
+ setWorldAnchorB(worldAnchorB: number[]): void;
+
+ getWorldAnchorA(result: number[]): number[];
+
+ getWorldAnchorB(result: number[]): number[];
+
+ applyForce(): void;
+
+ }
+
+ export class RotationalSpring extends Spring {
+
+ constructor(bodyA: Body, bodyB: Body, options?: {
+ restAngle?: number;
+ stiffness?: number;
+ damping?: number;
+ });
+
+ restAngle: number;
+
+ }
+
+ export class Capsule extends Shape {
+
+ constructor(length?: number, radius?: number);
+
+ length: number;
+ radius: number;
+
+ }
+
+ export class Circle extends Shape {
+
+ constructor(radius: number);
+
+ radius: number;
+
+ }
+
+ export class Convex extends Shape {
+
+ static triangleArea(a: number[], b: number[], c: number[]): number;
+
+ constructor(vertices: number[][], axes: number[]);
+
+ vertices: number[][];
+ axes: number[];
+ centerOfMass: number[];
+ triangles: number[];
+ boundingRadius: number;
+
+ projectOntoLocalAxis(localAxis: number[], result: number[]): void;
+
+ projectOntoWorldAxis(localAxis: number[], shapeOffset: number[], shapeAngle: number, result: number[]): void;
+
+ updateCenterOfMass(): void;
+
+ }
+
+ export class Heightfield extends Shape {
+
+ constructor(data: number[], options?: {
+ minValue?: number;
+ maxValue?: number;
+ elementWidth: number;
+ });
+
+ data: number[];
+ maxValue: number;
+ minValue: number;
+ elementWidth: number;
+
+ }
+
+ export interface SharedShapeOptions {
+
+ position?: number[];
+ angle?: number;
+ collisionGroup?: number;
+ collisionResponse?: boolean;
+ collisionMask?: number;
+ sensor?: boolean;
+
+ }
+
+ export interface ShapeOptions extends SharedShapeOptions {
+
+ type?: number;
+
+ }
+
+ export class Shape {
+
+ static idCounter: number;
+ static CIRCLE: number;
+ static PARTICLE: number;
+ static PLANE: number;
+ static CONVEX: number;
+ static LINE: number;
+ static RECTANGLE: number;
+ static CAPSULE: number;
+ static HEIGHTFIELD: number;
+
+ constructor(options?: ShapeOptions);
+
+ type: number;
+ id: number;
+ boundingRadius: number;
+ collisionGroup: number;
+ collisionMask: number;
+ material: Material;
+ area: number;
+ sensor: boolean;
+
+ computeMomentOfInertia(mass: number): number;
+
+ updateBoundingRadius(): number;
+
+ updateArea(): void;
+
+ computeAABB(out: AABB, position: number[], angle: number): void;
+
+ }
+
+ export class Line extends Shape {
+
+ constructor(length?: number);
+
+ length: number;
+
+ }
+
+ export class Particle extends Shape {
+
+ }
+
+ export class Plane extends Shape {
+
+ }
+
+ export class Rectangle extends Shape {
+
+ static sameDimensions(a: Rectangle, b: Rectangle): boolean;
+
+ constructor(width?: number, height?: number);
+
+ width: number;
+ height: number;
+
+ }
+
+ export class Solver extends EventEmitter {
+
+ static GS: number;
+ static ISLAND: number;
+
+ constructor(options?: {}, type?: number);
+
+ type: number;
+ equations: Equation[];
+ equationSortFunction: Equation; //Equation | boolean
+
+ solve(dy: number, world: World): void;
+
+ solveIsland(dy: number, island: Island): void;
+
+ sortEquations(): void;
+
+ addEquation(eq: Equation): void;
+
+ addEquations(eqs: Equation[]): void;
+
+ removeEquation(eq: Equation): void;
+
+ removeAllEquations(): void;
+
+ }
+
+ export class GSSolver extends Solver {
+
+ constructor(options?: {
+ iterations?: number;
+ tolerance?: number;
+ });
+
+ iterations: number;
+ tolerance: number;
+ useZeroRHS: boolean;
+ frictionIterations: number;
+ usedIterations: number;
+
+ solve(h: number, world: World): void;
+
+ }
+
+ export class OverlapKeeper {
+
+ constructor(bodyA: Body, shapeA: Shape, bodyB: Body, shapeB: Shape);
+
+ shapeA: Shape;
+ shapeB: Shape;
+ bodyA: Body;
+ bodyB: Body;
+
+ tick(): void;
+
+ setOverlapping(bodyA: Body, shapeA: Shape, bodyB: Body, shapeB: Body): void;
+
+ bodiesAreOverlapping(bodyA: Body, bodyB: Body): boolean;
+
+ set(bodyA: Body, shapeA: Shape, bodyB: Body, shapeB: Shape): void;
+
+ }
+
+ export class TupleDictionary {
+
+ data: number[];
+ keys: number[];
+
+ getKey(id1: number, id2: number): string;
+
+ getByKey(key: number): number;
+
+ get(i: number, j: number): number;
+
+ set(i: number, j: number, value: number): number;
+
+ reset(): void;
+
+ copy(dict: TupleDictionary): void;
+
+ }
+
+ export class Utils {
+
+ static appendArray(a: Array, b: Array): Array;
+
+ static chanceRoll(chance: number): boolean;
+
+ static defaults(options: any, defaults: any): any;
+
+ static extend(a: any, b: any): void;
+
+ static randomChoice(choice1: any, choice2: any): any;
+
+ static rotateArray(matrix: any[], direction: any): any[];
+
+ static splice(array: Array, index: number, howMany: number): void;
+
+ static shuffle(array: T[]): T[];
+
+ static transposeArray(array: T[]): T[];
+
+ }
+
+ export class Island {
+
+ equations: Equation[];
+ bodies: Body[];
+
+ reset(): void;
+
+ getBodies(result: any): Body[];
+
+ wantsToSleep(): boolean;
+
+ sleep(): boolean;
+
+ }
+
+ export class IslandManager extends Solver {
+
+ static getUnvisitedNode(nodes: Node[]): IslandNode; // IslandNode | boolean
+
+ equations: Equation[];
+ islands: Island[];
+ nodes: IslandNode[];
+
+ visit(node: IslandNode, bds: Body[], eqs: Equation[]): void;
+
+ bfs(root: IslandNode, bds: Body[], eqs: Equation[]): void;
+
+ split(world: World): Island[];
+
+ }
+
+ export class IslandNode {
+
+ constructor(body: Body);
+
+ body: Body;
+ neighbors: IslandNode[];
+ equations: Equation[];
+ visited: boolean;
+
+ reset(): void;
+
+ }
+
+ export class World extends EventEmitter {
+
+ postStepEvent: {
+ type: string;
+ };
+
+ addBodyEvent: {
+ type: string;
+ };
+
+ removeBodyEvent: {
+ type: string;
+ };
+
+ addSpringEvent: {
+ type: string;
+ };
+
+ impactEvent: {
+ type: string;
+ bodyA: Body;
+ bodyB: Body;
+ shapeA: Shape;
+ shapeB: Shape;
+ contactEquation: ContactEquation;
+ };
+
+ postBroadphaseEvent: {
+ type: string;
+ pairs: Body[];
+ };
+
+ beginContactEvent: {
+ type: string;
+ shapeA: Shape;
+ shapeB: Shape;
+ bodyA: Body;
+ bodyB: Body;
+ contactEquations: ContactEquation[];
+ };
+
+ endContactEvent: {
+ type: string;
+ shapeA: Shape;
+ shapeB: Shape;
+ bodyA: Body;
+ bodyB: Body;
+ };
+
+ preSolveEvent: {
+ type: string;
+ contactEquations: ContactEquation[];
+ frictionEquations: FrictionEquation[];
+ };
+
+ static NO_SLEEPING: number;
+ static BODY_SLEEPING: number;
+ static ISLAND_SLEEPING: number;
+
+ static integrateBody(body: Body, dy: number): void;
+
+ constructor(options?: {
+ solver?: Solver;
+ gravity?: number[];
+ broadphase?: Broadphase;
+ islandSplit?: boolean;
+ doProfiling?: boolean;
+ });
+
+ springs: Spring[];
+ bodies: Body[];
+ solver: Solver;
+ narrowphase: Narrowphase;
+ islandManager: IslandManager;
+ gravity: number[];
+ frictionGravity: number;
+ useWorldGravityAsFrictionGravity: boolean;
+ useFrictionGravityOnZeroGravity: boolean;
+ doProfiling: boolean;
+ lastStepTime: number;
+ broadphase: Broadphase;
+ constraints: Constraint[];
+ defaultMaterial: Material;
+ defaultContactMaterial: ContactMaterial;
+ lastTimeStep: number;
+ applySpringForces: boolean;
+ applyDamping: boolean;
+ applyGravity: boolean;
+ solveConstraints: boolean;
+ contactMaterials: ContactMaterial[];
+ time: number;
+ stepping: boolean;
+ islandSplit: boolean;
+ emitImpactEvent: boolean;
+ sleepMode: number;
+
+ addConstraint(c: Constraint): void;
+
+ addContactMaterial(contactMaterial: ContactMaterial): void;
+
+ removeContactMaterial(cm: ContactMaterial): void;
+
+ getContactMaterial(materialA: Material, materialB: Material): ContactMaterial; // ContactMaterial | boolean
+ removeConstraint(c: Constraint): void;
+
+ step(dy: number, timeSinceLastCalled?: number, maxSubSteps?: number): void;
+
+ runNarrowphase(np: Narrowphase, bi: Body, si: Shape, xi: any[], ai: number, bj: Body, sj: Shape, xj: any[], aj: number, cm: number, glen: number): void;
+
+ addSpring(s: Spring): void;
+
+ removeSpring(s: Spring): void;
+
+ addBody(body: Body): void;
+
+ removeBody(body: Body): void;
+
+ getBodyByID(id: number): Body; //Body | boolean
+ disableBodyCollision(bodyA: Body, bodyB: Body): void;
+
+ enableBodyCollision(bodyA: Body, bodyB: Body): void;
+
+ clear(): void;
+
+ clone(): World;
+
+ hitTest(worldPoint: number[], bodies: Body[], precision: number): Body[];
+
+ setGlobalEquationParameters(parameters: {
+ relaxation?: number;
+ stiffness?: number;
+ }): void;
+
+ setGlobalStiffness(stiffness: number): void;
+
+ setGlobalRelaxation(relaxation: number): void;
+ }
+
+}
diff --git a/mar/phaser/phaser-plugin-isometric.js b/mar/phaser/phaser-plugin-isometric.js
index bafe194..29a48f3 100644
--- a/mar/phaser/phaser-plugin-isometric.js
+++ b/mar/phaser/phaser-plugin-isometric.js
@@ -725,7 +725,7 @@ Phaser.Plugin.Isometric.IsoSprite = function (game, x, y, z, key, frame) {
Phaser.Sprite.call(this, game, x, y, key, frame);
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.Plugin.Isometric.ISOSPRITE;
@@ -2009,7 +2009,7 @@ Phaser.Plugin.Isometric.Body = function (sprite) {
this.game = sprite.game;
/**
- * @property {number} type - The type of physics system this body belongs to.
+ * @property {number} objType - The objType of physics system this body belongs to.
*/
this.type = Phaser.Plugin.Isometric.ISOARCADE;
@@ -2219,7 +2219,7 @@ Phaser.Plugin.Isometric.Body = function (sprite) {
/**
* This flag allows you to disable the custom x separation that takes place by Physics.IsoArcade.separate.
- * Used in combination with your own collision processHandler you can create whatever type of collision response you need.
+ * Used in combination with your own collision processHandler you can create whatever objType of collision response you need.
* @property {boolean} customSeparateX - Use a custom separation system or the built-in one?
* @default
*/
@@ -2227,7 +2227,7 @@ Phaser.Plugin.Isometric.Body = function (sprite) {
/**
* This flag allows you to disable the custom y separation that takes place by Physics.IsoArcade.separate.
- * Used in combination with your own collision processHandler you can create whatever type of collision response you need.
+ * Used in combination with your own collision processHandler you can create whatever objType of collision response you need.
* @property {boolean} customSeparateY - Use a custom separation system or the built-in one?
* @default
*/
@@ -2235,7 +2235,7 @@ Phaser.Plugin.Isometric.Body = function (sprite) {
/**
* This flag allows you to disable the custom z separation that takes place by Physics.IsoArcade.separate.
- * Used in combination with your own collision processHandler you can create whatever type of collision response you need.
+ * Used in combination with your own collision processHandler you can create whatever objType of collision response you need.
* @property {boolean} customSeparateZ - Use a custom separation system or the built-in one?
* @default
*/
diff --git a/mar/phaser/phaser.d.ts b/mar/phaser/phaser.d.ts
new file mode 100644
index 0000000..010f950
--- /dev/null
+++ b/mar/phaser/phaser.d.ts
@@ -0,0 +1,7685 @@
+///
+///
+
+// Type definitions for Phaser CE
+// Project: https://github.com/photonstorm/phaser-ce
+
+declare module "phaser-ce" {
+ export = Phaser;
+}
+
+declare class Phaser {
+
+ static VERSION: string;
+ static DEV_VERSION: string;
+ static GAMES: Phaser.Game[];
+
+ static AUTO: number;
+ static CANVAS: number;
+ static WEBGL: number;
+ static HEADLESS: number;
+ static WEBGL_MULTI: number;
+
+ static BITMAPDATA: number;
+ static BITMAPTEXT: number;
+ static BUTTON: number;
+ static CANVAS_FILTER: number;
+ static CIRCLE: number;
+ static ELLIPSE: number;
+ static EMITTER: number;
+ static GRAPHICS: number;
+ static GROUP: number;
+ static IMAGE: number;
+ static LINE: number;
+ static MATRIX: number;
+ static POINT: number;
+ static POINTER: number;
+ static POLYGON: number;
+ static RECTANGLE: number;
+ static ROUNDEDRECTANGLE: number;
+ static RENDERTEXTURE: number;
+ static RETROFONT: number;
+ static SPRITE: number;
+ static SPRITEBATCH: number;
+ static TEXT: number;
+ static TILEMAP: number;
+ static TILEMAPLAYER: number;
+ static TILESPRITE: number;
+ static WEBGL_FILTER: number;
+ static ROPE: number;
+ static CREATURE: number;
+ static VIDEO: number;
+
+ static NONE: number;
+ static LEFT: number;
+ static RIGHT: number;
+ static UP: number;
+ static DOWN: number;
+
+ static HORIZONTAL: number;
+ static VERTICAL: number;
+ static LANDSCAPE: number;
+ static PORTRAIT: number;
+
+ static ANGLE_UP: number;
+ static ANGLE_DOWN: number;
+ static ANGLE_LEFT: number;
+ static ANGLE_RIGHT: number;
+ static ANGLE_NORTH_EAST: number;
+ static ANGLE_NORTH_WEST: number;
+ static ANGLE_SOUTH_EAST: number;
+ static ANGLE_SOUTH_WEST: number;
+
+ static TOP_LEFT: number;
+ static TOP_CENTER: number;
+ static TOP_RIGHT: number;
+
+ static LEFT_TOP: number;
+ static LEFT_CENTER: number;
+ static LEFT_BOTTOM: number;
+
+ static CENTER: number;
+
+ static RIGHT_TOP: number;
+ static RIGHT_CENTER: number;
+ static RIGHT_BOTTOM: number;
+
+ static BOTTOM_LEFT: number;
+ static BOTTOM_CENTER: number;
+ static BOTTOM_RIGHT: number;
+
+}
+
+declare module Phaser {
+
+ enum blendModes {
+
+ NORMAL,
+ ADD,
+ MULTIPLY,
+ SCREEN,
+ OVERLAY,
+ DARKEN,
+ LIGHTEN,
+ COLOR_DODGE,
+ COLOR_BURN,
+ HARD_LIGHT,
+ SOFT_LIGHT,
+ DIFFERENCE,
+ EXCLUSION,
+ HUE,
+ SATURATION,
+ COLOR,
+ LUMINOSITY
+
+ }
+
+ export enum scaleModes {
+
+ DEFAULT,
+ LINEAR,
+ NEAREST
+
+ }
+
+ class Animation {
+
+ constructor(game: Phaser.Game, parent: Phaser.Sprite, name: string, frameData: Phaser.FrameData, frames: number[] | string[], frameRate?: number, loop?: boolean);
+
+ currentFrame: Phaser.Frame;
+ delay: number;
+ enableUpdate: boolean;
+ frame: number;
+ frameTotal: number;
+ game: Phaser.Game;
+ isFinished: boolean;
+ isPaused: boolean;
+ isPlaying: boolean;
+ killOnComplete: boolean;
+ loop: boolean;
+ loopCount: number;
+ name: string;
+ onComplete: Phaser.Signal;
+ onLoop: Phaser.Signal;
+ onStart: Phaser.Signal;
+ onUpdate: Phaser.Signal;
+ paused: boolean;
+ reversed: boolean;
+ speed: number;
+
+ complete(): void;
+
+ destroy(): void;
+
+ static generateFrameNames(prefix: string, start: number, stop: number, suffix?: string, zeroPad?: number): string[];
+
+ next(quantity?: number): void;
+
+ onPause(): void;
+
+ onResume(): void;
+
+ play(frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
+
+ previous(quantity?: number): void;
+
+ restart(): void;
+
+ reverse(): Animation;
+
+ reverseOnce(): Animation;
+
+ setFrame(frameId?: string | number, useLocalFrameIndex?: boolean): void;
+
+ stop(resetFrame?: boolean, dispatchComplete?: boolean): void;
+
+ update(): boolean;
+
+ updateCurrentFrame(signalUpdate: boolean, fromPlay?: boolean): boolean;
+
+ updateFrameData(frameData: FrameData): void;
+
+ }
+
+ class AnimationManager {
+
+ constructor(sprite: Phaser.Sprite);
+
+ currentAnim: Phaser.Animation;
+ currentFrame: Phaser.Frame;
+ frame: number;
+ frameData: Phaser.FrameData;
+ frameName: string;
+ frameTotal: number;
+ game: Phaser.Game;
+ isLoaded: boolean;
+ name: string;
+ paused: boolean;
+ sprite: Phaser.Sprite;
+ updateIfVisible: boolean;
+
+ add(name: string, frames?: number[] | string[], frameRate?: number, loop?: boolean, useNumericIndex?: boolean): Phaser.Animation;
+
+ copyFrameData(frameData: Phaser.FrameData, frame: string | number): boolean;
+
+ destroy(): void;
+
+ getAnimation(name: string): Phaser.Animation;
+
+ next(quantity?: number): void;
+
+ play(name: string, frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
+
+ previous(quantity?: number): void;
+
+ stop(name?: string, resetFrame?: boolean): void;
+
+ update(): boolean;
+
+ validateFrames(frames: Phaser.Frame[], useNumericIndex?: boolean): boolean;
+
+ }
+
+ class AnimationParser {
+
+ static JSONData(game: Phaser.Game, json: any): Phaser.FrameData;
+
+ static JSONDataHash(game: Phaser.Game, json: any): Phaser.FrameData;
+
+ static JSONDataPyxel(game: Phaser.Game, json: any): Phaser.FrameData;
+
+ static spriteSheet(game: Phaser.Game, key: string, frameWidth: number, frameHeight: number, frameMax?: number, margin?: number, spacing?: number, skipFrames?: number): Phaser.FrameData;
+
+ static XMLData(game: Phaser.Game, xml: any): Phaser.FrameData;
+
+ }
+
+ class AudioSprite {
+
+ constructor(game: Phaser.Game, key: string);
+
+ game: Phaser.Game;
+ key: string;
+ config: any;
+ autoplayKey: string;
+ autoplay: boolean;
+ sounds: any;
+
+ get(marker: string): Phaser.Sound;
+
+ play(marker: string, volume?: number): Phaser.Sound;
+
+ stop(marker: string): Phaser.Sound;
+
+ }
+
+ class ArraySet {
+
+ constructor(list: any[]);
+
+ position: number;
+ list: any[];
+ total: number;
+ first: any;
+ next: any;
+
+ add(item: any): any;
+
+ getByKey(property: string, value: any): any;
+
+ getIndex(item: any): number;
+
+ exists(item: any): boolean;
+
+ reset(): void;
+
+ remove(item: any): any;
+
+ removeAll(destoy?: boolean): void;
+
+ setAll(key: any, value: any): void;
+
+ callAll(key: string, ...parameter: any[]): void;
+
+ }
+
+ class ArrayUtils {
+
+ static getRandomItem(objects: T[], startIndex?: number, length?: number): T;
+
+ static removeRandomItem(objects: T[], startIndex?: number, length?: number): T;
+
+ static remove(array: T[], startIndex: number, count?: number): T;
+
+ static shuffle(array: T[]): T[];
+
+ static transposeMatrix(array: T[]): T;
+
+ static rotateMatrix(matrix: any, direction: number | string): any;
+
+ static findClosest(value: number, arr: number[]): number;
+
+ static rotate(array: any[]): any;
+
+ static rotateLeft(array: any[]): any;
+
+ static rotateRight(array: any[]): any;
+
+ static numberArray(start: number, end?: number): number[];
+
+ static numberArrayStep(start: number, end?: number, step?: number): number[];
+
+ }
+
+ interface BitmapFont {
+
+ base: PIXI.BaseTexture;
+ data: HTMLImageElement;
+ font: Phaser.BMFont;
+ url: string;
+
+ }
+
+ interface BMFont {
+
+ chars: Phaser.BMFontChar[];
+ font: string;
+ lineHeight: number;
+ size: number;
+
+ }
+
+ interface BMFontChar {
+
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+ xOffset: number;
+ yOffset: number;
+ xAdvance: number;
+ kerning: number[];
+ texture: PIXI.BaseTexture;
+
+ }
+
+ class BitmapData {
+
+ constructor(game: Phaser.Game, key: string, width?: number, height?: number, skipPool?: boolean);
+
+ baseTexture: PIXI.BaseTexture;
+ buffer: ArrayBuffer;
+ canvas: HTMLCanvasElement;
+ context: CanvasRenderingContext2D;
+ ctx: CanvasRenderingContext2D;
+ data: Uint8Array;
+ dirty: boolean;
+ disableTextureUpload: boolean;
+ game: Phaser.Game;
+ height: number;
+ imageData: ImageData;
+ key: string;
+ op: string;
+ pixels: Uint32Array;
+ smoothed: boolean;
+ smoothProperty: string;
+ texture: PIXI.Texture;
+ textureFrame: Phaser.Frame;
+ type: number;
+ width: number;
+
+ static getTransform(translateX: number, translateY: number, scaleX: number, scaleY: number, skewX: number, skewY: number): any;
+
+ add(object: any): Phaser.BitmapData;
+
+ addToWorld(x?: number, y?: number, anchorX?: number, anchorY?: number, scaleX?: number, scaleY?: number): Phaser.Image;
+
+ alphaMask(source: any, mask?: any, sourceRect?: Phaser.Rectangle, maskRect?: Phaser.Rectangle): Phaser.BitmapData;
+
+ blendAdd(): Phaser.BitmapData;
+
+ blendColor(): Phaser.BitmapData;
+
+ blendColorBurn(): Phaser.BitmapData;
+
+ blendColorDodge(): Phaser.BitmapData;
+
+ blendDarken(): Phaser.BitmapData;
+
+ blendDestinationAtop(): Phaser.BitmapData;
+
+ blendDestinationIn(): Phaser.BitmapData;
+
+ blendDestinationOut(): Phaser.BitmapData;
+
+ blendDestinationOver(): Phaser.BitmapData;
+
+ blendDifference(): Phaser.BitmapData;
+
+ blendExclusion(): Phaser.BitmapData;
+
+ blendHardLight(): Phaser.BitmapData;
+
+ blendHue(): Phaser.BitmapData;
+
+ blendLighten(): Phaser.BitmapData;
+
+ blendLuminosity(): Phaser.BitmapData;
+
+ blendMultiply(): Phaser.BitmapData;
+
+ blendOverlay(): Phaser.BitmapData;
+
+ blendReset(): Phaser.BitmapData;
+
+ blendSaturation(): Phaser.BitmapData;
+
+ blendScreen(): Phaser.BitmapData;
+
+ blendSoftLight(): Phaser.BitmapData;
+
+ blendSourceAtop(): Phaser.BitmapData;
+
+ blendSourceIn(): Phaser.BitmapData;
+
+ blendSourceOut(): Phaser.BitmapData;
+
+ blendSourceOver(): Phaser.BitmapData;
+
+ blendXor(): Phaser.BitmapData;
+
+ circle(x: number, y: number, radius: number, fillStyle?: string): Phaser.BitmapData;
+
+ clear(x?: number, y?: number, width?: number, height?: number): Phaser.BitmapData;
+
+ cls(): Phaser.BitmapData;
+
+ copy(source?: any, x?: number, y?: number, width?: number, height?: number, tx?: number, ty?: number, newWidth?: number, newHeight?: number, rotate?: number, anchorX?: number, anchorY?: number, scaleX?: number, scaleY?: number, alpha?: number, blendMode?: string, roundPx?: boolean): Phaser.BitmapData;
+
+ copyPixels(source: any, area: Phaser.Rectangle, x: number, y: number, alpha?: number): void;
+
+ copyRect(source: any, area: Phaser.Rectangle, x?: number, y?: number, alpha?: number, blendMode?: string, roundPx?: boolean): Phaser.BitmapData;
+
+ copyTransform(source: any, blendMode?: string, roundPx?: boolean): Phaser.BitmapData;
+
+ destroy(): void;
+
+ draw(source: any, x?: number, y?: number, width?: number, height?: number, blendMode?: string, roundPx?: boolean): Phaser.BitmapData;
+
+ drawFull(parent: any, blendMode?: string, roundPx?: boolean): Phaser.BitmapData;
+
+ drawGroup(group: Phaser.Group, blendMode?: string, roundPx?: boolean): Phaser.BitmapData;
+
+ extract(destination: Phaser.BitmapData, r: number, g: number, b: number, a?: number, resize?: boolean, r2?: number, g2?: number, b2?: number): Phaser.BitmapData;
+
+ fill(r: number, g: number, b: number, a?: number): Phaser.BitmapData;
+
+ generateTexture(key: string, callback?: (texture: PIXI.Texture) => void, callbackContext?: any): PIXI.Texture;
+
+ getBounds(rect?: Phaser.Rectangle): Phaser.Rectangle;
+
+ getFirstPixel(direction: number): { r: number; g: number; b: number; x: number; y: number; };
+
+ getPixel(x: number, y: number, out?: any): any;
+
+ getPixelRGB(x: number, y: number, out?: any, hsl?: boolean, hsv?: boolean): any;
+
+ getPixel32(x: number, y: number): number;
+
+ getPixels(rect: Phaser.Rectangle): ImageData;
+
+ getTransform(translateX: number, translateY: number, scaleX: number, scaleY: number, skewX: number, skewY: number): any;
+
+ line(x1: number, y1: number, x2: number, y2: number, color?: string, width?: number): Phaser.BitmapData;
+
+ load(source: any): Phaser.BitmapData;
+
+ move(x: number, y: number, wrap?: boolean): Phaser.BitmapData;
+
+ moveH(distance: number, wrap?: boolean): Phaser.BitmapData;
+
+ moveV(distance: number, wrap?: boolean): Phaser.BitmapData;
+
+ polygon(points: any[], fillStyle?: string | CanvasGradient | CanvasPattern, lineWidth?: number, strokeStyle?: string | CanvasGradient | CanvasPattern): Phaser.BitmapData;
+
+ processPixel(callback: (color: number, x: number, y: number) => void, callbackContext: any, x?: number, y?: Number, width?: number, height?: number): Phaser.BitmapData;
+
+ processPixelRGB(callback: (color: ColorComponents, x: number, y: number) => void, callbackContext: any, x?: number, y?: Number, width?: number, height?: number): Phaser.BitmapData;
+
+ rect(x: number, y: number, width: number, height: number, fillStyle?: string): Phaser.BitmapData;
+
+ render(): Phaser.BitmapData;
+
+ replaceRGB(r1: number, g1: number, b1: number, a1: number, r2: number, g2: number, b2: number, a2: number, region?: Phaser.Rectangle): Phaser.BitmapData;
+
+ resize(width: number, height: number): Phaser.BitmapData;
+
+ resizeFrame(parent: any, width: number, height: number): void;
+
+ setHSL(h?: number, s?: number, l?: number, region?: Phaser.Rectangle): Phaser.BitmapData;
+
+ setPixel(x: number, y: number, red: number, green: number, blue: number, immediate?: boolean): Phaser.BitmapData;
+
+ setPixel32(x: number, y: number, red: number, green: number, blue: number, alpha: number, immediate?: boolean): Phaser.BitmapData;
+
+ shadow(color: string, blur?: number, x?: number, y?: number): Phaser.BitmapData;
+
+ shiftHSL(h?: number, s?: number, l?: number, region?: Phaser.Rectangle): Phaser.BitmapData;
+
+ text(text: string, x?: number, y?: number, font?: string, color?: string, shadow?: boolean): Phaser.BitmapData;
+
+ textureLine(line: Phaser.Line, key: string, repeat?: string): Phaser.BitmapData;
+
+ update(x?: number, y?: number, width?: number, height?: number): Phaser.BitmapData;
+
+ copyBitmapData(source: Phaser.BitmapData, x: number, y: number): Phaser.BitmapData;
+
+ }
+
+ class BitmapText extends PIXI.DisplayObjectContainer {
+
+ constructor(game: Phaser.Game, x: number, y: number, font: string, text?: string, size?: number, align?: string);
+
+ align: string;
+ alive: boolean;
+ anchor: Phaser.Point;
+ animations: Phaser.AnimationManager;
+ angle: number;
+ autoCull: boolean;
+ body: Phaser.Physics.Arcade.Body | Phaser.Physics.P2.Body | Phaser.Physics.Ninja.Body | any;
+ bottom: number;
+ cameraOffset: Phaser.Point;
+ checkWorldBounds: boolean;
+ data: any;
+ destroyPhase: boolean;
+ debug: boolean;
+ dirty: boolean;
+ events: Phaser.Events;
+ exists: boolean;
+ fixedToCamera: boolean;
+ font: string;
+ fontSize: number;
+ fresh: boolean;
+ game: Phaser.Game;
+ input: Phaser.InputHandler;
+ inputEnabled: boolean;
+ inCamera: boolean;
+ inWorld: boolean;
+ key: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture;
+ left: number;
+ name: string;
+ components: any;
+ lifespan: number;
+ maxWidth: number;
+ offsetX: number;
+ offsetY: number;
+ outOfBoundsKill: boolean;
+ pendingDestroy: boolean;
+ physicsType: number;
+ previousPosition: Phaser.Point;
+ previousRotation: number;
+ position: Phaser.Point;
+ renderOrderID: number;
+ right: number;
+ text: string;
+ smoothed: boolean;
+ textWidth: number;
+ textHeight: number;
+ tint: number;
+ top: number;
+ type: number;
+ world: Phaser.Point;
+ x: number;
+ y: number;
+ z: number;
+
+ alignIn(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ alignTo(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ destroy(destroyChildren?: boolean): void;
+
+ kill(): void;
+
+ postUpdate(): void;
+
+ preUpdate(): void;
+
+ purgeGlyphs(): number;
+
+ reset(x: number, y: number, health?: number): Phaser.BitmapText;
+
+ revive(health?: number): Phaser.BitmapText;
+
+ scanLine(data: any, scale: number, text: string): { width: number; text: string; end: boolean; chars: string[] };
+
+ setText(text: string): void;
+
+ update(): void;
+
+ updateText(): void;
+
+ updateTransform(): void;
+
+ }
+
+ class Bullet extends Phaser.Sprite {
+
+ constructor(game: Phaser.Game, x: number, y: number, key?: any, frame?: any);
+
+ kill(): Phaser.Bullet;
+
+ update(): void;
+
+ }
+
+ class Button extends Phaser.Image {
+
+ constructor(game: Phaser.Game, x?: number, y?: number, key?: string, callback?: Function, callbackContext?: any, overFrame?: string | number, outFrame?: string | number, downFrame?: string | number, upFrame?: string | number);
+
+ forceOut: boolean;
+ freezeFrames: boolean;
+ onDownSound: Phaser.Sound | Phaser.AudioSprite;
+ onDownSoundMarker: string;
+ onInputDown: Phaser.Signal;
+ onInputOut: Phaser.Signal;
+ onInputOver: Phaser.Signal;
+ onInputUp: Phaser.Signal;
+ onOutSound: Phaser.Sound | Phaser.AudioSprite;
+ onOutSoundMarker: string;
+ onOverSound: Phaser.Sound | Phaser.AudioSprite;
+ onOverSoundMarker: string;
+ onOverMouseOnly: boolean;
+ onUpSound: Phaser.Sound | Phaser.AudioSprite;
+ onUpSoundMaker: string;
+ physicsType: number;
+ type: number;
+
+ clearFrames(): void;
+
+ setDownSound(sound: Phaser.Sound | Phaser.AudioSprite, marker?: string): void;
+
+ setFrames(overFrame?: string | number, outFrame?: string | number, downFrame?: string | number, upFrame?: string | number): void;
+
+ onInputOverHandler(sprite: Phaser.Button, pointer: Phaser.Pointer): void;
+
+ onInputOutHandler(sprite: Phaser.Button, pointer: Phaser.Pointer): void;
+
+ onInputDownHandler(sprite: Phaser.Button, pointer: Phaser.Pointer): void;
+
+ onInputUpHandler(sprite: Phaser.Button, pointer: Phaser.Pointer, isOver: boolean): void;
+
+ removedFromWorld(): void;
+
+ setOutSound(sound: Phaser.Sound | Phaser.AudioSprite, marker?: string): void;
+
+ setOverSound(sound: Phaser.Sound | Phaser.AudioSprite, marker?: string): void;
+
+ setSounds(overSound?: Phaser.Sound | Phaser.AudioSprite, overMarker?: string, downSound?: Phaser.Sound | Phaser.AudioSprite, downMarker?: string, outSound?: Phaser.Sound | Phaser.AudioSprite, outMarker?: string, upSound?: Phaser.Sound | Phaser.AudioSprite, upMarker?: string): void;
+
+ setState(newState: number): void;
+
+ setUpSound(sound: Phaser.Sound | Phaser.AudioSprite, marker?: string): void;
+
+ }
+
+ class PointerMode {
+
+ static CURSOR: number;
+ static CONTACT: number;
+
+ }
+
+ class Cache {
+
+ constructor(game: Phaser.Game);
+
+ static BINARY: number;
+ static BITMAPDATA: number;
+ static BITMAPFONT: number;
+ static CANVAS: number;
+ static IMAGE: number;
+ static JSON: number;
+ static PHYSICS: number;
+ static READY_TIMEOUT: number;
+ static RENDER_TEXTURE: number;
+ static SHADER: number;
+ static SOUND: number;
+ static SPRITE_SHEET: number;
+ static TEXT: number;
+ static TEXTURE: number;
+ static TEXTURE_ATLAS: number;
+ static TILEMAP: number;
+ static XML: number;
+ static VIDEO: number;
+
+ static DEFAULT: PIXI.Texture;
+ static MISSING: PIXI.Texture;
+
+ autoResolveURL: boolean;
+ game: Phaser.Game;
+ onReady: Phaser.Signal;
+ onSoundUnlock: Phaser.Signal;
+
+ addBinary(key: string, binaryData: any): void;
+
+ addBitmapData(key: string, bitmapData: Phaser.BitmapData, frameData?: Phaser.FrameData): Phaser.BitmapData;
+
+ addBitmapFont(key: string, url: string, data: any, atlasData: any, atlasType: string, xSpacing?: number, ySpacing?: number): void;
+
+ addBitmapFontFromAtlas(key: string, atlasKey: string, atlasFrame: string, dataKey: string, dataType?: string, xSpacing?: number, ySpacing?: number): void;
+
+ addCanvas(key: string, canvas: HTMLCanvasElement, context?: CanvasRenderingContext2D): void;
+
+ addDefaultImage(): void;
+
+ addImage(key: string, url: string, data: any): HTMLImageElement;
+
+ addJSON(key: string, urL: string, data: any): void;
+
+ addMissingImage(): void;
+
+ addPhysicsData(key: string, url: string, JSONData: any, format: number): void;
+
+ addRenderTexture(key: string, texture: RenderTexture): void;
+
+ addShader(key: string, url: string, data: any): void;
+
+ addSound(key: string, url: string, data: any, webAudio: boolean, audioTag: boolean): void;
+
+ addSpriteSheet(key: string, url: string, data: any, frameWidth: number, frameHeight: number, frameMax?: number, margin?: number, spacing?: number, skipFrames?: number): void;
+
+ addText(key: string, url: string, data: any): void;
+
+ addTextureAtlas(key: string, url: string, data: any, atlasData: any, format: number): void;
+
+ addTilemap(key: string, url: string, mapData: any, format: number): void;
+
+ addVideo(key: string, url: string, data: any, isBlob?: boolean): void;
+
+ addXML(key: string, url: string, data: any): void;
+
+ checkBinaryKey(key: string): boolean;
+
+ checkBitmapDataKey(key: string): boolean;
+
+ checkBitmapFontKey(key: string): boolean;
+
+ checkCanvasKey(key: string): boolean;
+
+ checkImageKey(key: string): boolean;
+
+ checkJSONKey(key: string): boolean;
+
+ checkKey(cache: number, key: string): boolean;
+
+ checkPhysicsKey(key: string): boolean;
+
+ checkRenderTextureKey(key: string): boolean;
+
+ checkShaderKey(key: string): boolean;
+
+ checkSoundKey(key: string): boolean;
+
+ checkTextKey(key: string): boolean;
+
+ checkTextureKey(key: string): boolean;
+
+ checkTilemapKey(key: string): boolean;
+
+ checkURL(url: string): any;
+
+ checkUrl(url: string): any;
+
+ checkXMLKey(key: string): boolean;
+
+ checkVideoKey(key: string): boolean;
+
+ clearGLTextures(): void;
+
+ decodedSound(key: string, data: any): void;
+
+ destroy(): void;
+
+ getBaseTexture(key: string, cache?: number): PIXI.BaseTexture;
+
+ getBinary(key: string): any;
+
+ getBitmapData(key: string): Phaser.BitmapData;
+
+ getBitmapFont(key: string): Phaser.BitmapFont;
+
+ getCanvas(key: string): HTMLCanvasElement;
+
+ getFrame(key: string, cache?: number): Phaser.Frame;
+
+ getFrameByIndex(key: string, index: number, cache?: number): Phaser.Frame;
+
+ getFrameByName(key: string, name: string, cache?: number): Phaser.Frame;
+
+ getFrameCount(key: string, cache?: number): number;
+
+ getFrameData(key: string, cache?: number): Phaser.FrameData;
+
+ getImage(key: string, full?: boolean): HTMLImageElement;
+
+ getItem(key: string, cache: number, method?: string, property?: string): any;
+
+ getJSON(key: string, clone?: boolean): any;
+
+ getKeys(cache: number): string[];
+
+ getPhysicsData(key: string, object?: string, fixtureKey?: string): any[];
+
+ getRenderTexture(key: string): Phaser.CachedRenderTexture;
+
+ getShader(key: string): string;
+
+ getSound(key: string): Phaser.Sound;
+
+ getSoundData(key: string): any;
+
+ getSpriteSheetKey(key: string): boolean;
+
+ getText(key: string): string;
+
+ getTextKeys(): string[];
+
+ getTexture(key: string): Phaser.RenderTexture;
+
+ getTextureAtlasKey(key: string): boolean;
+
+ getTextureFrame(key: string): Phaser.Frame;
+
+ getTilemap(key: string): any;
+
+ getTilemapData(key: string): any;
+
+ getURL(url: string): any;
+
+ getXML(key: string): any;
+
+ getVideo(key: string): Phaser.Video;
+
+ hasFrameData(key: string, cache?: number): boolean;
+
+ isSoundDecoded(key: string): boolean;
+
+ isSoundReady(key: string): boolean;
+
+ isSpriteSheet(key: string): boolean;
+
+ reloadSound(key: string): void;
+
+ reloadSoundComplete(key: string): void;
+
+ removeBinary(key: string): void;
+
+ removeBitmapData(key: string): void;
+
+ removeBitmapFont(key: string): void;
+
+ removeCanvas(key: string): void;
+
+ removeImage(key: string, destroyBaseTexture?: boolean): void;
+
+ removeJSON(key: string): void;
+
+ removePhysics(key: string): void;
+
+ removeRenderTexture(key: string): void;
+
+ removeShader(key: string): void;
+
+ removeSound(key: string): void;
+
+ removeSpriteSheet(key: string): void;
+
+ removeText(key: string): void;
+
+ removeTextureAtlas(key: string): void;
+
+ removeTilemap(key: string): void;
+
+ removeXML(key: string): void;
+
+ removeVideo(key: string): void;
+
+ updateFrameData(key: string, frameData: any, cache?: number): void;
+
+ updateSound(key: string, property: string, value: Phaser.Sound): void;
+
+ }
+
+ interface CachedRenderTexture {
+
+ frame: Phaser.Frame;
+ texture: Phaser.RenderTexture;
+
+ }
+
+ class Camera {
+
+ constructor(game: Phaser.Game, id: number, x: number, y: number, width: number, height: number);
+
+ static FOLLOW_LOCKON: number;
+ static FOLLOW_PLATFORMER: number;
+ static FOLLOW_TOPDOWN: number;
+ static FOLLOW_TOPDOWN_TIGHT: number;
+ static SHAKE_BOTH: number;
+ static SHAKE_HORIZONTAL: number;
+ static SHAKE_VERTICAL: number;
+ static ENABLE_FX: number;
+
+ atLimit: { x: boolean; y: boolean; };
+ bounds: Phaser.Rectangle;
+ deadzone: Phaser.Rectangle;
+ displayObject: PIXI.DisplayObject;
+ id: number;
+ fixedView: Phaser.Rectangle;
+ fx: Phaser.Graphics;
+ game: Phaser.Game;
+ height: number;
+ lerp: Phaser.Point;
+ position: Phaser.Point;
+ roundPx: boolean;
+ scale: Phaser.Point;
+ shakeIntensity: number;
+ onFadeComplete: Phaser.Signal;
+ onFlashComplete: Phaser.Signal;
+ onShakeComplete: Phaser.Signal;
+ target: Phaser.Sprite;
+ totalInView: number;
+ view: Phaser.Rectangle;
+ visible: boolean;
+ width: number;
+ world: Phaser.World;
+ x: number;
+ y: number;
+
+ checkBounds(): void;
+
+ fade(color?: number, duration?: number, force?: boolean, alpha?: number): boolean;
+
+ flash(color?: number, duration?: number, force?: boolean, alpha?: number): boolean;
+
+ focusOn(displayObject: PIXI.DisplayObject): void;
+
+ focusOnXY(x: number, y: number): void;
+
+ follow(target: Phaser.Sprite, style?: number, lerpX?: number, lerpY?: number): void;
+
+ reset(): void;
+
+ resetFX(): void;
+
+ setBoundsToWorld(): void;
+
+ setPosition(x: number, y: number): void;
+
+ setSize(width: number, height: number): void;
+
+ shake(intensity?: number, duration?: number, force?: boolean, direction?: number, shakeBounds?: boolean): boolean;
+
+ unfollow(): void;
+
+ update(): void;
+
+ }
+
+ class Canvas {
+
+ static addToDOM(canvas: HTMLCanvasElement, parent: HTMLElement, overflowHidden?: boolean): HTMLCanvasElement;
+
+ static create(parent: HTMLDivElement, width?: number, height?: number, id?: string, skipPool?: boolean): HTMLCanvasElement;
+
+ static getSmoothingEnabled(context: CanvasRenderingContext2D): boolean;
+
+ static getSmoothingPrefix(context: CanvasRenderingContext2D): string;
+
+ static removeFromDOM(canvas: HTMLCanvasElement): void;
+
+ static setBackgroundColor(canvas: HTMLCanvasElement, color: string): HTMLCanvasElement;
+
+ static setImageRenderingBicubic(canvas: HTMLCanvasElement): HTMLCanvasElement;
+
+ static setImageRenderingCrisp(canvas: HTMLCanvasElement): HTMLCanvasElement;
+
+ static setSmoothingEnabled(context: CanvasRenderingContext2D, value: boolean): CanvasRenderingContext2D;
+
+ static setTouchAction(canvas: HTMLCanvasElement, value: string): HTMLCanvasElement;
+
+ static setTransform(context: CanvasRenderingContext2D, translateX: number, translateY: number, scaleX: number, scaleY: number, skewX: number, skewY: number): CanvasRenderingContext2D;
+
+ static setUserSelect(canvas: HTMLCanvasElement, value?: string): HTMLCanvasElement;
+
+ }
+
+ export class CanvasPool {
+
+ static create(parent: HTMLElement, width?: number, height?: number): HTMLCanvasElement;
+
+ static getFirst(): HTMLCanvasElement;
+
+ static remove(parent: HTMLElement): void;
+
+ static removeByCanvas(canvas: HTMLCanvasElement): HTMLCanvasElement;
+
+ static getTotal(): number;
+
+ static getFree(): number;
+
+ static length: number;
+
+ static log(): void;
+
+ }
+
+ class Circle {
+
+ constructor(x?: number, y?: number, diameter?: number);
+
+ area: number;
+ bottom: number;
+ diameter: number;
+ empty: boolean;
+ left: number;
+ radius: number;
+ right: number;
+ top: number;
+ x: number;
+ y: number;
+
+ static circumferencePoint(a: Phaser.Circle, angle: number, asDegrees: boolean, out?: Phaser.Point): Phaser.Point;
+
+ static contains(a: Phaser.Circle, x: number, y: number): boolean;
+
+ static equals(a: Phaser.Circle, b: Phaser.Circle): boolean;
+
+ static intersects(a: Phaser.Circle, b: Phaser.Circle): boolean;
+
+ static intersectsRectangle(c: Phaser.Circle, r: Phaser.Rectangle): boolean;
+
+ circumference(): number;
+
+ circumferencePoint(angle: number, asDegrees?: boolean, out?: Phaser.Point): Phaser.Point;
+
+ clone(output: Phaser.Circle): Phaser.Circle;
+
+ contains(x: number, y: number): boolean;
+
+ copyFrom(source: any): Circle;
+
+ copyTo(dest: any): any;
+
+ distance(dest: any, round?: boolean): number;
+
+ getBounds(): Phaser.Rectangle;
+
+ offset(dx: number, dy: number): Phaser.Circle;
+
+ offsetPoint(point: Phaser.Point): Phaser.Circle;
+
+ random(out?: Phaser.Point): Phaser.Point;
+
+ sample(steps?: number, startAngle?: number, endAngle?: number, asDegrees?: boolean, out?: any[]): any[];
+
+ scale(x: number, y?: number): Phaser.Rectangle;
+
+ setTo(x: number, y: number, diameter: number): Circle;
+
+ toString(): string;
+
+ }
+
+ class Color {
+
+ static componentToHex(color: number): string;
+
+ static createColor(r?: number, g?: number, b?: number, a?: number, h?: number, s?: number, l?: number, v?: number): ColorComponents;
+
+ static fromRGBA(rgba: number, out?: ColorComponents): ColorComponents;
+
+ static getAlpha(color: number): number;
+
+ static getAlphaFloat(color: number): number;
+
+ static getBlue(color: number): number;
+
+ static getColor(red: number, green: number, blue: number): number;
+
+ static getColor32(alpha: number, red: number, green: number, blue: number): number;
+
+ static getGreen(color: number): number;
+
+ static getRandomColor(min?: number, max?: number, alpha?: number): number;
+
+ static getRed(color: number): number;
+
+ static getRGB(color: number): RGBColor;
+
+ static getWebRGB(color: number | RGBColor): string;
+
+ static hexToRGBArray(color: number): number[];
+
+ static hexToRGB(h: string): number;
+
+ static hexToColor(hex: string, out?: ColorComponents): ColorComponents;
+
+ static HSLtoRGB(h: number, s: number, l: number, out?: ColorComponents): ColorComponents;
+
+ static HSLColorWheel(s?: number, l?: number): ColorComponents[];
+
+ static HSVtoRGB(h: number, s: number, v: number, out?: ColorComponents): ColorComponents;
+
+ static HSVColorWheel(s?: number, v?: number): ColorComponents[];
+
+ static hueToColor(p: number, q: number, t: number): number;
+
+ static interpolateColor(color1: number, color2: number, steps: number, currentStep: number, alpha?: number, colorSpace?: number): number;
+
+ static interpolateColorWithRGB(color: number, r: number, g: number, b: number, steps: number, currentStep: number): number;
+
+ static interpolateRGB(r1: number, g1: number, b1: number, r2: number, g2: number, b2: number, steps: number, currentStep: number): number;
+
+ static linear(color1: number, color2: number, t: number): number;
+
+ static linearInterpolation(colors: number[], t: number): number;
+
+ static packPixel(r: number, g: number, b: number, a: number): number;
+
+ static RGBArrayToHex(rgb: number[]): number;
+
+ static RGBtoHSL(r: number, g: number, b: number, out?: ColorComponents): ColorComponents;
+
+ static RGBtoHSV(r: number, g: number, b: number, out?: ColorComponents): ColorComponents;
+
+ static RGBtoString(r: number, g: number, b: number, a?: number, prefix?: string): string;
+
+ static toRGBA(r: number, g: number, b: number, a: number): number;
+
+ static toABGR(r: number, g: number, b: number, a: number): number;
+
+ static unpackPixel(rgba: number, out?: ColorComponents, hsl?: boolean, hsv?: boolean): ColorComponents;
+
+ static updateColor(out: ColorComponents): ColorComponents;
+
+ static valueToColor(value: string, out?: ColorComponents): ColorComponents;
+
+ static webToColor(web: string, out?: ColorComponents): ColorComponents;
+
+ static blendNormal(a: number): number;
+
+ static blendLighten(a: number, b: number): number;
+
+ static blendDarken(a: number, b: number): number;
+
+ static blendMultiply(a: number, b: number): number;
+
+ static blendAverage(a: number, b: number): number;
+
+ static blendAdd(a: number, b: number): number;
+
+ static blendSubtract(a: number, b: number): number;
+
+ static blendDifference(a: number, b: number): number;
+
+ static blendNegation(a: number, b: number): number;
+
+ static blendScreen(a: number, b: number): number;
+
+ static blendExclusion(a: number, b: number): number;
+
+ static blendOverlay(a: number, b: number): number;
+
+ static blendSoftLight(a: number, b: number): number;
+
+ static blendHardLight(a: number, b: number): number;
+
+ static blendColorDodge(a: number, b: number): number;
+
+ static blendColorBurn(a: number, b: number): number;
+
+ static blendLinearDodge(a: number, b: number): number;
+
+ static blendLinearBurn(a: number, b: number): number;
+
+ static blendLinearLight(a: number, b: number): number;
+
+ static blendVividLight(a: number, b: number): number;
+
+ static blendPinLight(a: number, b: number): number;
+
+ static blendHardMix(a: number, b: number): number;
+
+ static blendReflect(a: number, b: number): number;
+
+ static blendGlow(a: number, b: number): number;
+
+ static blendPhoenix(a: number, b: number): number;
+
+ }
+
+ module Component {
+
+ module Core {
+ var skipTypeChecks: boolean;
+ }
+ }
+
+ interface RGBColor {
+ r: number;
+ g: number;
+ b: number;
+ a: number;
+ }
+
+ interface ColorComponents extends RGBColor {
+ h: number;
+ s: number;
+ v: number;
+ l: number;
+ color: number;
+ color32: number;
+ rgba: string;
+ }
+
+ class Create {
+
+ constructor(game: Phaser.Game);
+
+ static PALETTE_ARNE: number;
+ static PALETTE_JMP: number;
+ static PALETTE_CGA: number;
+ static PALETTE_C64: number;
+ static PALETTE_JAPANESE_MACHINE: number;
+
+ bmd: Phaser.BitmapData;
+ canvas: HTMLCanvasElement;
+ ctx: CanvasRenderingContext2D;
+ game: Phaser.Game;
+ palettes: any;
+
+ copy(dest?: Phaser.BitmapData, x?: number, y?: number, width?: number, height?: number, blendMode?: string, roundPx?: boolean): Phaser.BitmapData;
+
+ grid(key: string, width: number, height: number, cellWidth: number, cellHeight: number, color: string, generateTexture?: boolean, callback?: Function, callbackContext?: any): PIXI.Texture;
+
+ texture(key: string, data: any, pixelWidth?: number, pixelHeight?: number, palette?: number, generateTexture?: boolean, callback?: Function, callbackContext?: any): PIXI.Texture;
+
+ }
+
+ interface CursorKeys {
+
+ up: Phaser.Key;
+ down: Phaser.Key;
+ left: Phaser.Key;
+ right: Phaser.Key;
+
+ }
+
+ class Device {
+
+ static LITTLE_ENDIAN: boolean;
+ static onInitialized: Phaser.Signal;
+
+ static checkFullScreenSupport(): void;
+
+ static canPlayAudio(type: string): boolean;
+
+ static canPlayVideo(type: string): boolean;
+
+ static isConsoleOpen(): boolean;
+
+ static isAndroidStockBrowser(): string;
+
+ static whenReady: (callback: Function, context?: any) => void;
+
+ android: boolean;
+ arora: boolean;
+ audioData: boolean;
+ cancelFullScreen: string;
+ canHandleAlpha: boolean;
+ canUseMultiply: boolean;
+ canvas: boolean;
+ chrome: boolean;
+ chromeOS: boolean;
+ chromeVersion: number;
+ cocoonJS: boolean;
+ cocoonJSApp: boolean;
+ cordova: boolean;
+ crosswalk: boolean;
+ css3D: boolean;
+ desktop: boolean;
+ deviceReadyAt: number;
+ electron: boolean;
+ ejecta: boolean;
+ epiphany: boolean;
+ file: boolean;
+ fileSystem: boolean;
+ firefox: boolean;
+ firefoxVersion: number;
+ fullScreen: boolean;
+ fullScreenKeyboard: boolean;
+ getUserMedia: boolean;
+ game: Phaser.Game;
+ h264Video: boolean;
+ hlsVideo: boolean;
+ ie: boolean;
+ ieVersion: number;
+ iOS: boolean;
+ iOSVersion: number;
+ initialized: boolean;
+ iPad: boolean;
+ iPhone: boolean;
+ iPhone4: boolean;
+ kindle: boolean;
+ linux: boolean;
+ littleEndian: boolean;
+ localStorage: boolean;
+ m4a: boolean;
+ macOS: boolean;
+ midori: boolean;
+ mobileSafari: boolean;
+ mp3: boolean;
+ mp4Video: boolean;
+ mspointer: boolean;
+ node: boolean;
+ nodeWebkit: boolean;
+ ogg: boolean;
+ oggVideo: number;
+ opera: boolean;
+ opus: boolean;
+ pixelRatio: number;
+ pointerLock: boolean;
+ quirksMode: boolean;
+ requestFullScreen: string;
+ safari: boolean;
+ silk: boolean;
+ support32bit: boolean;
+ touch: boolean;
+ trident: boolean;
+ tridentVersion: number;
+ typedArray: boolean;
+ vibration: boolean;
+ vita: boolean;
+ wav: boolean;
+ webApp: boolean;
+ webAudio: boolean;
+ webGL: boolean;
+ webGLError: Error;
+ webm: boolean;
+ webmVideo: boolean;
+ windows: boolean;
+ windowsPhone: boolean;
+ wheelEvent: string;
+ worker: boolean;
+ wp9Video: boolean;
+
+ }
+
+ class DeviceButton {
+
+ constructor(parent: Phaser.Pointer | Phaser.SinglePad, butonCode: number);
+
+ buttonCode: number;
+ game: Phaser.Game;
+ isDown: boolean;
+ isUp: boolean;
+ onDown: Phaser.Signal;
+ onFloat: Phaser.Signal;
+ onUp: Phaser.Signal;
+ pad: Phaser.Gamepad;
+ repeats: number;
+ timeDown: number;
+ timeUp: number;
+ value: number;
+
+ destroy(): void;
+
+ justPressed(duration?: number): boolean;
+
+ justReleased(duration?: number): boolean;
+
+ processButtonDown(value: number): void;
+
+ processButtonFloat(value: number): void;
+
+ processButtonUp(value: number): void;
+
+ reset(): void;
+
+ }
+
+ module Easing {
+
+ var Default: Function;
+ var Power0: Function;
+ var Power1: Function;
+ var power2: Function;
+ var power3: Function;
+ var power4: Function;
+
+ class Back {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ class Bounce {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ class Circular {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ class Cubic {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ class Elastic {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ class Exponential {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ class Linear {
+ static None(k: number): number;
+ }
+
+ class Quadratic {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ class Quartic {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ class Quintic {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ class Sinusoidal {
+ static In(k: number): number;
+
+ static Out(k: number): number;
+
+ static InOut(k: number): number;
+ }
+
+ }
+
+ class Ellipse {
+
+ constructor(x?: number, y?: number, width?: number, height?: number);
+
+ bottom: number;
+ empty: boolean;
+ height: number;
+ left: number;
+ right: number;
+ top: number;
+ type: number;
+ width: number;
+ x: number;
+ y: number;
+
+ static constains(a: Phaser.Ellipse, x: number, y: number): boolean;
+
+ clone(output: Phaser.Ellipse): Phaser.Ellipse;
+
+ contains(x: number, y: number): boolean;
+
+ copyFrom(source: any): Phaser.Ellipse;
+
+ copyTo(dest: any): any;
+
+ getBounds(): Phaser.Rectangle;
+
+ random(out?: Phaser.Point): Phaser.Point;
+
+ setTo(x: number, y: number, width: number, height: number): Phaser.Ellipse;
+
+ toString(): string;
+
+ }
+
+ class Events {
+
+ constructor(sprite: Phaser.Sprite);
+
+ parent: Phaser.Sprite;
+ onAddedToGroup: Phaser.Signal;
+ onRemovedFromGroup: Phaser.Signal;
+ onRemovedFromWorld: Phaser.Signal;
+ onKilled: Phaser.Signal;
+ onRevived: Phaser.Signal;
+ onOutOfBounds: Phaser.Signal;
+ onEnterBounds: Phaser.Signal;
+ onInputOver: Phaser.Signal;
+ onInputOut: Phaser.Signal;
+ onInputDown: Phaser.Signal;
+ onInputUp: Phaser.Signal;
+ onDestroy: Phaser.Signal;
+ onDragStart: Phaser.Signal;
+ onDragStop: Phaser.Signal;
+ onDragUpdate: Phaser.Signal;
+ onAnimationStart: Phaser.Signal;
+ onAnimationComplete: Phaser.Signal;
+ onAnimationLoop: Phaser.Signal;
+
+ destroy(): void;
+
+ }
+
+ class Filter extends PIXI.AbstractFilter {
+
+ constructor(game: Phaser.Game, uniforms: any, fragmentSrc: string | string[]);
+
+ dirty: boolean;
+ game: Phaser.Game;
+ height: number;
+ fragmentSrc: string | string[];
+ padding: number;
+ prevPoint: Phaser.Point;
+ type: number;
+ uniforms: any;
+ width: number;
+
+ addToWorld(x?: number, y?: number, width?: number, height?: number, anchorX?: number, anchorY?: number): Phaser.Image;
+
+ apply(frameBuffer: WebGLFramebuffer): void;
+
+ destroy(): void;
+
+ init(...args: any[]): void;
+
+ setResolution(width: number, height: number): void;
+
+ syncUniforms(): void;
+
+ update(pointer?: Phaser.Pointer): void;
+
+ }
+
+ module Filter {
+
+ class BinarySerpents extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number, march?: number, maxDistance?: number);
+
+ fog: number;
+
+ }
+
+ class BlurX extends Phaser.Filter {
+
+ blur: number;
+
+ }
+
+ class BlurY extends Phaser.Filter {
+
+ blur: number;
+
+ }
+
+ class CausticLight extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number, divisor?: number);
+
+ init(width: number, height: number, divisor?: number): void;
+
+ }
+
+ class CheckerWave extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number);
+
+ alpha: number;
+ cameraX: number;
+ cameraY: number;
+ cameraZ: number;
+
+ init(width: number, height: number): void;
+
+ setColor1(red: number, green: number, blue: number): void;
+
+ setColor2(red: number, green: number, blue: number): void;
+
+ }
+
+ class ColorBars extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number);
+
+ alpha: number;
+
+ init(width: number, height: number): void;
+
+ }
+
+ class Fire extends Phaser.Filter {
+
+ constructor(width: number, height: number, alpha?: number, shift?: number);
+
+ alpha: number;
+ shift: number;
+ speed: number;
+
+ init(width: number, height: number, alpha?: number, shift?: number): void;
+
+ }
+
+ class Gray extends Phaser.Filter {
+
+ gray: number;
+
+ }
+
+ class HueRotate extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number, texture: any);
+
+ alpha: number;
+
+ init(width: number, height: number, texture: any): void;
+
+ }
+
+ class LazerBeam extends Phaser.Filter {
+
+ init(width: number, height: number, divisor?: number): void;
+
+ }
+
+ class LightBeam extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number);
+
+ alpha: number;
+ blue: number;
+ green: number;
+ red: number;
+ thickness: number;
+ speed: number;
+
+ init(width: number, height: number): void;
+
+ }
+
+ class Marble extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number, speed?: number, intensity?: number);
+
+ alpha: number;
+ intensity: number;
+ speed: number;
+
+ init(width: number, height: number, speed?: number, intensity?: number): void;
+
+ }
+
+ class Pixelate extends Phaser.Filter {
+
+ size: number;
+ sizeX: number;
+ sizeY: number;
+
+ }
+
+ class Plasma extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number, alpha?: number, size?: number);
+
+ alpha: number;
+ blueShift: number;
+ greenShift: number;
+ redShift: number;
+ size: number;
+
+ init(width: number, height: number, alpha?: number, size?: number): void;
+
+ }
+
+ class SampleFilter extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number, divisor?: number);
+
+ init(width: number, height: number, divisor?: number): void;
+
+ }
+
+ class Tunnel extends Phaser.Filter {
+
+ constructor(game: Phaser.Game, width: number, height: number, texture: any);
+
+ alpha: number;
+ origin: number;
+
+ init(width: number, height: number, texture: any): void;
+
+ }
+ }
+
+ class FlexGrid {
+
+ constructor(manager: Phaser.ScaleManager, width: number, height: number);
+
+ game: Phaser.Game;
+ manager: Phaser.ScaleManager;
+ width: number;
+ height: number;
+ boundsCustom: Phaser.Rectangle;
+ boundsFluid: Phaser.Rectangle;
+ boundsFull: Phaser.Rectangle;
+ boundsNone: Phaser.Rectangle;
+ customWidth: number;
+ customHeight: number;
+ customOffsetX: number;
+ customOffsetY: number;
+ positionCustom: Phaser.Point;
+ positionFluid: Phaser.Point;
+ positionFull: Phaser.Point;
+ positionNone: Phaser.Point;
+ scaleCustom: Phaser.Point;
+ scaleFluid: Phaser.Point;
+ scaleFluidInversed: Phaser.Point;
+ scaleFull: Phaser.Point;
+ scaleNone: Phaser.Point;
+ ratioH: number;
+ ratioV: number;
+ multiplier: number;
+
+ createCustomLayer(width: number, height: number, children?: PIXI.DisplayObject[], addToWorld?: boolean): Phaser.FlexLayer;
+
+ createFluidLayer(children: PIXI.DisplayObject[]): Phaser.FlexLayer;
+
+ createFullLayer(children: PIXI.DisplayObject[]): Phaser.FlexLayer;
+
+ createFixedLayer(children: PIXI.DisplayObject[]): Phaser.FlexLayer;
+
+ debug(): void;
+
+ fitSprite(sprite: Phaser.Sprite): void;
+
+ onResize(width: number, height: number): void;
+
+ refresh(): void;
+
+ reset(): void;
+
+ setSize(width: number, height: number): void;
+
+ }
+
+ class FlexLayer extends Phaser.Group {
+
+ constructor(manager: Phaser.ScaleManager, position: Phaser.Point, bounds: Phaser.Rectangle, scale: Phaser.Point);
+
+ grid: Phaser.FlexGrid;
+ manager: Phaser.ScaleManager;
+
+ bottomLeft: Phaser.Point;
+ bottomMiddle: Phaser.Point;
+ bottomRight: Phaser.Point;
+ bounds: Phaser.Rectangle;
+ persist: boolean;
+ position: Phaser.Point;
+ scale: Phaser.Point;
+ topLeft: Phaser.Point;
+ topMiddle: Phaser.Point;
+ topRight: Phaser.Point;
+
+ debug(): void;
+
+ resize(): void;
+
+ }
+
+ class Frame {
+
+ constructor(index: number, x: number, y: number, width: number, height: number, name: string);
+
+ bottom: number;
+ centerX: number;
+ centerY: number;
+ distance: number;
+ height: number;
+ index: number;
+ name: string;
+ right: number;
+ rotated: boolean;
+ sourceSizeH: number;
+ sourceSizeW: number;
+ spriteSourceSizeH: number;
+ spriteSourceSizeW: number;
+ spriteSourceSizeX: number;
+ spriteSourceSizeY: number;
+ trimmed: boolean;
+ uuid: string;
+ width: number;
+ x: number;
+ y: number;
+
+ clone(): Phaser.Frame;
+
+ getRect(out?: Phaser.Rectangle): Phaser.Rectangle;
+
+ setTrim(trimmed: boolean, actualWidth: number, actualHeight: number, destX: number, destY: number, destWidth: number, destHeight: number): void;
+
+ resize(width: number, height: number): void;
+
+ }
+
+ class FrameData {
+
+ total: number;
+
+ addFrame(frame: Frame): Phaser.Frame;
+
+ checkFrameName(name: string): boolean;
+
+ clone(): Phaser.FrameData;
+
+ getFrame(index: number): Phaser.Frame;
+
+ getFrameByName(name: string): Phaser.Frame;
+
+ getFrameIndexes(frames?: number[], useNumericIndex?: boolean, output?: number[]): number[];
+
+ getFrameRange(start: number, end: number, output: Phaser.Frame[]): Phaser.Frame[];
+
+ getFrames(frames?: number[], useNumericIndex?: boolean, output?: Phaser.Frame[]): Phaser.Frame[];
+
+ }
+
+ interface IGameConfig {
+
+ backgroundColor?: string;
+ canvas?: HTMLCanvasElement;
+ canvasId?: string;
+ canvasStyle?: string;
+ disableVisibilityChange?: boolean;
+ fullScreenScaleMode?: number;
+ antialias?: boolean;
+ enableDebug?: boolean;
+ forceSetTimeOut?: boolean;
+ height?: number | string;
+ multiTexture?: boolean;
+ parent?: HTMLElement | string;
+ physicsConfig?: any;
+ preserveDrawingBuffer?: boolean;
+ renderer?: number;
+ resolution?: number;
+ scaleMode?: number;
+ seed?: number;
+ state?: any; // Phaser.State | function | object
+ transparent?: boolean;
+ width?: number | string;
+
+ }
+
+ class Game {
+
+ constructor(width?: number | string, height?: number | string, renderer?: number, parent?: any, state?: any, transparent?: boolean, antialias?: boolean, physicsConfig?: any);
+ constructor(config: IGameConfig);
+
+ add: Phaser.GameObjectFactory;
+ antialias: boolean;
+ cache: Phaser.Cache;
+ camera: Phaser.Camera;
+ canvas: HTMLCanvasElement;
+ clearBeforeRender: boolean;
+ config: IGameConfig;
+ context: CanvasRenderingContext2D;
+ count: number;
+ create: Phaser.Create;
+ debug: Phaser.Utils.Debug;
+ device: Phaser.Device;
+ forceSingleUpdate: boolean;
+ fpsProblemNotifier: Phaser.Signal;
+ height: number;
+ id: number;
+ input: Phaser.Input;
+ isBooted: boolean;
+ isRunning: boolean;
+ load: Phaser.Loader;
+ lockRender: boolean;
+ make: Phaser.GameObjectCreator;
+ math: Phaser.Math;
+ net: Phaser.Net;
+ onBlur: Phaser.Signal;
+ onFocus: Phaser.Signal;
+ onPause: Phaser.Signal;
+ onResume: Phaser.Signal;
+ parent: HTMLElement;
+ particles: Phaser.Particles;
+ paused: boolean;
+ pendingStep: boolean;
+ physics: Phaser.Physics;
+ physicsConfig: any;
+ plugins: PluginManager;
+ preserveDrawingBuffer: Boolean;
+ raf: Phaser.RequestAnimationFrame;
+ renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer;
+ renderType: number;
+ resolution: number;
+ rnd: Phaser.RandomDataGenerator;
+ scale: Phaser.ScaleManager;
+ scratch: Phaser.BitmapData;
+ sound: Phaser.SoundManager;
+ stage: Phaser.Stage;
+ state: Phaser.StateManager;
+ stepCount: number;
+ stepping: boolean;
+ time: Phaser.Time;
+ transparent: boolean;
+ tweens: Phaser.TweenManager;
+ currentUpdateID: number;
+ updatesThisFrame: number;
+ width: number;
+ world: Phaser.World;
+
+ boot(): void;
+
+ destroy(): void;
+
+ disableStep(): void;
+
+ enableStep(): void;
+
+ focusGain(event: any): void;
+
+ focusLoss(event: any): void;
+
+ gamePaused(event: any): void;
+
+ gameResumed(event: any): void;
+
+ parseConfig(config: any): void;
+
+ removeFromDOM(canvas: HTMLCanvasElement): void;
+
+ setUpRenderer(): void;
+
+ showDebugHeader(): void;
+
+ step(): void;
+
+ update(time: number): void;
+
+ updateLogic(timeStep: number): void;
+
+ updateRender(timeStep: number): void;
+
+
+ //Added by simon987
+ iso: any;
+ }
+
+ class GameObjectCreator {
+
+ constructor(game: Phaser.Game);
+
+ game: Phaser.Game;
+ world: Phaser.World;
+
+ audio(key: string, volume?: number, loop?: boolean, connect?: boolean): Phaser.Sound;
+
+ audioSprite(key: string): Phaser.AudioSprite;
+
+ bitmapData(width?: number, height?: number, key?: string, addToCache?: boolean): Phaser.BitmapData;
+
+ bitmapText(x: number, y: number, font: string, text?: string, size?: number, align?: string): Phaser.BitmapText;
+
+ button(x?: number, y?: number, key?: string, callback?: Function, callbackContext?: any, overFrame?: any, outFrame?: any, downFrame?: any, upFrame?: any): Phaser.Button;
+
+ emitter(x?: number, y?: number, maxParticles?: number): Phaser.Particles.Arcade.Emitter;
+
+ filter(filter: any, ...args: any[]): Phaser.Filter;
+
+ graphics(x?: number, y?: number): Phaser.Graphics;
+
+ group(parent?: any, name?: string, addToStage?: boolean, enableBody?: boolean, physicsBodyType?: number): Phaser.Group;
+
+ image(x: number, y: number, key?: any, frame?: any): Phaser.Image;
+
+ renderTexture(width?: number, height?: number, key?: any, addToCache?: boolean): Phaser.RenderTexture;
+
+ retroFont(font: string, characterWidth: number, characterHeight: number, chars: string, charsPerRow: number, xSpacing?: number, ySpacing?: number, xOffset?: number, yOffset?: number): Phaser.RetroFont;
+
+ rope(x: number, y: number, key: any, frame?: any, points?: Phaser.Point[]): Phaser.Rope;
+
+ sound(key: string, volume?: number, loop?: boolean, connect?: boolean): Phaser.Sound;
+
+ sprite(x: number, y: number, key?: any, frame?: any): Phaser.Sprite;
+
+ spriteBatch(parent: any, name?: String, addToStage?: boolean): Phaser.SpriteBatch;
+
+ text(x: number, y: number, text?: string, style?: PhaserTextStyle): Phaser.Text;
+
+ tilemap(key: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number): Phaser.Tilemap;
+
+ tileSprite(x: number, y: number, width: number, height: number, key: any, frame: any): Phaser.TileSprite;
+
+ tween(obj: any): Phaser.Tween;
+
+ }
+
+ class GameObjectFactory {
+
+ constructor(game: Phaser.Game);
+
+ game: Phaser.Game;
+ world: Phaser.World;
+
+ audio(key: string, volume?: number, loop?: boolean, connect?: boolean): Phaser.Sound;
+
+ audioSprite(key: string): Phaser.AudioSprite;
+
+ bitmapData(width?: number, height?: number, key?: string, addToCache?: boolean): Phaser.BitmapData;
+
+ bitmapText(x: number, y: number, font: string, text?: string, size?: number, group?: Phaser.Group | Phaser.Stage): Phaser.BitmapText;
+
+ button(x?: number, y?: number, key?: string, callback?: Function, callbackContext?: any, overFrame?: any, outFrame?: any, downFrame?: any, upFrame?: any, group?: Phaser.Group | Phaser.Stage): Phaser.Button;
+
+ emitter(x?: number, y?: number, maxParticles?: number): Phaser.Particles.Arcade.Emitter;
+
+ existing(object: any): any;
+
+ filter(filter: string, ...args: any[]): Phaser.Filter;
+
+ graphics(x?: number, y?: number, group?: Phaser.Group | Phaser.Stage): Phaser.Graphics;
+
+ group(parent?: any, name?: string, addToStage?: boolean, enableBody?: boolean, physicsBodyType?: number): Phaser.Group;
+
+ image(x?: number, y?: number, key?: any, frame?: any, group?: Phaser.Group | Phaser.Stage): Phaser.Image;
+
+ physicsGroup(physicsBodyType?: number, parent?: any, name?: string, addToStage?: boolean): Phaser.Group;
+
+ plugin(plugin: Phaser.Plugin, ...parameter: any[]): Phaser.Plugin;
+
+ renderTexture(width?: number, height?: number, key?: string, addToCache?: boolean): Phaser.RenderTexture;
+
+ retroFont(font: string, characterWidth: number, characterHeight: number, chars: string, charsPerRow: number, xSpacing?: number, ySpacing?: number, xOffset?: number, yOffset?: number): Phaser.RetroFont;
+
+ rope(x?: number, y?: number, key?: any, frame?: any, points?: Phaser.Point[]): Phaser.Rope;
+
+ sound(key: string, volume?: number, loop?: boolean, connect?: boolean): Phaser.Sound;
+
+ sprite(x?: number, y?: number, key?: any, frame?: any, group?: Phaser.Group | Phaser.Stage): Phaser.Sprite;
+
+ spriteBatch(parent: any, name?: string, addToStage?: boolean): Phaser.Group | Phaser.Stage;
+
+ text(x?: number, y?: number, text?: string, style?: PhaserTextStyle, group?: Phaser.Group | Phaser.Stage): Phaser.Text;
+
+ tilemap(key?: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number): Phaser.Tilemap;
+
+ tileSprite(x: number, y: number, width: number, height: number, key?: any, frame?: any, group?: Phaser.Group | Phaser.Stage): Phaser.TileSprite;
+
+ tween(obj: any): Phaser.Tween;
+
+ weapon(quantity?: number, key?: any, frame?: any, group?: Phaser.Group, bulletClass?: Phaser.Bullet): Phaser.Weapon;
+
+ video(key?: string, url?: string): Phaser.Video;
+
+ //Added by simon987, for isometric plugin
+ isoSprite(x: number, y: number, z: number, key?: any, frame?: any, group?: Phaser.Group): Phaser.Sprite;
+
+ }
+
+ class Gamepad {
+
+ constructor(game: Phaser.Game);
+
+ static BUTTON_0: number;
+ static BUTTON_1: number;
+ static BUTTON_2: number;
+ static BUTTON_3: number;
+ static BUTTON_4: number;
+ static BUTTON_5: number;
+ static BUTTON_6: number;
+ static BUTTON_7: number;
+ static BUTTON_8: number;
+ static BUTTON_9: number;
+ static BUTTON_10: number;
+ static BUTTON_11: number;
+ static BUTTON_12: number;
+ static BUTTON_13: number;
+ static BUTTON_14: number;
+ static BUTTON_15: number;
+
+ static AXIS_0: number;
+ static AXIS_1: number;
+ static AXIS_2: number;
+ static AXIS_3: number;
+ static AXIS_4: number;
+ static AXIS_5: number;
+ static AXIS_6: number;
+ static AXIS_7: number;
+ static AXIS_8: number;
+ static AXIS_9: number;
+
+ static XBOX360_A: number;
+ static XBOX360_B: number;
+ static XBOX360_X: number;
+ static XBOX360_Y: number;
+ static XBOX360_LEFT_BUMPER: number;
+ static XBOX360_RIGHT_BUMPER: number;
+ static XBOX360_LEFT_TRIGGER: number;
+ static XBOX360_RIGHT_TRIGGER: number;
+ static XBOX360_BACK: number;
+ static XBOX360_START: number;
+ static XBOX360_STICK_LEFT_BUTTON: number;
+ static XBOX360_STICK_RIGHT_BUTTON: number;
+ static XBOX360_DPAD_LEFT: number;
+ static XBOX360_DPAD_RIGHT: number;
+ static XBOX360_DPAD_UP: number;
+ static XBOX360_DPAD_DOWN: number;
+ static XBOX360_STICK_LEFT_X: number;
+ static XBOX360_STICK_LEFT_Y: number;
+ static XBOX360_STICK_RIGHT_X: number;
+ static XBOX360_STICK_RIGHT_Y: number;
+
+ static PS3XC_X: number;
+ static PS3XC_CIRCLE: number;
+ static PS3XC_SQUARE: number;
+ static PS3XC_TRIANGLE: number;
+ static PS3XC_L1: number;
+ static PS3XC_R1: number;
+ static PS3XC_L2: number;
+ static PS3XC_R2: number;
+ static PS3XC_SELECT: number;
+ static PS3XC_START: number;
+ static PS3XC_STICK_LEFT_BUTTON: number;
+ static PS3XC_STICK_RIGHT_BUTTON: number;
+ static PS3XC_DPAD_UP: number;
+ static PS3XC_DPAD_DOWN: number;
+ static PS3XC_DPAD_LEFT: number;
+ static PS3XC_DPAD_RIGHT: number;
+ static PS3XC_STICK_LEFT_X: number;
+ static PS3XC_STICK_LEFT_Y: number;
+ static PS3XC_STICK_RIGHT_X: number;
+ static PS3XC_STICK_RIGHT_Y: number;
+
+ active: boolean;
+ callbackContext: any;
+ enabled: boolean;
+ game: Phaser.Game;
+ onAxisCallBack: Function;
+ onConnectCallback: Function;
+ onDisconnectCallback: Function;
+ onDownCallback: Function;
+ onFloatCallback: Function;
+ onUpCallback: Function;
+ pad1: Phaser.SinglePad;
+ pad2: Phaser.SinglePad;
+ pad3: Phaser.SinglePad;
+ pad4: Phaser.SinglePad;
+ padsConnected: number;
+ supported: boolean;
+
+ addCallbacks(context: any, callbacks: any): void;
+
+ isDown(buttonCode: number): boolean;
+
+ justPressed(buttonCode: number, duration?: number): boolean;
+
+ justReleased(buttonCode: number, duration?: number): boolean;
+
+ reset(): void;
+
+ setDeadZones(value: any): void;
+
+ start(): void;
+
+ stop(): void;
+
+ update(): void;
+
+ }
+
+ class Graphics extends PIXI.DisplayObjectContainer {
+
+ constructor(game: Phaser.Game, x?: number, y?: number);
+
+ alive: boolean;
+ angle: number;
+ animations: Phaser.AnimationManager;
+ autoCull: boolean;
+ blendMode: Phaser.blendModes;
+ body: Phaser.Physics.Arcade.Body | Phaser.Physics.P2.Body | Phaser.Physics.Ninja.Body | any;
+ bottom: number;
+ boundsPadding: number;
+ cameraOffset: Phaser.Point;
+ centerX: number;
+ centerY: number;
+ checkWorldBounds: boolean;
+ components: any;
+ data: any;
+ debug: boolean;
+ destroyPhase: boolean;
+ events: Phaser.Events;
+ exists: boolean;
+ fillAlpha: number;
+ fixedToCamera: boolean;
+ fresh: boolean;
+ game: Phaser.Game;
+ height: number;
+ inCamera: boolean;
+ inWorld: boolean;
+ input: Phaser.InputHandler;
+ inputEnabled: boolean;
+ isMask: boolean;
+ key: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture;
+ left: number;
+ lifespan: number;
+ lineColor: number;
+ lineWidth: number;
+ name: string;
+ offsetX: number;
+ offsetY: number;
+ outOfBoundsKill: boolean;
+ pendingDestroy: boolean;
+ physicsType: number;
+ position: Phaser.Point;
+ previousPosition: Phaser.Point;
+ previousRotation: number;
+ renderOrderID: number;
+ right: number;
+ tint: number;
+ top: number;
+ type: number;
+ width: number;
+ world: Phaser.Point;
+ worldAlpha: number;
+ z: number;
+
+ alignIn(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ alignTo(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean): Phaser.Graphics;
+
+ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): Phaser.Graphics;
+
+ beginFill(color?: number, alpha?: number): Phaser.Graphics;
+
+ bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): Phaser.Graphics;
+
+ clear(): Phaser.Graphics;
+
+ destroy(destroyChildren?: boolean): void;
+
+ destroyCachedSprite(): void;
+
+ drawCircle(x: number, y: number, diameter: number): Phaser.Graphics;
+
+ drawEllipse(x: number, y: number, width: number, height: number): Phaser.Graphics;
+
+ drawPolygon(...path: any[]): Phaser.Graphics;
+
+ drawRect(x: number, y: number, width: number, height: number): Phaser.Graphics;
+
+ drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): Phaser.Graphics;
+
+ drawShape(shape: Circle): Phaser.GraphicsData;
+ drawShape(shape: Ellipse): Phaser.GraphicsData;
+ drawShape(shape: Polygon): Phaser.GraphicsData;
+ drawShape(shape: Rectangle): Phaser.GraphicsData;
+
+ drawTriangle(points: Phaser.Point[], cull?: boolean): void;
+
+ drawTriangles(vertices: Phaser.Point[] | number[], indices?: number[], cull?: boolean): void;
+
+ endFill(): Phaser.Graphics;
+
+ generateTexture(resolution?: number, scaleMode?: Phaser.scaleModes, padding?: number): Phaser.RenderTexture;
+
+ kill(): Phaser.Graphics;
+
+ lineStyle(lineWidth?: number, color?: number, alpha?: number): Phaser.Graphics;
+
+ lineTo(x: number, y: number): Phaser.Graphics;
+
+ moveTo(x: number, y: number): Phaser.Graphics;
+
+ postUpdate(): void;
+
+ preUpdate(): void;
+
+ quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): Phaser.Graphics;
+
+ reset(x: number, y: number, health?: number): Phaser.Graphics;
+
+ revive(health?: number): Phaser.Graphics;
+
+ update(): void;
+
+ }
+
+ class GraphicsData {
+
+ constructor(lineWidth?: number, lineColor?: number, lineAlpha?: number, fillColor?: number, fillAlpha?: number, fill?: boolean, shape?: any);
+
+ lineWidth: number;
+ lineColor: number;
+ lineAlpha: number;
+ fillColor: number;
+ fillAlpha: number;
+ fill: boolean;
+ shape: any;
+ type: number;
+
+ }
+
+ class Group extends PIXI.DisplayObjectContainer {
+
+ constructor(game: Phaser.Game, parent?: PIXI.DisplayObjectContainer, name?: string, addToStage?: boolean, enableBody?: boolean, physicsBodyType?: number);
+
+ static RETURN_CHILD: number;
+ static RETURN_NONE: number;
+ static RETURN_TOTAL: number;
+ static RETURN_ALL: number;
+ static SORT_ASCENDING: number;
+ static SORT_DESCENDING: number;
+
+ alpha: number;
+ angle: number;
+ alive: boolean;
+ bottom: number;
+ cameraOffset: Phaser.Point;
+ centerX: number;
+ centerY: number;
+ classType: any;
+ cursor: any;
+ cursorIndex: number;
+ enableBody: boolean;
+ enableBodyDebug: boolean;
+ exists: boolean;
+ fixedToCamera: boolean;
+ game: Phaser.Game;
+ hash: PIXI.DisplayObject[];
+ ignoreDestroy: boolean;
+ inputEnableChildren: boolean;
+ left: number;
+ length: number;
+ name: string;
+ onChildInputDown: Phaser.Signal;
+ onChildInputUp: Phaser.Signal;
+ onChildInputOver: Phaser.Signal;
+ onChildInputOut: Phaser.Signal;
+ onDestroy: Phaser.Signal;
+ pendingDestroy: boolean;
+ physicsBodyType: number;
+ physicsType: number;
+ physicsSortDirection: number;
+ position: Phaser.Point;
+ right: number;
+ rotation: number;
+ scale: Phaser.Point;
+ top: number;
+ total: number;
+ type: number;
+ updateOnlyExistingChildren: boolean;
+ visible: boolean;
+ z: number;
+
+ add(child: any, silent?: boolean, index?: number): any;
+
+ addAll(property: string, amount: number, checkAlive?: boolean, checkVisible?: boolean): void;
+
+ addAt(child: any, index: number, silent?: boolean): any;
+
+ addMultiple(children: any[], silent?: boolean): any[];
+
+ addToHash(child: PIXI.DisplayObject): boolean;
+
+ align(width: number, height: number, cellWidth: number, cellHeight: number, position?: number, offset?: number): boolean;
+
+ alignIn(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): Phaser.Group;
+
+ alignTo(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): Phaser.Group;
+
+ bringToTop(child: any): any;
+
+ callAll(method: string, context: any, ...parameters: any[]): void;
+
+ callAllExists(callback: string, existsValue: boolean, ...parameters: any[]): void;
+
+ callbackFromArray(child: any, callback: Function, length: number): void;
+
+ checkAll(key: string, value: any, checkAlive?: boolean, checkVisible?: boolean, force?: boolean): boolean;
+
+ checkAny(key: string, value: any, checkAlive?: boolean, checkVisible?: boolean): boolean;
+
+ checkProperty(child: any, key: string, value: any, force?: boolean): boolean;
+
+ count(key: string, value: any): number;
+
+ countDead(): number;
+
+ countLiving(): number;
+
+ create(x: number, y: number, key?: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number, exists?: boolean, index?: number): any;
+
+ createMultiple(quantity: number, key: string | string[], frame?: any | any[], exists?: boolean, callback?: Function, callbackContext?: any): any[];
+
+ customSort(sortHandler: Function, context?: any): void;
+
+ destroy(destroyChildren?: boolean, soft?: boolean): void;
+
+ divideAll(property: string, amount: number, checkAlive?: boolean, checkVisible?: boolean): void;
+
+ forEach(callback: Function, callbackContext: any, checkExists?: boolean, ...args: any[]): void;
+
+ forEachAlive(callback: Function, callbackContext?: any, ...args: any[]): void;
+
+ forEachDead(callback: Function, callbackContext?: any, ...args: any[]): void;
+
+ forEachExists(callback: Function, callbackContext?: any): void;
+
+ filter(predicate: Function, checkExists?: boolean): ArraySet;
+
+ getAll(property?: string, value?: any, startIndex?: number, endIndex?: number): any[];
+
+ getAt(index: number): PIXI.DisplayObject | number;
+
+ getBottom(): any;
+
+ getByName(name: string): any;
+
+ getClosestTo(object: any, callback?: Function, callbackContext?: any): any;
+
+ getFirst(key: string, value: any): any;
+
+ getFirstAlive(createIfNull?: boolean, x?: number, y?: number, key?: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number): any;
+
+ getFirstDead(createIfNull?: boolean, x?: number, y?: number, key?: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number): any;
+
+ getFirstExists(exists: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number): any;
+
+ getFurthestFrom(object: any, callback?: Function, callbackContext?: any): any;
+
+ getIndex(child: any): number;
+
+ getRandom(startIndex?: number, length?: number): any;
+
+ getTop(): any;
+
+ hasProperty(child: any, key: string[]): boolean;
+
+ iterate(key: string, value: any, returnType: number, callback?: Function, callbackContext?: any, ...args: any[]): any;
+
+ kill(): void;
+
+ killAll(): void;
+
+ moveAll(group: Phaser.Group, silent?: boolean): Phaser.Group;
+
+ moveDown(child: any): any;
+
+ moveUp(child: any): any;
+
+ multiplyAll(property: string, amount: number, checkAlive: boolean, checkVisible: boolean): void;
+
+ next(): any;
+
+ postUpdate(): void;
+
+ preUpdate(): void;
+
+ previous(): any;
+
+ remove(child: any, destroy?: boolean, silent?: boolean): boolean;
+
+ removeAll(destroy?: boolean, silent?: boolean, destroyTexture?: boolean): void;
+
+ removeBetween(startIndex: number, endIndex?: number, destroy?: boolean, silent?: boolean): void;
+
+ removeFromHash(child: PIXI.DisplayObject): boolean;
+
+ replace(oldChild: any, newChild: any): any;
+
+ resetAll(x?: number, y?: number, key?: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number, checkExists?: boolean): void;
+
+ resetChild(child: any, x?: number, y?: number, key?: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number): any;
+
+ resetCursor(index?: number): any;
+
+ reverse(): void;
+
+ revive(): void;
+
+ reviveAll(): void;
+
+ scatter(rect?: Phaser.Rectangle, checkExists?: boolean): void;
+
+ sendToBack(child: any): any;
+
+ set(child: any, key: string[], value: any, operation?: number, force?: boolean): boolean;
+
+ setAll(key: string, value: any, checkAlive?: boolean, checkVisible?: boolean, operation?: number, force?: boolean): void;
+
+ setAllChildren(key: string, value: any, checkAlive?: boolean, checkVisible?: boolean, operation?: number, force?: boolean): void;
+
+ setProperty(child: any, key: string[], value: any, operation?: number, force?: boolean): boolean;
+
+ shuffle(): void;
+
+ sort(key?: string, order?: number): void;
+
+ subAll(property: string, amount: number, checkAlive: boolean, checkVisible: boolean): void;
+
+ swap(child1: any, child2: any): boolean;
+
+ update(): void;
+
+ updateZ(): void;
+
+ xy(index: number, x: number, y: number): void;
+
+ }
+
+ class Image extends PIXI.Sprite {
+
+ constructor(game: Phaser.Game, x: number, y: number, key: string | Phaser.RenderTexture | Phaser.BitmapData | PIXI.Texture, frame?: string | number);
+
+ alive: boolean;
+ angle: number;
+ anchor: Phaser.Point;
+ animations: Phaser.AnimationManager;
+ autoCull: boolean;
+ bottom: number;
+ cameraOffset: Phaser.Point;
+ centerX: number;
+ centerY: number;
+ components: any;
+ cropRect: Phaser.Rectangle;
+ customRender: boolean;
+ data: any;
+ debug: boolean;
+ deltaX: number;
+ deltaY: number;
+ deltaZ: number;
+ destroyPhase: boolean;
+ events: Phaser.Events;
+ exists: boolean;
+ fixedToCamera: boolean;
+ frame: string | number;
+ frameName: string;
+ fresh: boolean;
+ game: Phaser.Game;
+ inCamera: boolean;
+ input: Phaser.InputHandler;
+ inputEnabled: boolean;
+ inWorld: boolean;
+ key: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture;
+ lifespan: number;
+ left: number;
+ name: string;
+ offsetX: number;
+ offsetY: number;
+ pendingDestroy: boolean;
+ position: Phaser.Point;
+ previousPosition: Phaser.Point;
+ previousRotation: number;
+ renderOrderID: number;
+ right: number;
+ scale: Phaser.Point;
+ smoothed: boolean;
+ top: number;
+ type: number;
+ world: Phaser.Point;
+ z: number;
+
+ alignIn(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ alignTo(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ bringToTop(): Phaser.Image;
+
+ crop(rect: Phaser.Rectangle, copy?: boolean): void;
+
+ destroy(destroyChildren?: boolean): void;
+
+ kill(): Phaser.Image;
+
+ loadTexture(key: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number, stopAnimation?: boolean): void;
+
+ resizeFrame(parent: any, width: number, height: number): void;
+
+ moveDown(): Phaser.Image;
+
+ moveUp(): Phaser.Image;
+
+ overlap(displayObject: Phaser.Sprite | Phaser.Image | Phaser.TileSprite | Phaser.Button | PIXI.DisplayObject): boolean;
+
+ play(name: string, frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
+
+ postUpdate(): void;
+
+ preUpdate(): void;
+
+ reset(x: number, y: number, health?: number): Phaser.Image;
+
+ resetFrame(): void;
+
+ revive(health?: number): Phaser.Image;
+
+ sendToBack(): Phaser.Image;
+
+ setFrame(frame: Phaser.Frame): void;
+
+ update(): void;
+
+ updateCrop(): void;
+
+ }
+
+ class ImageCollection {
+
+ constructor(name: string, firstgid: number, width?: number, height?: number, margin?: number, spacing?: number, properties?: any);
+
+ name: string;
+ firstgid: number;
+ imageWidth: number;
+ imageHeight: number;
+ imageMargin: number;
+ imageSpacing: number;
+ properties: any;
+ images: any[];
+ total: number;
+
+ addImage(gid: number, image: string): void;
+
+ containsImageIndex(imageIndex: number): boolean;
+
+ }
+
+ class Input {
+
+ constructor(game: Phaser.Game);
+
+ static MAX_POINTERS: number;
+ static MOUSE_OVERRIDES_TOUCH: number;
+ static MOUSE_TOUCH_COMBINE: number;
+ static TOUCH_OVERRIDES_MOUSE: number;
+
+ activePointer: Phaser.Pointer;
+ circle: Phaser.Circle;
+ enabled: boolean;
+ doubleTapRate: number;
+ game: Phaser.Game;
+ gamepad: Phaser.Gamepad;
+ hitCanvas: HTMLCanvasElement;
+ hitContext: CanvasRenderingContext2D;
+ holdRate: number;
+ interactiveItems: Phaser.ArraySet;
+ justPressedRate: number;
+ justReleasedRate: number;
+ keyboard: Phaser.Keyboard;
+ maxPointers: number;
+ minPriorityID: number;
+ mouse: Phaser.Mouse;
+ mousePointer: Phaser.Pointer;
+ moveCallbacks: (pointer: Phaser.Pointer, x: number, y: number) => void[];
+ mspointer: Phaser.MSPointer;
+ multiInputOverride: number;
+ onDown: Phaser.Signal;
+ onHold: Phaser.Signal;
+ onTap: Phaser.Signal;
+ onUp: Phaser.Signal;
+ pointer1: Phaser.Pointer;
+ pointer2: Phaser.Pointer;
+ pointer3: Phaser.Pointer;
+ pointer4: Phaser.Pointer;
+ pointer5: Phaser.Pointer;
+ pointer6: Phaser.Pointer;
+ pointer7: Phaser.Pointer;
+ pointer8: Phaser.Pointer;
+ pointer9: Phaser.Pointer;
+ pointer10: Phaser.Pointer;
+ pollLocked: boolean;
+ pollRate: number;
+ position: Phaser.Point;
+ pointer: Phaser.Pointer[];
+ recordLimit: number;
+ recordPointerHistory: boolean;
+ recordRate: number;
+ resetLocked: boolean;
+ scale: Phaser.Point;
+ speed: Phaser.Point;
+ tapRate: number;
+ totalActivePointers: number;
+ totalInactivePointers: number;
+ touch: Phaser.Touch;
+ worldX: number;
+ worldY: number;
+ x: number;
+ y: number;
+
+ addPointer(): Phaser.Pointer;
+
+ addMoveCallback(callback: Function, context: any): number;
+
+ boot(): void;
+
+ countActivePointers(limit?: number): number;
+
+ deleteMoveCallback(callback: Function, context?: any): void;
+
+ destroy(): void;
+
+ getLocalPosition(displayObject: any, pointer: Phaser.Pointer): Phaser.Point;
+
+ getPointer(isActive?: boolean): Phaser.Pointer;
+
+ getPointerFromId(pointerID: number): Phaser.Pointer;
+
+ getPointerFromIdentifier(identifier: number): Phaser.Pointer;
+
+ hitTest(displayObject: PIXI.DisplayObject, pointer: Phaser.Pointer, localPoint: Phaser.Point): void;
+
+ reset(hard?: boolean): void;
+
+ resetSpeed(x: number, y: number): void;
+
+ setInteractiveCandidateHandler(callback: Function, context?: any): void;
+
+ startPointer(event: any): Phaser.Pointer;
+
+ stopPointer(event: any): Phaser.Pointer;
+
+ update(): void;
+
+ updatePointer(event: any): Phaser.Pointer;
+
+ }
+
+ class InputHandler {
+
+ constructor(sprite: Phaser.Sprite);
+
+ allowHorizontalDrag: boolean;
+ allowVerticalDrag: boolean;
+ boundsRect: Phaser.Rectangle;
+ boundsSprite: Phaser.Sprite;
+ bringToTop: boolean;
+ downPoint: Phaser.Point;
+ dragDistanceThreshold: number;
+ dragOffset: Phaser.Point;
+ dragFromCenter: boolean;
+ draggable: boolean;
+ dragStartPoint: Phaser.Point;
+ dragStopBlocksInputUp: boolean;
+ dragTimeThreshold: number;
+ enabled: boolean;
+ game: Phaser.Game;
+
+ globalToLocalX(x: number): number;
+
+ globalToLocalY(y: number): number;
+
+ isDragged: boolean;
+ pixelPerfectAlpha: number;
+ pixelPerfectClick: boolean;
+ pixelPerfectOver: boolean;
+ priorityID: number;
+ scaleLayer: boolean;
+ snapOffset: Phaser.Point;
+ snapOffsetX: number;
+ snapOffsetY: number;
+ snapOnDrag: boolean;
+ snapOnRelease: boolean;
+ snapPoint: Phaser.Point;
+ snapX: number;
+ snapY: number;
+ sprite: Phaser.Sprite;
+ useHandCursor: boolean;
+
+ checkBoundsRect(): void;
+
+ checkBoundsSprite(): void;
+
+ checkPixel(x: number, y: number, pointer?: Phaser.Pointer): boolean;
+
+ checkPointerDown(pointer: Phaser.Pointer, fastTest?: boolean): boolean;
+
+ checkPointerOver(pointer: Phaser.Pointer, fastTest?: boolean): boolean;
+
+ destroy(): void;
+
+ disableDrag(): void;
+
+ disableSnap(): void;
+
+ downDuration(pointerId?: number): number;
+
+ enableDrag(lockCenter?: boolean, bringToTop?: boolean, pixelPerfect?: boolean, alphaThreshold?: number, boundsRect?: Phaser.Rectangle, boundsSprite?: Phaser.Sprite): void;
+
+ enableSnap(snapX: number, snapY: number, onDrag?: boolean, onRelease?: boolean, snapOffsetX?: number, snapOffsetY?: number): void;
+
+ isPixelPerfect(): boolean;
+
+ justOut(pointerId?: number, delay?: number): boolean;
+
+ justOver(pointerId?: number, delay?: number): boolean;
+
+ justPressed(pointerId?: number, delay?: number): boolean;
+
+ justReleased(pointerId?: number, delay?: number): boolean;
+
+ overDuration(pointerId?: number): number;
+
+ pointerDown(pointerId?: number): boolean;
+
+ pointerDragged(pointerId?: number): boolean;
+
+ pointerOut(pointerId?: number): boolean;
+
+ pointerOver(pointerId?: number): boolean;
+
+ pointerTimeDown(pointerId?: number): number;
+
+ pointerTimeOut(pointerId?: number): number;
+
+ pointerTimeOver(pointerId?: number): number;
+
+ pointerTimeUp(pointerId?: number): number;
+
+ pointerUp(pointerId?: number): boolean;
+
+ pointerX(pointerId?: number): number;
+
+ pointerY(pointerId?: number): number;
+
+ reset(): void;
+
+ setDragLock(allowHorizontal?: boolean, allowVertical?: boolean): void;
+
+ start(priority: number, useHandCursor: boolean): Phaser.Sprite;
+
+ startDrag(pointer: Phaser.Pointer): void;
+
+ stop(): void;
+
+ stopDrag(pointer: Phaser.Pointer): void;
+
+ update(pointer: Phaser.Pointer): void;
+
+ updateDrag(pointer: Phaser.Pointer): boolean;
+
+ validForInput(highestID: number, highestRenderID: number, includePixelPerfect?: boolean): boolean;
+
+ }
+
+ class Key {
+
+ constructor(game: Phaser.Game, keycode: number);
+
+ altKey: boolean;
+ ctrlKey: boolean;
+ duration: number;
+ enabled: boolean;
+ event: any;
+ game: Phaser.Game;
+ isDown: boolean;
+ isUp: boolean;
+ _justDown: boolean;
+ justDown: boolean;
+ _justUp: boolean;
+ justUp: boolean;
+ keyCode: number;
+ onDown: Phaser.Signal;
+ onHoldCallback: Function;
+ onHoldContext: any;
+ onUp: Phaser.Signal;
+ repeats: number;
+ shiftKey: boolean;
+ timeDown: number;
+ timeUp: number;
+
+ downDuration(duration?: number): boolean;
+
+ processKeyDown(event: KeyboardEvent): void;
+
+ processKeyUp(event: KeyboardEvent): void;
+
+ reset(hard?: boolean): void;
+
+ update(): void;
+
+ upDuration(duration?: number): boolean;
+
+ }
+
+ class Keyboard {
+
+ constructor(game: Phaser.Game);
+
+ static A: number;
+ static B: number;
+ static C: number;
+ static D: number;
+ static E: number;
+ static F: number;
+ static G: number;
+ static H: number;
+ static I: number;
+ static J: number;
+ static K: number;
+ static L: number;
+ static M: number;
+ static N: number;
+ static O: number;
+ static P: number;
+ static Q: number;
+ static R: number;
+ static S: number;
+ static T: number;
+ static U: number;
+ static V: number;
+ static W: number;
+ static X: number;
+ static Y: number;
+ static Z: number;
+ static ZERO: number;
+ static ONE: number;
+ static TWO: number;
+ static THREE: number;
+ static FOUR: number;
+ static FIVE: number;
+ static SIX: number;
+ static SEVEN: number;
+ static EIGHT: number;
+ static NINE: number;
+ static NUMPAD_0: number;
+ static NUMPAD_1: number;
+ static NUMPAD_2: number;
+ static NUMPAD_3: number;
+ static NUMPAD_4: number;
+ static NUMPAD_5: number;
+ static NUMPAD_6: number;
+ static NUMPAD_7: number;
+ static NUMPAD_8: number;
+ static NUMPAD_9: number;
+ static NUMPAD_MULTIPLY: number;
+ static NUMPAD_ADD: number;
+ static NUMPAD_ENTER: number;
+ static NUMPAD_SUBTRACT: number;
+ static NUMPAD_DECIMAL: number;
+ static NUMPAD_DIVIDE: number;
+ static F1: number;
+ static F2: number;
+ static F3: number;
+ static F4: number;
+ static F5: number;
+ static F6: number;
+ static F7: number;
+ static F8: number;
+ static F9: number;
+ static F10: number;
+ static F11: number;
+ static F12: number;
+ static F13: number;
+ static F14: number;
+ static F15: number;
+ static COLON: number;
+ static EQUALS: number;
+ static COMMA: number;
+ static UNDERSCORE: number;
+ static PERIOD: number;
+ static QUESTION_MARK: number;
+ static TILDE: number;
+ static OPEN_BRACKET: number;
+ static BACKWARD_SLASH: number;
+ static CLOSED_BRACKET: number;
+ static QUOTES: number;
+ static BACKSPACE: number;
+ static TAB: number;
+ static CLEAR: number;
+ static ENTER: number;
+ static SHIFT: number;
+ static CONTROL: number;
+ static ALT: number;
+ static CAPS_LOCK: number;
+ static ESC: number;
+ static SPACEBAR: number;
+ static PAGE_UP: number;
+ static PAGE_DOWN: number;
+ static END: number;
+ static HOME: number;
+ static LEFT: number;
+ static UP: number;
+ static RIGHT: number;
+ static DOWN: number;
+ static INSERT: number;
+ static DELETE: number;
+ static HELP: number;
+ static NUM_LOCK: number;
+ static PLUS: number;
+ static MINUS: number;
+
+ callbackContext: any;
+ enabled: boolean;
+ event: any;
+ game: Phaser.Game;
+ lastChar: string;
+ lastKey: Phaser.Key;
+ onDownCallback: Function;
+ onPressCallback: Function;
+ onUpCallback: Function;
+ pressEvent: any;
+
+ addCallbacks(context: any, onDown?: Function, onUp?: Function, onPress?: Function): void;
+
+ addKey(keycode: number): Phaser.Key;
+
+ addKeys(keys: any): any;
+
+ addKeyCapture(keycode: any): void;
+
+ createCursorKeys(): Phaser.CursorKeys;
+
+ clearCaptures(): void;
+
+ destroy(): void;
+
+ downDuration(keycode: number, duration?: number): boolean;
+
+ isDown(keycode: number): boolean;
+
+ processKeyDown(event: KeyboardEvent): void;
+
+ processKeyPress(event: KeyboardEvent): void;
+
+ processKeyUp(event: KeyboardEvent): void;
+
+ removeCallbacks(): void;
+
+ removeKey(keycode: number): void;
+
+ removeKeyCapture(keycode: number): void;
+
+ reset(hard?: boolean): void;
+
+ start(): void;
+
+ stop(): void;
+
+ update(): void;
+
+ upDuration(keycode: number, duration?: number): boolean;
+
+ }
+
+ class KeyCode {
+
+ static A: number;
+ static B: number;
+ static C: number;
+ static D: number;
+ static E: number;
+ static F: number;
+ static G: number;
+ static H: number;
+ static I: number;
+ static J: number;
+ static K: number;
+ static L: number;
+ static M: number;
+ static N: number;
+ static O: number;
+ static P: number;
+ static Q: number;
+ static R: number;
+ static S: number;
+ static T: number;
+ static U: number;
+ static V: number;
+ static W: number;
+ static X: number;
+ static Y: number;
+ static Z: number;
+ static ZERO: number;
+ static ONE: number;
+ static TWO: number;
+ static THREE: number;
+ static FOUR: number;
+ static FIVE: number;
+ static SIX: number;
+ static SEVEN: number;
+ static EIGHT: number;
+ static NINE: number;
+ static NUMPAD_0: number;
+ static NUMPAD_1: number;
+ static NUMPAD_2: number;
+ static NUMPAD_3: number;
+ static NUMPAD_4: number;
+ static NUMPAD_5: number;
+ static NUMPAD_6: number;
+ static NUMPAD_7: number;
+ static NUMPAD_8: number;
+ static NUMPAD_9: number;
+ static NUMPAD_MULTIPLY: number;
+ static NUMPAD_ADD: number;
+ static NUMPAD_ENTER: number;
+ static NUMPAD_SUBTRACT: number;
+ static NUMPAD_DECIMAL: number;
+ static NUMPAD_DIVIDE: number;
+ static F1: number;
+ static F2: number;
+ static F3: number;
+ static F4: number;
+ static F5: number;
+ static F6: number;
+ static F7: number;
+ static F8: number;
+ static F9: number;
+ static F10: number;
+ static F11: number;
+ static F12: number;
+ static F13: number;
+ static F14: number;
+ static F15: number;
+ static COLON: number;
+ static EQUALS: number;
+ static COMMA: number;
+ static UNDERSCORE: number;
+ static PERIOD: number;
+ static QUESTION_MARK: number;
+ static TILDE: number;
+ static OPEN_BRACKET: number;
+ static BACKWARD_SLASH: number;
+ static CLOSED_BRACKET: number;
+ static QUOTES: number;
+ static BACKSPACE: number;
+ static TAB: number;
+ static CLEAR: number;
+ static ENTER: number;
+ static SHIFT: number;
+ static CONTROL: number;
+ static ALT: number;
+ static CAPS_LOCK: number;
+ static ESC: number;
+ static SPACEBAR: number;
+ static PAGE_UP: number;
+ static PAGE_DOWN: number;
+ static END: number;
+ static HOME: number;
+ static LEFT: number;
+ static UP: number;
+ static RIGHT: number;
+ static DOWN: number;
+ static INSERT: number;
+ static DELETE: number;
+ static HELP: number;
+ static NUM_LOCK: number;
+ static PLUS: number;
+ static MINUS: number;
+
+ }
+
+ class Line {
+
+ constructor(x1?: number, y1?: number, x2?: number, y2?: number);
+
+ angle: number;
+ end: Phaser.Point;
+ height: number;
+ left: number;
+ length: number;
+ normalAngle: number;
+ normalX: number;
+ normalY: number;
+ perpSlope: number;
+ right: number;
+ slope: number;
+ start: Phaser.Point;
+ top: number;
+ type: number;
+ width: number;
+ x: number;
+ y: number;
+
+ static intersectionWithRectangle(line: Phaser.Line, rect: Phaser.Rectangle, result?: Phaser.Point): Phaser.Point;
+
+ static intersectsPoints(a: Phaser.Point, b: Phaser.Point, e: Phaser.Point, f: Phaser.Point, asSegment?: boolean, result?: Phaser.Point): Phaser.Point;
+
+ static intersects(a: Phaser.Line, b: Phaser.Line, asSegment?: boolean, result?: Phaser.Point): Phaser.Point;
+
+ static intersectsRectangle(line: Phaser.Line, rect: Phaser.Rectangle): boolean;
+
+ static reflect(a: Phaser.Line, b: Phaser.Line): number;
+
+ centerOn(x: number, y: number): Phaser.Line;
+
+ clone(output: Phaser.Line): Phaser.Line;
+
+ coordinatesOnLine(stepRate: number, results: any[]): any[];
+
+ fromAngle(x: number, y: number, angle: number, length: number): Phaser.Line;
+
+ fromPoints(start: any, end: any): Phaser.Line;
+
+ fromSprite(startSprite: Phaser.Sprite, endSprite: Phaser.Sprite, useCenter?: boolean): Phaser.Line;
+
+ intersects(line: Phaser.Line, asSegment?: boolean, result?: Phaser.Point): Phaser.Point;
+
+ midPoint(out?: Phaser.Point): Phaser.Point;
+
+ pointOnLine(x: number, y: number, epsilon?: number): boolean;
+
+ pointOnSegment(x: number, y: number, epsilon?: number): boolean;
+
+ random(out?: Phaser.Point): Phaser.Point;
+
+ reflect(line: Phaser.Line): number;
+
+ rotate(angle: number, asDegrees?: boolean): Phaser.Line;
+
+ rotateAround(x: number, y: number, angle: number, asDegrees?: boolean): Phaser.Line;
+
+ setTo(x1?: number, y1?: number, x2?: number, y2?: number): Phaser.Line;
+
+ }
+
+ class LinkedList {
+
+ first: any;
+ last: any;
+ next: any;
+ prev: any;
+ total: number;
+
+ add(item: any): any;
+
+ callAll(callback: Function): void;
+
+ remove(item: any): void;
+
+ reset(): void;
+
+ }
+
+ class Loader {
+
+ constructor(game: Phaser.Game);
+
+ static PHYSICS_LIME_CORONA_JSON: number;
+ static PHYSICS_PHASER_JSON: number;
+ static TEXTURE_ATLAS_JSON_ARRAY: number;
+ static TEXTURE_ATLAS_JSON_HASH: number;
+ static TEXTURE_ATLAS_XML_STARLING: number;
+ static TEXTURE_ATLAS_JSON_PYXEL: number;
+
+ baseURL: string;
+ cache: Phaser.Cache;
+ crossOrigin: boolean | string;
+ enableParallel: boolean;
+ game: Phaser.Game;
+ hasLoaded: boolean;
+ headers: any;
+ isLoading: boolean;
+ maxParallelDownloads: number;
+ onFileStart: Phaser.Signal;
+ onFileComplete: Phaser.Signal;
+ onFileError: Phaser.Signal;
+ onLoadComplete: Phaser.Signal;
+ onLoadStart: Phaser.Signal;
+ onPackComplete: Phaser.Signal;
+ path: string;
+ preloadSprite: any;
+ progress: number;
+ progressFloat: number;
+ resetLocked: boolean;
+ useXDomainRequest: boolean;
+
+ asyncComplete(file: any, errorMessage?: string): void;
+
+ addSyncPoint(type: string, key: string): Phaser.Loader;
+
+ addToFileList(type: string, key: string, url?: string, properties?: any, overwrite?: boolean, extension?: string): Phaser.Loader;
+
+ atlas(key: string, textureURL?: string, atlasURL?: string, atlasData?: any, format?: number): Phaser.Loader;
+
+ atlasJSONArray(key: string, textureURL?: string, atlasURL?: string, atlasData?: any): Phaser.Loader;
+
+ atlasJSONHash(key: string, textureURL?: string, atlasURL?: string, atlasData?: any): Phaser.Loader;
+
+ atlasXML(key: string, textureURL?: string, atlasURL?: string, atlasData?: any): Phaser.Loader;
+
+ audio(key: string, urls: string | string[] | any, autoDecode?: boolean): Phaser.Loader;
+
+ audiosprite(key: string, urls: string[], jsonURL?: string, jsonData?: string | any, autoDecode?: boolean): Phaser.Loader;
+
+ binary(key: string, url?: string, callback?: Function, callbackContext?: any): Phaser.Loader;
+
+ bitmapFont(key: string, textureURL?: string, atlasURL?: string, atlasData?: any, xSpacing?: number, ySpacing?: number): Phaser.Loader;
+
+ checkKeyExists(type: string, key: string): boolean;
+
+ csvLoadComplete(file: any, xhr: XMLHttpRequest): void;
+
+ fileComplete(file: any, xhr: XMLHttpRequest): void;
+
+ fileError(file: any, xhr: XMLHttpRequest, reason: string): void;
+
+ finishedLoading(abnormal?: boolean): void;
+
+ getAsset(type: string, key: string): any;
+
+ getAssetIndex(type: string, key: string): number;
+
+ getAudioURL(urls: any[]): void;
+
+ image(key: string, url?: string | any, overwrite?: boolean): Phaser.Loader;
+
+ imageFromBitmapData(key: string, bitmapData: Phaser.BitmapData, overwrite?: boolean): Phaser.Loader;
+
+ imageFromGrid(key: string, width: number, height: number, cellWidth: number, cellHeight: number, color?: string): Phaser.Loader;
+
+ imageFromTexture(key: string, data: any, pixelWidth: number, pixelHeight: number, palette?: number): Phaser.Loader;
+
+ images(keys: string[], urls?: string[]): Phaser.Loader;
+
+ json(key: string, url?: string, overwrite?: boolean): Phaser.Loader;
+
+ jsonLoadComplete(file: any, xhr: XMLHttpRequest): void;
+
+ loadAudioTag(file: any): void;
+
+ loadFile(file: any): void;
+
+ loadImageTag(file: any): void;
+
+ pack(key: string, url?: string, data?: any, callbackContext?: any): Phaser.Loader;
+
+ parseXml(data: string): XMLDocument;
+
+ physics(key: string, url?: string, data?: any, format?: string): Phaser.Loader;
+
+ processLoadQueue(): void;
+
+ processPack(pack: any): void;
+
+ removeAll(): void;
+
+ removeFile(type: string, key: string): void;
+
+ replaceInFileList(type: string, key: string, url: string, properties: any): void;
+
+ reset(hard?: boolean, clearEvents?: boolean): void;
+
+ resize(): void;
+
+ script(key: string, url?: String, callback?: Function, callbackContext?: any): Phaser.Loader;
+
+ shader(key: string, url?: String, overwrite?: boolean): Phaser.Loader;
+
+ setPreloadSprite(sprite: Phaser.Sprite | Phaser.Image, direction?: number): void;
+
+ spritesheet(key: string, url: string, frameWidth: number, frameHeight: number, frameMax?: number, margin?: number, spacing?: number, skipFrames?: number): Phaser.Loader;
+
+ start(): void;
+
+ text(key: string, url?: string, overwrite?: boolean): Phaser.Loader;
+
+ texture(key: string, object: any, overwrite?: boolean): Phaser.Loader;
+
+ tilemap(key: string, url?: string, data?: any, format?: number): Phaser.Loader;
+
+ totalLoadedFiles(): number;
+
+ totalLoadedPacks(): number;
+
+ totalQueuedFiles(): number;
+
+ totalQueuedPacks(): number;
+
+ transformUrl(url: string, file?: any): string;
+
+ updateProgress(): void;
+
+ video(key: string, urls: string | string[] | any, loadEvent?: string, asBlob?: boolean): Phaser.Loader;
+
+ withSyncPoint(callback: Function, callbackContext?: any): Phaser.Loader;
+
+ xml(key: string, url?: string, overwrite?: boolean): Phaser.Loader;
+
+ xhrLoad(file: any, url: string, type: string, onload: Function, onerror?: Function): void;
+
+ xhrLoadWithXDR(file: any, url: string, type: string, onload: Function, onerror?: Function): void;
+
+ xmlLoadComplete(file: any, xhr: XMLHttpRequest): void;
+
+ }
+
+ class LoaderParser {
+
+ static bitmapFont(xml: any, baseTexture: PIXI.BaseTexture, xSpacing?: number, ySpacing?: number, frame?: Phaser.Frame, resolution?: number): any;
+
+ static xmlBitmapFont(xml: any, baseTexture: PIXI.BaseTexture, xSpacing?: number, ySpacing?: number, frame?: Phaser.Frame, resolution?: number): any;
+
+ static jsonBitmapFont(json: any, baseTexture: PIXI.BaseTexture, xSpacing?: number, ySpacing?: number, frame?: Phaser.Frame, resolution?: number): any;
+
+ }
+
+ class Matrix {
+
+ a: number;
+ b: number;
+ c: number;
+ d: number;
+ tx: number;
+ ty: number;
+ type: number;
+
+ constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
+
+ apply(pos: Phaser.Point, newPos?: Phaser.Point): Phaser.Point;
+
+ applyInverse(pos: Phaser.Point, newPos?: Phaser.Point): Phaser.Point;
+
+ clone(output?: Phaser.Matrix): Phaser.Matrix;
+
+ copyFrom(matrix: Phaser.Matrix): Phaser.Matrix;
+
+ copyTo(matrix: Phaser.Matrix): Phaser.Matrix;
+
+ fromArray(array: number[]): Phaser.Matrix;
+
+ setTo(a: number, b: number, c: number, d: number, tx: number, ty: number): Phaser.Matrix;
+
+ toArray(transpose?: boolean, array?: number[]): number[];
+
+ translate(x: number, y: number): Phaser.Matrix;
+
+ scale(x: number, y: number): Phaser.Matrix;
+
+ rotate(angle: number): Phaser.Matrix;
+
+ append(matrix: Phaser.Matrix): Phaser.Matrix;
+
+ identity(): Phaser.Matrix;
+
+ }
+
+ class Math {
+
+ static angleBetween(x1: number, y1: number, x2: number, y2: number): number;
+
+ static angleBetweenPoints(point1: Phaser.Point, point2: Phaser.Point): number;
+
+ static angleBetweenY(x1: number, y1: number, x2: number, y2: number): number;
+
+ static angleBetweenPointsY(point1: Phaser.Point, point2: Phaser.Point): number;
+
+ static average(...numbers: number[]): number;
+
+ static bernstein(n: number, i: number): number;
+
+ static random(min: number, max: number): number;
+
+ static between(min: number, max: number): number;
+
+ static bezierInterpolation(v: number[], k: number): number;
+
+ static catmullRom(p0: number, p1: number, p2: number, p3: number, t: number): number;
+
+ static catmullRomInterpolation(v: number[], k: number): number;
+
+ static ceilTo(value: number, place?: number, base?: number): number;
+
+ static clamp(x: number, a: number, b: number): number;
+
+ static clampBottom(x: number, a: number): number;
+
+ static degToRad(degrees: number): number;
+
+ static difference(a: number, b: number): number;
+
+ static distance(x1: number, y1: number, x2: number, y2: number): number;
+
+ static distanceSq(x1: number, y1: number, x2: number, y2: number): number;
+
+ static distancePow(xy: number, y1: number, x2: number, y2: number, pow?: number): number;
+
+ static factorial(value: number): number;
+
+ static floorTo(value: number, place: number, base: number): number;
+
+ static fuzzyCeil(val: number, epsilon?: number): number;
+
+ static fuzzyEqual(a: number, b: number, epsilon?: number): boolean;
+
+ static fuzzyLessThan(a: number, b: number, epsilon?: number): boolean;
+
+ static fuzzyFloor(val: number, epsilon?: number): number;
+
+ static fuzzyGreaterThan(a: number, b: number, epsilon?: number): boolean;
+
+ static fuzzyLessThan(a: number, b: number, epsilon?: number): boolean;
+
+ static getShortestAngle(angle1: number, angle2: number): number;
+
+ static getNextPowerOfTwo(value: number): number;
+
+ static HALF_PI: number;
+
+ static isEven(n: number): boolean;
+
+ static isOdd(n: number): boolean;
+
+ static isPowerOfTwo(width: number, height: number): boolean;
+
+ static linear(p0: number, p1: number, t: number): number;
+
+ static linearInterpolation(v: number[], k: number): number;
+
+ static mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number;
+
+ static max(...numbers: number[]): number;
+
+ static maxAdd(value: number, amount: number, max: number): number;
+
+ static maxProperty(...numbers: number[]): number;
+
+ static min(...numbers: number[]): number;
+
+ static minProperty(...numbers: number[]): number;
+
+ static minSub(value: number, amount: number, min: number): number;
+
+ static normalizeAngle(angle: number, radians?: boolean): number;
+
+ static percent(a: number, b: number, base?: number): number;
+
+ static p2px(v: number): number;
+
+ static PI2: number;
+
+ static radToDeg(radians: number): number;
+
+ static reverseAngle(angleRed: number): number;
+
+ static rotateToAngle(currentAngle: number, targetAngle: number, lerp?: number): number;
+
+ static roundAwayFromZero(value: number): number;
+
+ static roundTo(value: number, place?: number, base?: number): number;
+
+ static shear(n: number): number;
+
+ static sign(x: number): number;
+
+ static sinCosGenerator(length: number, sinAmplitude?: number, cosAmplitude?: number, frequency?: number): { sin: number[]; cos: number[]; };
+
+ static hypot(a: number, b: number): number;
+
+ static smootherstep(x: number, min: number, max: number): number;
+
+ static smoothstep(x: number, min: number, max: number): number;
+
+ static snapTo(input: number, gap: number, start?: number): number;
+
+ static snapToCeil(input: number, gap: number, start?: number): number;
+
+ static snapToFloor(input: number, gap: number, start?: number): number;
+
+ static within(a: number, b: number, tolerance: number): boolean;
+
+ static wrap(value: number, min: number, max: number): number;
+
+ static wrapAngle(angle: number, radians?: boolean): number;
+
+ static wrapValue(value: number, amount: number, max: number): number;
+
+ }
+
+ interface WheelEventProxy {
+
+ bindEvent(event: any): WheelEventProxy;
+
+ type: string;
+ deltaMode: number;
+ deltaX: number;
+ deltaY: number;
+ deltaZ: number;
+
+ }
+
+ class Mouse {
+
+ constructor(game: Phaser.Game);
+
+ static NO_BUTTON: number;
+ static LEFT_BUTTON: number;
+ static MIDDLE_BUTTON: number;
+ static RIGHT_BUTTON: number;
+ static BACK_BUTTON: number;
+ static FORWARD_BUTTON: number;
+ static WHEEL_DOWN: number;
+ static WHEEL_UP: number;
+
+ button: number;
+ callbackContext: any;
+ capture: boolean;
+ enabled: boolean;
+ event: MouseEvent;
+ game: Phaser.Game;
+ input: Phaser.Input;
+ locked: boolean;
+ mouseDownCallback: (event: MouseEvent) => void;
+ mouseOutCallback: (event: MouseEvent) => void;
+ mouseOverCallback: (event: MouseEvent) => void;
+ mouseUpCallback: (event: MouseEvent) => void;
+ mouseWheelCallback: (event: MouseEvent) => void;
+ _onMouseDown: (event: MouseEvent) => void;
+ _onMouseMove: (event: MouseEvent) => void;
+ _onMouseUp: (event: MouseEvent) => void;
+ _onMouseOut: (event: MouseEvent) => void;
+ _onMouseOver: (event: MouseEvent) => void;
+ _onMouseWheel: (event: MouseEvent) => void;
+ _wheelEvent: WheelEventProxy;
+ pointerLock: Phaser.Signal;
+ stopOnGameOut: boolean;
+ wheelDelta: number;
+
+ onMouseDown(event: MouseEvent): void;
+
+ onMouseMove(event: MouseEvent): void;
+
+ onMouseOut(event: MouseEvent): void;
+
+ onMouseOver(event: MouseEvent): void;
+
+ onMouseUp(event: MouseEvent): void;
+
+ onMouseUpGlobal(event: MouseEvent): void;
+
+ onMouseWheel(event: MouseEvent): void;
+
+ pointerLockChange(event: MouseEvent): void;
+
+ releasePointerLock(): void;
+
+ requestPointerLock(): void;
+
+ start(): void;
+
+ stop(): void;
+
+ }
+
+ class MSPointer {
+
+ constructor(game: Phaser.Game);
+
+ button: number;
+ capture: boolean;
+ callbackContext: any;
+ event: MSPointerEvent;
+ game: Phaser.Game;
+ input: Phaser.Input;
+
+ onPointerDown: (event: MSPointerEvent) => void;
+ onPointerMove: (event: MSPointerEvent) => void;
+ onPointerUp: (event: MSPointerEvent) => void;
+ mouseDownCallback: (event: MSPointerEvent) => void;
+ mouseMoveCallback: (event: MSPointerEvent) => void;
+ mouseUpCallback: (event: MSPointerEvent) => void;
+ pointerDownCallback: (event: MSPointerEvent) => void;
+ pointerMoveCallback: (event: MSPointerEvent) => void;
+ pointerUpCallback: (event: MSPointerEvent) => void;
+
+ start(): void;
+
+ stop(): void;
+
+ }
+
+ class Net {
+
+ constructor(game: Phaser.Game);
+
+ game: Phaser.Game;
+
+ checkDomainName(domain: string): boolean;
+
+ decodeURI(value: string): string;
+
+ getHostName(): string;
+
+ getQueryString(parameter?: string): string;
+
+ updateQueryString(key: string, value: any, redirect?: boolean, url?: string): string;
+
+ }
+
+ class Particle extends Phaser.Sprite {
+
+ constructor(game: Phaser.Game, x: number, y: number, key?: any, frame?: any);
+
+ fresh: boolean;
+
+ onEmit(): void;
+
+ reset(x: number, y: number, health?: number): Phaser.Particle;
+
+ setAlphaData(data: any[]): void;
+
+ setScaleData(data: any[]): void;
+
+ update(): void;
+
+ }
+
+ class Particles {
+
+ constructor(game: Phaser.Game);
+
+ emitters: any;
+ game: Phaser.Game;
+ ID: number;
+
+ add(emitter: Phaser.Particles.Arcade.Emitter): Phaser.Particles.Arcade.Emitter;
+
+ remove(emitter: Phaser.Particles.Arcade.Emitter): void;
+
+ update(): void;
+
+ }
+
+ module Particles {
+
+ module Arcade {
+
+ interface EmitterCount {
+ emitted: number;
+ failed: number;
+ totalEmitted: number;
+ totalFailed: number;
+ }
+
+ class Emitter extends Phaser.Group {
+
+ constructor(game: Phaser.Game, x?: number, y?: number, maxParticles?: number);
+
+ alphaData: any[];
+ autoAlpha: boolean;
+ autoScale: boolean;
+ angle: number;
+ angularDrag: number;
+ blendMode: Phaser.blendModes;
+ bottom: number;
+ bounce: Phaser.Point;
+ counts: EmitterCount;
+ emitX: number;
+ emitY: number;
+ exists: boolean;
+ frequency: number;
+ gravity: Phaser.Point;
+ group: Phaser.Group;
+ height: number;
+ left: number;
+ lifespan: number;
+ lifespanOutput: number;
+ maxAngle: number;
+ maxParticles: number;
+ maxParticleScale: number;
+ maxParticleSpeed: Phaser.Point;
+ maxRotation: number;
+ maxSpeed: number;
+ minAngle: number;
+ minParticleScale: number;
+ minParticleSpeed: Phaser.Point;
+ minRotation: number;
+ minSpeed: number;
+ name: string;
+ on: boolean;
+ output: number;
+ particleAnchor: Phaser.Point;
+ particleBringToTop: boolean;
+ particleSendToBack: boolean;
+ particleClass: any;
+ particleDrag: Phaser.Point;
+ physicsType: number;
+ position: Phaser.Point;
+ remainder: number;
+ right: number;
+ scaleData: any[];
+ top: number;
+ type: number;
+ width: number;
+ x: number;
+ y: number;
+
+ at(object: any): Phaser.Particles.Arcade.Emitter;
+
+ emitParticle(x?: number, y?: number, key?: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number): boolean;
+
+ explode(lifespan?: number, quantity?: number): Phaser.Particles.Arcade.Emitter;
+
+ flow(lifespan?: number, frequency?: number, quantity?: number, total?: number, immediate?: boolean): Phaser.Particles.Arcade.Emitter;
+
+ kill(): Phaser.Particles.Arcade.Emitter;
+
+ makeParticles(keys: any, frames?: any, quantity?: number, collide?: boolean, collideWorldBounds?: boolean, particleArguments?: any): Phaser.Particles.Arcade.Emitter;
+
+ reset(x: number, y: number, health?: number): Phaser.Particles;
+
+ setAlpha(min?: number, max?: number, rate?: number, ease?: (k: number) => number, yoyo?: boolean): Phaser.Particles.Arcade.Emitter;
+
+ setAngle(minAngle: number, maxAngle: number, minSpeed?: number, maxSpeed?: number): Phaser.Particles.Arcade.Emitter;
+
+ setRotation(min?: number, max?: number): Phaser.Particles.Arcade.Emitter;
+
+ setScale(minX?: number, maxX?: number, minY?: number, maxY?: number, rate?: number, ease?: (k: number) => number, yoyo?: boolean): Phaser.Particles.Arcade.Emitter;
+
+ setSize(width: number, height: number): Phaser.Particles.Arcade.Emitter;
+
+ setXSpeed(min: number, max: number): Phaser.Particles.Arcade.Emitter;
+
+ setYSpeed(min: number, max: number): Phaser.Particles.Arcade.Emitter;
+
+ start(explode?: boolean, lifespan?: number, frequency?: number, total?: number, forceQuantity?: boolean): Phaser.Particles.Arcade.Emitter;
+
+ update(): void;
+
+ revive(): Phaser.Particles.Arcade.Emitter;
+
+ }
+ }
+ }
+
+ class Physics {
+
+ constructor(game: Phaser.Game, config?: any);
+
+ static ARCADE: number;
+ static P2JS: number;
+ static NINJA: number;
+ static BOX2D: number;
+ static CHIPMUNK: number;
+ static MATTERJS: number;
+
+ arcade: Phaser.Physics.Arcade;
+ config: any;
+ game: Phaser.Game;
+ ninja: Phaser.Physics.Ninja;
+ p2: Phaser.Physics.P2;
+ box2d: any;
+
+ clear(): void;
+
+ destroy(): void;
+
+ enable(object: any, system?: number, debug?: boolean): void;
+
+ parseConfig(): void;
+
+ preUpdate(): void;
+
+ reset(): void;
+
+ setBoundsToWorld(): void;
+
+ startSystem(system: number): void;
+
+ update(): void;
+
+ }
+
+ export class Video {
+
+ game: Phaser.Game;
+ key: string;
+ video: HTMLVideoElement;
+ baseTexture: PIXI.BaseTexture;
+ texture: PIXI.Texture;
+ textureFrame: Phaser.Frame;
+ type: number;
+ disableTextureUpload: boolean;
+ dirty: boolean;
+
+ currentTime: number;
+ duration: number;
+ progress: number;
+ mute: boolean;
+ paused: boolean;
+ volume: boolean;
+ playbackRate: boolean;
+ playing: boolean;
+ loop: boolean;
+ width: number;
+ height: number;
+ videoStream: any;
+ isStreaming: boolean;
+ snapshot: Phaser.BitmapData;
+ timeout: number;
+ retryLimit: number;
+ retry: number;
+ retryInterval: number;
+
+ onAccess: Phaser.Signal;
+ onError: Phaser.Signal;
+ onPlay: Phaser.Signal;
+ onComplete: Phaser.Signal;
+ onUpdate: Phaser.Signal;
+ onTimeout: Phaser.Signal;
+
+ touchLocked: boolean;
+ complete: () => void;
+
+ constructor(game: Phaser.Game, key?: string, url?: string);
+
+ add(object: Phaser.Sprite | Phaser.Sprite[] | Phaser.Image | Phaser.Image[]): Phaser.Video;
+
+ addToWorld(x?: number, y?: number, anchorX?: number, anchorY?: Number, scaleX?: number, scaleY?: number): Phaser.Image;
+
+ createVideoFromBlob(blob: Blob): Phaser.Video;
+
+ startMediaStream(captureAudio?: boolean, width?: number, height?: number): Phaser.Video;
+
+ createVideoFromURL(url: string, autoplay?: boolean): Phaser.Video;
+
+ changeSource(src: string, autoplay?: boolean): Phaser.Video;
+
+ connectToMediaStram(video: any, stream: any): Phaser.Video;
+
+ destroy(): void;
+
+ play(loop?: boolean, playbackRate?: number): Phaser.Video;
+
+ playHandler(): void;
+
+ render(): void;
+
+ removeVideoElement(): void;
+
+ resizeFrame(parent: any, width: number, height: number): void;
+
+ setTouchLock(): void;
+
+ grab(clear?: boolean, alpha?: number, blendMode?: string): Phaser.BitmapData;
+
+ stop(): void;
+
+ unlock(): boolean;
+
+ updateTexture(event?: any, width?: number, height?: number): void;
+
+ }
+
+ module Physics {
+
+ class Arcade {
+
+ static SORT_NONE: number;
+ static LEFT_RIGHT: number;
+ static RIGHT_LEFT: number;
+ static TOP_BOTTOM: number;
+ static BOTTOM_TOP: number;
+ static OVERLAP_BIAS: number;
+ static TILE_BIAS: number;
+
+ constructor(game: Phaser.Game);
+
+ bounds: Phaser.Rectangle;
+ checkCollision: { up?: boolean; down?: boolean; left?: boolean; right?: boolean; };
+ forceX: boolean;
+ game: Phaser.Game;
+ gravity: Phaser.Point;
+ isPaused: boolean;
+ quadTree: Phaser.QuadTree;
+ maxObjects: number;
+ maxLevels: number;
+ skipQuadTree: boolean;
+ sortDirection: number;
+
+ accelerationFromRotation(rotation: number, speed?: number, point?: Phaser.Point): Phaser.Point;
+
+ accelerateToObject(displayObject: any, destination: any, speed?: number, xSpeedMax?: number, ySpeedMax?: number): number;
+
+ accelerateToPointer(displayObject: any, pointer?: Phaser.Pointer, speed?: number, xSpeedMax?: number, ySpeedMax?: number): number;
+
+ accelerateToXY(displayObject: any, x: number, y: number, speed?: number, xSpeedMax?: number, ySpeedMax?: number): number;
+
+ angleBetween(source: any, target: any, world?: boolean): number;
+
+ angleToPointer(displayObject: any, pointer?: Phaser.Pointer, world?: boolean): number;
+
+ angleToXY(displayObject: any, x: number, y: number, world?: boolean): number;
+
+ closest(source: any, targets: any[], world?: boolean, useCenter?: boolean): any;
+
+ collide(object1: any, object2?: any, collideCallback?: Function, processCallback?: Function, callbackContext?: any): boolean;
+
+ computeVelocity(axis: number, body: Phaser.Physics.Arcade.Body, velocity: number, acceleration: number, drag: number, max?: number): number;
+
+ distanceBetween(source: any, target: any, world?: boolean, useCenter?: boolean): number;
+
+ distanceToPointer(displayObject: any, pointer?: Phaser.Pointer, world?: boolean): number;
+
+ distanceToXY(displayObject: any, x: number, y: number, world?: boolean): number;
+
+ enable(object: any, children?: Boolean): void;
+
+ enableBody(object: any): void;
+
+ farthest(source: any, targets: any[], world?: boolean, useCenter?: boolean): any;
+
+ getObjectsAtLocation(x: number, y: number, group: Phaser.Group, callback?: (callbackArg: any, object: any) => void, callbackContext?: any, callbackArg?: any): Sprite[];
+
+ getOverlapX(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body): number;
+
+ getOverlapY(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body): number;
+
+ intersects(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body): boolean;
+
+ moveToObject(displayObject: any, destination: any, speed?: number, maxTime?: number): number;
+
+ moveToPointer(displayObject: any, speed?: number, pointer?: Phaser.Pointer, maxTime?: number): number;
+
+ moveToXY(displayObject: any, x: number, y: number, speed?: number, maxTime?: number): number;
+
+ overlap(object1: any, object2: any, overlapCallback?: Function, processCallback?: Function, callbackContext?: any): boolean;
+
+ processTileSeparationX(body: Phaser.Physics.Arcade.Body, x: number): boolean;
+
+ processTileSeparationY(body: Phaser.Physics.Arcade.Body, y: number): void;
+
+ setBounds(x: number, y: number, width: number, height: number): void;
+
+ setBoundsToWorld(): void;
+
+ separate(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, processCallback?: Function, callbackContext?: any, overlapOnly?: boolean): boolean;
+
+ separateX(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean): boolean;
+
+ separateY(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean): boolean;
+
+ separateTile(i: number, body: Phaser.Physics.Arcade.Body, tile: Phaser.Tile): boolean;
+
+ sort(group: Phaser.Group): void;
+
+ tileCheckX(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tile): number;
+
+ tileCheckY(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tile): number;
+
+ updateMotion(body: Phaser.Physics.Arcade.Body): void;
+
+ velocityFromAngle(angle: number, speed?: number, point?: Phaser.Point): Phaser.Point;
+
+ velocityFromRotation(rotation: number, speed?: number, point?: Phaser.Point): Phaser.Point;
+
+ }
+
+ module Arcade {
+
+ class Body {
+
+ constructor(sprite: Phaser.Sprite);
+
+ acceleration: Phaser.Point;
+ allowDrag: boolean;
+ allowGravity: boolean;
+ allowRotation: boolean;
+ angle: number;
+ angularAcceleration: number;
+ angularDrag: number;
+ angularVelocity: number;
+ blocked: FaceChoices;
+ bottom: number;
+ bounce: Phaser.Point;
+ center: Phaser.Point;
+ checkCollision: FaceChoices;
+ collideWorldBounds: boolean;
+ customSeparateX: boolean;
+ customSeparateY: boolean;
+ deltaMax: Phaser.Point;
+ dirty: boolean;
+ drag: Phaser.Point;
+ embedded: boolean;
+ enable: boolean;
+ facing: number;
+ friction: Phaser.Point;
+ game: Phaser.Game;
+ gravity: Phaser.Point;
+ halfWidth: number;
+ halfHeight: number;
+ height: number;
+ immovable: boolean;
+ isCircle: boolean;
+ isMoving: boolean;
+ mass: number;
+ maxAngular: number;
+ maxVelocity: Phaser.Point;
+ moves: boolean;
+ movementCallback: any;
+ movementCallbackContext: any;
+ newVelocity: Phaser.Point;
+ offset: Phaser.Point;
+ onCollide: Phaser.Signal;
+ onMoveComplete: Phaser.Signal;
+ onOverlap: Phaser.Signal;
+ onWorldBounds: Phaser.Signal;
+ overlapX: number;
+ overlapY: number;
+ phase: number;
+ position: Phaser.Point;
+ preRotation: number;
+ prev: Phaser.Point;
+ radius: number;
+ right: number;
+ rotation: number;
+ skipQuadTree: boolean;
+ sourceWidth: number;
+ sourceHeight: number;
+ speed: number;
+ sprite: Phaser.Sprite;
+ stopVelocityOnCollide: boolean;
+ syncBounds: boolean;
+ tilePadding: Phaser.Point;
+ touching: FaceChoices;
+ type: number;
+ wasTouching: FaceChoices;
+ width: number;
+ worldBounce: Phaser.Point;
+ velocity: Phaser.Point;
+ x: number;
+ y: number;
+
+ checkWorldBounds(): void;
+
+ deltaX(): number;
+
+ deltaY(): number;
+
+ deltaZ(): number;
+
+ deltaAbsX(): number;
+
+ deltaAbsY(): number;
+
+ destroy(): void;
+
+ getBounds(obj: any): any;
+
+ hitTest(x: number, y: number): boolean;
+
+ moveFrom(duration: number, speed?: number, direction?: number): boolean;
+
+ moveTo(duration: number, distance: number, direction?: number): boolean;
+
+ onFloor(): boolean;
+
+ onWall(): boolean;
+
+ preUpdate(): void;
+
+ postUpdate(): void;
+
+ render(context: any, body: Phaser.Physics.Arcade.Body, color?: string, filled?: boolean, lineWidth?: number): void;
+
+ renderBodyInfo(debug: Phaser.Utils.Debug, body: Phaser.Physics.Arcade.Body): void;
+
+ reset(x: number, y: number): void;
+
+ setCircle(radius: number, offsetX?: number, offsetY?: number): void;
+
+ setSize(width: number, height: number, offsetX?: number, offsetY?: number): void;
+
+ updateBounds(): boolean;
+
+ }
+
+ class FaceChoices {
+
+ none: boolean;
+ up: boolean;
+ down: boolean;
+ left: boolean;
+ right: boolean;
+
+ }
+ }
+
+ class Ninja {
+
+ constructor(game: Phaser.Game);
+
+ game: Phaser.Game;
+ gravity: number;
+ bounds: Phaser.Rectangle;
+ maxObjects: number;
+ maxLevels: number;
+ quadTree: Phaser.QuadTree;
+ time: Phaser.Time;
+
+ clearTilemapLayerBodies(map: Phaser.Tilemap, layer: any): void;
+
+ collide(object1: any, object2: any, collideCallback?: Function, processCallback?: Function, callbackContext?: any): boolean;
+
+ convertTilemap(map: Phaser.Tilemap, layer: any, slopeMap: any): Phaser.Physics.Ninja.Tile[];
+
+ enableAABB(object: any, children?: boolean): void;
+
+ enableCircle(object: any, radius: number, children?: boolean): void;
+
+ enableTile(object: any, id: number, children?: boolean): void;
+
+ enable(object: any, type?: number, id?: number, radius?: number, children?: boolean): void;
+
+ enableBody(object: any, type?: number, id?: number, radius?: number): void;
+
+ overlap(object1: any, object2: any, overlapCallback?: Function, processCallback?: Function, callbackContext?: any): boolean;
+
+ separate(body1: Phaser.Physics.Ninja.Body, body2: Phaser.Physics.Ninja.Body, processCallback?: Function, callbackContext?: any, overlapOnly?: boolean): boolean;
+
+ setBounds(x: number, y: number, width: number, height: number): void;
+
+ setBoundsToWorld(): void;
+ }
+
+ module Ninja {
+
+ class Body {
+
+ constructor(system: Phaser.Physics.Ninja, sprite: Phaser.Sprite, type?: number, id?: number, radius?: number, x?: number, y?: number, width?: number, height?: number);
+
+ aabb: Phaser.Physics.Ninja.AABB;
+ angle: number;
+ bottom: number;
+ bounce: number;
+ checkCollision: Phaser.Physics.Arcade.FaceChoices;
+ circle: Phaser.Physics.Ninja.Circle;
+ collideWorldBounds: boolean;
+ drag: number;
+ facing: number;
+ friction: number;
+ game: Phaser.Game;
+ gravityScale: number;
+ height: number;
+ immovable: boolean;
+ maxSpeed: number;
+ right: number;
+ sprite: Phaser.Sprite;
+ system: Phaser.Physics.Ninja;
+ tile: Phaser.Physics.Ninja.Tile;
+ touching: Phaser.Physics.Arcade.FaceChoices;
+ type: number;
+ shape: any;
+ speed: number;
+ velocity: Phaser.Point;
+ wasTouching: Phaser.Physics.Arcade.FaceChoices;
+ width: number;
+ x: number;
+ y: number;
+
+ deltaAbsX(): number;
+
+ deltaAbsY(): number;
+
+ deltaX(): number;
+
+ deltaY(): number;
+
+ destroy(): void;
+
+ setZeroVelocity(): void;
+
+ moveTo(speed: number, angle: number): void;
+
+ moveFrom(speed: number, angle: number): void;
+
+ moveLeft(speed: number): void;
+
+ moveRight(speed: number): void;
+
+ moveUp(speed: number): void;
+
+ moveDown(speed: number): void;
+
+ poseUpdate(): void;
+
+ preUpdate(): void;
+
+ render(context: any, body: Phaser.Physics.Ninja.Body, color?: string, filled?: boolean): void;
+
+ reset(): void;
+
+ }
+
+ class AABB {
+
+ constructor(body: Phaser.Physics.Ninja.Body, x: number, y: number, width: number, height: number);
+
+ static COL_NONE: number;
+ static COL_AXIS: number;
+ static COL_OTHER: number;
+
+ aabbTileProjections: any;
+ body: Phaser.Physics.Ninja.Body;
+ height: number;
+ oldPos: Phaser.Point;
+ pos: Phaser.Point;
+ system: Phaser.Physics.Ninja;
+ width: number;
+ velocity: Phaser.Point;
+ xw: number;
+ yw: number;
+
+ collideWorldBounds(): void;
+
+ collideAABBVsAABB(aabb: Phaser.Physics.Ninja.AABB): boolean;
+
+ collideAABBVsTile(tile: Phaser.Physics.Ninja.Tile): boolean;
+
+ destroy(): void;
+
+ integrate(): void;
+
+ render(context: any, xOffset: number, yOffset: number, color: string, filled: boolean): void;
+
+ reportCollision(px: number, py: number, dx: number, dy: number): void;
+
+ reportCollisionVsWorld(px: number, py: number, dx: number, dy: number, obj: any): void;
+
+ reportCollisionVsBody(px: number, py: number, dx: number, dy: number, obj: any): void;
+
+ resolveTile(x: number, y: number, body: Phaser.Physics.Ninja.AABB, tile: Phaser.Physics.Ninja.Tile): boolean;
+
+ reverse(): void;
+
+ }
+
+ class Circle {
+
+ constructor(body: Phaser.Physics.Ninja.Body, x: number, y: number, radius: number);
+
+ COL_NONE: number;
+ COL_AXIS: number;
+ COL_OTHER: number;
+
+ body: Phaser.Physics.Ninja.Body;
+ circleTileProjections: { [index: number]: ((x: number, y: number, oH: number, oV: number, obj: Phaser.Physics.Ninja.Circle, t: Phaser.Physics.Ninja.Tile) => number); };
+ oldPos: Phaser.Point;
+ height: number;
+ pos: Phaser.Point;
+ radius: number;
+ system: Phaser.Physics.Ninja;
+ type: number;
+ velocity: Phaser.Point;
+ width: number;
+ xw: number;
+ yw: number;
+
+ collideCircleVsTile(tile: Phaser.Physics.Ninja.Tile): boolean;
+
+ collideWorldBounds(): void;
+
+ destroy(): void;
+
+ distance(dest: number, round?: boolean): number;
+
+ integrate(): void;
+
+ render(context: any, xOffset: number, yOffset: number, color: string, filled: boolean): void;
+
+ reportCollisionVsWorld(px: number, py: number, dx: number, dy: number, obj: any): void;
+
+ reportCollisionVsBody(px: number, py: number, dx: number, dy: number, obj: any): void;
+
+ resolveCircleTile(x: number, y: number, oH: number, oV: number, obj: Phaser.Physics.Ninja.Circle, t: Phaser.Physics.Ninja.Tile): boolean;
+
+ }
+
+ enum TileType {
+ TYPE_EMPTY,
+ TYPE_FULL,
+ TYPE_45DEG,
+ TYPE_CONCAVE,
+ TYPE_CONVEX,
+ TYPE_22DEGs,
+ TYPE_22DEGb,
+ TYPE_67DEGs,
+ TYPE_67DEGb,
+ TYPE_HALF
+ }
+
+ class Tile {
+
+ constructor(body: Phaser.Physics.Ninja.Body, x: number, y: number, width: number, height: number, type?: number);
+
+ body: Phaser.Physics.Ninja.Body;
+ bottom: number;
+ flipped: boolean;
+ height: number;
+ id: number;
+ oldpos: Phaser.Point;
+ pos: Phaser.Point;
+ right: number;
+ rotation: number;
+ system: Phaser.Physics.Ninja;
+ type: Phaser.Physics.Ninja.TileType;
+ velocity: Phaser.Point;
+ width: number;
+ xw: number;
+ yw: number;
+ x: number;
+ y: number;
+
+ clear(): void;
+
+ collideWorldBounds(): void;
+
+ destroy(): void;
+
+ integrate(): void;
+
+ reportCollisionVsWorld(px: number, py: number, dx: number, dy: number, obj: any): void;
+
+ setType(id: number): number;
+
+ }
+
+ }
+
+ class P2 {
+
+ constructor(game: Phaser.Game, config?: any);
+
+ applyDamping: boolean;
+ applyGravity: boolean;
+ applySpringForces: boolean;
+ boundsCollidesWith: Phaser.Physics.P2.Body[];
+ boundsCollisionGroup: Phaser.Physics.P2.CollisionGroup;
+ config: any;
+ callbackContext: any;
+ collisionGroups: Phaser.Physics.P2.CollisionGroup[];
+ contactMaterial: Phaser.Physics.P2.ContactMaterial;
+ emitImpactEvent: boolean;
+ everythingCollisionGroup: Phaser.Physics.P2.CollisionGroup;
+ frameRate: number;
+ friction: number;
+ game: Phaser.Game;
+ gravity: Phaser.Physics.P2.InversePointProxy;
+ materials: Phaser.Physics.P2.Material[];
+ nothingCollisionGroup: Phaser.Physics.P2.CollisionGroup;
+ onBodyAdded: Phaser.Signal;
+ onBodyRemoved: Phaser.Signal;
+ onBeginContact: Phaser.Signal;
+ onConstraintAdded: Phaser.Signal;
+ onConstraintRemoved: Phaser.Signal;
+ onContactMaterialAdded: Phaser.Signal;
+ onContactMaterialRemoved: Phaser.Signal;
+ onEndContact: Phaser.Signal;
+ onSpringAdded: Phaser.Signal;
+ onSpringRemoved: Phaser.Signal;
+ paused: boolean;
+ postBroaddphaseCallback: Function;
+ restitution: number;
+ solveConstraints: boolean;
+ time: any;
+ total: number;
+ useElapsedTime: boolean;
+ walls: {
+ left?: Phaser.Physics.P2.Body;
+ right?: Phaser.Physics.P2.Body;
+ top?: Phaser.Physics.P2.Body;
+ bottom?: Phaser.Physics.P2.Body;
+ };
+ world: p2.World;
+
+ addBody(body: Phaser.Physics.P2.Body): boolean;
+
+ addContactMaterial(material: Phaser.Physics.P2.ContactMaterial): Phaser.Physics.P2.ContactMaterial;
+
+ addConstraint(constraint: T): T;
+
+ addSpring(spring: Phaser.Physics.P2.Spring): Phaser.Physics.P2.Spring;
+
+ beginContactHandler(event: any): void;
+
+ clear(): void;
+
+ clearTilemapLayerBodies(map: Phaser.Tilemap, layer?: any): void;
+
+ convertCollisionObjects(map: Phaser.Tilemap, layer?: any, addToWorld?: boolean): Phaser.Physics.P2.Body[];
+
+ convertTilemap(map: Phaser.Tilemap, layer?: any, addToWorld?: Boolean, optimize?: boolean): Phaser.Physics.P2.Body[];
+
+ createBody(x: number, y: number, mass: number, addToWorld?: boolean, options?: p2.BodyOptions, data?: number[][]): Phaser.Physics.P2.Body;
+ createBody(x: number, y: number, mass: number, addToWorld?: boolean, options?: p2.BodyOptions, data?: number[]): Phaser.Physics.P2.Body;
+
+ createCollisionGroup(group?: Phaser.Group): Phaser.Physics.P2.CollisionGroup;
+ createCollisionGroup(group?: Phaser.Sprite): Phaser.Physics.P2.CollisionGroup;
+
+ createContactMaterial(materialA: Phaser.Physics.P2.Material, materialB: Phaser.Physics.P2.Material, options?: p2.ContactMaterialOptions): Phaser.Physics.P2.ContactMaterial;
+
+ createDistanceConstraint(bodyA: any, bodyB: any, distance: number, localAnchorA?: number[], localAnchorB?: number[], maxForce?: number): Phaser.Physics.P2.DistanceConstraint;
+
+ createGearConstraint(bodyA: any, bodyB: any, angle?: number, ratio?: number): Phaser.Physics.P2.GearConstraint;
+
+ createLockConstraint(bodyA: any, bodyB: any, offset?: number[], angle?: number, maxForce?: number): Phaser.Physics.P2.LockConstraint;
+
+ createMaterial(name?: string, body?: Phaser.Physics.P2.Body): Phaser.Physics.P2.Material;
+
+ createParticle(x: number, y: number, mass: number, addToWorld?: boolean, options?: p2.BodyOptions, data?: number[][]): Phaser.Physics.P2.Body;
+ createParticle(x: number, y: number, mass: number, addToWorld?: boolean, options?: p2.BodyOptions, data?: number[]): Phaser.Physics.P2.Body;
+
+ createPrismaticConstraint(body: any, bodyB: any, lockRotation?: boolean, anchorA?: number[], anchorB?: number[], axis?: Float32Array, maxForce?: number): Phaser.Physics.P2.PrismaticConstraint;
+
+ createRevoluteConstraint(bodyA: any, pivotA: number[], bodyB: any, pivotB: number[], maxForce?: number, worldPivot?: number[]): Phaser.Physics.P2.RevoluteConstraint;
+
+ createRotationalSpring(bodyA: any, bodyB: any, restAngle?: number, stiffness?: number, damping?: number): p2.RotationalSpring;
+
+ createSpring(bodyA: any, bodyB: any, restLength?: number, stiffness?: number, damping?: number, worldA?: number[], worldB?: number[], localA?: number[], localB?: number[]): Phaser.Physics.P2.Spring;
+
+ destroy(): void;
+
+ enable(object: any, debug?: boolean, children?: boolean): void;
+
+ enableBody(object: any, debug: boolean): void;
+
+ endContactHandler(event: any): void;
+
+ getBodies(): Phaser.Physics.P2.Body[];
+
+ getBody(object: any): Phaser.Physics.P2.Body;
+
+ getConstraints(): p2.Constraint[];
+
+ getSprings(): Phaser.Physics.P2.Spring[];
+
+ getContactMaterial(materialA: Phaser.Physics.P2.Material, materialB: Phaser.Physics.P2.Material): Phaser.Physics.P2.ContactMaterial;
+
+ hitTest(worldPoint: Phaser.Point, bodies?: any[], precision?: number, filterStatic?: boolean): Phaser.Physics.P2.Body[];
+
+ mpx(v: number): number;
+
+ mpxi(v: number): number;
+
+ pause(): void;
+
+ preUpdate(): void;
+
+ pxm(v: number): number;
+
+ pxmi(v: number): number;
+
+ removeBody(body: Phaser.Physics.P2.Body): Phaser.Physics.P2.Body;
+
+ removeBodyNextStep(body: Phaser.Physics.P2.Body): void;
+
+ removeConstraint(constraint: T): T;
+
+ removeContactMaterial(material: Phaser.Physics.P2.ContactMaterial): Phaser.Physics.P2.ContactMaterial;
+
+ removeSpring(spring: Phaser.Physics.P2.Spring): Phaser.Physics.P2.Spring;
+
+ reset(): void;
+
+ resume(): void;
+
+ setBounds(x: number, y: number, width: number, height: number, left?: Boolean, right?: boolean, top?: boolean, bottom?: boolean, setCollisionGroup?: boolean): void;
+
+ setBoundsToWorld(left?: boolean, right?: boolean, top?: boolean, bottom?: boolean, setCollisionGroup?: boolean): void;
+
+ setCollisionGroup(object: any, group: Phaser.Physics.P2.CollisionGroup): void;
+
+ setImpactEvents(state: boolean): void;
+
+ setMaterial(material: Phaser.Physics.P2.Material, bodies?: Phaser.Physics.P2.Body[]): void;
+
+ setPostBroadphaseCallback(callback: Function, context: any): void;
+
+ setWorldMaterial(material: Phaser.Physics.P2.Material, left?: boolean, right?: boolean, top?: boolean, bottom?: boolean): void;
+
+ toJSON(): any;
+
+ update(): void;
+
+ updateBoundsCollisionGroup(setCollisionGroup?: boolean): void;
+
+ }
+
+ module P2 {
+
+ class Body {
+
+ static DYNAMIC: number;
+ static STATIC: number;
+ static KINEMATIC: number;
+
+ constructor(game: Phaser.Game, sprite?: Phaser.Sprite, x?: number, y?: number, mass?: number);
+
+ allowSleep: boolean;
+ angle: number;
+ angularDamping: number;
+ angularForce: number;
+ angularVelocity: number;
+ collidesWith: Phaser.Physics.P2.CollisionGroup[];
+ collideWorldBounds: boolean;
+ damping: number;
+ data: p2.Body;
+ debug: boolean;
+ debugBody: Phaser.Physics.P2.BodyDebug;
+ dynamic: boolean;
+ fixedRotation: boolean;
+ force: Phaser.Physics.P2.InversePointProxy;
+ kinematic: boolean;
+ game: Phaser.Game;
+ gravity: Phaser.Point;
+ id: number;
+ inertia: number;
+ mass: number;
+ motionState: number;
+ offset: Phaser.Point;
+ onBeginContact: Phaser.Signal;
+ onEndContact: Phaser.Signal;
+ rotation: number;
+ removeNextStep: boolean;
+ sprite: Phaser.Sprite;
+ sleepSpeedLimit: number;
+ static: boolean;
+ type: number;
+ velocity: Phaser.Physics.P2.InversePointProxy;
+ world: Phaser.Physics.P2;
+ x: number;
+ y: number;
+
+ addToWorld(): void;
+
+ addCapsule(length: number, radius: number, offsetX?: number, offsetY?: number, rotation?: number): p2.Capsule;
+
+ addCircle(radius: number, offsetX?: number, offsetY?: number, rotation?: number): p2.Circle;
+
+ addFixture(fixtureData: string): p2.Shape[];
+
+ addLine(length: number, offsetX?: number, offsetY?: number, rotation?: number): p2.Line;
+
+ addParticle(offsetX?: number, offsetY?: number, rotation?: number): p2.Particle;
+
+ addPolygon(options: { optimalDecomp?: boolean; skipSimpleCheck?: boolean; removeCollinearPoints?: boolean; }, points: number[][]): boolean;
+
+ addPhaserPolygon(key: string, object: string): Phaser.Physics.P2.FixtureList;
+
+ addPlane(offsetX?: number, offsetY?: number, rotation?: number): p2.Plane;
+
+ addRectangle(width: number, height: number, offsetX?: number, offsetY?: number, rotation?: number): p2.Rectangle;
+
+ addShape(shape: p2.Shape, offsetX?: number, offsetY?: number, rotation?: number): p2.Shape;
+
+ adjustCenterOfMass(): void;
+
+ applyDamping(dt: number): void;
+
+ applyForce(force: number[], worldX: number, worldY: number): void;
+
+ applyImpulse(impulse: number[], worldX: number, worldY: number): void;
+
+ applyImpulseLocal(impulse: number[], localX: number, localY: number): void;
+
+ clearCollision(clearGroup?: boolean, cleanMask?: boolean, shape?: p2.Shape): void;
+
+ clearShapes(): void;
+
+ collides(group: any, callback?: Function, callbackContext?: any, shape?: p2.Shape): void;
+
+ createBodyCallback(object: any, callback: Function, callbackContext: any): void;
+
+ createGroupCallback(group: Phaser.Physics.P2.CollisionGroup, callback: Function, callbackContext: any): void;
+
+ destroy(): void;
+
+ getCollisionMask(): number;
+
+ getVelocityAtPoint(result: number[], relativePoint: number[]): number[];
+
+ loadPolygon(key: string, object: string, scale ?: number): boolean;
+
+ moveBackward(speed: number): void;
+
+ moveDown(speed: number): void;
+
+ moveForward(speed: number): void;
+
+ moveLeft(speed: number): void;
+
+ moveRight(speed: number): void;
+
+ moveUp(speed: number): void;
+
+ preUpdate(): void;
+
+ postUpdate(): void;
+
+ removeCollisionGroup(group: any, clearCallback?: boolean, shape?: p2.Shape): void;
+
+ removeFromWorld(): void;
+
+ removeShape(shape: p2.Shape): boolean;
+
+ reverse(speed: number): void;
+
+ rotateLeft(speed: number): void;
+
+ rotateRight(speed: number): void;
+
+ reset(x: number, y: number, resetDamping?: boolean, resetMass?: boolean): void;
+
+ shapeChanged(): void;
+
+ setCircle(radius: number, offsetX?: number, offsetY?: number, rotation?: number): p2.Circle;
+
+ setCollisionGroup(group: Phaser.Physics.P2.CollisionGroup, shape?: p2.Shape): void;
+
+ setRectangle(width?: number, height?: number, offsetX?: number, offsetY?: number, rotation?: number): p2.Rectangle;
+
+ setRectangleFromSprite(sprite: any): p2.Rectangle;
+
+ setMaterial(material: Phaser.Physics.P2.Material, shape?: p2.Shape): void;
+
+ setZeroDamping(): void;
+
+ setZeroForce(): void;
+
+ setZeroRotation(): void;
+
+ setZeroVelocity(): void;
+
+ toLocalFrame(out: number[], worldPoint: number[]): void;
+
+ thrust(speed: number): void;
+
+ thrustLeft(speed: number): void;
+
+ thrustRight(speed: number): void;
+
+ toWorldFrame(out: number[], localPoint: number[]): void;
+
+ updateCollisionMask(shape?: p2.Shape): void;
+
+ }
+
+ class BodyDebug extends Phaser.Group {
+
+ constructor(game: Phaser.Game, body: Phaser.Physics.P2.Body, settings: { pixelsPerLengthUnit?: number; debugPolygons?: boolean; lineWidth?: number; alpha?: number; });
+
+ body: Phaser.Physics.P2.Body;
+ canvas: Phaser.Graphics;
+ ppu: number;
+
+ updateSpriteTransform(): void;
+
+ draw(): void;
+
+ }
+
+ class CollisionGroup {
+
+ constructor(bitmask: number);
+
+ mask: number;
+
+ }
+
+ class ContactMaterial extends p2.ContactMaterial {
+
+ }
+
+ class DistanceConstraint extends p2.DistanceConstraint {
+
+ constructor(world: Phaser.Physics.P2, bodyA: Phaser.Physics.P2.Body, bodyB: Phaser.Physics.P2.Body, distance: number, maxForce: number);
+
+ game: Phaser.Game;
+ world: Phaser.Physics.P2;
+
+ }
+
+ class FixtureList {
+
+ constructor(list: any[]);
+
+ flatten(array: any[]): any[];
+
+ getFixtures(keys: string): any[];
+
+ getFixtureByKey(key: string): any[];
+
+ getGroup(groupID: number): any[];
+
+ init(): void;
+
+ parse(): void;
+
+ setCategory(bit: number, fictureKey: string): void;
+
+ setMask(bit: number, fixtureKey: string): void;
+
+ setMaterial(material: any, fixtureKey: string): void;
+
+ setSensor(value: boolean, fixtureKey: string): void;
+
+ }
+
+ class GearConstraint extends p2.GearConstraint {
+
+ constructor(world: Phaser.Physics.P2, bodyA: Phaser.Physics.P2.Body, bodyB: Phaser.Physics.P2.Body, angle?: number, ratio?: number);
+
+ game: Phaser.Game;
+ world: Phaser.Physics.P2;
+
+ }
+
+ class InversePointProxy {
+
+ constructor(world: Phaser.Physics.P2, destination: any);
+
+ x: number;
+ y: number;
+ mx: number;
+ my: number;
+
+ }
+
+ class LockConstraint extends p2.LockConstraint {
+
+ constructor(world: Phaser.Physics.P2, bodyA: Phaser.Physics.P2.Body, bodyB: Phaser.Physics.P2.Body, offset?: number[], angle?: number, maxForce?: number);
+
+ game: Phaser.Game;
+ world: Phaser.Physics.P2;
+ }
+
+ class Material extends p2.Material {
+
+ constructor(name: string);
+
+ name: string;
+
+ }
+
+ class PointProxy {
+
+ constructor(world: Phaser.Physics.P2, destination: any);
+
+ x: number;
+ y: number;
+ mx: number;
+ my: number;
+
+ }
+
+ class PrismaticConstraint extends p2.PrismaticConstraint {
+
+ constructor(world: Phaser.Physics.P2, bodyA?: Phaser.Physics.P2.Body, bodyB?: Phaser.Physics.P2.Body, lockRotation?: boolean, anchorA?: number[], anchorB?: number[], axis?: number[], maxForce?: number);
+
+ game: Phaser.Game;
+ world: Phaser.Physics.P2;
+
+ }
+
+ class RevoluteConstraint extends p2.RevoluteConstraint {
+
+ constructor(world: Phaser.Physics.P2, bodyA: Phaser.Physics.P2.Body, pivotA: number[], bodyB: Phaser.Physics.P2.Body, pivotB: number[], maxForce?: number);
+
+ game: Phaser.Game;
+ world: Phaser.Physics.P2;
+
+ }
+
+ class Spring {
+
+ constructor(world: Phaser.Physics.P2, bodyA: Phaser.Physics.P2.Body, bodyB: Phaser.Physics.P2.Body, restLength?: number, stiffness?: number, damping?: number, worldA?: number[], worldB?: number[], localA?: number[], localB?: number[]);
+
+ data: p2.LinearSpring;
+ game: Phaser.Game;
+ world: Phaser.Physics.P2;
+
+ }
+ }
+ }
+
+ class Plugin implements IStateCycle {
+
+ constructor(game: Phaser.Game, parent: Phaser.PluginManager);
+
+ active: boolean;
+ game: Phaser.Game;
+ hasPostRender: boolean;
+ hasPostUpdate: boolean;
+ hasPreUpdate: boolean;
+ hasRender: boolean;
+ hasUpdate: boolean;
+ parent: PIXI.DisplayObject;
+ visible: boolean;
+
+ destroy(): void;
+
+ postRender(): void;
+
+ preUpdate(): void;
+
+ render(): void;
+
+ update(): void;
+
+ }
+
+ module Plugin {
+
+ class SaveCPU extends Phaser.Plugin {
+
+ renderOnFPS: number;
+ renderOnPointerChange: boolean;
+
+ forceRender(): void;
+ }
+
+ class AStar extends Phaser.Plugin {
+
+ static VERSION: string;
+ static COST_ORTHOGONAL: number;
+ static COST_DIAGONAL: number;
+ static DISTANCE_MANHATTAN: string;
+ static DISTANCE_EUCLIDIAN: string;
+
+ constructor(parent: PIXI.DisplayObject);
+
+ parent: PIXI.DisplayObject;
+ version: string;
+
+ findPath(startPoint: Phaser.Point, goalPoint: Phaser.Point): Phaser.Plugin.AStar.AStarPath;
+
+ isWalkable(x: number, y: number): boolean;
+
+ setAStarMap(map: Phaser.Tilemap, layerName: string, tilesetName: string): Phaser.Plugin.AStar;
+
+ }
+
+ module AStar {
+
+ class AStarNode {
+
+ constructor(x: number, y: number, isWalkable: boolean);
+
+ x: number;
+ y: number;
+ g: number;
+ h: number;
+ f: number;
+ parent: Phaser.Plugin.AStar.AStarNode;
+ travelCost: number;
+ walkable: boolean;
+
+ }
+
+ interface AStarNodeArray {
+ x: number;
+ y: number;
+ }
+
+ class AStarPath {
+
+ constructor(nodes?: AStarNodeArray[], start?: Phaser.Plugin.AStar.AStarNode, goal?: Phaser.Plugin.AStar.AStarNode);
+
+ nodes: AStarNodeArray[];
+ start: Phaser.Plugin.AStar.AStarNode;
+ goal: Phaser.Plugin.AStar.AStarNode;
+ visited: Phaser.Plugin.AStar.AStarNode[];
+
+ }
+
+ }
+
+ class ColorHarmony extends Phaser.Plugin {
+
+ getAnalogousHarmony(color: number, threshold?: number): any;
+
+ getComplementHarmony(color: number): number;
+
+ getSplitComplementHarmony(color: number, threshold: number): any;
+
+ getTriadicHarmony(color: number): any;
+
+ }
+
+ class CSS3Filters extends Phaser.Plugin {
+
+ constructor(parent: PIXI.DisplayObject);
+
+ blur: number;
+ brightness: number;
+ contrast: number;
+ grayscale: number;
+ hueRotate: number;
+ invert: number;
+ opacity: number;
+ saturate: number;
+ sepia: number;
+
+ }
+
+ class TilemapWalker extends Phaser.Plugin {
+
+ constructor(game: Phaser.Game, map: Phaser.Tilemap, layer?: any, x?: number, y?: number);
+
+ collides: boolean;
+ game: Phaser.Game;
+ history: boolean;
+ facing: number;
+ map: Phaser.Tilemap;
+ location: Phaser.Point;
+ locationLayer: number;
+
+ checkTile(x: number, y: number): boolean;
+
+ getTileFromLocation(x: number, y: number): Phaser.Tile;
+
+ getTiles(width: number, height: number, center?: boolean): any[];
+
+ getTileBehind(distance?: number): Phaser.Tile;
+
+ getTileBehindLeft(distance?: number): Phaser.Tile;
+
+ getTileBehindRight(distance?: number): Phaser.Tile;
+
+ getTileAhead(distance?: number): Phaser.Tile;
+
+ getTileAheadLeft(distance?: number): Phaser.Tile;
+
+ getTileAheadRight(distance?: number): Phaser.Tile;
+
+ getTileLeft(distance: number): Phaser.Tile;
+
+ getTileRight(distance: number): Phaser.Tile;
+
+ moveForward(): boolean;
+
+ moveBackward(): boolean;
+
+ moveLeft(): boolean;
+
+ moveRight(): boolean;
+
+ putTile(index: number): void;
+
+ setLocation(x: number, y: number, layer?: any): boolean;
+
+ turnLeft(): void;
+
+ turnRight(): void;
+
+ updateLocation(x: number, y: number): boolean;
+
+ }
+
+ class SamplePlugin extends Phaser.Plugin {
+
+ constructor(game: Phaser.Game, parent: PIXI.DisplayObject);
+
+ addSprite(sprite: Phaser.Sprite): void;
+
+ update(): void;
+
+ }
+
+ class VirtualJoystick extends Phaser.Plugin {
+
+ constructor(game: Phaser.Game, parent: any);
+
+ angle: number;
+ base: Phaser.Sprite;
+ baseBMD: Phaser.BitmapData;
+ baseCircle: Phaser.Circle;
+ deltaX: number;
+ deltaY: number;
+ distance: number;
+ force: number;
+ isDragging: boolean;
+ limit: number;
+ limitPoint: Phaser.Point;
+ location: Phaser.Point;
+ nub: Phaser.Sprite;
+ nubBMD: Phaser.BitmapData;
+ speed: number;
+ x: number;
+ y: number;
+
+ init(x: number, y: number, diameter?: number, limit?: number): void;
+
+ move(pointer: Phaser.Pointer, x: number, y: number): void;
+
+ render(): void;
+
+ setVelocity(sprite: Phaser.Sprite, minSpeed?: number, maxSpeed?: number): Phaser.Sprite;
+
+ startDrag(): void;
+
+ stopDrag(nub: Phaser.Sprite, pointer: Phaser.Pointer): void;
+
+ update(): void;
+
+ }
+
+
+ class Webcam extends Phaser.Plugin {
+
+ constructor(game: Phaser.Game, parent: PIXI.DisplayObject);
+
+ active: boolean;
+ context: any;
+ stream: any;
+ video: HTMLVideoElement;
+
+ connectCallback: (stream: any) => void;
+ errorCallback: (e: any) => void;
+ grab: (context: any, x: number, y: number) => void;
+
+ start(width: number, height: number, context: any): void;
+
+ stop(): void;
+
+ update(): void;
+ }
+
+ class Juicy extends Phaser.Plugin {
+
+ constructor(game: Phaser.Game);
+
+ createScreenFlash(color?: string): Phaser.Plugin.Juicy.ScreenFlash;
+
+ createTrail(length?: number, color?: number): Phaser.Plugin.Juicy.Trail;
+
+ overScale(object: Phaser.Sprite, scale?: number, initialScale?: Phaser.Point): void;
+
+ jelly(object: Phaser.Sprite, strength?: number, delay?: number, initialScale?: Phaser.Point): void;
+
+ mouseStretch(object: Phaser.Sprite, strength?: number, initialScale?: Phaser.Point): void;
+
+ update(): void;
+
+ shake(duration?: number, strength?: number): void;
+ }
+
+ module Juicy {
+
+ class Trail {
+
+ constructor(game: Phaser.Game, trailLength?: number, color?: number);
+
+ target: Phaser.Sprite;
+ trailLength: number;
+ trailWidth: number;
+ trailScaling: boolean;
+ trailColor: number;
+
+ update(): void;
+
+ addSegment(x: number, y: number): void;
+
+ redrawSegments(offsetX: number, offsetY: number): void;
+
+ }
+
+ class ScreenFlash {
+
+ constructor(game: Phaser.Game, color?: string);
+
+ flash(maxAlpha?: number, duration?: number): void;
+
+ }
+ }
+ }
+
+ interface PluginConstructorOf {
+ new (...parameters: any[]): T;
+ }
+
+ class PluginManager implements IStateCycle {
+
+ constructor(game: Phaser.Game);
+
+ game: Phaser.Game;
+ plugins: Phaser.Plugin[];
+
+ add(plugin: any, ...parameters: any[]): T;
+
+ destroy(): void;
+
+ postRender(): void;
+
+ postUpdate(): void;
+
+ preUpdate(): void;
+
+ remove(plugin: Phaser.Plugin, destroy?: boolean): void;
+
+ removeAll(): void;
+
+ render(): void;
+
+ update(): void;
+
+ }
+
+ class Point extends PIXI.Point {
+
+ constructor(x?: number, y?: number);
+
+ x: number;
+ y: number;
+ type: number;
+
+ static add(a: Phaser.Point, b: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static subtract(a: Phaser.Point, b: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static multiply(a: Phaser.Point, b: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static divide(a: Phaser.Point, b: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static equals(a: Phaser.Point, b: Phaser.Point): boolean;
+
+ static equalsXY(a: Phaser.Point, x: number, y: number): boolean;
+
+ static fuzzyEquals(a: Phaser.Point, b: Phaser.Point, epsilon?: number): boolean;
+
+ static fuzzyEqualsXY(a: Phaser.Point, x: number, y: number, epsilon?: number): boolean;
+
+ static angle(a: Phaser.Point, b: Phaser.Point): number;
+
+ static angleSq(a: Phaser.Point, b: Phaser.Point): number;
+
+ static negative(a: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static multiplyAdd(a: Phaser.Point, b: Phaser.Point, scale: number, out?: Phaser.Point): Phaser.Point;
+
+ static interpolate(a: Phaser.Point, b: Phaser.Point, alpha: number, out?: Phaser.Point): Phaser.Point;
+
+ static parse(obj: any, xProp?: string, yProp?: string): Phaser.Point;
+
+ static perp(a: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static rperp(a: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static distance(a: any, b: any, round?: boolean): number;
+
+ static project(a: Phaser.Point, b: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static projectUnit(a: Phaser.Point, b: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static normalRightHand(a: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static normalize(a: Phaser.Point, out?: Phaser.Point): Phaser.Point;
+
+ static rotate(a: Phaser.Point, x: number, y: number, angle: number, asDegrees?: boolean, distance?: number): Phaser.Point;
+
+ static centroid(points: Phaser.Point[], out?: Phaser.Point): Phaser.Point;
+
+ static isPoint(obj: any): boolean;
+
+ static set(obj: any, x: number, y: number): any;
+
+ static sortClockwise(points: any[], center?: Phaser.Point): any[];
+
+ add(x: number, y: number): Phaser.Point;
+
+ angle(a: Phaser.Point, asDegrees?: boolean): number;
+
+ angleSq(a: Phaser.Point): number;
+
+ angleXY(x: number, y: number, asDegrees?: boolean): number;
+
+ atan(asDegrees?: boolean): number;
+
+ ceil(): Phaser.Point;
+
+ clamp(min: number, max: number): Phaser.Point;
+
+ clampX(min: number, max: number): Phaser.Point;
+
+ clampY(min: number, max: number): Phaser.Point;
+
+ clip(rect: any): Phaser.Point;
+
+ clone(output?: Phaser.Point): Phaser.Point;
+
+ copyFrom(source: Phaser.Point): Phaser.Point;
+
+ copyTo(dest: T): T;
+
+ cross(a: Phaser.Point): number;
+
+ distance(dest: Phaser.Point, round?: boolean): number;
+
+ divide(x: number, y: number): Phaser.Point;
+
+ dot(a: Phaser.Point): number;
+
+ equals(a: Phaser.Point): boolean;
+
+ equalsXY(x: number, y: number): boolean;
+
+ expand(min: number): Phaser.Point;
+
+ floor(): Phaser.Point;
+
+ fuzzyEquals(a: Phaser.Point, epsilon?: number): boolean;
+
+ fuzzyEqualsXY(x: number, y: number, epsilon?: number): boolean;
+
+ getMagnitude(): number;
+
+ getMagnitudeSq(): number;
+
+ invert(): Phaser.Point;
+
+ isZero(): boolean;
+
+ limit(max: number): Phaser.Point;
+
+ multiply(x: number, y: number): Phaser.Point;
+
+ normalize(): Phaser.Point;
+
+ normalRightHand(): Phaser.Point;
+
+ perp(): Phaser.Point;
+
+ rotate(x: number, y: number, angle: number, asDegrees?: boolean, distance?: number): Phaser.Point;
+
+ rperp(): Phaser.Point;
+
+ set(x: number, y?: number): Phaser.Point;
+
+ setMagnitude(magnitude: number): Phaser.Point;
+
+ setTo(x: number, y?: number): Phaser.Point;
+
+ setToPolar(azimuth: number, radius?: number, asDegrees?: boolean): Phaser.Point;
+
+ subtract(x: number, y: number): Phaser.Point;
+
+ toString(): string;
+
+ }
+
+ class Pointer {
+
+ constructor(game: Phaser.Game, id: number, pointerMode?: number);
+
+ static NO_BUTTON: number;
+ static LEFT_BUTTON: number;
+ static RIGHT_BUTTON: number;
+ static MIDDLE_BUTTON: number;
+ static BACK_BUTTON: number;
+ static FORWARD_BUTTON: number;
+ static ERASER_BUTTON: number;
+
+ active: boolean;
+ backButton: Phaser.DeviceButton;
+ button: any;
+ circle: Phaser.Circle;
+ clientX: number;
+ clientY: number;
+ dirty: boolean;
+ duration: number;
+ eraserButton: Phaser.DeviceButton;
+ exists: boolean;
+ forceOut: boolean;
+ forwardButton: Phaser.DeviceButton;
+ game: Phaser.Game;
+ justReleasePreventsOver: boolean | number;
+ id: number;
+ identifier: number;
+ interactiveCandidates: Phaser.InputHandler[];
+ isDown: boolean;
+ isMouse: boolean;
+ isUp: boolean;
+ leftButton: Phaser.DeviceButton;
+ middleButton: Phaser.DeviceButton;
+ movementX: number;
+ movementY: number;
+ msSinceLastClick: number;
+ pageX: number;
+ pageY: number;
+ pointerId: number;
+ pointerMode: number;
+ position: Phaser.Point;
+ positionDown: Phaser.Point;
+ positionUp: Phaser.Point;
+ previousTapTime: number;
+ rawMovementX: number;
+ rawMovementY: number;
+ rightButton: Phaser.DeviceButton;
+ screenX: number;
+ screenY: number;
+ target: any;
+ targetObject: any;
+ timeDown: number;
+ timeUp: number;
+ totalTouches: number;
+ type: number;
+ withinGame: boolean;
+ worldX: number;
+ worldY: number;
+ x: number;
+ y: number;
+
+ addClickTrampoline(name: string, callback: Function, callbackContext: any, ...callbackArgs: any[]): void;
+
+ justPressed(duration?: number): boolean;
+
+ justReleased(duration?: number): boolean;
+
+ leave(event: any): void;
+
+ move(event: any, fromClick?: boolean): void;
+
+ reset(): void;
+
+ resetButtons(): void;
+
+ resetMovement(): void;
+
+ start(event: any): void;
+
+ stop(event: any): void;
+
+ swapTarget(newTarget: Phaser.InputHandler, silent?: boolean): void;
+
+ update(): void;
+
+ updateButtons(event: MouseEvent): void;
+
+ }
+
+ class Polygon {
+
+ constructor(points: Phaser.Point[] | number[]);
+ constructor(...points: Phaser.Point[]);
+ constructor(...points: number[]);
+
+ area: number;
+ flattened: boolean;
+ points: number[] | Phaser.Point[];
+ type: number;
+
+ clone(output: Phaser.Polygon): Phaser.Polygon;
+
+ contains(x: number, y: number): boolean;
+
+ flatten(): Phaser.Polygon;
+
+ setTo(points: Phaser.Point[] | number[]): void;
+ setTo(...points: Phaser.Point[]): void;
+ setTo(...points: number[]): void;
+
+ toNumberArray(output?: number[]): number[];
+
+ }
+
+ class QuadTree {
+
+ constructor(x: number, y: number, width: number, height: number, maxObject?: number, maxLevels?: number, level?: number);
+
+ bounds: {
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+ subWidth: number;
+ subHeight: number;
+ right: number;
+ bottom: number;
+ };
+ level: number;
+ maxObjects: number;
+ maxLevels: number;
+ objects: any[];
+ nodes: any[];
+
+ clear(): void;
+
+ getIndex(rect: any): number;
+
+ insert(body: any): void;
+
+ populate(group: Phaser.Group): void;
+
+ populateHandler(sprite: Phaser.Sprite): void;
+
+ reset(x: number, y: number, width: number, height: number, maxObject?: number, maxLevels?: number, level?: number): void;
+
+ retrieve(source: any): any[];
+
+ split(): void;
+
+ }
+
+ class RandomDataGenerator {
+
+ constructor(seeds?: any[] | string);
+
+ angle(): number;
+
+ between(min: number, max: number): number;
+
+ frac(): number;
+
+ integer(): number;
+
+ integerInRange(min: number, max: number): number;
+
+ normal(): number;
+
+ pick(ary: T[]): T;
+
+ real(): number;
+
+ realInRange(min: number, max: number): number;
+
+ sign(): number;
+
+ sow(seeds: any[]): void;
+
+ state(state?: string): string;
+
+ timestamp(min: number, max: number): number;
+
+ uuid(): string;
+
+ weightedPick(ary: T[]): T;
+
+ }
+
+ class Rectangle {
+
+ constructor(x: number, y: number, width: number, height: number);
+
+ bottom: number;
+ bottomRight: Phaser.Point;
+ bottomLeft: Phaser.Point;
+ centerX: number;
+ centerY: number;
+ empty: boolean;
+ halfHeight: number;
+ halfWidth: number;
+ height: number;
+ left: number;
+ perimeter: number;
+ randomX: number;
+ randomY: number;
+ right: number;
+ top: number;
+ topLeft: Phaser.Point;
+ topRight: Phaser.Point;
+ type: number;
+ volume: number;
+ width: number;
+ x: number;
+ y: number;
+
+ static aabb(points: Phaser.Point[], out?: Phaser.Rectangle): Phaser.Rectangle;
+
+ static clone(a: Phaser.Rectangle, output?: Phaser.Rectangle): Phaser.Rectangle;
+
+ static contains(a: Phaser.Rectangle, x: number, y: number): boolean;
+
+ static containsPoint(a: Phaser.Rectangle, point: Phaser.Point): boolean;
+
+ static containsRaw(rx: number, ry: number, rw: number, rh: number, x: number, y: number): boolean;
+
+ static containsRect(a: Phaser.Rectangle, b: Phaser.Rectangle): boolean;
+
+ static createFromBounds(a: any, output?: Phaser.Rectangle): Phaser.Rectangle;
+
+ static equals(a: Phaser.Rectangle, b: Phaser.Rectangle): boolean;
+
+ static inflate(a: Phaser.Rectangle, dx: number, dy: number): Phaser.Rectangle;
+
+ static inflatePoint(a: Phaser.Rectangle, point: Phaser.Point): Phaser.Rectangle;
+
+ static intersection(a: Phaser.Rectangle, b: Phaser.Rectangle, out?: Phaser.Rectangle): Phaser.Rectangle;
+
+ static intersects(a: Phaser.Rectangle, b: Phaser.Rectangle): boolean;
+
+ static intersectsRaw(left: number, right: number, top: number, bottom: number, tolerance: number): boolean;
+
+ static size(a: Phaser.Rectangle, output?: Phaser.Point): Phaser.Point;
+
+ static union(a: Phaser.Rectangle, b: Phaser.Rectangle, out?: Phaser.Rectangle): Phaser.Rectangle;
+
+ ceil(): void;
+
+ ceilAll(): void;
+
+ centerOn(x: number, y: number): Phaser.Rectangle;
+
+ clone(output: Phaser.Rectangle): Phaser.Rectangle;
+
+ contains(x: number, y: number): boolean;
+
+ containsRect(b: Phaser.Rectangle): boolean;
+
+ copyFrom(source: any): Phaser.Rectangle;
+
+ copyFromBounds(source: any): Phaser.Rectangle;
+
+ copyTo(dest: any): any;
+
+ equals(b: Phaser.Rectangle): boolean;
+
+ floor(): void;
+
+ floorAll(): void;
+
+ getPoint(position: number, out: Phaser.Point): Phaser.Point;
+
+ inflate(dx: number, dy: number): Phaser.Rectangle;
+
+ intersection(b: Phaser.Rectangle, out: Phaser.Rectangle): Phaser.Rectangle;
+
+ intersects(b: Phaser.Rectangle, tolerance: number): boolean;
+
+ intersectsRaw(left: number, right: number, top: number, bottom: number, tolerance: number): boolean;
+
+ offset(dx: number, dy: number): Phaser.Rectangle;
+
+ offsetPoint(point: Phaser.Point): Phaser.Rectangle;
+
+ random(out?: Phaser.Point): Phaser.Point;
+
+ resize(width: number, height: number): Phaser.Rectangle;
+
+ setTo(x: number, y: number, width: number, height: number): Phaser.Rectangle;
+
+ scale(x: number, y?: number): Phaser.Rectangle;
+
+ sides(top?: Phaser.Line, right?: Phaser.Line, bottom?: Phaser.Line, left?: Phaser.Line): Phaser.Line[];
+
+ size(output?: Phaser.Point): Phaser.Point;
+
+ toString(): string;
+
+ union(b: Phaser.Rectangle, out?: Phaser.Rectangle): Phaser.Rectangle;
+
+ }
+
+ class RenderTexture extends PIXI.Texture {
+
+ constructor(game: Phaser.Game, width?: number, height?: number, key?: string, scaleMode?: Phaser.scaleModes, resolution?: number);
+
+ crop: PIXI.Rectangle;
+ game: Phaser.Game;
+ key: string;
+ type: number;
+
+ render(displayObject: PIXI.DisplayObject, matrix?: Phaser.Matrix, clear?: boolean): void;
+
+ renderXY(displayObject: PIXI.DisplayObject, x: number, y: number, clear?: boolean): void;
+
+ renderRawXY(displayObject: PIXI.DisplayObject, x: number, y: number, clear?: boolean): void;
+
+ }
+
+ class RequestAnimationFrame {
+
+ constructor(game: Phaser.Game, forceSetTimeOut?: boolean);
+
+ forceSetTimeOut: boolean;
+ game: Phaser.Game;
+ isRunning: boolean;
+
+ isRAF(): boolean;
+
+ isSetTimeOut(): boolean;
+
+ start(): boolean;
+
+ stop(): void;
+
+ updateRAF(rafTime: number): void;
+
+ updateSetTimeout(time: number): void;
+
+ }
+
+ class RetroFont extends Phaser.RenderTexture {
+
+ constructor(game: Phaser.Game, key: string, characterWidth: number, characterHeight: number, chars: string, charsPerRow?: number, xSpacing?: number, ySpacing?: number, xOffset?: number, yOffset?: number);
+
+ static ALIGN_CENTER: string;
+ static ALIGN_LEFT: string;
+ static ALIGN_RIGHT: string;
+ static TEXT_SET1: string;
+ static TEXT_SET2: string;
+ static TEXT_SET3: string;
+ static TEXT_SET4: string;
+ static TEXT_SET5: string;
+ static TEXT_SET6: string;
+ static TEXT_SET7: string;
+ static TEXT_SET8: string;
+ static TEXT_SET9: string;
+ static TEXT_SET10: string;
+ static TEXT_SET11: string;
+
+ align: string;
+ autoUpperCase: boolean;
+ characterHeight: number;
+ characterPerRow: number;
+ characterSpacingX: number;
+ characterSpacingY: number;
+ characterWidth: number;
+ customSpacingX: number;
+ customSpacingY: number;
+ fixedWidth: number;
+ fontSet: Image;
+ frameData: Phaser.FrameData;
+ multiLine: boolean;
+ offsetX: number;
+ offsetY: number;
+ smoothed: boolean;
+ stamp: Phaser.Image;
+ text: string;
+
+ buildRetroFontText(): void;
+
+ getLongestLine(): number;
+
+ pasteLine(line: string, x: number, y: number, customSpacingX: number): void;
+
+ removeUnsupportedCharacters(stripCR?: boolean): string;
+
+ setFixedWidth(width: number, lineAlignment?: string): void;
+
+ setText(content: string, multiLine?: boolean, characterSpacing?: number, lineSpacing?: number, lineAlignment?: string, allowLowerCase?: boolean): void;
+
+ updateOffset(x?: number, y?: number): void;
+
+ }
+
+ class Rope extends PIXI.Rope {
+
+ constructor(game: Phaser.Game, x: number, y: number, key: string | Phaser.RenderTexture | Phaser.BitmapData | PIXI.Texture | Phaser.Video, frame?: string | number, points?: Phaser.Point[]);
+
+ angle: number;
+ animations: Phaser.AnimationManager;
+ alive: boolean;
+ autoCull: boolean;
+ body: Phaser.Physics.Arcade.Body | Phaser.Physics.P2.Body | Phaser.Physics.Ninja.Body | any;
+ bottom: number;
+ cameraOffset: Phaser.Point;
+ checkWorldBounds: boolean;
+ cropRect: Phaser.Rectangle;
+ components: any;
+ customRender: boolean;
+ debug: boolean;
+ deltaX: number;
+ deltaY: number;
+ deltaZ: number;
+ destroyPhase: boolean;
+ exists: boolean;
+ events: Phaser.Events;
+ fixedToCamera: boolean;
+ frame: string | number;
+ frameName: string;
+ fresh: boolean;
+ game: Phaser.Game;
+ inCamera: boolean;
+ input: Phaser.InputHandler;
+ inputEnabled: boolean;
+ inWorld: boolean;
+ left: number;
+ lifespan: number;
+ key: string | Phaser.RenderTexture | Phaser.BitmapData | PIXI.Texture | Phaser.Video;
+ name: string;
+ offsetX: number;
+ offsetY: number;
+ outOfBoundsKill: boolean;
+
+ overlap(displayObject: Phaser.Sprite | Phaser.Image | Phaser.TileSprite | Phaser.Button | PIXI.DisplayObject): boolean;
+
+ pendingDestroy: boolean;
+ points: Phaser.Point[];
+ position: Phaser.Point;
+ previousPosition: Phaser.Point;
+ previousRotation: number;
+ right: number;
+ renderOrderID: number;
+ segments: Phaser.Rectangle[];
+ smoothed: boolean;
+ top: number;
+ type: number;
+ transformCallback: Function;
+ transformCallbackContext: any;
+ scaleMin: Phaser.Point;
+ scaleMax: Phaser.Point;
+ updateAnimation: Function;
+ world: Phaser.Point;
+ x: number;
+ y: number;
+ z: number;
+
+ bringToTop(): Phaser.Rope;
+
+ checkTransform(wt: Phaser.Matrix): void;
+
+ crop(rect: Phaser.Rectangle, copy?: boolean): void;
+
+ destroy(destroyChildren?: boolean): void;
+
+ kill(): Phaser.Rope;
+
+ loadTexture(key: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number, stopAnimation?: boolean): void;
+
+ moveUp(): Phaser.Rope;
+
+ moveDown(): Phaser.Rope;
+
+ play(name: string, frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
+
+ preUpdate(): void;
+
+ postUpdate(): void;
+
+ reset(x: number, y: number, health?: number): Phaser.Rope;
+
+ resizeFrame(parent: any, width: number, height: number): void;
+
+ resetFrame(): void;
+
+ revive(health?: number): Phaser.Rope;
+
+ sendToBack(): Phaser.Rope;
+
+ setFrame(frame: Phaser.Frame): void;
+
+ setScaleMinMax(minX?: number, minY?: number, maxX?: number, maxY?: number): void;
+
+ updateCrop(): void;
+
+ update(): void;
+
+ }
+
+ class RoundedRectangle {
+
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+ radius: number;
+ type: number;
+
+ clone(): RoundedRectangle;
+
+ contains(x: number, y: number): boolean;
+
+ }
+
+ class Signal {
+
+ active: boolean;
+ boundDispatch: Function;
+ memorize: boolean;
+
+ add(listener: Function, listenerContext?: any, priority?: number, ...args: any[]): Phaser.SignalBinding;
+
+ addOnce(listener: Function, listenerContext?: any, priority?: number, ...args: any[]): Phaser.SignalBinding;
+
+ dispatch(...params: any[]): void;
+
+ dispose(): void;
+
+ forget(): void;
+
+ getNumListeners(): number;
+
+ halt(): void;
+
+ has(listener: Function, context?: any): boolean;
+
+ remove(listener: Function, context?: any): Function;
+
+ removeAll(context?: any): void;
+
+ toString(): string;
+
+ validateListener(listener: Function, fnName: string): void;
+
+ }
+
+ class SignalBinding {
+
+ constructor(signal: Phaser.Signal, listener: Function, isOnce: boolean, listenerContext?: any, priority?: number, ...args: any[]);
+
+ active: boolean;
+ callCount: number;
+ context: any;
+ params: any[];
+
+ execute(paramsArr?: any[]): void;
+
+ detach(): Function;
+
+ isBound(): boolean;
+
+ isOnce(): boolean;
+
+ getListener(): Function;
+
+ getSignal(): Phaser.Signal;
+
+ toString(): string;
+
+ }
+
+ class SinglePad {
+
+ constructor(game: Phaser.Game, padParent: any);
+
+ callbackContext: any;
+ connected: boolean;
+ deadZone: number;
+ game: Phaser.Game;
+ index: number;
+ onAxisCallback: Function;
+ onConnectCallback: Function;
+ onDisconnectCallback: Function;
+ onDownCallback: Function;
+ onFloatCallback: Function;
+ onUpCallback: Function;
+
+ axis(axisCode: number): number;
+
+ addCallbacks(context: any, callbacks: any): void;
+
+ buttonValue(buttonCode: number): number;
+
+ connect(rawPad: any): void;
+
+ destroy(): void;
+
+ disconnect(): void;
+
+ getButton(buttonCode: number): Phaser.DeviceButton;
+
+ isDown(buttonCode: number): boolean;
+
+ isUp(buttonCode: number): boolean;
+
+ justPressed(buttonCode: number, duration?: number): boolean;
+
+ justReleased(buttonCode: number, duration?: number): boolean;
+
+ pollStatus(): void;
+
+ processAxisChange(axisState: any): void;
+
+ processButtonDown(buttonCode: number, value: any): void;
+
+ processButtonFloat(buttonCode: number, value: any): void;
+
+ processButtonUp(buttonCode: number, value: any): void;
+
+ reset(): void;
+
+ }
+
+ class Sound {
+
+ constructor(game: Phaser.Game, key: string, volume?: number, loop?: boolean, connect?: boolean);
+
+ autoplay: boolean;
+ allowMultiple: boolean;
+ context: any;
+ currentMarker: string;
+ currentTime: number;
+
+ destroy(remove?: boolean): void;
+
+ duration: number;
+ durationMS: number;
+ externalNode: any;
+ fadeTween: Phaser.Tween;
+ game: Phaser.Game;
+ gainNode: any;
+ isDecoded: boolean;
+ isDecoding: boolean;
+ isPlaying: boolean;
+ key: string;
+ loop: boolean;
+ markers: any;
+ masterGainNode: any;
+ mute: boolean;
+ name: string;
+ onDecoded: Phaser.Signal;
+ onEndedHandler: () => void;
+ onFadeComplete: Phaser.Signal;
+ onLoop: Phaser.Signal;
+ onMarkerComplete: Phaser.Signal;
+ onMute: Phaser.Signal;
+ onPause: Phaser.Signal;
+ onPlay: Phaser.Signal;
+ onResume: Phaser.Signal;
+ onStop: Phaser.Signal;
+ override: boolean;
+ paused: boolean;
+ pausedPosition: number;
+ pausedTime: number;
+ pendingPlayback: boolean;
+ position: number;
+ startTime: number;
+ stopTime: number;
+ totalDuration: number;
+ usingAudioTag: boolean;
+ usingWebAudio: boolean;
+ volume: number;
+
+ addMarker(name: string, start: number, duration: number, volume?: number, loop?: boolean): void;
+
+ destroy(): void;
+
+ fadeIn(duration?: number, loop?: boolean, marker?: string): void;
+
+ fadeOut(duration?: number): void;
+
+ fadeTo(duration?: number, volume?: number): void;
+
+ loopFull(volume?: number): Phaser.Sound;
+
+ pause(): void;
+
+ play(marker?: string, position?: number, volume?: number, loop?: boolean, forceRestart?: boolean): Phaser.Sound;
+
+ removeMarker(name: string): void;
+
+ restart(marker: string, position: number, volume?: number, loop?: boolean): void;
+
+ resume(): void;
+
+ soundHasUnlocked(key: string): void;
+
+ stop(): void;
+
+ update(): void;
+
+ }
+
+ class SoundManager {
+
+ constructor(game: Phaser.Game);
+
+ channels: number;
+ connectToMaster: boolean;
+ context: any;
+ game: Phaser.Game;
+ mute: boolean;
+ muteOnPause: boolean;
+ noAudio: boolean;
+ onSoundDecode: Phaser.Signal;
+ onVolumeChange: Phaser.Signal;
+ onMute: Phaser.Signal;
+ onUnMute: Phaser.Signal;
+ touchLocked: boolean;
+ usingAudioTag: boolean;
+ usingWebAudio: boolean;
+ volume: number;
+
+ add(key: string, volume?: number, loop?: boolean, connect?: boolean): Phaser.Sound;
+
+ addSprite(key: string): Phaser.AudioSprite;
+
+ boot(): void;
+
+ decode(key: string, sound?: Phaser.Sound): void;
+
+ destroy(): void;
+
+ pauseAll(): void;
+
+ play(key: string, volume?: number, loop?: boolean): Phaser.Sound;
+
+ remove(sound: Phaser.Sound): boolean;
+
+ removeByKey(key: string): number;
+
+ resumeAll(): void;
+
+ setDecodedCallback(files: string[] | Phaser.Sound[], callback: Function, callbackContext: any): void;
+
+ setTouchLock(): void;
+
+ stopAll(): void;
+
+ unlock(): boolean;
+
+ update(): void;
+
+ }
+
+ class Sprite extends PIXI.Sprite {
+
+ constructor(game: Phaser.Game, x: number, y: number, key?: string | Phaser.RenderTexture | Phaser.BitmapData | PIXI.Texture, frame?: string | number);
+
+ alive: boolean;
+ anchor: Phaser.Point;
+ angle: number;
+ animations: Phaser.AnimationManager;
+ autoCull: boolean;
+ body: Phaser.Physics.Arcade.Body | Phaser.Physics.P2.Body | Phaser.Physics.Ninja.Body | any;
+ bottom: number;
+ cameraOffset: Phaser.Point;
+ centerX: number;
+ centerY: number;
+ checkWorldBounds: boolean;
+ components: any;
+ cropRect: Phaser.Rectangle;
+ customRender: boolean;
+ data: any;
+ debug: boolean;
+ deltaX: number;
+ deltaY: number;
+ deltaZ: number;
+ destroyPhase: boolean;
+ events: Phaser.Events;
+ exists: boolean;
+ fixedToCamera: boolean;
+ frame: string | number;
+ frameName: string;
+ fresh: boolean;
+ game: Phaser.Game;
+ health: number;
+ inCamera: boolean;
+ input: Phaser.InputHandler;
+ inputEnabled: boolean;
+ inWorld: boolean;
+ key: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture;
+ left: number;
+ lifespan: number;
+ maxHealth: number;
+ name: string;
+ offsetX: number;
+ offsetY: number;
+ outOfBoundsKill: boolean;
+ outOfCameraBoundsKill: boolean;
+ pendingDestroy: boolean;
+ previousPosition: Phaser.Point;
+ previousRotation: number;
+ position: Phaser.Point;
+ physicsEnabled: boolean;
+ physicsType: number;
+ renderOrderID: number;
+ right: number;
+ scale: Phaser.Point;
+ scaleMin: Phaser.Point;
+ scaleMax: Phaser.Point;
+ smoothed: boolean;
+ top: number;
+ objType: number;
+ tintedTexture: HTMLCanvasElement;
+ transformCallback: Function;
+ transformCallbackContext: any;
+ world: Phaser.Point;
+ x: number;
+ y: number;
+ z: number;
+
+ alignIn(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ alignTo(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ bringToTop(): Phaser.Sprite;
+
+ crop(rect: Phaser.Rectangle, copy: boolean): void;
+
+ checkTransform(wt: Phaser.Matrix): void;
+
+ damage(amount: number): Phaser.Sprite;
+
+ destroy(destroyChildren?: boolean): void;
+
+ drawPolygon(): void;
+
+ heal(amount: number): Phaser.Sprite;
+
+ kill(): Phaser.Sprite;
+
+ loadTexture(key: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number, stopAnimation?: boolean): void;
+
+ moveUp(): Phaser.Sprite;
+
+ moveDown(): Phaser.Sprite;
+
+ overlap(displayObject: Phaser.Sprite | Phaser.Image | Phaser.TileSprite | Phaser.Button | PIXI.DisplayObject): boolean;
+
+ play(name: string, frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
+
+ postUpdate(): void;
+
+ preUpdate(): void;
+
+ reset(x: number, y: number, health?: number): Phaser.Sprite;
+
+ resetFrame(): void;
+
+ resizeFrame(parent: any, width: number, height: number): void;
+
+ revive(health?: number): Phaser.Sprite;
+
+ sendToBack(): Phaser.Sprite;
+
+ setFrame(frame: Phaser.Frame): void;
+
+ setScaleMinMax(minX?: number, minY?: number, maxX?: number, maxY?: number): void;
+
+ update(): void;
+
+ updateCrop(): void;
+
+ }
+
+ class SpriteBatch extends Phaser.Group {
+
+ constructor(game: Phaser.Game, parent: PIXI.DisplayObjectContainer, name?: string, addedToStage?: boolean);
+
+ type: number;
+
+ }
+
+ class Stage extends PIXI.DisplayObjectContainer {
+
+ constructor(game: Phaser.Game);
+
+ game: Phaser.Game;
+ name: string;
+ disableVisibilityChange: boolean;
+ exists: boolean;
+ currentRenderOrderID: number;
+ backgroundColor: any;
+ smoothed: boolean;
+
+ add(child: any, silent?: boolean, index?: number): any;
+
+ parseConfig(config: any): void;
+
+ preUpdate(): void;
+
+ update(): void;
+
+ postUpdate(): void;
+
+ updateTransform(): void;
+
+ checkVisibility(): void;
+
+ visibilityChange(event: Event): void;
+
+ setBackgroundColor(backgroundColor: number | string): void;
+
+ destroy(): void;
+
+ }
+
+ interface ResizeCallback {
+ (scale: ScaleManager, parentBounds: Rectangle): any;
+ }
+
+ class ScaleManager {
+
+ constructor(game: Phaser.Game, width: number | string, height: number | string);
+
+ static EXACT_FIT: number;
+ static NO_SCALE: number;
+ static SHOW_ALL: number;
+ static RESIZE: number;
+ static USER_SCALE: number;
+
+ aspectRatio: number;
+ bounds: Rectangle;
+ boundingParent: HTMLElement;
+ compatibility: {
+ canExpandParent: boolean;
+ clickTrampoline: string;
+ forceMinimumDocumentHeight: boolean;
+ noMargins: boolean;
+ orientationFallback: boolean;
+ scrollTo: Point;
+ supportsFullScreen: boolean;
+ };
+ currentScaleMode: number;
+ dom: Phaser.DOM;
+ enterIncorrectOrientation: Signal;
+ event: any;
+ forceLandscape: boolean;
+ forcePortrait: boolean;
+ fullScreenScaleMode: number;
+ fullScreenTarget: HTMLElement;
+ game: Phaser.Game;
+ grid: Phaser.FlexGrid;
+ hasPhaserSetFullScreen: boolean;
+ height: number;
+ incorrectOrientation: boolean;
+ isFullScreen: boolean;
+ isGameLandscape: boolean;
+ isGamePortrait: boolean;
+ isPortrait: boolean;
+ isLandscape: boolean;
+ leaveIncorrectOrientation: Signal;
+ margin: { left: number; top: number; right: number; bottom: number; x: number; y: number; };
+ maxHeight: number;
+ maxWidth: number;
+ minHeight: number;
+ minWidth: number;
+ offset: Point;
+ onFullScreenInit: Phaser.Signal;
+ onFullScreenChange: Phaser.Signal;
+ onFullScreenError: Phaser.Signal;
+ onOrientationChange: Phaser.Signal;
+ onSizeChange: Signal;
+ pageAlignHorizontally: boolean;
+ pageAlignVertically: boolean;
+ parentNode: HTMLElement;
+ parentIsWindow: boolean;
+ parentScaleFactor: Point;
+ scaleFactor: Point;
+ scaleFactorInversed: Point;
+ scaleMode: number;
+ screenOrientation: string;
+ sourceAspectRatio: number;
+ trackParentInterval: number;
+ width: number;
+ windowConstraints: {
+ bottom: string;
+ right: string;
+ };
+
+ align(horizontal?: boolean, vertical?: boolean): void;
+
+ boot(): void;
+
+ createFullScreenTarget(): HTMLDivElement;
+
+ destroy(): void;
+
+ forceOrientation(forceLandscape: boolean, forcePortrait?: boolean): void;
+
+ getParentBounds(target?: Rectangle): Rectangle;
+
+ parseConfig(config: any): void;
+
+ preUpdate(): void;
+
+ pauseUpdate(): void;
+
+ refresh(): void;
+
+ setGameSize(width: number, height: number): void;
+
+ setResizeCallback(callback: ResizeCallback, context: any): void;
+
+ setUserScale(hScale: number, vScale: number, hTrim?: number, vTrim?: number, queueUpdate?: boolean, force?: boolean): void;
+
+ setMinMax(minWidth: number, minHeight: number, maxWidth?: number, maxHeight?: number): void;
+
+ setupScale(width: number, height: number): void;
+ setupScale(width: string, height: string): void;
+
+ scaleSprite(sprite: Sprite, width?: number, height?: number, letterBox?: boolean): Sprite;
+ scaleSprite(sprite: Image, width?: number, height?: number, letterBox?: boolean): Sprite;
+
+ startFullScreen(antialias?: boolean, allowTrampoline?: boolean): boolean;
+
+ stopFullScreen(): boolean;
+
+ }
+
+ class DOM {
+
+ static visualBounds: Phaser.Rectangle;
+ static layoutBounds: Phaser.Rectangle;
+ static documentBounds: Phaser.Rectangle;
+
+ static calibrate(coords: any, cushion?: number): any;
+
+ static getAspectRatio(object: any): number;
+
+ static getScreenOrientation(primaryFallback?: string): string;
+
+ static getBounds(element: any, cushion?: number): any;
+
+ static getOffset(element: any, point?: Point): Point;
+
+ static inLayoutViewport(element: any, cushion?: number): boolean;
+ }
+
+ class State {
+
+ add: Phaser.GameObjectFactory;
+ cache: Phaser.Cache;
+ camera: Phaser.Camera;
+ game: Phaser.Game;
+ input: Phaser.Input;
+ key: string;
+ load: Phaser.Loader;
+ make: Phaser.GameObjectCreator;
+ particles: Phaser.Particles;
+ physics: Phaser.Physics;
+ rnd: Phaser.RandomDataGenerator;
+ scale: Phaser.ScaleManager;
+ sound: Phaser.SoundManager;
+ stage: Phaser.Stage;
+ state: Phaser.StateManager;
+ time: Phaser.Time;
+ tweens: Phaser.TweenManager;
+ world: Phaser.World;
+
+ create(game: Phaser.Game): void;
+
+ init(...args: any[]): void;
+
+ loadRender(game: Phaser.Game): void;
+
+ loadUpdate(game: Phaser.Game): void;
+
+ paused(game: Phaser.Game): void;
+
+ pauseUpdate(game: Phaser.Game): void;
+
+ preload(game: Phaser.Game): void;
+
+ preRender(game: Phaser.Game, elapsedTime: number): void;
+
+ render(game: Phaser.Game): void;
+
+ resize(width: number, height: number): void;
+
+ resumed(game: Phaser.Game): void;
+
+ shutdown(game: Phaser.Game): void;
+
+ update(game: Phaser.Game): void;
+
+ }
+
+ interface IStateCycle {
+
+ preUpdate(): void;
+
+ update(): void;
+
+ render(): void;
+
+ postRender(): void;
+
+ destroy(): void;
+ }
+
+ class StateManager {
+
+ constructor(game: Phaser.Game, pendingState?: Phaser.State);
+
+ created: boolean;
+ current: string;
+ game: Phaser.Game;
+ onCreateCallback: Function;
+ onInitCallback: Function;
+ onLoadRenderCallback: Function;
+ onLoadUpdateCallback: Function;
+ onPausedCallback: Function;
+ onPauseUpdateCallback: Function;
+ onPreloadCallback: Function;
+ onPreRenderCallback: Function;
+ onRenderCallback: Function;
+ onResumedCallback: Function;
+ onResizeCallback: Function;
+ onShutDownCallback: Function;
+ onUpdateCallback: Function;
+ states: any;
+
+ onStateChange: Phaser.Signal;
+
+ add(key: string, state: any, autoStart?: boolean): void;
+
+ checkState(key: string): boolean;
+
+ clearCurrentState(): void;
+
+ destroy(): void;
+
+ getCurrentState(): Phaser.State;
+
+ link(key: string): void;
+
+ loadComplete(): void;
+
+ preRender(elapsedTime: number): void;
+
+ preUpdate(): void;
+
+ render(): void;
+
+ remove(key: string): void;
+
+ resume(): void;
+
+ restart(clearWorld?: boolean, clearCache?: boolean, ...args: any[]): void;
+
+ resize(width: number, height: number): void;
+
+ start(key: string, clearWorld?: boolean, clearCache?: boolean, ...args: any[]): void;
+
+ update(): void;
+
+ unlink(key: string): void;
+
+ }
+
+ interface PhaserTextStyle {
+
+ font?: string;
+ fill?: any;
+ align?: string;
+ stroke?: string;
+ strokeThickness?: number;
+ wordWrap?: boolean;
+ wordWrapWidth?: number;
+ maxLines?: number;
+ shadowOffsetX?: number;
+ shadowOffsetY?: number;
+ shadowColor?: string;
+ shadowBlur?: number;
+ valign?: string;
+ tab?: number;
+ tabs?: number;
+
+ fontSize?: number;
+ fontStyle?: string;
+ fontVariant?: string;
+ fontWeight?: string | number;
+ backgroundColor?: string;
+ boundsAlignH?: string;
+ boundsAlignV?: string;
+
+ }
+
+ class Text extends Phaser.Sprite {
+
+ constructor(game: Phaser.Game, x: number, y: number, text: string, style?: PhaserTextStyle);
+
+ static fontPropertiesCanvas: any;
+ static fontPropertiesContext: any;
+ static fontPropertiesCache: any;
+
+ align: string;
+ angle: number;
+ autoRound: boolean;
+ boundsAlignH: string;
+ boundsAlignV: string;
+ cameraOffset: Phaser.Point;
+ canvas: HTMLCanvasElement;
+ colors: string[];
+ context: CanvasRenderingContext2D;
+ cssFont: string;
+ destroyPhase: boolean;
+ events: Phaser.Events;
+ exists: boolean;
+ fill: any;
+ fixedToCamera: boolean;
+ font: string;
+ fontSize: number | string;
+ fontStyle: string;
+ fontStyles: string[];
+ fontVariant: string;
+ fontWeight: string | number;
+ fontWeights: (string | number)[];
+ game: Phaser.Game;
+ input: Phaser.InputHandler;
+ inputEnabled: boolean;
+ lineSpacing: number;
+ name: string;
+ padding: Phaser.Point;
+ pendingDestroy: boolean;
+ physicsType: number;
+ position: Phaser.Point;
+ previousPosition: Phaser.Point;
+ previousRotation: number;
+ renderOrderID: number;
+ resolution: number;
+ shadowBlur: number;
+ shadowColor: string;
+ shadowFill: boolean;
+ shadowOffsetX: number;
+ shadowOffsetY: number;
+ shadowStroke: boolean;
+ splitRegExp: any;
+ stroke: string;
+ strokeColors: string[];
+ strokeThickness: number;
+ scale: Phaser.Point;
+ tab: number;
+ tabs: number | number[];
+ text: string;
+ textBounds: Phaser.Rectangle;
+ objType: number;
+ useAdvancedWrap: boolean;
+ world: Phaser.Point;
+ wordWrap: boolean;
+ wordWrapWidth: number;
+ z: number;
+
+ addColor(color: string, position: number): Phaser.Text;
+
+ addFontStyle(style: string, position: number): Phaser.Text;
+
+ addFontWeight(weight: string, position: number): Phaser.Text;
+
+ addStrokeColor(color: string, position: number): Phaser.Text;
+
+ alignIn(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ alignTo(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ clearColors(): Phaser.Text;
+
+ clearFontValues(): Phaser.Text;
+
+ componentsToFont(components: any): string;
+
+ destroy(destroyChildren?: boolean): void;
+
+ fontToComponents(font: string): any;
+
+ postUpdate(): void;
+
+ parseList(list: any[]): Phaser.Text;
+
+ precalculateWordWrap(text: string): string[];
+
+ preUpdate(): void;
+
+ renderTabLine(line: string, x: number, y: number, fill?: boolean): void;
+
+ setShadow(x?: number, y?: number, color?: any, blur?: number, shadowStroke?: boolean, shadowFill?: boolean): Phaser.Text;
+
+ setStyle(style?: PhaserTextStyle, update?: boolean): Phaser.Text;
+
+ setText(text: string, immediate?: boolean): Phaser.Text;
+
+ setTextBounds(x?: number, y?: number, width?: number, height?: number): Phaser.Text;
+
+ update(): void;
+
+ updateFont(components: any): void;
+
+ updateLine(text: string, x?: number, y?: number): void;
+
+ updateShadow(state?: boolean): void;
+
+ updateTexture(): void;
+
+ }
+
+ class Tile {
+
+ constructor(layer: any, index: number, x: number, y: Number, width: number, height: number);
+
+ alpha: number;
+ bottom: number;
+ callback: Function;
+ callbackContext: any;
+ centerX: number;
+ centerY: number;
+ canCollide: boolean;
+ collideDown: boolean;
+ collideLeft: boolean;
+ collideNone: boolean;
+ collideRight: boolean;
+ collisionCallback: Function;
+ collisionCallbackContext: any;
+ collides: boolean;
+ collideUp: boolean;
+ faceBottom: boolean;
+ faceLeft: boolean;
+ faceRight: boolean;
+ faceTop: boolean;
+ game: Phaser.Game;
+ height: number;
+ index: number;
+ layer: any;
+ left: number;
+ properties: any;
+ right: number;
+ scanned: boolean;
+ top: number;
+ width: number;
+ worldX: number;
+ worldY: number;
+ x: number;
+ y: number;
+
+ copy(tile: Phaser.Tile): Phaser.Tile;
+
+ containsPoint(x: number, y: number): boolean;
+
+ destroy(): void;
+
+ intersects(x: number, y: number, right: number, bottom: number): boolean;
+
+ isInterested(collides: boolean, faces: boolean): boolean;
+
+ resetCollision(): void;
+
+ setCollision(left: boolean, right: boolean, up: boolean, down: boolean): void;
+
+ setCollisionCallback(callback: Function, context: any): void;
+
+ }
+
+ class Tilemap {
+
+ constructor(game: Phaser.Game, key?: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number);
+
+ static CSV: number;
+ static TILED_JSON: number;
+ static NORTH: number;
+ static EAST: number;
+ static SOUTH: number;
+ static WEST: number;
+
+ collision: any[];
+ collideIndexes: any[];
+ currentLayer: number;
+ debugMap: any[];
+ enableDebug: boolean;
+ format: number;
+ game: Phaser.Game;
+ height: number;
+ heightInPixels: number;
+ images: any[];
+ imagecollections: ImageCollection[];
+ key: string;
+ layer: Phaser.TilemapLayer[];
+ layers: any[];
+ objects: any[];
+ orientation: string;
+ properties: any;
+ rayStepRate: number;
+ tileHeight: number;
+ tiles: Phaser.Tile[];
+ tilesets: Phaser.Tileset[];
+ tileWidth: number;
+ version: number;
+ width: number;
+ widthInPixels: number;
+
+ addTilesetImage(tileset: string, key?: string | Phaser.BitmapData, tileWidth?: number, tileHeight?: number, tileMargin?: number, tileSpacing?: number, gid?: number): Phaser.Tileset;
+
+ calculateFaces(layer: number): void;
+
+ copy(x: number, y: number, width: number, height: number, layer?: any): Phaser.Tile[];
+
+ create(name: string, width: number, height: number, tileWidth: number, tileHeight: number, group?: Phaser.Group): Phaser.TilemapLayer;
+
+ createBlankLayer(name: string, width: number, height: number, tileWidth: number, tileHeight: number, group?: Phaser.Group): Phaser.TilemapLayer;
+
+ createFromObjects(name: string, gid: number, key: string, frame?: any, exists?: boolean, autoCull?: boolean, group?: Phaser.Group, CustomClass?: any, adjustY?: boolean, adjustSize?: boolean): void;
+
+ createFromTiles(tiles: any, replacements: any, key: string, layer?: any, group?: Phaser.Group, properties?: any): number;
+
+ createLayer(layer: any, width?: number, height?: number, group?: Phaser.Group): Phaser.TilemapLayer;
+
+ destroy(): void;
+
+ dump(): void;
+
+ fill(index: number, x: number, y: number, width: number, height: number, layer?: any): void;
+
+ forEach(callback: Function, context: any, x: number, y: Number, width: number, height: number, layer?: any): void;
+
+ getImageIndex(name: string): number;
+
+ getIndex(location: any[], name: string): number;
+
+ getLayer(layer: any): number;
+
+ getLayerIndex(name: string): number;
+
+ getObjectIndex(name: string): number;
+
+ getTile(x: number, y: number, layer?: any, nonNull?: boolean): Phaser.Tile;
+
+ getTileAbove(layer: number, x: number, y: number): Phaser.Tile;
+
+ getTileBelow(layer: number, x: number, y: number): Phaser.Tile;
+
+ getTileLeft(layer: number, x: number, y: number): Phaser.Tile;
+
+ getTileRight(layer: number, x: number, y: number): Phaser.Tile;
+
+ getTilesetIndex(name: string): number;
+
+ getTileWorldXY(x: number, y: number, tileWidth?: number, tileHeight?: number, layer?: number | string | Phaser.TilemapLayer, nonNull?: boolean): Phaser.Tile;
+
+ hasTile(x: number, y: number, layer: Phaser.TilemapLayer): boolean;
+
+ paste(x: number, y: number, tileblock: Phaser.Tile[], layer?: any): void;
+
+ putTile(tile: any, x: number, y: number, layer?: any): Phaser.Tile;
+
+ putTileWorldXY(tile: any, x: number, y: number, tileWidth: number, tileHeight: number, layer?: any): void;
+
+ random(x: number, y: number, width: number, height: number, layer?: any): void;
+
+ removeAllLayers(): void;
+
+ removeTile(x: number, y: number, layer?: any): Phaser.Tile;
+
+ removeTileWorldXY(x: number, y: number, tileWidth: number, tileHeight: number, layer?: any): Phaser.Tile;
+
+ replace(source: number, dest: number, x: number, y: number, width: number, height: number, layer?: any): void;
+
+ searchTileIndex(index: number, skip?: number, reverse?: boolean, layer?: any): Phaser.Tile;
+
+ setCollision(indexes: any, collides?: boolean, layer?: any, recalculate?: boolean): void;
+
+ setCollisionBetween(start: number, stop: number, collides?: boolean, layer?: any, recalculate?: boolean): void;
+
+ setCollisionByExclusion(indexes: any[], collides?: boolean, layer?: any, recalculate?: boolean): void;
+
+ setCollisionByIndex(index: number, collides?: boolean, layer?: number, recalculate?: boolean): void;
+
+ setLayer(layer: any): void;
+
+ setPreventRecalculate(value: boolean): void;
+
+ setTileIndexCallback(indexes: any, callback: Function, callbackContext: any, layer?: any): void;
+
+ setTileLocationCallback(x: number, y: number, width: number, height: number, callback: Function, callbackContext: any, layer?: any): void;
+
+ setTileSize(tileWidth: number, tileHeight: number): void;
+
+ shuffle(x: number, y: number, width: number, height: number, layer: any): void;
+
+ swap(tileA: number, tileB: number, x: number, y: number, width: number, height: number, layer?: any): void;
+
+ }
+
+ class TilemapLayer extends Phaser.Sprite {
+
+ constructor(game: Phaser.Game, tilemap: Phaser.Tilemap, index: number, width?: number, height?: number);
+
+ cameraOffset: Phaser.Point;
+ canvas: HTMLCanvasElement;
+ collisionHeight: number;
+ collisionWidth: number;
+ context: CanvasRenderingContext2D;
+ data: any;
+ debug: boolean;
+ debugAlpha: number;
+ debugCallbackColor: string;
+ debugColor: string;
+ debugSettings: { missingImageFill: string; debuggedTileOverfill: string; forceFullRedraw: boolean; debugAlpha: number; facingEdgeStroke: string; collidingTileOverfill: string; };
+ dirty: boolean;
+ exists: boolean;
+ fixedToCamera: boolean;
+ game: Phaser.Game;
+ index: number;
+ layer: Phaser.TilemapLayer;
+ map: Phaser.Tilemap;
+ name: string;
+ physicsType: number;
+ renderSettings: { enableScrollDelta: boolean; overdrawRatio: number; copyCanvas: any; };
+ scrollFactorX: number;
+ scrollFactorY: number;
+ scrollX: number;
+ scrollY: number;
+ objType: number;
+ wrap: boolean;
+
+ destroy(): void;
+
+ getRayCastTiles(line: Phaser.Line, stepRate?: number, collides?: boolean, interestingFace?: boolean): Phaser.Tile[];
+
+ getTiles(x: number, y: number, width: number, height: number, collides?: boolean, interestingFace?: boolean): Phaser.Tile[];
+
+ getTileX(x: number): number;
+
+ getTileXY(x: number, y: number, point: Phaser.Point): Phaser.Point;
+
+ getTileY(y: number): number;
+
+ postUpdate(): void;
+
+ render(): void;
+
+ resize(width: number, height: number): void;
+
+ resizeWorld(): void;
+
+ resetTilesetCache(): void;
+
+ setScale(xScale?: number, yScale?: number): void;
+
+ updateMax(): void;
+
+ getTileOffsetX(): number;
+
+ getTileOffsetY(): number;
+
+ }
+
+ class TilemapLayerGL {
+
+ constructor(game: Phaser.Game, tilemap: Phaser.Tilemap, index: number, width?: number, height?: number, tileset?: Phaser.Tileset);
+
+ collisionHeight: number;
+ collisionWidth: number;
+ data: any;
+ dirty: boolean;
+ exists: boolean;
+ fixedToCamera: boolean;
+ game: Phaser.Game;
+ index: number;
+ layer: Phaser.TilemapLayer;
+ map: Phaser.Tilemap;
+ name: string;
+ physicsType: number;
+ scrollFactorX: number;
+ scrollFactorY: number;
+ scrollX: number;
+ scrollY: number;
+ type: number;
+ wrap: boolean;
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+
+ destroy(): void;
+
+ postUpdate(): void;
+
+ render(): void;
+
+ resize(width: number, height: number): void;
+
+ resizeWorld(): void;
+
+ resetTilesetCache(): void;
+
+ setScale(xScale?: number, yScale?: number): void;
+
+ updateMax(): void;
+
+ }
+
+ class TilemapParser {
+
+ static INSERT_NULL: boolean;
+
+ static getEmptyData(tileWidth?: number, tileHeight?: number, width?: number, height?: number): any;
+
+ static parse(game: Phaser.Game, key: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number): any;
+
+ static parseCSV(key: string, data: string, tileWidth?: number, tileHeight?: number): any;
+
+ static parseJSON(json: any): any;
+
+ }
+
+ class Tileset {
+
+ constructor(name: string, firstgid: number, width?: number, height?: number, margin?: number, spacing?: number, properties?: any);
+
+ columns: number;
+ firstgid: number;
+ image: any;
+ lastgid: number;
+ name: string;
+ properties: any;
+ rows: number;
+ tileHeight: number;
+ tileMargin: number;
+ tileSpacing: number;
+ tileWidth: number;
+ total: number;
+
+ containsTileIndex(tileIndex: number): boolean;
+
+ draw(context: CanvasRenderingContext2D, x: number, y: number, index: number): void;
+
+ drawGl(glBatch: any[], x: number, y: number, index: number, alpha: number, flippedVal: number): void;
+
+ setImage(image: any): void;
+
+ setSpacing(margin?: number, spacing?: number): void;
+
+ }
+
+ class TileSprite extends PIXI.TilingSprite {
+
+ constructor(game: Phaser.Game, x: number, y: number, width: number, height: number, key?: string | Phaser.RenderTexture | Phaser.BitmapData | PIXI.Texture, frame?: string | number);
+
+ alive: boolean;
+ angle: number;
+ animations: Phaser.AnimationManager;
+ autoCull: boolean;
+ body: Phaser.Physics.Arcade.Body | Phaser.Physics.P2.Body | Phaser.Physics.Ninja.Body | any;
+ bottom: number;
+ cameraOffset: Phaser.Point;
+ checkWorldBounds: boolean;
+ components: any;
+ customRender: boolean;
+ data: any;
+ debug: boolean;
+ destroyPhase: boolean;
+ events: Phaser.Events;
+ exists: boolean;
+ fixedToCamera: boolean;
+ frame: string | number;
+ frameName: string;
+ fresh: boolean;
+ game: Phaser.Game;
+ inCamera: boolean;
+ input: Phaser.InputHandler;
+ inputEnabled: boolean;
+ inWorld: boolean;
+ key: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture;
+ left: number;
+ name: string;
+ offsetX: number;
+ offsetY: number;
+ outOfBoundsKill: boolean;
+ pendingDestroy: boolean;
+ physicsType: number;
+ position: Phaser.Point;
+ smoothed: boolean;
+ previousPosition: Phaser.Point;
+ previousRoation: number;
+ right: number;
+ top: number;
+ renderOrderID: number;
+ type: number;
+ world: Phaser.Point;
+ z: number;
+
+ alignIn(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ alignTo(container: Phaser.Rectangle | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.TileSprite, position?: number, offsetX?: number, offsetY?: number): any;
+
+ autoScroll(x: number, y: number): void;
+
+ destroy(destroyChildren?: boolean): void;
+
+ loadTexture(key: string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture, frame?: string | number, stopAnimation?: boolean): void;
+
+ play(name: string, frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
+
+ postUpdate(): void;
+
+ preUpdate(): void;
+
+ overlap(displayObject: Phaser.Sprite | Phaser.Image | Phaser.TileSprite | Phaser.Button | PIXI.DisplayObject): boolean;
+
+ reset(x: number, y: number, health?: number): Phaser.TileSprite;
+
+ resizeFrame(parent: any, width: number, height: number): void;
+
+ resetFrame(): void;
+
+ setFrame(frame: Phaser.Frame): void;
+
+ stopScroll(): void;
+
+ update(): void;
+
+ }
+
+ class Time {
+
+ constructor(game: Phaser.Game);
+
+ advancedTiming: boolean;
+ desiredFps: number;
+ desiredFpsMult: number;
+ elapsed: number;
+ events: Phaser.Timer;
+ elapsedMS: number;
+ fps: number;
+ fpsMax: number;
+ fpsMin: number;
+ frames: number;
+ game: Phaser.Game;
+ lastTime: number;
+ msMax: number;
+ msMin: number;
+ now: number;
+ pausedTime: number;
+ pauseDuration: number;
+ physicsElapsed: number;
+ physicsElapsedMS: number;
+ prevTime: number;
+ slowMotion: number;
+ suggestedFps: number;
+ time: number;
+ timeExpected: number;
+ timeToCall: number;
+
+ add(timer: Phaser.Timer): Phaser.Timer;
+
+ boot(): void;
+
+ create(autoDestroy?: boolean): Phaser.Timer;
+
+ elapsedSecondsSince(since: number): number;
+
+ elapsedSince(since: number): number;
+
+ removeAll(): void;
+
+ reset(): void;
+
+ totalElapsedSeconds(): number;
+
+ update(time: number): void;
+
+ }
+
+ class Timer {
+
+ constructor(game: Phaser.Game, autoDestroy?: boolean);
+
+ static HALF: number;
+ static MINUTE: number;
+ static QUARTER: number;
+ static SECOND: number;
+
+ autoDestroy: boolean;
+ duration: number;
+ events: Phaser.TimerEvent[];
+ expired: boolean;
+ game: Phaser.Game;
+ length: number;
+ ms: number;
+ next: number;
+ nextTick: number;
+ onComplete: Phaser.Signal;
+ running: boolean;
+ paused: boolean;
+ seconds: number;
+
+ add(delay: number, callback: Function, callbackContext?: any, ...args: any[]): Phaser.TimerEvent;
+
+ clearPendingEvents(): void;
+
+ destroy(): void;
+
+ loop(delay: number, callback: Function, callbackContext?: any, ...args: any[]): Phaser.TimerEvent;
+
+ order(): void;
+
+ pause(): void;
+
+ remove(event: Phaser.TimerEvent): boolean;
+
+ removeAll(): void;
+
+ repeat(delay: number, repeatCount: number, callback: Function, callbackContext?: any, ...args: any[]): Phaser.TimerEvent;
+
+ resume(): void;
+
+ sortHandler(a: any, b: any): number;
+
+ start(startDelay?: number): void;
+
+ stop(clearEvents?: boolean): void;
+
+ update(time: number): boolean;
+
+ }
+
+ class TimerEvent {
+
+ constructor(timer: Phaser.Timer, delay: number, tick: number, repeatCount: number, loop: boolean, callback: Function, callbackContext: any, ...args: any[]);
+
+ args: any[];
+ callback: Function;
+ callbackContext: any;
+ delay: number;
+ loop: boolean;
+ pendingDelete: boolean;
+ repeatCount: number;
+ tick: number;
+ timer: Phaser.Timer;
+
+ }
+
+ class Touch {
+
+ constructor(game: Phaser.Game);
+
+ callbackContext: any;
+ enabled: boolean;
+ event: any;
+ game: Phaser.Game;
+ preventDefault: boolean;
+ touchCancelCallback: Function;
+ touchEndCallback: Function;
+ touchEnterCallback: Function;
+ touchLeaveCallback: Function;
+ touchMoveCallback: Function;
+ touchStartCallback: Function;
+ touchLockCallbacks: Function[];
+
+ addTouchLockCallback(callback: Function, context?: any, onEnd?: boolean): void;
+
+ removeTouchLockCallback(callback: Function, context?: any): boolean;
+
+ consumeTouchMove(): void;
+
+ onTouchCancel(event: any): void;
+
+ onTouchEnd(event: any): void;
+
+ onTouchEnter(event: any): void;
+
+ onTouchLeave(event: any): void;
+
+ onTouchMove(event: any): void;
+
+ onTouchStart(event: any): void;
+
+ start(): void;
+
+ stop(): void;
+
+ }
+
+ class Tween {
+
+ static updateColor(tween: Tween): void;
+
+ constructor(target: any, game: Phaser.Game, manager: Phaser.TweenManager);
+
+ chainedTween: Phaser.Tween;
+ current: number;
+ frameBased: boolean;
+ game: Phaser.Game;
+ isRunning: boolean;
+ isPaused: boolean;
+ manager: Phaser.TweenManager;
+ onChildComplete: Phaser.Signal;
+ onComplete: Phaser.Signal;
+ onLoop: Phaser.Signal;
+ onRepeat: Phaser.Signal;
+ onStart: Phaser.Signal;
+ pendingDelete: boolean;
+ properties: any;
+ repeatCounter: number;
+ reverse: boolean;
+ target: any;
+ timeline: Phaser.TweenData[];
+ timeScale: number;
+ totalDuration: number;
+
+ chain(...args: any[]): Phaser.Tween;
+
+ delay(duration: number, index?: number): Phaser.Tween;
+
+ easing(ease: Function, index?: number): Phaser.Tween;
+ easing(ease: string, index?: number): Phaser.Tween;
+
+ from(properties: any, duration?: number, ease?: Function, autoStart?: boolean, delay?: number, repeat?: number, yoyo?: boolean): Phaser.Tween;
+ from(properties: any, duration?: number, ease?: string, autoStart?: boolean, delay?: number, repeat?: number, yoyo?: boolean): Phaser.Tween;
+
+ generateData(frameRate?: number, data?: any): any[];
+
+ interpolation(interpolation: Function, context?: any, index?: number): Phaser.Tween;
+
+ loop(value?: boolean): Phaser.Tween;
+
+ onUpdateCallback(callback: Function, callbackContext?: any): Phaser.Tween;
+
+ pause(): void;
+
+ repeat(total: number, repeatDelay?: number, index?: number): Phaser.Tween;
+
+ repeatDelay(duration: number, index?: number): Phaser.Tween;
+
+ repeatAll(total?: number): Phaser.Tween;
+
+ resume(): void;
+
+ start(index?: number): Phaser.Tween;
+
+ stop(complete?: boolean): Phaser.Tween;
+
+ to(properties: any, duration?: number, ease?: Function, autoStart?: boolean, delay?: number, repeat?: number, yoyo?: boolean): Phaser.Tween;
+ to(properties: any, duration?: number, ease?: string, autoStart?: boolean, delay?: number, repeat?: number, yoyo?: boolean): Phaser.Tween;
+
+ update(time: number): boolean;
+
+ updateTweenData(property: string, value: number | Function, index?: number): Phaser.Tween;
+
+ yoyo(enable: boolean, yoyoDelay?: number, index?: number): Phaser.Tween;
+
+ yoyoDelay(duration: number, index?: number): Phaser.Tween;
+
+ }
+
+ class TweenData {
+
+ constructor(parent: Phaser.Tween);
+
+ static COMPLETE: number;
+ static LOOPED: number;
+ static PENDING: number;
+ static RUNNING: number;
+
+ delay: number;
+ dt: number;
+ duration: number;
+ easingFunction: Function;
+ game: Phaser.Game;
+ inReverse: boolean;
+ interpolate: boolean;
+ interpolateFunctionContext: Phaser.Math;
+ interpolationContext: Phaser.Math;
+ interpolationFunction: Function;
+ isRunning: boolean;
+ isFrom: boolean;
+ parent: Phaser.Tween;
+ percent: number;
+ repeatCounter: number;
+ startTime: number;
+ value: number;
+ yoyo: boolean;
+ yoyoDelay: number;
+
+ from(properties: any, duration?: number, ease?: Function, delay?: number, repeat?: number, yoyo?: boolean): Phaser.TweenData;
+
+ generateData(frameRate?: number): any[];
+
+ repeat(): number;
+
+ start(): Phaser.TweenData;
+
+ to(properties: any, duration?: number, ease?: Function, delay?: number, repeat?: number, yoyo?: boolean): Phaser.TweenData;
+
+ update(time: number): number;
+
+ }
+
+ class TweenManager {
+
+ constructor(game: Phaser.Game);
+
+ frameBased: boolean;
+ game: Phaser.Game;
+
+ add(tween: Phaser.Tween): Phaser.Tween;
+
+ create(object: any): Phaser.Tween;
+
+ getAll(): Phaser.Tween[];
+
+ isTweening(object: any, checkIsRunning?: boolean): boolean;
+
+ remove(tween: Phaser.Tween): Phaser.Tween;
+
+ removeAll(): void;
+
+ removeFrom(obj: any, children?: boolean): void;
+
+ resumeAll(): void;
+
+ update(): boolean;
+
+ pauseAll(): void;
+
+ }
+
+ class Utils {
+
+ static getProperty(obj: any, prop: string): any;
+
+ static setProperty(obj: any, prop: string, value: any): any;
+
+ static setProperties(obj: any, props: any): any;
+
+ static chanceRoll(chance: number): boolean;
+
+ static randomChoice(choice1: string | number, choice2: any): any;
+
+ static reverseString(string: string): string;
+
+ static parseDimension(size: any, dimension: number): number;
+
+ static pad(str: string, len?: number, pad?: string, dir?: number): string;
+
+ static isPlainObject(object: any): boolean;
+
+ static extend(deep: boolean, target: any, ...args: any[]): any;
+
+ static mixinPrototype(target: any, mixin: any, replace?: boolean): void;
+
+ static mixin(from: T, to: any): T;
+
+ }
+
+ module Utils {
+
+ class Debug {
+
+ constructor(game: Phaser.Game);
+
+ bmd: Phaser.BitmapData;
+ canvas: HTMLCanvasElement;
+ columnWidth: number;
+ context: CanvasRenderingContext2D;
+ currentAlpha: number;
+ currentX: number;
+ currentY: number;
+ dirty: boolean;
+ font: string;
+ game: Phaser.Game;
+ lineHeight: number;
+ lineWidth: number;
+ renderShadow: boolean;
+ sprite: Phaser.Image;
+
+ AStar(astar: Phaser.Plugin.AStar, x: number, y: number, showVisited: boolean): void;
+
+ boot(): void;
+
+ body(sprite: Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.Sprite | Phaser.Text | Phaser.TileSprite, color?: string, filled?: boolean): void;
+
+ bodyInfo(sprite: Phaser.BitmapText | Phaser.Button | Phaser.Graphics | Phaser.Sprite | Phaser.Text | Phaser.TileSprite, x: number, y: Number, color?: string): void;
+
+ box2dBody(body: any /* Phaser.Physics.Box2D.Body */, color?: string): void;
+
+ box2dWorld(): void;
+
+ camera(camera: Phaser.Camera, color?: string, filled?: boolean): void;
+
+ cameraInfo(camera: Phaser.Camera, x: number, y: number, color?: string): void;
+
+ destroy(): void;
+
+ geom(object: any, color?: string, fiiled?: boolean, forceType?: number): void;
+
+ inputInfo(x: number, y: number, color?: string): void;
+
+ lineInfo(line: Phaser.Line, x: number, y: number, color?: string): void;
+
+ key(key: Phaser.Key, x?: number, y?: number, color?: string): void;
+
+ line(...args: string[]): void;
+
+ phaser(x: number, y: number, color?: string): void;
+
+ preUpdate(): void;
+
+ physicsGroup(group: Phaser.Group, color?: string, filled?: boolean, checkExists?: boolean): void;
+
+ pixel(x: number, y: number, color?: string, size?: number): void;
+
+ pointer(pointer: Phaser.Pointer, hideIfUp?: boolean, downColor?: string, upColor?: string, color?: string): void;
+
+ quadTree(quadtree: Phaser.QuadTree, color?: string): void;
+
+ rectangle(object: Phaser.Rectangle, color?: string, filled?: boolean): void;
+
+ renderer(x?: number, y?: number, color?: string): void;
+
+ reset(): void;
+
+ ropeSegments(rope: Phaser.Rope, color?: number, filled?: boolean): void;
+
+ soundInfo(sound: Phaser.Sound, x: number, y: number, color?: string): void;
+
+ spriteBounds(sprite: any, color?: string, filled?: boolean): void;
+
+ spriteCoords(sprite: any, x: number, y: number, color?: string): void;
+
+ spriteInfo(sprite: Phaser.Sprite, x: number, y: number, color?: string): void;
+
+ spriteInputInfo(sprite: Phaser.Sprite, x: number, y: number, color?: string): void;
+
+ start(x?: number, y?: number, color?: string, columnWidth?: number): void;
+
+ stop(): void;
+
+ text(text: string, x: number, y: number, color?: string, font?: string): void;
+
+ timer(timer: Phaser.Timer, x: number, y: number, color?: string): void;
+
+ }
+
+ }
+
+ class Weapon extends Phaser.Plugin {
+
+ constructor(game: Phaser.Game, parent: Phaser.PluginManager);
+
+ static KILL_NEVER: number;
+ static KILL_LIFESPAN: number;
+ static KILL_DISTANCE: number;
+ static KILL_WEAPON_BOUNDS: number;
+ static KILL_CAMERA_BOUNDS: number;
+ static KILL_WORLD_BOUNDS: number;
+ static KILL_STATIC_BOUNDS: number;
+
+ autoExpandBulletsGroup: boolean;
+ autofire: boolean;
+ bounds: Phaser.Rectangle;
+ bulletAngleOffset: number;
+ bulletAngleVariance: number;
+ bulletAnimation: string;
+ bulletClass: any;
+ bulletCollideWorldBounds: boolean;
+ bulletFrame: string;
+ bulletFrameCycle: boolean;
+ bulletFrameRandom: boolean;
+ bulletFrames: any[];
+ bulletGravity: Phaser.Point;
+ bulletInheritSpriteSpeed: boolean;
+ bulletKey: string;
+ bulletKillDistance: number;
+ bulletKillType: number;
+ bulletLifespan: number;
+ bulletRotateToVelocity: boolean;
+ bullets: Phaser.Group;
+ bulletSpeed: number;
+ bulletSpeedVariance: number;
+ bulletWorldWrap: boolean;
+ bulletWorldWrapPadding: number;
+ fireAngle: number;
+ fireFrom: Phaser.Rectangle;
+ fireLimit: number;
+ fireRate: number;
+ fireRateVariance: number;
+ multiFire: boolean;
+ onFire: Phaser.Signal;
+ onFireLimit: Phaser.Signal;
+ onKill: Phaser.Signal;
+ shots: number;
+ trackedPointer: Phaser.Pointer;
+ trackedSprite: any;
+ trackOffset: Phaser.Point;
+ trackRotation: boolean;
+ x: number;
+ y: number;
+
+ addBulletAnimation(name: string, frames?: number[] | string[], frameRate?: number, loop?: boolean, useNumericIndex?: boolean): Phaser.Weapon;
+
+ createBullets(quantity?: number, key?: any, frame?: any, group?: Phaser.Group): Phaser.Weapon;
+
+ debug(x?: number, y?: number, debugBodies?: boolean): void;
+
+ destroy(): void;
+
+ fire(from?: any, x?: number, y?: number, offsetX?: number, offsetY?: number): Phaser.Bullet;
+
+ fireAtPointer(pointer: Phaser.Pointer): Phaser.Bullet;
+
+ fireAtSprite(sprite: Phaser.Sprite): Phaser.Bullet;
+
+ fireAtXY(x: number, y: number): Phaser.Bullet;
+
+ fireMany(positions: any[], from?: any): Phaser.Bullet[];
+
+ fireOffset(offsetX?: number, offsetY?: number): Phaser.Bullet;
+
+ forEach(callback: any, callbackContext: any): Phaser.Weapon;
+
+ killAll(): Phaser.Weapon;
+
+ pauseAll(): Phaser.Weapon;
+
+ resetShots(newLimit?: number): Phaser.Weapon;
+
+ resumeAll(): Phaser.Weapon;
+
+ setBulletBodyOffset(width: number, height: number, offsetX?: number, offsetY?: number): Phaser.Weapon;
+
+ setBulletFrames(min: number, max: number, cycle?: boolean, random?: boolean): Phaser.Weapon;
+
+ trackPointer(pointer: Phaser.Pointer, offsetX?: number, offsetY?: number): Phaser.Weapon;
+
+ trackSprite(sprite: Phaser.Sprite, offsetX?: number, offsetY?: number, trackRotation?: boolean): Phaser.Weapon;
+
+ }
+
+ class World extends Phaser.Group {
+
+ constructor(game: Phaser.Game);
+
+ bounds: Phaser.Rectangle;
+ camera: Phaser.Camera;
+ centerX: number;
+ centerY: number;
+ game: Phaser.Game;
+ height: number;
+ isPaused: boolean;
+ randomX: number;
+ randomY: number;
+ stats: {
+ skipped: number;
+ ignored: number;
+ checked: number;
+ };
+ width: number;
+
+ boot(): void;
+
+ getObjectsUnderPointer(pointer: Phaser.Pointer, group: Phaser.Group, callback?: Function, callbackContext?: any): Phaser.Sprite;
+
+ resize(width: number, height: number): void;
+
+ setBounds(x: number, y: number, width: number, height: number): void;
+
+ sortLeftRight(a: Phaser.Sprite, b: Phaser.Sprite): number;
+
+ sortRightLeft(a: Phaser.Sprite, b: Phaser.Sprite): number;
+
+ sortTopBottom(a: Phaser.Sprite, b: Phaser.Sprite): number;
+
+ sortBottomTop(a: Phaser.Sprite, b: Phaser.Sprite): number;
+
+ sort(group: Phaser.Group, sortDirection?: number): void;
+ sort(key?: string, order?: number): void;
+
+ shutdown(): void;
+
+ wrap(sprite: any, padding?: number, useBounds?: boolean, horizontal?: boolean, vertical?: boolean): void;
+
+ wrapAll(group: Phaser.Group, checkExists?: boolean, padding?: number, useBounds?: boolean, horizontal?: boolean, vertical?: boolean): void;
+
+ }
+
+}
diff --git a/mar/phaser/phaser.js b/mar/phaser/phaser.js
index 43fd514..7d412cf 100644
--- a/mar/phaser/phaser.js
+++ b/mar/phaser/phaser.js
@@ -240,7 +240,7 @@
/**
* Vertices that this polygon consists of. An array of array of numbers, example: [[0,0],[1,0],..]
* @property vertices
- * @type {Array}
+ * @objType {Array}
*/
this.vertices = [];
}
@@ -815,7 +815,7 @@
/**
* The lower bound of the bounding box.
* @property lowerBound
- * @type {Array}
+ * @objType {Array}
*/
this.lowerBound = vec2.create();
if (options && options.lowerBound) {
@@ -825,7 +825,7 @@
/**
* The upper bound of the bounding box.
* @property upperBound
- * @type {Array}
+ * @objType {Array}
*/
this.upperBound = vec2.create();
if (options && options.upperBound) {
@@ -1017,34 +1017,34 @@
/**
* The resulting overlapping pairs. Will be filled with results during .getCollisionPairs().
* @property result
- * @type {Array}
+ * @objType {Array}
*/
this.result = [];
/**
* The world to search for collision pairs in. To change it, use .setWorld()
* @property world
- * @type {World}
+ * @objType {World}
* @readOnly
*/
this.world = null;
/**
- * The bounding volume type to use in the broadphase algorithms. Should be set to Broadphase.AABB or Broadphase.BOUNDING_CIRCLE.
+ * The bounding volume objType to use in the broadphase algorithms. Should be set to Broadphase.AABB or Broadphase.BOUNDING_CIRCLE.
* @property {Number} boundingVolumeType
*/
this.boundingVolumeType = Broadphase.AABB;
}
/**
- * Axis aligned bounding box type.
+ * Axis aligned bounding box objType.
* @static
* @property {Number} AABB
*/
Broadphase.AABB = 1;
/**
- * Bounding circle type.
+ * Bounding circle objType.
* @static
* @property {Number} BOUNDING_CIRCLE
*/
@@ -1113,7 +1113,7 @@
result = Broadphase.aabbCheck(bodyA, bodyB);
break;
default:
- throw new Error('Bounding volume type not recognized: ' + this.boundingVolumeType);
+ throw new Error('Bounding volume objType not recognized: ' + this.boundingVolumeType);
}
return result;
};
@@ -1300,41 +1300,41 @@
/**
* @property contactEquations
- * @type {Array}
+ * @objType {Array}
*/
this.contactEquations = [];
/**
* @property frictionEquations
- * @type {Array}
+ * @objType {Array}
*/
this.frictionEquations = [];
/**
* Whether to make friction equations in the upcoming contacts.
* @property enableFriction
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.enableFriction = true;
/**
* Whether to make equations enabled in upcoming contacts.
* @property enabledEquations
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.enabledEquations = true;
/**
* The friction slip force to use when creating friction equations.
* @property slipForce
- * @type {Number}
+ * @objType {Number}
*/
this.slipForce = 10.0;
/**
* The friction value to use in the upcoming friction equations.
* @property frictionCoefficient
- * @type {Number}
+ * @objType {Number}
*/
this.frictionCoefficient = 0.3;
@@ -1366,7 +1366,7 @@
/**
* The restitution value to use in the next contact equations.
* @property restitution
- * @type {Number}
+ * @objType {Number}
*/
this.restitution = 0;
@@ -1385,21 +1385,21 @@
/**
* The stiffness value to use in the next friction equations.
* @property frictionStiffness
- * @type {Number}
+ * @objType {Number}
*/
this.frictionStiffness = Equation.DEFAULT_STIFFNESS;
/**
* The relaxation value to use in the next friction equations.
* @property frictionRelaxation
- * @type {Number}
+ * @objType {Number}
*/
this.frictionRelaxation = Equation.DEFAULT_RELAXATION;
/**
* Enable reduction of friction equations. If disabled, a box on a plane will generate 2 contact equations and 2 friction equations. If enabled, there will be only one friction equation. Same kind of simplifications are made for all collision types.
* @property enableFrictionReduction
- * @type {Boolean}
+ * @objType {Boolean}
* @deprecated This flag will be removed when the feature is stable enough.
* @default true
*/
@@ -1409,7 +1409,7 @@
* Keeps track of the colliding bodies last step.
* @private
* @property collidingBodiesLastStep
- * @type {TupleDictionary}
+ * @objType {TupleDictionary}
*/
this.collidingBodiesLastStep = new TupleDictionary();
@@ -4132,14 +4132,14 @@
/**
* List of bodies currently in the broadphase.
* @property axisList
- * @type {Array}
+ * @objType {Array}
*/
this.axisList = [];
/**
* The axis to sort along. 0 means x-axis and 1 y-axis. If your bodies are more spread out over the X axis, set axisIndex to 0, and you will gain some performance.
* @property axisIndex
- * @type {Number}
+ * @objType {Number}
*/
this.axisIndex = 0;
@@ -4320,8 +4320,8 @@
function Constraint(bodyA, bodyB, type, options) {
/**
- * The type of constraint. May be one of Constraint.DISTANCE, Constraint.GEAR, Constraint.LOCK, Constraint.PRISMATIC or Constraint.REVOLUTE.
- * @property {number} type
+ * The objType of constraint. May be one of Constraint.DISTANCE, Constraint.GEAR, Constraint.LOCK, Constraint.PRISMATIC or Constraint.REVOLUTE.
+ * @property {number} objType
*/
this.type = type;
@@ -4334,28 +4334,28 @@
* Equations to be solved in this constraint
*
* @property equations
- * @type {Array}
+ * @objType {Array}
*/
this.equations = [];
/**
* First body participating in the constraint.
* @property bodyA
- * @type {Body}
+ * @objType {Body}
*/
this.bodyA = bodyA;
/**
* Second body participating in the constraint.
* @property bodyB
- * @type {Body}
+ * @objType {Body}
*/
this.bodyB = bodyB;
/**
* Set to true if you want the connected bodies to collide.
* @property collideConnected
- * @type {Boolean}
+ * @objType {Boolean}
* @default true
*/
this.collideConnected = options.collideConnected;
@@ -4489,14 +4489,14 @@
/**
* Local anchor in body A.
* @property localAnchorA
- * @type {Array}
+ * @objType {Array}
*/
this.localAnchorA = vec2.fromValues(options.localAnchorA[0], options.localAnchorA[1]);
/**
* Local anchor in body B.
* @property localAnchorB
- * @type {Array}
+ * @objType {Array}
*/
this.localAnchorB = vec2.fromValues(options.localAnchorB[0], options.localAnchorB[1]);
@@ -4506,7 +4506,7 @@
/**
* The distance to keep.
* @property distance
- * @type {Number}
+ * @objType {Number}
*/
this.distance = 0;
@@ -4750,14 +4750,14 @@
/**
* The gear ratio.
* @property ratio
- * @type {Number}
+ * @objType {Number}
*/
this.ratio = options.ratio !== undefined ? options.ratio : 1;
/**
* The relative angle
* @property angle
- * @type {Number}
+ * @objType {Number}
*/
this.angle = options.angle !== undefined ? options.angle : bodyB.angle - this.ratio * bodyA.angle;
@@ -5031,19 +5031,19 @@
/**
* @property localAnchorA
- * @type {Array}
+ * @objType {Array}
*/
this.localAnchorA = localAnchorA;
/**
* @property localAnchorB
- * @type {Array}
+ * @objType {Array}
*/
this.localAnchorB = localAnchorB;
/**
* @property localAxisA
- * @type {Array}
+ * @objType {Array}
*/
this.localAxisA = localAxisA;
@@ -5106,7 +5106,7 @@
/**
* The position of anchor A relative to anchor B, along the constraint axis.
* @property position
- * @type {Number}
+ * @objType {Number}
*/
this.position = 0;
@@ -5116,28 +5116,28 @@
/**
* Set to true to enable lower limit.
* @property lowerLimitEnabled
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.lowerLimitEnabled = typeof(options.lowerLimit) !== "undefined" ? true : false;
/**
* Set to true to enable upper limit.
* @property upperLimitEnabled
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.upperLimitEnabled = typeof(options.upperLimit) !== "undefined" ? true : false;
/**
* Lower constraint limit. The constraint position is forced to be larger than this value.
* @property lowerLimit
- * @type {Number}
+ * @objType {Number}
*/
this.lowerLimit = typeof(options.lowerLimit) !== "undefined" ? options.lowerLimit : 0;
/**
* Upper constraint limit. The constraint position is forced to be smaller than this value.
* @property upperLimit
- * @type {Number}
+ * @objType {Number}
*/
this.upperLimit = typeof(options.upperLimit) !== "undefined" ? options.upperLimit : 1;
@@ -5152,21 +5152,21 @@
/**
* Equation used for the motor.
* @property motorEquation
- * @type {Equation}
+ * @objType {Equation}
*/
this.motorEquation = new Equation(bodyA, bodyB);
/**
* The current motor state. Enable or disable the motor using .enableMotor
* @property motorEnabled
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.motorEnabled = false;
/**
* Set the target speed for the motor.
* @property motorSpeed
- * @type {Number}
+ * @objType {Number}
*/
this.motorSpeed = 0;
@@ -5468,7 +5468,7 @@
/**
* The constraint position.
* @property angle
- * @type {Number}
+ * @objType {Number}
* @readOnly
*/
this.angle = 0;
@@ -5476,28 +5476,28 @@
/**
* Set to true to enable lower limit
* @property lowerLimitEnabled
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.lowerLimitEnabled = false;
/**
* Set to true to enable upper limit
* @property upperLimitEnabled
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.upperLimitEnabled = false;
/**
* The lower limit on the constraint angle.
* @property lowerLimit
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.lowerLimit = 0;
/**
* The upper limit on the constraint angle.
* @property upperLimit
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.upperLimit = 0;
@@ -5772,7 +5772,7 @@
/**
* Vector from body i center of mass to the contact point.
* @property contactPointA
- * @type {Array}
+ * @objType {Array}
*/
this.contactPointA = vec2.create();
this.penetrationVec = vec2.create();
@@ -5780,28 +5780,28 @@
/**
* World-oriented vector from body A center of mass to the contact point.
* @property contactPointB
- * @type {Array}
+ * @objType {Array}
*/
this.contactPointB = vec2.create();
/**
* The normal vector, pointing out of body i
* @property normalA
- * @type {Array}
+ * @objType {Array}
*/
this.normalA = vec2.create();
/**
* The restitution to use (0=no bounciness, 1=max bounciness).
* @property restitution
- * @type {Number}
+ * @objType {Number}
*/
this.restitution = 0;
/**
* This property is set to true if this is the first impact between the bodies (not persistant contact).
* @property firstImpact
- * @type {Boolean}
+ * @objType {Boolean}
* @readOnly
*/
this.firstImpact = false;
@@ -5809,14 +5809,14 @@
/**
* The shape in body i that triggered this contact.
* @property shapeA
- * @type {Shape}
+ * @objType {Shape}
*/
this.shapeA = null;
/**
* The shape in body j that triggered this contact.
* @property shapeB
- * @type {Shape}
+ * @objType {Shape}
*/
this.shapeB = null;
}
@@ -5907,49 +5907,49 @@
/**
* Minimum force to apply when solving.
* @property minForce
- * @type {Number}
+ * @objType {Number}
*/
this.minForce = typeof(minForce) === "undefined" ? -Number.MAX_VALUE : minForce;
/**
* Max force to apply when solving.
* @property maxForce
- * @type {Number}
+ * @objType {Number}
*/
this.maxForce = typeof(maxForce) === "undefined" ? Number.MAX_VALUE : maxForce;
/**
* First body participating in the constraint
* @property bodyA
- * @type {Body}
+ * @objType {Body}
*/
this.bodyA = bodyA;
/**
* Second body participating in the constraint
* @property bodyB
- * @type {Body}
+ * @objType {Body}
*/
this.bodyB = bodyB;
/**
* The stiffness of this equation. Typically chosen to a large number (~1e7), but can be chosen somewhat freely to get a stable simulation.
* @property stiffness
- * @type {Number}
+ * @objType {Number}
*/
this.stiffness = Equation.DEFAULT_STIFFNESS;
/**
* The number of time steps needed to stabilize the constraint equation. Typically between 3 and 5 time steps.
* @property relaxation
- * @type {Number}
+ * @objType {Number}
*/
this.relaxation = Equation.DEFAULT_RELAXATION;
/**
* The Jacobian entry of this equation. 6 numbers, 3 per body (x,y,angle).
* @property G
- * @type {Array}
+ * @objType {Array}
*/
this.G = new Utils.ARRAY_TYPE(6);
for (var i = 0; i < 6; i++) {
@@ -5972,7 +5972,7 @@
/**
* The resulting constraint multiplier from the last solve. This is mostly equivalent to the force produced by the constraint.
* @property multiplier
- * @type {Number}
+ * @objType {Number}
*/
this.multiplier = 0;
@@ -6234,35 +6234,35 @@
/**
* Relative vector from center of body A to the contact point, world oriented.
* @property contactPointA
- * @type {Array}
+ * @objType {Array}
*/
this.contactPointA = vec2.create();
/**
* Relative vector from center of body B to the contact point, world oriented.
* @property contactPointB
- * @type {Array}
+ * @objType {Array}
*/
this.contactPointB = vec2.create();
/**
* Tangent vector that the friction force will act along. World oriented.
* @property t
- * @type {Array}
+ * @objType {Array}
*/
this.t = vec2.create();
/**
* ContactEquations connected to this friction equation. The contact equations can be used to rescale the max force for the friction. If more than one contact equation is given, then the max force can be set to the average.
* @property contactEquations
- * @type {ContactEquation}
+ * @objType {ContactEquation}
*/
this.contactEquations = [];
/**
* The shape in body i that triggered this friction.
* @property shapeA
- * @type {Shape}
+ * @objType {Shape}
* @todo Needed? The shape can be looked up via contactEquation.shapeA...
*/
this.shapeA = null;
@@ -6270,7 +6270,7 @@
/**
* The shape in body j that triggered this friction.
* @property shapeB
- * @type {Shape}
+ * @objType {Shape}
* @todo Needed? The shape can be looked up via contactEquation.shapeB...
*/
this.shapeB = null;
@@ -6278,7 +6278,7 @@
/**
* The friction coefficient to use.
* @property frictionCoefficient
- * @type {Number}
+ * @objType {Number}
*/
this.frictionCoefficient = 0.3;
}
@@ -6497,7 +6497,7 @@
* Emit an event.
* @method emit
* @param {Object} event
- * @param {String} event.type
+ * @param {String} event.objType
* @return {EventEmitter} The self object, for chainability.
*/
emit: function (event) {
@@ -6550,28 +6550,28 @@
/**
* The contact material identifier
* @property id
- * @type {Number}
+ * @objType {Number}
*/
this.id = ContactMaterial.idCounter++;
/**
* First material participating in the contact material
* @property materialA
- * @type {Material}
+ * @objType {Material}
*/
this.materialA = materialA;
/**
* Second material participating in the contact material
* @property materialB
- * @type {Material}
+ * @objType {Material}
*/
this.materialB = materialB;
/**
* Friction coefficient to use in the contact of these two materials. Friction = 0 will make the involved objects super slippery, and friction = 1 will make it much less slippery. A friction coefficient larger than 1 will allow for very large friction forces, which can be convenient for preventing car tires not slip on the ground.
* @property friction
- * @type {Number}
+ * @objType {Number}
* @default 0.3
*/
this.friction = typeof(options.friction) !== "undefined" ? Number(options.friction) : 0.3;
@@ -6579,7 +6579,7 @@
/**
* Restitution, or "bounciness" to use in the contact of these two materials. A restitution of 0 will make no bounce, while restitution=1 will approximately bounce back with the same velocity the object came with.
* @property restitution
- * @type {Number}
+ * @objType {Number}
* @default 0
*/
this.restitution = typeof(options.restitution) !== "undefined" ? Number(options.restitution) : 0;
@@ -6587,28 +6587,28 @@
/**
* Hardness of the contact. Less stiffness will make the objects penetrate more, and will make the contact act more like a spring than a contact force. Default value is {{#crossLink "Equation/DEFAULT_STIFFNESS:property"}}Equation.DEFAULT_STIFFNESS{{/crossLink}}.
* @property stiffness
- * @type {Number}
+ * @objType {Number}
*/
this.stiffness = typeof(options.stiffness) !== "undefined" ? Number(options.stiffness) : Equation.DEFAULT_STIFFNESS;
/**
* Relaxation of the resulting ContactEquation that this ContactMaterial generate. Default value is {{#crossLink "Equation/DEFAULT_RELAXATION:property"}}Equation.DEFAULT_RELAXATION{{/crossLink}}.
* @property relaxation
- * @type {Number}
+ * @objType {Number}
*/
this.relaxation = typeof(options.relaxation) !== "undefined" ? Number(options.relaxation) : Equation.DEFAULT_RELAXATION;
/**
* Stiffness of the resulting friction force. For most cases, the value of this property should be a large number. I cannot think of any case where you would want less frictionStiffness. Default value is {{#crossLink "Equation/DEFAULT_STIFFNESS:property"}}Equation.DEFAULT_STIFFNESS{{/crossLink}}.
* @property frictionStiffness
- * @type {Number}
+ * @objType {Number}
*/
this.frictionStiffness = typeof(options.frictionStiffness) !== "undefined" ? Number(options.frictionStiffness) : Equation.DEFAULT_STIFFNESS;
/**
* Relaxation of the resulting friction force. The default value should be good for most simulations. Default value is {{#crossLink "Equation/DEFAULT_RELAXATION:property"}}Equation.DEFAULT_RELAXATION{{/crossLink}}.
* @property frictionRelaxation
- * @type {Number}
+ * @objType {Number}
*/
this.frictionRelaxation = typeof(options.frictionRelaxation) !== "undefined" ? Number(options.frictionRelaxation) : Equation.DEFAULT_RELAXATION;
@@ -6622,7 +6622,7 @@
/**
* Offset to be set on ContactEquations. A positive value will make the bodies penetrate more into each other. Can be useful in scenes where contacts need to be more persistent, for example when stacking. Aka "cure for nervous contacts".
* @property contactSkinSize
- * @type {Number}
+ * @objType {Number}
*/
this.contactSkinSize = 0.005;
}
@@ -6644,7 +6644,7 @@
/**
* The material identifier
* @property id
- * @type {Number}
+ * @objType {Number}
*/
this.id = id || Material.idCounter++;
}
@@ -7722,7 +7722,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* @param {Number} [options.fixedRotation=false]
* @param {Number} [options.gravityScale]
* @param {Number} [options.id]
- * @param {Number} [options.mass=0] A number >= 0. If zero, the .type will be set to Body.STATIC.
+ * @param {Number} [options.mass=0] A number >= 0. If zero, the .objType will be set to Body.STATIC.
* @param {Number} [options.sleepSpeedLimit]
* @param {Number} [options.sleepTimeLimit]
* @param {Object} [options]
@@ -7752,14 +7752,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The body identifyer
* @property id
- * @type {Number}
+ * @objType {Number}
*/
this.id = options.id || ++Body._idCounter;
/**
* The world that this body is added to. This property is set to NULL if the body is not added to any world.
* @property world
- * @type {World}
+ * @objType {World}
*/
this.world = null;
@@ -7767,35 +7767,35 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The shapes of the body.
*
* @property shapes
- * @type {Array}
+ * @objType {Array}
*/
this.shapes = [];
/**
* The mass of the body.
* @property mass
- * @type {number}
+ * @objType {number}
*/
this.mass = options.mass || 0;
/**
* The inverse mass of the body.
* @property invMass
- * @type {number}
+ * @objType {number}
*/
this.invMass = 0;
/**
* The inertia of the body around the Z axis.
* @property inertia
- * @type {number}
+ * @objType {number}
*/
this.inertia = 0;
/**
* The inverse inertia of the body.
* @property invInertia
- * @type {number}
+ * @objType {number}
*/
this.invInertia = 0;
@@ -7805,7 +7805,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Set to true if you want to fix the rotation of the body.
* @property fixedRotation
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.fixedRotation = !!options.fixedRotation;
@@ -7830,7 +7830,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The position of the body
* @property position
- * @type {Array}
+ * @objType {Array}
*/
this.position = vec2.fromValues(0, 0);
if (options.position) {
@@ -7840,35 +7840,35 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The interpolated position of the body. Use this for rendering.
* @property interpolatedPosition
- * @type {Array}
+ * @objType {Array}
*/
this.interpolatedPosition = vec2.fromValues(0, 0);
/**
* The interpolated angle of the body. Use this for rendering.
* @property interpolatedAngle
- * @type {Number}
+ * @objType {Number}
*/
this.interpolatedAngle = 0;
/**
* The previous position of the body.
* @property previousPosition
- * @type {Array}
+ * @objType {Array}
*/
this.previousPosition = vec2.fromValues(0, 0);
/**
* The previous angle of the body.
* @property previousAngle
- * @type {Number}
+ * @objType {Number}
*/
this.previousAngle = 0;
/**
* The current velocity of the body.
* @property velocity
- * @type {Array}
+ * @objType {Array}
*/
this.velocity = vec2.fromValues(0, 0);
if (options.velocity) {
@@ -7878,21 +7878,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Constraint velocity that was added to the body during the last step.
* @property vlambda
- * @type {Array}
+ * @objType {Array}
*/
this.vlambda = vec2.fromValues(0, 0);
/**
* Angular constraint velocity that was added to the body during last step.
* @property wlambda
- * @type {Array}
+ * @objType {Array}
*/
this.wlambda = 0;
/**
* The angle of the body, in radians.
* @property angle
- * @type {number}
+ * @objType {number}
* @example
* // The angle property is not normalized to the interval 0 to 2*pi, it can be any value.
* // If you need a value between 0 and 2*pi, use the following function to normalize it.
@@ -7909,14 +7909,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The angular velocity of the body, in radians per second.
* @property angularVelocity
- * @type {number}
+ * @objType {number}
*/
this.angularVelocity = options.angularVelocity || 0;
/**
* The force acting on the body. Since the body force (and {{#crossLink "Body/angularForce:property"}}{{/crossLink}}) will be zeroed after each step, so you need to set the force before each step.
* @property force
- * @type {Array}
+ * @objType {Array}
*
* @example
* // This produces a forcefield of 1 Newton in the positive x direction.
@@ -7940,14 +7940,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The angular force acting on the body. See {{#crossLink "Body/force:property"}}{{/crossLink}}.
* @property angularForce
- * @type {number}
+ * @objType {number}
*/
this.angularForce = options.angularForce || 0;
/**
* The linear damping acting on the body in the velocity direction. Should be a value between 0 and 1.
* @property damping
- * @type {Number}
+ * @objType {Number}
* @default 0.1
*/
this.damping = typeof(options.damping) === "number" ? options.damping : 0.1;
@@ -7955,25 +7955,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The angular force acting on the body. Should be a value between 0 and 1.
* @property angularDamping
- * @type {Number}
+ * @objType {Number}
* @default 0.1
*/
this.angularDamping = typeof(options.angularDamping) === "number" ? options.angularDamping : 0.1;
/**
- * The type of motion this body has. Should be one of: {{#crossLink "Body/STATIC:property"}}Body.STATIC{{/crossLink}}, {{#crossLink "Body/DYNAMIC:property"}}Body.DYNAMIC{{/crossLink}} and {{#crossLink "Body/KINEMATIC:property"}}Body.KINEMATIC{{/crossLink}}.
+ * The objType of motion this body has. Should be one of: {{#crossLink "Body/STATIC:property"}}Body.STATIC{{/crossLink}}, {{#crossLink "Body/DYNAMIC:property"}}Body.DYNAMIC{{/crossLink}} and {{#crossLink "Body/KINEMATIC:property"}}Body.KINEMATIC{{/crossLink}}.
*
* * Static bodies do not move, and they do not respond to forces or collision.
* * Dynamic bodies body can move and respond to collisions and forces.
* * Kinematic bodies only moves according to its .velocity, and does not respond to collisions or force.
*
* @property type
- * @type {number}
+ * @objType {number}
*
* @example
* // Bodies are static by default. Static bodies will never move.
* var body = new Body();
- * console.log(body.type == Body.STATIC); // true
+ * console.log(body.objType == Body.STATIC); // true
*
* @example
* // By setting the mass of a body to a nonzero number, the body
@@ -7981,12 +7981,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* var dynamicBody = new Body({
* mass : 1
* });
- * console.log(dynamicBody.type == Body.DYNAMIC); // true
+ * console.log(dynamicBody.objType == Body.DYNAMIC); // true
*
* @example
* // Kinematic bodies will only move if you change their velocity.
* var kinematicBody = new Body({
- * type: Body.KINEMATIC // Type can be set via the options object.
+ * objType: Body.KINEMATIC // Type can be set via the options object.
* });
*/
this.type = Body.STATIC;
@@ -8002,21 +8002,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Bounding circle radius.
* @property boundingRadius
- * @type {Number}
+ * @objType {Number}
*/
this.boundingRadius = 0;
/**
* Bounding box of this body.
* @property aabb
- * @type {AABB}
+ * @objType {AABB}
*/
this.aabb = new AABB();
/**
* Indicates if the AABB needs update. Update it with {{#crossLink "Body/updateAABB:method"}}.updateAABB(){{/crossLink}}.
* @property aabbNeedsUpdate
- * @type {Boolean}
+ * @objType {Boolean}
* @see updateAABB
*
* @example
@@ -8030,7 +8030,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* If true, the body will automatically fall to sleep. Note that you need to enable sleeping in the {{#crossLink "World"}}{{/crossLink}} before anything will happen.
* @property allowSleep
- * @type {Boolean}
+ * @objType {Boolean}
* @default true
*/
this.allowSleep = options.allowSleep !== undefined ? options.allowSleep : true;
@@ -8043,7 +8043,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The body is initially Body.AWAKE. If its velocity norm is below .sleepSpeedLimit, the sleepState will become Body.SLEEPY. If the body continues to be Body.SLEEPY for .sleepTimeLimit seconds, it will fall asleep (Body.SLEEPY).
*
* @property sleepState
- * @type {Number}
+ * @objType {Number}
* @default Body.AWAKE
*/
this.sleepState = Body.AWAKE;
@@ -8051,7 +8051,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* If the speed (the norm of the velocity) is smaller than this value, the body is considered sleepy.
* @property sleepSpeedLimit
- * @type {Number}
+ * @objType {Number}
* @default 0.2
*/
this.sleepSpeedLimit = options.sleepSpeedLimit !== undefined ? options.sleepSpeedLimit : 0.2;
@@ -8059,7 +8059,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* If the body has been sleepy for this sleepTimeLimit seconds, it is considered sleeping.
* @property sleepTimeLimit
- * @type {Number}
+ * @objType {Number}
* @default 1
*/
this.sleepTimeLimit = options.sleepTimeLimit !== undefined ? options.sleepTimeLimit : 1;
@@ -8867,7 +8867,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Dynamic body.
* @property DYNAMIC
- * @type {Number}
+ * @objType {Number}
* @static
*/
Body.DYNAMIC = 1;
@@ -8875,7 +8875,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Static body.
* @property STATIC
- * @type {Number}
+ * @objType {Number}
* @static
*/
Body.STATIC = 2;
@@ -8883,28 +8883,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Kinematic body.
* @property KINEMATIC
- * @type {Number}
+ * @objType {Number}
* @static
*/
Body.KINEMATIC = 4;
/**
* @property AWAKE
- * @type {Number}
+ * @objType {Number}
* @static
*/
Body.AWAKE = 0;
/**
* @property SLEEPY
- * @type {Number}
+ * @objType {Number}
* @static
*/
Body.SLEEPY = 1;
/**
* @property SLEEPING
- * @type {Number}
+ * @objType {Number}
* @static
*/
Body.SLEEPING = 2;
@@ -8953,14 +8953,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Anchor for bodyA in local bodyA coordinates.
* @property localAnchorA
- * @type {Array}
+ * @objType {Array}
*/
this.localAnchorA = vec2.fromValues(0, 0);
/**
* Anchor for bodyB in local bodyB coordinates.
* @property localAnchorB
- * @type {Array}
+ * @objType {Array}
*/
this.localAnchorB = vec2.fromValues(0, 0);
@@ -8986,7 +8986,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Rest length of the spring.
* @property restLength
- * @type {number}
+ * @objType {number}
*/
this.restLength = typeof(options.restLength) === "number" ? options.restLength : worldDistance;
}
@@ -9128,7 +9128,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Rest angle of the spring.
* @property restAngle
- * @type {number}
+ * @objType {number}
*/
this.restAngle = typeof(options.restAngle) === "number" ? options.restAngle : bodyB.angle - bodyA.angle;
}
@@ -9186,28 +9186,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Stiffness of the spring.
* @property stiffness
- * @type {number}
+ * @objType {number}
*/
this.stiffness = options.stiffness;
/**
* Damping of the spring.
* @property damping
- * @type {number}
+ * @objType {number}
*/
this.damping = options.damping;
/**
* First connected body.
* @property bodyA
- * @type {Body}
+ * @objType {Body}
*/
this.bodyA = bodyA;
/**
* Second connected body.
* @property bodyB
- * @type {Body}
+ * @objType {Body}
*/
this.bodyB = bodyB;
}
@@ -9592,14 +9592,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Total width of the box
* @property width
- * @type {Number}
+ * @objType {Number}
*/
var width = this.width = options.width || 1;
/**
* Total height of the box
* @property height
- * @type {Number}
+ * @objType {Number}
*/
var height = this.height = options.height || 1;
@@ -9909,7 +9909,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The radius of the circle.
* @property radius
- * @type {number}
+ * @objType {number}
*/
this.radius = options.radius || 1;
@@ -10063,7 +10063,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Vertices defined in the local frame.
* @property vertices
- * @type {Array}
+ * @objType {Array}
*/
this.vertices = [];
@@ -10078,7 +10078,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Axes defined in the local frame.
* @property axes
- * @type {Array}
+ * @objType {Array}
*/
this.axes = [];
@@ -10114,14 +10114,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The center of mass of the Convex
* @property centerOfMass
- * @type {Array}
+ * @objType {Array}
*/
this.centerOfMass = vec2.fromValues(0, 0);
/**
* Triangulated version of this convex. The structure is Array of 3-Arrays, and each subarray contains 3 integers, referencing the vertices.
* @property triangles
- * @type {Array}
+ * @objType {Array}
*/
this.triangles = [];
@@ -10133,7 +10133,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The bounding radius of the convex
* @property boundingRadius
- * @type {Number}
+ * @objType {Number}
*/
this.boundingRadius = 0;
@@ -10956,7 +10956,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* @param {number} [options.collisionMask=1]
* @param {boolean} [options.sensor=false]
* @param {boolean} [options.collisionResponse=true]
- * @param {object} [options.type=0]
+ * @param {object} [options.objType=0]
*/
function Shape(options) {
options = options || {};
@@ -10983,7 +10983,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.angle = options.angle || 0;
/**
- * The type of the shape. One of:
+ * The objType of the shape. One of:
*
* * {{#crossLink "Shape/CIRCLE:property"}}Shape.CIRCLE{{/crossLink}}
* * {{#crossLink "Shape/PARTICLE:property"}}Shape.PARTICLE{{/crossLink}}
@@ -10994,13 +10994,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* * {{#crossLink "Shape/CAPSULE:property"}}Shape.CAPSULE{{/crossLink}}
* * {{#crossLink "Shape/HEIGHTFIELD:property"}}Shape.HEIGHTFIELD{{/crossLink}}
*
- * @property {number} type
+ * @property {number} objType
*/
this.type = options.type || 0;
/**
* Shape object identifier.
- * @type {Number}
+ * @objType {Number}
* @property id
*/
this.id = Shape.idCounter++;
@@ -11008,14 +11008,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Bounding circle radius of this shape
* @property boundingRadius
- * @type {Number}
+ * @objType {Number}
*/
this.boundingRadius = 0;
/**
* Collision group that this shape belongs to (bit mask). See this tutorial.
* @property collisionGroup
- * @type {Number}
+ * @objType {Number}
* @example
* // Setup bits for each available group
* var PLAYER = Math.pow(2,0),
@@ -11052,21 +11052,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Collision mask of this shape. See .collisionGroup.
* @property collisionMask
- * @type {Number}
+ * @objType {Number}
*/
this.collisionMask = options.collisionMask !== undefined ? options.collisionMask : 1;
/**
* Material to use in collisions for this Shape. If this is set to null, the world will use default material properties instead.
* @property material
- * @type {Material}
+ * @objType {Material}
*/
this.material = options.material || null;
/**
* Area of this shape.
* @property area
- * @type {Number}
+ * @objType {Number}
*/
this.area = 0;
@@ -11213,14 +11213,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The max number of iterations to do when solving. More gives better results, but is more expensive.
* @property iterations
- * @type {Number}
+ * @objType {Number}
*/
this.iterations = options.iterations || 10;
/**
* The error tolerance, per constraint. If the total error is below this limit, the solver will stop iterating. Set to zero for as good solution as possible, but to something larger than zero to make computations faster.
* @property tolerance
- * @type {Number}
+ * @objType {Number}
* @default 1e-7
*/
this.tolerance = options.tolerance || 1e-7;
@@ -11233,7 +11233,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Set to true to set all right hand side terms to zero when solving. Can be handy for a few applications.
* @property useZeroRHS
- * @type {Boolean}
+ * @objType {Boolean}
* @todo Remove, not used
*/
this.useZeroRHS = false;
@@ -11244,7 +11244,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Use only frictionIterations > 0 if the approximated normal force (F_normal = mass * gravity) is not good enough. Examples of where it can happen is in space games where gravity is zero, or in tall stacks where the normal force is large at bottom but small at top.
*
* @property frictionIterations
- * @type {Number}
+ * @objType {Number}
* @default 0
*/
this.frictionIterations = options.frictionIterations !== undefined ? 0 : options.frictionIterations;
@@ -11463,14 +11463,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Current equations in the solver.
*
* @property equations
- * @type {Array}
+ * @objType {Array}
*/
this.equations = [];
/**
* Function that is used to sort all equations before each solve.
* @property equationSortFunction
- * @type {function|boolean}
+ * @objType {function|boolean}
*/
this.equationSortFunction = options.equationSortFunction || false;
}
@@ -11979,7 +11979,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property {Array} objects
- * @type {Array}
+ * @objType {Array}
*/
this.objects = [];
@@ -12044,7 +12044,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The data storage
* @property data
- * @type {Object}
+ * @objType {Object}
*/
this.data = {};
@@ -12200,12 +12200,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
};
/**
- * The array type to use for internal numeric computations throughout the library. Float32Array is used if it is available, but falls back on Array. If you want to set array type manually, inject it via the global variable P2_ARRAY_TYPE. See example below.
+ * The array objType to use for internal numeric computations throughout the library. Float32Array is used if it is available, but falls back on Array. If you want to set array objType manually, inject it via the global variable P2_ARRAY_TYPE. See example below.
* @static
* @property {function} ARRAY_TYPE
* @example
*
*
@@ -12265,14 +12265,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Current equations in this island.
* @property equations
- * @type {Array}
+ * @objType {Array}
*/
this.equations = [];
/**
* Current bodies in this island.
* @property bodies
- * @type {Array}
+ * @objType {Array}
*/
this.bodies = [];
}
@@ -12360,13 +12360,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property nodePool
- * @type {IslandNodePool}
+ * @objType {IslandNodePool}
*/
this.nodePool = new IslandNodePool({size: 16});
/**
* @property islandPool
- * @type {IslandPool}
+ * @objType {IslandPool}
*/
this.islandPool = new IslandPool({size: 8});
@@ -12577,7 +12577,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* If this node was visiting during the graph traversal.
* @property visited
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.visited = false;
}
@@ -12657,7 +12657,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* All springs in the world. To add a spring to the world, use {{#crossLink "World/addSpring:method"}}{{/crossLink}}.
*
* @property springs
- * @type {Array}
+ * @objType {Array}
*/
this.springs = [];
@@ -12684,7 +12684,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The narrowphase to use to generate contacts.
*
* @property narrowphase
- * @type {Narrowphase}
+ * @objType {Narrowphase}
*/
this.narrowphase = new Narrowphase(this);
@@ -12698,7 +12698,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Gravity in the world. This is applied on all bodies in the beginning of each step().
*
* @property gravity
- * @type {Array}
+ * @objType {Array}
*/
this.gravity = vec2.fromValues(0, -9.78);
if (options.gravity) {
@@ -12729,7 +12729,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The broadphase algorithm to use.
*
* @property broadphase
- * @type {Broadphase}
+ * @objType {Broadphase}
*/
this.broadphase = options.broadphase || new SAPBroadphase();
this.broadphase.setWorld(this);
@@ -12738,7 +12738,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* User-added constraints.
*
* @property constraints
- * @type {Array}
+ * @objType {Array}
*/
this.constraints = [];
@@ -12757,14 +12757,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* For keeping track of what time step size we used last step
* @property lastTimeStep
- * @type {Number}
+ * @objType {Number}
*/
this.lastTimeStep = 1 / 60;
/**
* Enable to automatically apply spring forces each step.
* @property applySpringForces
- * @type {Boolean}
+ * @objType {Boolean}
* @default true
*/
this.applySpringForces = true;
@@ -12772,7 +12772,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Enable to automatically apply body damping each step.
* @property applyDamping
- * @type {Boolean}
+ * @objType {Boolean}
* @default true
*/
this.applyDamping = true;
@@ -12780,7 +12780,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Enable to automatically apply gravity each step.
* @property applyGravity
- * @type {Boolean}
+ * @objType {Boolean}
* @default true
*/
this.applyGravity = true;
@@ -12788,7 +12788,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Enable/disable constraint solving in each step.
* @property solveConstraints
- * @type {Boolean}
+ * @objType {Boolean}
* @default true
*/
this.solveConstraints = true;
@@ -12796,14 +12796,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The ContactMaterials added to the World.
* @property contactMaterials
- * @type {Array}
+ * @objType {Array}
*/
this.contactMaterials = [];
/**
* World time.
* @property time
- * @type {Number}
+ * @objType {Number}
*/
this.time = 0.0;
this.accumulator = 0;
@@ -12831,7 +12831,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Set to true if you want to the world to emit the "impact" event. Turning this off could improve performance.
* @property emitImpactEvent
- * @type {Boolean}
+ * @objType {Boolean}
* @default true
*/
this.emitImpactEvent = true;
@@ -12909,7 +12909,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* How to deactivate bodies during simulation. Possible modes are: {{#crossLink "World/NO_SLEEPING:property"}}World.NO_SLEEPING{{/crossLink}}, {{#crossLink "World/BODY_SLEEPING:property"}}World.BODY_SLEEPING{{/crossLink}} and {{#crossLink "World/ISLAND_SLEEPING:property"}}World.ISLAND_SLEEPING{{/crossLink}}.
* If sleeping is enabled, you might need to {{#crossLink "Body/wakeUp:method"}}wake up{{/crossLink}} the bodies if they fall asleep when they shouldn't. If you want to enable sleeping in the world, but want to disable it for a particular body, see {{#crossLink "Body/allowSleep:property"}}Body.allowSleep{{/crossLink}}.
* @property sleepMode
- * @type {number}
+ * @objType {number}
* @default World.NO_SLEEPING
*/
this.sleepMode = World.NO_SLEEPING;
@@ -13368,7 +13368,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
for (var i = 0; i !== Nbodies; i++) {
var body = bodies[i];
- // if(body.sleepState !== Body.SLEEPING && body.type !== Body.STATIC){
+ // if(body.sleepState !== Body.SLEEPING && body.objType !== Body.STATIC){
body.integrate(dt);
// }
}
@@ -14025,7 +14025,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)
*
* @property hitArea
- * @type Rectangle|Circle|Ellipse|Polygon
+ * @objType Rectangle|Circle|Ellipse|Polygon
*/
this.hitArea = null;
@@ -14130,7 +14130,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The rectangular area used by filters when rendering a shader for this DisplayObject.
*
* @property {PIXI.Rectangle} filterArea
- * @type Rectangle
+ * @objType Rectangle
* @default
*/
this.filterArea = null;
@@ -14759,7 +14759,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* [read-only] The array of children of this container.
*
* @property children
- * @type Array(DisplayObject)
+ * @objType Array(DisplayObject)
* @readOnly
*/
this.children = [];
@@ -15273,7 +15273,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
*
* @property width
- * @type Number
+ * @objType Number
*/
Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
@@ -15300,7 +15300,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
*
* @property height
- * @type Number
+ * @objType Number
*/
Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
@@ -15349,7 +15349,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* You can modify the default values in PIXI.Sprite.defaultAnchor.
*
* @property anchor
- * @type Point
+ * @objType Point
*/
this.anchor = new PIXI.Point(PIXI.Sprite.defaultAnchor.x, PIXI.Sprite.defaultAnchor.y);
@@ -15357,7 +15357,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The texture that the sprite is using
*
* @property texture
- * @type Texture
+ * @objType Texture
*/
this.texture = texture || PIXI.Texture.emptyTexture;
@@ -15365,7 +15365,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The width of the sprite (this is initially set by the texture)
*
* @property _width
- * @type Number
+ * @objType Number
* @private
*/
this._width = 0;
@@ -15374,7 +15374,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The height of the sprite (this is initially set by the texture)
*
* @property _height
- * @type Number
+ * @objType Number
* @private
*/
this._height = 0;
@@ -15383,7 +15383,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.
*
* @property tint
- * @type Number
+ * @objType Number
* @default 0xFFFFFF
*/
this.tint = 0xFFFFFF;
@@ -15393,7 +15393,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
*
* @property cachedTint
* @private
- * @type Number
+ * @objType Number
* @default -1
*/
this.cachedTint = -1;
@@ -15402,7 +15402,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* A canvas that contains the tinted version of the Sprite (in Canvas mode, WebGL doesn't populate this)
*
* @property tintedTexture
- * @type Canvas
+ * @objType Canvas
* @default null
*/
this.tintedTexture = null;
@@ -15413,7 +15413,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Warning: You cannot have a blend mode and a filter active on the same Sprite. Doing so will render the sprite invisible.
*
* @property blendMode
- * @type Number
+ * @objType Number
* @default PIXI.blendModes.NORMAL;
*/
this.blendMode = PIXI.blendModes.NORMAL;
@@ -15423,7 +15423,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Set to null to remove a current shader.
*
* @property shader
- * @type Phaser.Filter
+ * @objType Phaser.Filter
* @default null
*/
this.shader = null;
@@ -15432,7 +15432,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Controls if this Sprite is processed by the core Phaser game loops and Group loops (except {@link Phaser.Group#update}).
*
* @property exists
- * @type Boolean
+ * @objType Boolean
* @default true
*/
this.exists = true;
@@ -15447,7 +15447,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property PIXI.Sprite.defaultAnchor - A Point-like object.
- * @type {{x: number, y: number}}
+ * @objType {{x: number, y: number}}
* @default
*/
PIXI.Sprite.defaultAnchor = {x: 0, y: 0};
@@ -15460,7 +15460,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The width of the sprite, setting this will actually modify the scale to achieve the value set
*
* @property width
- * @type Number
+ * @objType Number
*/
Object.defineProperty(PIXI.Sprite.prototype, 'width', {
@@ -15479,7 +15479,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The height of the sprite, setting this will actually modify the scale to achieve the value set
*
* @property height
- * @type Number
+ * @objType Number
*/
Object.defineProperty(PIXI.Sprite.prototype, 'height', {
@@ -15959,42 +15959,42 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
PIXI.PixiShader = function (gl) {
/**
* @property _UID
- * @type Number
+ * @objType Number
* @private
*/
this._UID = Phaser._UID++;
/**
* @property gl
- * @type WebGLContext
+ * @objType WebGLContext
*/
this.gl = gl;
/**
* The WebGL program.
* @property program
- * @type Any
+ * @objType Any
*/
this.program = null;
/**
* The fragment shader.
* @property fragmentSrc
- * @type Array
+ * @objType Array
*/
this.fragmentSrc = null;
/**
* A local texture counter for multi-texture shaders.
* @property textureCount
- * @type Number
+ * @objType Number
*/
this.textureCount = 0;
/**
* A local flag
* @property firstRun
- * @type Boolean
+ * @objType Boolean
* @private
*/
this.firstRun = true;
@@ -16002,14 +16002,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* A dirty flag
* @property dirty
- * @type Boolean
+ * @objType Boolean
*/
this.dirty = true;
/**
* Uniform attributes cache.
* @property attributes
- * @type Array
+ * @objType Array
* @private
*/
this.attributes = [];
@@ -16285,11 +16285,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
var height = (data.height) ? data.height : 2;
var border = (data.border) ? data.border : 0;
- // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
+ // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum objType, ArrayBufferView? pixels);
gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null);
}
else {
- // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels);
+ // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum objType, ImageData? pixels);
gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source);
}
@@ -16378,7 +16378,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The Default Vertex shader source.
*
* @property defaultVertexSrc
- * @type String
+ * @objType String
*/
PIXI.PixiShader.defaultVertexSrc = [
'// PixiShader Vertex Shader',
@@ -16418,21 +16418,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
PIXI.PixiFastShader = function (gl) {
/**
* @property _UID
- * @type Number
+ * @objType Number
* @private
*/
this._UID = Phaser._UID++;
/**
* @property gl
- * @type WebGLContext
+ * @objType WebGLContext
*/
this.gl = gl;
/**
* The WebGL program.
* @property program
- * @type Any
+ * @objType Any
*/
this.program = null;
@@ -16449,7 +16449,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The fragment shader.
* @property fragmentSrc
- * @type Array
+ * @objType Array
*/
this.fragmentSrc = [
'// PixiFastShader Fragment Shader.',
@@ -16488,7 +16488,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The vertex shader.
* @property vertexSrc
- * @type Array
+ * @objType Array
*/
this.vertexSrc = [
'// PixiFastShader Vertex Shader.',
@@ -16527,7 +16527,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* A local texture counter for multi-texture shaders.
* @property textureCount
- * @type Number
+ * @objType Number
*/
this.textureCount = 0;
@@ -16636,21 +16636,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
PIXI.StripShader = function (gl) {
/**
* @property _UID
- * @type Number
+ * @objType Number
* @private
*/
this._UID = Phaser._UID++;
/**
* @property gl
- * @type WebGLContext
+ * @objType WebGLContext
*/
this.gl = gl;
/**
* The WebGL program.
* @property program
- * @type Any
+ * @objType Any
*/
this.program = null;
@@ -16668,7 +16668,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The fragment shader.
* @property fragmentSrc
- * @type Array
+ * @objType Array
*/
this.fragmentSrc = [
'//StripShader Fragment Shader.',
@@ -16695,7 +16695,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The fragment shader.
* @property fragmentSrc
- * @type Array
+ * @objType Array
*/
this.fragmentSrc = [
'//StripShader Fragment Shader.',
@@ -16714,7 +16714,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The vertex shader.
* @property vertexSrc
- * @type Array
+ * @objType Array
*/
this.vertexSrc = [
'//StripShader Vertex Shader.',
@@ -16820,28 +16820,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
PIXI.PrimitiveShader = function (gl) {
/**
* @property _UID
- * @type Number
+ * @objType Number
* @private
*/
this._UID = Phaser._UID++;
/**
* @property gl
- * @type WebGLContext
+ * @objType WebGLContext
*/
this.gl = gl;
/**
* The WebGL program.
* @property program
- * @type Any
+ * @objType Any
*/
this.program = null;
/**
* The fragment shader.
* @property fragmentSrc
- * @type Array
+ * @objType Array
*/
this.fragmentSrc = [
'precision mediump float;',
@@ -16855,7 +16855,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The vertex shader.
* @property vertexSrc
- * @type Array
+ * @objType Array
*/
this.vertexSrc = [
'attribute vec2 aVertexPosition;',
@@ -16935,28 +16935,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
PIXI.ComplexPrimitiveShader = function (gl) {
/**
* @property _UID
- * @type Number
+ * @objType Number
* @private
*/
this._UID = Phaser._UID++;
/**
* @property gl
- * @type WebGLContext
+ * @objType WebGLContext
*/
this.gl = gl;
/**
* The WebGL program.
* @property program
- * @type Any
+ * @objType Any
*/
this.program = null;
/**
* The fragment shader.
* @property fragmentSrc
- * @type Array
+ * @objType Array
*/
this.fragmentSrc = [
@@ -16972,7 +16972,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The vertex shader.
* @property vertexSrc
- * @type Array
+ * @objType Array
*/
this.vertexSrc = [
'attribute vec2 aVertexPosition;',
@@ -17076,7 +17076,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property type
- * @type Number
+ * @objType Number
*/
this.type = Phaser.WEBGL;
@@ -17084,7 +17084,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The resolution of the renderer
*
* @property resolution
- * @type Number
+ * @objType Number
* @default 1
*/
this.resolution = game.resolution;
@@ -17093,7 +17093,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Whether the render view is transparent
*
* @property transparent
- * @type Boolean
+ * @objType Boolean
*/
this.transparent = game.transparent;
@@ -17101,7 +17101,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Whether the render view should be resized automatically
*
* @property autoResize
- * @type Boolean
+ * @objType Boolean
*/
this.autoResize = false;
@@ -17109,7 +17109,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.
*
* @property preserveDrawingBuffer
- * @type Boolean
+ * @objType Boolean
*/
this.preserveDrawingBuffer = game.preserveDrawingBuffer;
@@ -17120,7 +17120,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.
*
* @property clearBeforeRender
- * @type Boolean
+ * @objType Boolean
* @default
*/
this.clearBeforeRender = game.clearBeforeRender;
@@ -17129,7 +17129,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The width of the canvas view
*
* @property width
- * @type Number
+ * @objType Number
*/
this.width = game.width;
@@ -17137,7 +17137,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The height of the canvas view
*
* @property height
- * @type Number
+ * @objType Number
*/
this.height = game.height;
@@ -17145,13 +17145,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The canvas element that everything is drawn to
*
* @property view
- * @type HTMLCanvasElement
+ * @objType HTMLCanvasElement
*/
this.view = game.canvas;
/**
* @property _contextOptions
- * @type Object
+ * @objType Object
* @private
*/
this._contextOptions = {
@@ -17164,13 +17164,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property projection
- * @type Point
+ * @objType Point
*/
this.projection = new PIXI.Point();
/**
* @property offset
- * @type Point
+ * @objType Point
*/
this.offset = new PIXI.Point();
@@ -17179,54 +17179,54 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Deals with managing the shader programs and their attribs
* @property shaderManager
- * @type WebGLShaderManager
+ * @objType WebGLShaderManager
*/
this.shaderManager = new PIXI.WebGLShaderManager();
/**
* Manages the rendering of sprites
* @property spriteBatch
- * @type WebGLSpriteBatch
+ * @objType WebGLSpriteBatch
*/
this.spriteBatch = new PIXI.WebGLSpriteBatch(game);
/**
* Manages the masks using the stencil buffer
* @property maskManager
- * @type WebGLMaskManager
+ * @objType WebGLMaskManager
*/
this.maskManager = new PIXI.WebGLMaskManager();
/**
* Manages the filters
* @property filterManager
- * @type WebGLFilterManager
+ * @objType WebGLFilterManager
*/
this.filterManager = new PIXI.WebGLFilterManager();
/**
* Manages the stencil buffer
* @property stencilManager
- * @type WebGLStencilManager
+ * @objType WebGLStencilManager
*/
this.stencilManager = new PIXI.WebGLStencilManager();
/**
* Manages the blendModes
* @property blendModeManager
- * @type WebGLBlendModeManager
+ * @objType WebGLBlendModeManager
*/
this.blendModeManager = new PIXI.WebGLBlendModeManager();
/**
* @property renderSession
- * @type Object
+ * @objType Object
*/
this.renderSession = {};
/**
* @property currentBatchedTextures
- * @type Array
+ * @objType Array
*/
this.currentBatchedTextures = [];
@@ -17689,7 +17689,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
PIXI.WebGLBlendModeManager = function () {
/**
* @property currentBlendMode
- * @type Number
+ * @objType Number
*/
this.currentBlendMode = 99999;
};
@@ -18086,19 +18086,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
PIXI.WebGLShaderManager = function () {
/**
* @property maxAttibs
- * @type Number
+ * @objType Number
*/
this.maxAttibs = 10;
/**
* @property attribState
- * @type Array
+ * @objType Array
*/
this.attribState = [];
/**
* @property tempAttribState
- * @type Array
+ * @objType Array
*/
this.tempAttribState = [];
@@ -18108,7 +18108,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property stack
- * @type Array
+ * @objType Array
*/
this.stack = [];
@@ -18254,14 +18254,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property vertSize
- * @type Number
+ * @objType Number
*/
this.vertSize = 5;
/**
* The number of images in the SpriteBatch before it flushes
* @property size
- * @type Number
+ * @objType Number
*/
this.size = 2000; //Math.pow(2, 16) / this.vertSize;
@@ -18279,7 +18279,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Holds the vertices
*
* @property vertices
- * @type ArrayBuffer
+ * @objType ArrayBuffer
*/
this.vertices = new ArrayBuffer(numVerts);
@@ -18287,7 +18287,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* View on the vertices as a Float32Array
*
* @property positions
- * @type Float32Array
+ * @objType Float32Array
*/
this.positions = new Float32Array(this.vertices);
@@ -18295,7 +18295,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* View on the vertices as a Uint32Array
*
* @property colors
- * @type Uint32Array
+ * @objType Uint32Array
*/
this.colors = new Uint32Array(this.vertices);
@@ -18303,13 +18303,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Holds the indices
*
* @property indices
- * @type Uint16Array
+ * @objType Uint16Array
*/
this.indices = new Uint16Array(numIndices);
/**
* @property lastIndexCount
- * @type Number
+ * @objType Number
*/
this.lastIndexCount = 0;
@@ -18324,55 +18324,55 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property drawing
- * @type Boolean
+ * @objType Boolean
*/
this.drawing = false;
/**
* @property currentBatchSize
- * @type Number
+ * @objType Number
*/
this.currentBatchSize = 0;
/**
* @property currentBaseTexture
- * @type BaseTexture
+ * @objType BaseTexture
*/
this.currentBaseTexture = null;
/**
* @property dirty
- * @type Boolean
+ * @objType Boolean
*/
this.dirty = true;
/**
* @property textures
- * @type Array
+ * @objType Array
*/
this.textures = [];
/**
* @property blendModes
- * @type Array
+ * @objType Array
*/
this.blendModes = [];
/**
* @property shaders
- * @type Array
+ * @objType Array
*/
this.shaders = [];
/**
* @property sprites
- * @type Array
+ * @objType Array
*/
this.sprites = [];
/**
* @property defaultShader
- * @type Phaser.Filter
+ * @objType Phaser.Filter
*/
this.defaultShader = null;
};
@@ -18992,19 +18992,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property vertSize
- * @type Number
+ * @objType Number
*/
this.vertSize = 11;
/**
* @property maxSize
- * @type Number
+ * @objType Number
*/
this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize;
/**
* @property size
- * @type Number
+ * @objType Number
*/
this.size = this.maxSize;
@@ -19017,32 +19017,32 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Vertex data
* @property vertices
- * @type Float32Array
+ * @objType Float32Array
*/
this.vertices = new Float32Array(numVerts);
/**
* Index data
* @property indices
- * @type Uint16Array
+ * @objType Uint16Array
*/
this.indices = new Uint16Array(numIndices);
/**
* @property vertexBuffer
- * @type Object
+ * @objType Object
*/
this.vertexBuffer = null;
/**
* @property indexBuffer
- * @type Object
+ * @objType Object
*/
this.indexBuffer = null;
/**
* @property lastIndexCount
- * @type Number
+ * @objType Number
*/
this.lastIndexCount = 0;
@@ -19057,43 +19057,43 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property drawing
- * @type Boolean
+ * @objType Boolean
*/
this.drawing = false;
/**
* @property currentBatchSize
- * @type Number
+ * @objType Number
*/
this.currentBatchSize = 0;
/**
* @property currentBaseTexture
- * @type BaseTexture
+ * @objType BaseTexture
*/
this.currentBaseTexture = null;
/**
* @property currentBlendMode
- * @type Number
+ * @objType Number
*/
this.currentBlendMode = 0;
/**
* @property renderSession
- * @type Object
+ * @objType Object
*/
this.renderSession = null;
/**
* @property shader
- * @type Object
+ * @objType Object
*/
this.shader = null;
/**
* @property matrix
- * @type Matrix
+ * @objType Matrix
*/
this.matrix = null;
@@ -19412,19 +19412,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
PIXI.WebGLFilterManager = function () {
/**
* @property filterStack
- * @type Array
+ * @objType Array
*/
this.filterStack = [];
/**
* @property offsetX
- * @type Number
+ * @objType Number
*/
this.offsetX = 0;
/**
* @property offsetY
- * @type Number
+ * @objType Number
*/
this.offsetY = 0;
};
@@ -19923,19 +19923,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
textureUnit = typeof textureUnit === 'number' ? textureUnit : 0;
/**
* @property gl
- * @type WebGLContext
+ * @objType WebGLContext
*/
this.gl = gl;
// next time to create a frame buffer and texture
/**
* @property frameBuffer
- * @type Any
+ * @objType Any
*/
this.frameBuffer = _CreateFramebuffer(gl, width, height, scaleMode || PIXI.scaleModes.DEFAULT, textureUnit);
/**
* @property texture
- * @type Any
+ * @objType Any
*/
this.texture = this.frameBuffer.targetTexture;
this.width = width;
@@ -20009,7 +20009,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The width of the Canvas in pixels.
*
* @property width
- * @type Number
+ * @objType Number
*/
this.width = width;
@@ -20017,7 +20017,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The height of the Canvas in pixels.
*
* @property height
- * @type Number
+ * @objType Number
*/
this.height = height;
@@ -20025,7 +20025,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The Canvas object that belongs to this CanvasBuffer.
*
* @property canvas
- * @type HTMLCanvasElement
+ * @objType HTMLCanvasElement
*/
this.canvas = Phaser.CanvasPool.create(this, this.width, this.height);
@@ -20033,7 +20033,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* A CanvasRenderingContext2D object representing a two-dimensional rendering context.
*
* @property context
- * @type CanvasRenderingContext2D
+ * @objType CanvasRenderingContext2D
*/
this.context = this.canvas.getContext("2d");
@@ -20279,10 +20279,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
}
/**
- * The renderer type.
+ * The renderer objType.
*
* @property type
- * @type Number
+ * @objType Number
*/
this.type = Phaser.CANVAS;
@@ -20290,7 +20290,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The resolution of the canvas.
*
* @property resolution
- * @type Number
+ * @objType Number
*/
this.resolution = game.resolution;
@@ -20301,7 +20301,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.
*
* @property clearBeforeRender
- * @type Boolean
+ * @objType Boolean
* @default
*/
this.clearBeforeRender = game.clearBeforeRender;
@@ -20310,7 +20310,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Whether the render view is transparent
*
* @property transparent
- * @type Boolean
+ * @objType Boolean
*/
this.transparent = game.transparent;
@@ -20318,7 +20318,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Whether the render view should be resized automatically
*
* @property autoResize
- * @type Boolean
+ * @objType Boolean
*/
this.autoResize = false;
@@ -20326,7 +20326,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The width of the canvas view
*
* @property width
- * @type Number
+ * @objType Number
* @default 800
*/
this.width = game.width * this.resolution;
@@ -20335,7 +20335,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The height of the canvas view
*
* @property height
- * @type Number
+ * @objType Number
* @default 600
*/
this.height = game.height * this.resolution;
@@ -20344,14 +20344,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The canvas element that everything is drawn to.
*
* @property view
- * @type HTMLCanvasElement
+ * @objType HTMLCanvasElement
*/
this.view = game.canvas;
/**
* The canvas 2d context that everything is drawn with
* @property context
- * @type CanvasRenderingContext2D
+ * @objType CanvasRenderingContext2D
*/
this.context = this.view.getContext("2d", {alpha: this.transparent});
@@ -20359,7 +20359,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Boolean flag controlling canvas refresh.
*
* @property refresh
- * @type Boolean
+ * @objType Boolean
*/
this.refresh = true;
@@ -20367,21 +20367,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Internal var.
*
* @property count
- * @type Number
+ * @objType Number
*/
this.count = 0;
/**
* Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer
* @property CanvasMaskManager
- * @type CanvasMaskManager
+ * @objType CanvasMaskManager
*/
this.maskManager = new PIXI.CanvasMaskManager();
/**
* The render session is just a bunch of parameter used for rendering
* @property renderSession
- * @type Object
+ * @objType Object
*/
this.renderSession = {
context: this.context,
@@ -20570,7 +20570,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The Resolution of the texture.
*
* @property resolution
- * @type Number
+ * @objType Number
*/
this.resolution = resolution || 1;
@@ -20578,7 +20578,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* [read-only] The width of the base texture set when the image has loaded
*
* @property width
- * @type Number
+ * @objType Number
* @readOnly
*/
this.width = 100;
@@ -20587,7 +20587,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* [read-only] The height of the base texture set when the image has loaded
*
* @property height
- * @type Number
+ * @objType Number
* @readOnly
*/
this.height = 100;
@@ -20596,7 +20596,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The scale mode to apply when scaling this texture
*
* @property scaleMode
- * @type {Number}
+ * @objType {Number}
* @default PIXI.scaleModes.LINEAR
*/
this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
@@ -20605,7 +20605,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* [read-only] Set to true once the base texture has loaded
*
* @property hasLoaded
- * @type Boolean
+ * @objType Boolean
* @readOnly
*/
this.hasLoaded = false;
@@ -20614,7 +20614,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The image source that is used to create the texture.
*
* @property source
- * @type Image
+ * @objType Image
*/
this.source = source;
@@ -20622,7 +20622,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)
*
* @property premultipliedAlpha
- * @type Boolean
+ * @objType Boolean
* @default true
*/
this.premultipliedAlpha = true;
@@ -20631,7 +20631,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @property _glTextures
- * @type Array
+ * @objType Array
* @private
*/
this._glTextures = [];
@@ -20641,20 +20641,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Also the texture must be a power of two size to work
*
* @property mipmap
- * @type {Boolean}
+ * @objType {Boolean}
*/
this.mipmap = false;
/**
* The multi texture batching index number.
* @property textureIndex
- * @type Number
+ * @objType Number
*/
this.textureIndex = 0;
/**
* @property _dirty
- * @type Array
+ * @objType Array
* @private
*/
this._dirty = [true, true, true, true];
@@ -20677,13 +20677,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* that has children that you do want to render, without causing a batch flush in the process.
*
* @property skipRender
- * @type Boolean
+ * @objType Boolean
*/
this.skipRender = false;
/**
* @property _powerOf2
- * @type Boolean
+ * @objType Boolean
* @private
*/
this._powerOf2 = false;
@@ -20803,7 +20803,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* If `true` then {@link PIXI.Texture#setFrame} will no longer throw an error if the texture dimensions are incorrect.
* Instead {@link PIXI.Texture#valid} will be set to `false` (#1556)
*
- * @type {boolean}
+ * @objType {boolean}
*/
PIXI.TextureSilentFail = false;
@@ -20823,7 +20823,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Does this Texture have any frame data assigned to it?
*
* @property noFrame
- * @type Boolean
+ * @objType Boolean
*/
this.noFrame = false;
@@ -20840,7 +20840,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The base texture that this texture uses.
*
* @property baseTexture
- * @type BaseTexture
+ * @objType BaseTexture
*/
this.baseTexture = baseTexture;
@@ -20848,7 +20848,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The frame specifies the region of the base texture that this texture uses
*
* @property frame
- * @type Rectangle
+ * @objType Rectangle
*/
this.frame = frame;
@@ -20856,7 +20856,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The texture trim data.
*
* @property trim
- * @type Rectangle
+ * @objType Rectangle
*/
this.trim = trim;
@@ -20864,7 +20864,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
*
* @property valid
- * @type Boolean
+ * @objType Boolean
*/
this.valid = false;
@@ -20872,7 +20872,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Is this a tiling texture? As used by the likes of a TilingSprite.
*
* @property isTiling
- * @type Boolean
+ * @objType Boolean
*/
this.isTiling = false;
@@ -20880,7 +20880,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)
*
* @property requiresUpdate
- * @type Boolean
+ * @objType Boolean
*/
this.requiresUpdate = false;
@@ -20888,7 +20888,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* This will let a renderer know that a tinted parent has updated its texture.
*
* @property requiresReTint
- * @type Boolean
+ * @objType Boolean
*/
this.requiresReTint = false;
@@ -20896,7 +20896,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The WebGL UV data cache.
*
* @property _uvs
- * @type Object
+ * @objType Object
* @private
*/
this._uvs = null;
@@ -20905,7 +20905,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The width of the Texture in pixels.
*
* @property width
- * @type Number
+ * @objType Number
*/
this.width = 0;
@@ -20913,7 +20913,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The height of the Texture in pixels.
*
* @property height
- * @type Number
+ * @objType Number
*/
this.height = 0;
@@ -20922,7 +20922,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
*
* @property crop
- * @type Rectangle
+ * @objType Rectangle
*/
this.crop = crop || new PIXI.Rectangle(0, 0, 1, 1);
@@ -20932,7 +20932,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* Sprite rotation.
*
* @property rotated
- * @type Boolean
+ * @objType Boolean
*/
this.rotated = false;
@@ -21141,469 +21141,469 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The Phaser version number.
* @constant Phaser.VERSION
- * @type {string}
+ * @objType {string}
*/
VERSION: '2.9.1',
/**
* An array of Phaser game instances.
* @constant Phaser.GAMES
- * @type {array}
+ * @objType {array}
*/
GAMES: [],
/**
* AUTO renderer - picks between WebGL or Canvas based on device.
* @constant Phaser.AUTO
- * @type {integer}
+ * @objType {integer}
*/
AUTO: 0,
/**
* Canvas Renderer.
* @constant Phaser.CANVAS
- * @type {integer}
+ * @objType {integer}
*/
CANVAS: 1,
/**
* WebGL Renderer.
* @constant Phaser.WEBGL
- * @type {integer}
+ * @objType {integer}
*/
WEBGL: 2,
/**
* Headless renderer (not visual output)
* @constant Phaser.HEADLESS
- * @type {integer}
+ * @objType {integer}
*/
HEADLESS: 3,
/**
* WebGL Renderer with MultiTexture support enabled.
* @constant Phaser.WEBGL_MULTI
- * @type {integer}
+ * @objType {integer}
*/
WEBGL_MULTI: 4,
/**
* Direction constant.
* @constant Phaser.NONE
- * @type {integer}
+ * @objType {integer}
*/
NONE: 0,
/**
* Direction constant.
* @constant Phaser.LEFT
- * @type {integer}
+ * @objType {integer}
*/
LEFT: 1,
/**
* Direction constant.
* @constant Phaser.RIGHT
- * @type {integer}
+ * @objType {integer}
*/
RIGHT: 2,
/**
* Direction constant.
* @constant Phaser.UP
- * @type {integer}
+ * @objType {integer}
*/
UP: 3,
/**
* Direction constant.
* @constant Phaser.DOWN
- * @type {integer}
+ * @objType {integer}
*/
DOWN: 4,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.SPRITE
- * @type {integer}
+ * @objType {integer}
*/
SPRITE: 0,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.BUTTON
- * @type {integer}
+ * @objType {integer}
*/
BUTTON: 1,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.IMAGE
- * @type {integer}
+ * @objType {integer}
*/
IMAGE: 2,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.GRAPHICS
- * @type {integer}
+ * @objType {integer}
*/
GRAPHICS: 3,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.TEXT
- * @type {integer}
+ * @objType {integer}
*/
TEXT: 4,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.TILESPRITE
- * @type {integer}
+ * @objType {integer}
*/
TILESPRITE: 5,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.BITMAPTEXT
- * @type {integer}
+ * @objType {integer}
*/
BITMAPTEXT: 6,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.GROUP
- * @type {integer}
+ * @objType {integer}
*/
GROUP: 7,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.RENDERTEXTURE
- * @type {integer}
+ * @objType {integer}
*/
RENDERTEXTURE: 8,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.TILEMAP
- * @type {integer}
+ * @objType {integer}
*/
TILEMAP: 9,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.TILEMAPLAYER
- * @type {integer}
+ * @objType {integer}
*/
TILEMAPLAYER: 10,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.EMITTER
- * @type {integer}
+ * @objType {integer}
*/
EMITTER: 11,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.POLYGON
- * @type {integer}
+ * @objType {integer}
*/
POLYGON: 12,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.BITMAPDATA
- * @type {integer}
+ * @objType {integer}
*/
BITMAPDATA: 13,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.CANVAS_FILTER
- * @type {integer}
+ * @objType {integer}
*/
CANVAS_FILTER: 14,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.WEBGL_FILTER
- * @type {integer}
+ * @objType {integer}
*/
WEBGL_FILTER: 15,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.ELLIPSE
- * @type {integer}
+ * @objType {integer}
*/
ELLIPSE: 16,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.SPRITEBATCH
- * @type {integer}
+ * @objType {integer}
*/
SPRITEBATCH: 17,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.RETROFONT
- * @type {integer}
+ * @objType {integer}
*/
RETROFONT: 18,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.POINTER
- * @type {integer}
+ * @objType {integer}
*/
POINTER: 19,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.ROPE
- * @type {integer}
+ * @objType {integer}
*/
ROPE: 20,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.CIRCLE
- * @type {integer}
+ * @objType {integer}
*/
CIRCLE: 21,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.RECTANGLE
- * @type {integer}
+ * @objType {integer}
*/
RECTANGLE: 22,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.LINE
- * @type {integer}
+ * @objType {integer}
*/
LINE: 23,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.MATRIX
- * @type {integer}
+ * @objType {integer}
*/
MATRIX: 24,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.POINT
- * @type {integer}
+ * @objType {integer}
*/
POINT: 25,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.ROUNDEDRECTANGLE
- * @type {integer}
+ * @objType {integer}
*/
ROUNDEDRECTANGLE: 26,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.CREATURE
- * @type {integer}
+ * @objType {integer}
*/
CREATURE: 27,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.VIDEO
- * @type {integer}
+ * @objType {integer}
*/
VIDEO: 28,
/**
- * Game Object type.
+ * Game Object objType.
* @constant Phaser.PENDING_ATLAS
- * @type {integer}
+ * @objType {integer}
*/
PENDING_ATLAS: -1,
/**
* A horizontal orientation
* @constant Phaser.HORIZONTAL
- * @type {integer}
+ * @objType {integer}
*/
HORIZONTAL: 0,
/**
* A vertical orientation
* @constant Phaser.VERTICAL
- * @type {integer}
+ * @objType {integer}
*/
VERTICAL: 1,
/**
* A landscape orientation
* @constant Phaser.LANDSCAPE
- * @type {integer}
+ * @objType {integer}
*/
LANDSCAPE: 0,
/**
* A portrait orientation
* @constant Phaser.PORTRAIT
- * @type {integer}
+ * @objType {integer}
*/
PORTRAIT: 1,
/**
* The Angle (in degrees) a Game Object needs to be set to in order to face up.
* @constant Phaser.ANGLE_UP
- * @type {integer}
+ * @objType {integer}
*/
ANGLE_UP: 270,
/**
* The Angle (in degrees) a Game Object needs to be set to in order to face down.
* @constant Phaser.ANGLE_DOWN
- * @type {integer}
+ * @objType {integer}
*/
ANGLE_DOWN: 90,
/**
* The Angle (in degrees) a Game Object needs to be set to in order to face left.
* @constant Phaser.ANGLE_LEFT
- * @type {integer}
+ * @objType {integer}
*/
ANGLE_LEFT: 180,
/**
* The Angle (in degrees) a Game Object needs to be set to in order to face right.
* @constant Phaser.ANGLE_RIGHT
- * @type {integer}
+ * @objType {integer}
*/
ANGLE_RIGHT: 0,
/**
* The Angle (in degrees) a Game Object needs to be set to in order to face north east.
* @constant Phaser.ANGLE_NORTH_EAST
- * @type {integer}
+ * @objType {integer}
*/
ANGLE_NORTH_EAST: 315,
/**
* The Angle (in degrees) a Game Object needs to be set to in order to face north west.
* @constant Phaser.ANGLE_NORTH_WEST
- * @type {integer}
+ * @objType {integer}
*/
ANGLE_NORTH_WEST: 225,
/**
* The Angle (in degrees) a Game Object needs to be set to in order to face south east.
* @constant Phaser.ANGLE_SOUTH_EAST
- * @type {integer}
+ * @objType {integer}
*/
ANGLE_SOUTH_EAST: 45,
/**
* The Angle (in degrees) a Game Object needs to be set to in order to face south west.
* @constant Phaser.ANGLE_SOUTH_WEST
- * @type {integer}
+ * @objType {integer}
*/
ANGLE_SOUTH_WEST: 135,
/**
* A constant representing a top-left alignment or position.
* @constant Phaser.TOP_LEFT
- * @type {integer}
+ * @objType {integer}
*/
TOP_LEFT: 0,
/**
* A constant representing a top-center alignment or position.
* @constant Phaser.TOP_CENTER
- * @type {integer}
+ * @objType {integer}
*/
TOP_CENTER: 1,
/**
* A constant representing a top-right alignment or position.
* @constant Phaser.TOP_RIGHT
- * @type {integer}
+ * @objType {integer}
*/
TOP_RIGHT: 2,
/**
* A constant representing a left-top alignment or position.
* @constant Phaser.Phaser.LEFT_TOP
- * @type {integer}
+ * @objType {integer}
*/
LEFT_TOP: 3,
/**
* A constant representing a left-center alignment or position.
* @constant Phaser.LEFT_TOP
- * @type {integer}
+ * @objType {integer}
*/
LEFT_CENTER: 4,
/**
* A constant representing a left-bottom alignment or position.
* @constant Phaser.LEFT_BOTTOM
- * @type {integer}
+ * @objType {integer}
*/
LEFT_BOTTOM: 5,
/**
* A constant representing a center alignment or position.
* @constant Phaser.CENTER
- * @type {integer}
+ * @objType {integer}
*/
CENTER: 6,
/**
* A constant representing a right-top alignment or position.
* @constant Phaser.RIGHT_TOP
- * @type {integer}
+ * @objType {integer}
*/
RIGHT_TOP: 7,
/**
* A constant representing a right-center alignment or position.
* @constant Phaser.RIGHT_CENTER
- * @type {integer}
+ * @objType {integer}
*/
RIGHT_CENTER: 8,
/**
* A constant representing a right-bottom alignment or position.
* @constant Phaser.RIGHT_BOTTOM
- * @type {integer}
+ * @objType {integer}
*/
RIGHT_BOTTOM: 9,
/**
* A constant representing a bottom-left alignment or position.
* @constant Phaser.BOTTOM_LEFT
- * @type {integer}
+ * @objType {integer}
*/
BOTTOM_LEFT: 10,
/**
* A constant representing a bottom-center alignment or position.
* @constant Phaser.BOTTOM_CENTER
- * @type {integer}
+ * @objType {integer}
*/
BOTTOM_CENTER: 11,
/**
* A constant representing a bottom-right alignment or position.
* @constant Phaser.BOTTOM_RIGHT
- * @type {integer}
+ * @objType {integer}
*/
BOTTOM_RIGHT: 12,
@@ -22380,7 +22380,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
}
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.CIRCLE;
@@ -23026,7 +23026,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.height = height;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.ELLIPSE;
@@ -23379,7 +23379,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.end = new Phaser.Point(x2, y2);
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.LINE;
@@ -24220,7 +24220,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.ty = ty;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.MATRIX;
@@ -24570,7 +24570,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.y = y;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.POINT;
@@ -25654,7 +25654,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.flattened = false;
/**
- * @property {number} type - The base object type.
+ * @property {number} objType - The base object objType.
*/
this.type = Phaser.POLYGON;
@@ -25810,7 +25810,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
var y0 = Number.MAX_VALUE;
- // Allows for mixed-type arguments
+ // Allows for mixed-objType arguments
for (var i = 0, len = points.length; i < len; i++) {
if (typeof points[i] === 'number') {
var p = new PIXI.Point(points[i], points[i + 1]);
@@ -25905,7 +25905,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
});
-// Because PIXI uses its own type, we'll replace it with ours to avoid duplicating code or confusion.
+// Because PIXI uses its own objType, we'll replace it with ours to avoid duplicating code or confusion.
PIXI.Polygon = Phaser.Polygon;
/**
@@ -25953,7 +25953,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.height = height;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.RECTANGLE;
@@ -27090,7 +27090,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.radius = radius || 20;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.ROUNDEDRECTANGLE;
@@ -27143,7 +27143,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
Phaser.RoundedRectangle.prototype.constructor = Phaser.RoundedRectangle;
-// Because PIXI uses its own type, we'll replace it with ours to avoid duplicating code or confusion.
+// Because PIXI uses its own objType, we'll replace it with ours to avoid duplicating code or confusion.
PIXI.RoundedRectangle = Phaser.RoundedRectangle;
/**
@@ -27323,7 +27323,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this._fxDuration = 0;
/**
- * @property {number} _fxType - The FX type running.
+ * @property {number} _fxType - The FX objType running.
* @private
*/
this._fxType = 0;
@@ -27340,7 +27340,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* A follow style that uses no deadzone.
*
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Camera.FOLLOW_LOCKON = 0;
@@ -27348,7 +27348,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* A follow style that uses a tall, narrow deadzone (0.33 x 0.125) with a center slightly above the view center.
*
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Camera.FOLLOW_PLATFORMER = 1;
@@ -27356,7 +27356,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* A follow style that uses a square deadzone (0.25 of the larger view edge).
*
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Camera.FOLLOW_TOPDOWN = 2;
@@ -27364,31 +27364,31 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* A follow style that uses a small square deadzone (0.125 of the larger view edge).
*
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Camera.FOLLOW_TOPDOWN_TIGHT = 3;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Camera.SHAKE_BOTH = 4;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Camera.SHAKE_HORIZONTAL = 5;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Camera.SHAKE_VERTICAL = 6;
/**
* @constant
- * @type {boolean}
+ * @objType {boolean}
*/
Phaser.Camera.ENABLE_FX = true;
@@ -27430,7 +27430,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Tell the camera which sprite to follow.
*
- * You can set the follow type and a linear interpolation value.
+ * You can set the follow objType and a linear interpolation value.
* Use low lerp values (such as 0.1) to automatically smooth the camera motion.
*
* If you find you're getting a slight "jitter" effect when following a Sprite it's probably to do with sub-pixel rendering of the Sprite position.
@@ -29845,15 +29845,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The default uniforms, types and values for all Filters are:
*
* ```javascript
- * resolution: { type: '2f', value: { x: 256, y: 256 }}
- * time: { type: '1f', value: 0 }
- * mouse: { type: '2f', value: { x: 0.0, y: 0.0 } }
- * date: { type: '4fv', value: [ d.getFullYear(), d.getMonth(), d.getDate(), d.getHours() *60 * 60 + d.getMinutes() * 60 + d.getSeconds() ] }
- * sampleRate: { type: '1f', value: 44100.0 }
- * iChannel0: { type: 'sampler2D', value: null, textureData: { repeat: true } }
- * iChannel1: { type: 'sampler2D', value: null, textureData: { repeat: true } }
- * iChannel2: { type: 'sampler2D', value: null, textureData: { repeat: true } }
- * iChannel3: { type: 'sampler2D', value: null, textureData: { repeat: true } }
+ * resolution: { objType: '2f', value: { x: 256, y: 256 }}
+ * time: { objType: '1f', value: 0 }
+ * mouse: { objType: '2f', value: { x: 0.0, y: 0.0 } }
+ * date: { objType: '4fv', value: [ d.getFullYear(), d.getMonth(), d.getDate(), d.getHours() *60 * 60 + d.getMinutes() * 60 + d.getSeconds() ] }
+ * sampleRate: { objType: '1f', value: 44100.0 }
+ * iChannel0: { objType: 'sampler2D', value: null, textureData: { repeat: true } }
+ * iChannel1: { objType: 'sampler2D', value: null, textureData: { repeat: true } }
+ * iChannel2: { objType: 'sampler2D', value: null, textureData: { repeat: true } }
+ * iChannel3: { objType: 'sampler2D', value: null, textureData: { repeat: true } }
* ```
*
* The vast majority of filters (including all of those that ship with Phaser) use fragment shaders, and
@@ -29873,7 +29873,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.game = game;
/**
- * @property {number} type - The const type of this object, either Phaser.WEBGL_FILTER or Phaser.CANVAS_FILTER.
+ * @property {number} objType - The const objType of this object, either Phaser.WEBGL_FILTER or Phaser.CANVAS_FILTER.
* @default
*/
this.type = Phaser.WEBGL_FILTER;
@@ -30829,7 +30829,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* - `visibilitychange` (visible) and CocoonJS's `onActivated` {@link Phaser.Game#gameResumed resume the game} unless {@link #disableVisibilityChange} is on.
*
* @method Phaser.Stage#visibilityChange
- * @param {Event} event - Its type will be used to decide whether the game should be paused or not.
+ * @param {Event} event - Its objType will be used to decide whether the game should be paused or not.
*/
Phaser.Stage.prototype.visibilityChange = function (event) {
@@ -30982,8 +30982,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* If undefined/unspecified the Group will be added to the {@link Phaser.Game#world Game World}; if null the Group will not be added to any parent.
* @param {string} [name='group'] - A name for this group. Not used internally but useful for debugging.
* @param {boolean} [addToStage=false] - If true this group will be added directly to the Game.Stage instead of Game.World.
- * @param {boolean} [enableBody=false] - If true all Sprites created with {@link #create} or {@link #createMulitple} will have a physics body created on them. Change the body type with {@link #physicsBodyType}.
- * @param {integer} [physicsBodyType=0] - The physics body type to use when physics bodies are automatically added. See {@link #physicsBodyType} for values.
+ * @param {boolean} [enableBody=false] - If true all Sprites created with {@link #create} or {@link #createMulitple} will have a physics body created on them. Change the body objType with {@link #physicsBodyType}.
+ * @param {integer} [physicsBodyType=0] - The physics body objType to use when physics bodies are automatically added. See {@link #physicsBodyType} for values.
*/
Phaser.Group = function (game, parent, name, addToStage, enableBody, physicsBodyType) {
@@ -31037,13 +31037,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Internal Phaser Type value.
- * @property {integer} type
+ * @property {integer} objType
* @protected
*/
this.type = Phaser.GROUP;
/**
- * @property {number} physicsType - The const physics body type of this object.
+ * @property {number} physicsType - The const physics body objType of this object.
* @readonly
*/
this.physicsType = Phaser.GROUP;
@@ -31082,7 +31082,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.pendingDestroy = false;
/**
- * The type of objects that will be created when using {@link #create} or {@link #createMultiple}.
+ * The objType of objects that will be created when using {@link #create} or {@link #createMultiple}.
*
* It should extend either Sprite or Image and accept the same constructor arguments: `(game, x, y, key, frame)`.
*
@@ -31172,7 +31172,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
*
* If there are children already in the Group at the time you set this property, they are not changed.
*
- * The default body type is controlled with {@link #physicsBodyType}.
+ * The default body objType is controlled with {@link #physicsBodyType}.
* @property {boolean} enableBody
*/
this.enableBody = enableBody;
@@ -31187,7 +31187,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.enableBodyDebug = false;
/**
- * If {@link #enableBody} is true this is the type of physics body that is created on new Sprites.
+ * If {@link #enableBody} is true this is the objType of physics body that is created on new Sprites.
*
* The valid values are {@link Phaser.Physics.ARCADE}, {@link Phaser.Physics.P2JS}, {@link Phaser.Physics.NINJA}, etc.
* @property {integer} physicsBodyType
@@ -31269,42 +31269,42 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* A returnType value, as specified in {@link #iterate} eg.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Group.RETURN_NONE = 0;
/**
* A returnType value, as specified in {@link #iterate} eg.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Group.RETURN_TOTAL = 1;
/**
* A returnType value, as specified in {@link #iterate} eg.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Group.RETURN_CHILD = 2;
/**
* A returnType value, as specified in {@link #iterate} eg.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Group.RETURN_ALL = 3;
/**
* A sort ordering value, as specified in {@link #sort} eg.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Group.SORT_ASCENDING = -1;
/**
* A sort ordering value, as specified in {@link #sort} eg.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Group.SORT_DESCENDING = 1;
@@ -31498,7 +31498,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Creates a new Phaser.Sprite object and adds it to the top of this group.
*
- * Use {@link #classType} to change the type of object created.
+ * Use {@link #classType} to change the objType of object created.
*
* The child is automatically added to the top of the group, and is displayed above every previous child.
*
@@ -31539,7 +31539,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
*
* This method is useful if you need to quickly generate a pool of sprites, such as bullets.
*
- * Use {@link #classType} to change the type of object created.
+ * Use {@link #classType} to change the objType of object created.
*
* You can provide an array as the `key` and / or `frame` arguments. When you do this
* it will create `quantity` Sprites for every key (and frame) in the arrays.
@@ -34651,7 +34651,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* Has support for Multiple bound Textures in WebGL been enabled? This is a read-only property.
- * To set it you need to either specify `Phaser.WEBGL_MULTI` as the renderer type, or use the Game
+ * To set it you need to either specify `Phaser.WEBGL_MULTI` as the renderer objType, or use the Game
* Configuration object with the property `multiTexture` set to true. It has to be enabled before
* Pixi boots, and cannot be changed after the game is running. Once enabled, take advantage of it
* via the `game.renderer.setTexturePriority` method.
@@ -35806,7 +35806,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* When enabled, input (eg. Keyboard, Mouse, Touch) will be processed - as long as the individual sources are enabled themselves.
*
- * When not enabled, _all_ input sources are ignored. To disable just one type of input; for example, the Mouse, use `input.mouse.enabled = false`.
+ * When not enabled, _all_ input sources are ignored. To disable just one objType of input; for example, the Mouse, use `input.mouse.enabled = false`.
* @property {boolean} enabled
* @default
*/
@@ -36127,26 +36127,26 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Input.MOUSE_OVERRIDES_TOUCH = 0;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Input.TOUCH_OVERRIDES_MOUSE = 1;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Input.MOUSE_TOUCH_COMBINE = 2;
/**
* The maximum number of pointers that can be added. This excludes the mouse pointer.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Input.MAX_POINTERS = 10;
@@ -36346,7 +36346,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
},
/**
- * Execute any {@link #touchLockCallbacks} of the given type.
+ * Execute any {@link #touchLockCallbacks} of the given objType.
*
* @method Phaser.Input#executeTouchLockCallbacks
* @private
@@ -37109,49 +37109,49 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Mouse.NO_BUTTON = -1;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Mouse.LEFT_BUTTON = 0;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Mouse.MIDDLE_BUTTON = 1;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Mouse.RIGHT_BUTTON = 2;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Mouse.BACK_BUTTON = 3;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Mouse.FORWARD_BUTTON = 4;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Mouse.WHEEL_UP = 1;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Mouse.WHEEL_DOWN = -1;
@@ -38439,7 +38439,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.id = id;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.POINTER;
@@ -38776,28 +38776,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* No buttons at all.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Pointer.NO_BUTTON = 0;
/**
* The Left Mouse button, or in PointerEvent devices a Touch contact or Pen contact.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Pointer.LEFT_BUTTON = 1;
/**
* The Right Mouse button, or in PointerEvent devices a Pen contact with a barrel button.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Pointer.RIGHT_BUTTON = 2;
/**
* The Middle Mouse button.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Pointer.MIDDLE_BUTTON = 4;
@@ -38805,7 +38805,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The X1 button. This is typically the mouse Back button, but is often reconfigured.
* On Linux (GTK) this is unsupported. On Windows if advanced pointer software (such as IntelliPoint) is installed this doesn't register.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Pointer.BACK_BUTTON = 8;
@@ -38813,14 +38813,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* The X2 button. This is typically the mouse Forward button, but is often reconfigured.
* On Linux (GTK) this is unsupported. On Windows if advanced pointer software (such as IntelliPoint) is installed this doesn't register.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Pointer.FORWARD_BUTTON = 16;
/**
* The Eraser pen button on PointerEvent supported devices only.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Pointer.ERASER_BUTTON = 32;
@@ -44746,7 +44746,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
};
/**
- * @property {boolean} skipTypeChecks - Skip type checks in {@link #init}.
+ * @property {boolean} skipTypeChecks - Skip objType checks in {@link #init}.
* @static
* @default
*/
@@ -47295,8 +47295,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default.
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
- * @param {boolean} [enableBody=false] - If true all Sprites created with `Group.create` or `Group.createMulitple` will have a physics body created on them. Change the body type with physicsBodyType.
- * @param {number} [physicsBodyType=0] - If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.
+ * @param {boolean} [enableBody=false] - If true all Sprites created with `Group.create` or `Group.createMulitple` will have a physics body created on them. Change the body objType with physicsBodyType.
+ * @param {number} [physicsBodyType=0] - If enableBody is true this is the objType of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.
* @return {Phaser.Group} The newly created Group.
*/
group: function (parent, name, addToStage, enableBody, physicsBodyType) {
@@ -47312,7 +47312,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* are automatically given a physics body.
*
* @method Phaser.GameObjectFactory#physicsGroup
- * @param {number} [physicsBodyType=Phaser.Physics.ARCADE] - If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2JS, Phaser.Physics.NINJA, etc.
+ * @param {number} [physicsBodyType=Phaser.Physics.ARCADE] - If enableBody is true this is the objType of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2JS, Phaser.Physics.NINJA, etc.
* @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default.
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
@@ -47822,8 +47822,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
* @param {any} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
- * @param {boolean} [enableBody=false] - If true all Sprites created with `Group.create` or `Group.createMulitple` will have a physics body created on them. Change the body type with physicsBodyType.
- * @param {number} [physicsBodyType=0] - If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.
+ * @param {boolean} [enableBody=false] - If true all Sprites created with `Group.create` or `Group.createMulitple` will have a physics body created on them. Change the body objType with physicsBodyType.
+ * @param {number} [physicsBodyType=0] - If enableBody is true this is the objType of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.
* @return {Phaser.Group} The newly created Group.
*/
group: function (parent, name, addToStage, enableBody, physicsBodyType) {
@@ -48224,13 +48224,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
frame = frame || null;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
- this.type = Phaser.SPRITE;
+ this.objType = Phaser.SPRITE;
/**
- * @property {number} physicsType - The const physics body type of this object.
+ * @property {number} physicsType - The const physics body objType of this object.
* @readonly
*/
this.physicsType = Phaser.SPRITE;
@@ -48333,7 +48333,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
frame = frame || null;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.IMAGE;
@@ -48392,7 +48392,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
*/
/**
- * Create a new `Button` object. A Button is a special type of Sprite that is set-up to handle Pointer events automatically.
+ * Create a new `Button` object. A Button is a special objType of Sprite that is set-up to handle Pointer events automatically.
*
* The four states a Button responds to are:
*
@@ -48431,13 +48431,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/**
* The Phaser Object Type.
- * @property {number} type
+ * @property {number} objType
* @readonly
*/
this.type = Phaser.BUTTON;
/**
- * @property {number} physicsType - The const physics body type of this object.
+ * @property {number} physicsType - The const physics body objType of this object.
* @readonly
*/
this.physicsType = Phaser.SPRITE;
@@ -48974,7 +48974,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
Phaser.Group.call(this, game, parent, name, addToStage);
/**
- * @property {number} type - Internal Phaser Type value.
+ * @property {number} objType - Internal Phaser Type value.
* @protected
*/
this.type = Phaser.SPRITEBATCH;
@@ -49267,7 +49267,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.texture.frame = this.textureFrame;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @default
*/
this.type = Phaser.BITMAPDATA;
@@ -50761,7 +50761,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
this.copyTransform(child, blendMode, roundPx);
}
- if (child.type === Phaser.GROUP && child.exists) {
+ if (child.objType === Phaser.GROUP && child.exists) {
this.drawGroup(child, blendMode, roundPx);
}
else {
@@ -50805,8 +50805,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
return this;
}
- if (parent.type !== Phaser.GROUP && parent.type !== Phaser.EMITTER && parent.type !== Phaser.BITMAPTEXT) {
- if (parent.type === Phaser.GRAPHICS) {
+ if (parent.objType !== Phaser.GROUP && parent.objType !== Phaser.EMITTER && parent.objType !== Phaser.BITMAPTEXT) {
+ if (parent.objType === Phaser.GRAPHICS) {
var bounds = parent.getBounds();
this.ctx.save();
this.ctx.translate(bounds.x, bounds.y);
@@ -52272,7 +52272,7 @@ THIS SOFTWARE.
/**
* The number of points beyond which Pixi swaps to using the Stencil Buffer to render the Graphics.
*
- * @type {number}
+ * @objType {number}
*/
PIXI.WebGLGraphics.stencilBufferLimit = 6;
@@ -53465,7 +53465,7 @@ THIS SOFTWARE.
this.shape = shape;
/*
- * @member {number} The type of the shape, see the Const.Shapes file for all the existing types,
+ * @member {number} The objType of the shape, see the Const.Shapes file for all the existing types,
*/
this.type = shape.type;
@@ -53551,13 +53551,13 @@ THIS SOFTWARE.
}
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @default
*/
this.type = Phaser.GRAPHICS;
/**
- * @property {number} physicsType - The const physics body type of this object.
+ * @property {number} physicsType - The const physics body objType of this object.
* @readonly
*/
this.physicsType = Phaser.SPRITE;
@@ -53576,7 +53576,7 @@ THIS SOFTWARE.
* The alpha value used when filling the Graphics object.
*
* @property fillAlpha
- * @type Number
+ * @objType Number
*/
this.fillAlpha = 1;
@@ -53584,7 +53584,7 @@ THIS SOFTWARE.
* The width (thickness) of any lines drawn.
*
* @property lineWidth
- * @type Number
+ * @objType Number
*/
this.lineWidth = 0;
@@ -53592,7 +53592,7 @@ THIS SOFTWARE.
* The color of any lines drawn.
*
* @property lineColor
- * @type String
+ * @objType String
* @default 0
*/
this.lineColor = 0;
@@ -53601,7 +53601,7 @@ THIS SOFTWARE.
* Graphics data
*
* @property graphicsData
- * @type Array
+ * @objType Array
* @private
*/
this.graphicsData = [];
@@ -53610,7 +53610,7 @@ THIS SOFTWARE.
* The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.
*
* @property tint
- * @type Number
+ * @objType Number
* @default 0xFFFFFF
*/
this.tint = 0xFFFFFF;
@@ -53619,7 +53619,7 @@ THIS SOFTWARE.
* The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.
*
* @property blendMode
- * @type Number
+ * @objType Number
* @default PIXI.blendModes.NORMAL;
*/
this.blendMode = PIXI.blendModes.NORMAL;
@@ -53628,7 +53628,7 @@ THIS SOFTWARE.
* Current path
*
* @property currentPath
- * @type Object
+ * @objType Object
* @private
*/
this.currentPath = null;
@@ -53637,7 +53637,7 @@ THIS SOFTWARE.
* Array containing some WebGL-related properties used by the WebGL renderer.
*
* @property _webGL
- * @type Array
+ * @objType Array
* @private
*/
this._webGL = [];
@@ -53646,7 +53646,7 @@ THIS SOFTWARE.
* Whether this shape is being used as a mask.
*
* @property isMask
- * @type Boolean
+ * @objType Boolean
*/
this.isMask = false;
@@ -53654,7 +53654,7 @@ THIS SOFTWARE.
* The bounds' padding used for bounds calculation.
*
* @property boundsPadding
- * @type Number
+ * @objType Number
*/
this.boundsPadding = 0;
@@ -53664,7 +53664,7 @@ THIS SOFTWARE.
* Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.
*
* @property dirty
- * @type Boolean
+ * @objType Boolean
* @private
*/
this.dirty = true;
@@ -53674,7 +53674,7 @@ THIS SOFTWARE.
* If this is set to true then the updateLocalBounds is called once in the postUpdate method.
*
* @property _boundsDirty
- * @type Boolean
+ * @objType Boolean
* @private
*/
this._boundsDirty = false;
@@ -53683,7 +53683,7 @@ THIS SOFTWARE.
* Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.
*
* @property webGLDirty
- * @type Boolean
+ * @objType Boolean
* @private
*/
this.webGLDirty = false;
@@ -53692,7 +53692,7 @@ THIS SOFTWARE.
* Used to detect if the cached sprite object needs to be updated.
*
* @property cachedSpriteDirty
- * @type Boolean
+ * @objType Boolean
* @private
*/
this.cachedSpriteDirty = false;
@@ -54913,7 +54913,7 @@ THIS SOFTWARE.
this.currentPath = null;
- // Handle mixed-type polygons
+ // Handle mixed-objType polygons
if (shape instanceof Phaser.Polygon) {
shape = shape.clone();
shape.flatten();
@@ -54942,7 +54942,7 @@ THIS SOFTWARE.
* This is not recommended if you are constantly redrawing the graphics element.
*
* @property cacheAsBitmap
- * @type Boolean
+ * @objType Boolean
* @default false
* @private
*/
@@ -55026,7 +55026,7 @@ THIS SOFTWARE.
this.key = key;
/**
- * @property {number} type - Base Phaser object type.
+ * @property {number} objType - Base Phaser object objType.
*/
this.type = Phaser.RENDERTEXTURE;
@@ -55048,7 +55048,7 @@ THIS SOFTWARE.
* The base texture object that this texture uses
*
* @property baseTexture
- * @type BaseTexture
+ * @objType BaseTexture
*/
this.baseTexture = new PIXI.BaseTexture();
this.baseTexture.width = this.width * this.resolution;
@@ -55066,7 +55066,7 @@ THIS SOFTWARE.
* The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.
*
* @property renderer
- * @type CanvasRenderer|WebGLRenderer
+ * @objType CanvasRenderer|WebGLRenderer
*/
this.renderer = renderer;
@@ -55087,7 +55087,7 @@ THIS SOFTWARE.
/**
* @property valid
- * @type Boolean
+ * @objType Boolean
*/
this.valid = true;
@@ -55413,7 +55413,7 @@ THIS SOFTWARE.
/**
* Create a new game object for displaying Text.
*
- * This uses a local hidden Canvas object and renders the type into it. It then makes a texture from this for rendering to the view.
+ * This uses a local hidden Canvas object and renders the objType into it. It then makes a texture from this for rendering to the view.
* Because of this you can only display fonts that are currently loaded and available to the browser: fonts must be pre-loaded.
*
* See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts across mobile browsers.
@@ -55458,13 +55458,13 @@ THIS SOFTWARE.
style = Phaser.Utils.extend({}, style);
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @default
*/
- this.type = Phaser.TEXT;
+ this.objType = Phaser.TEXT;
/**
- * @property {number} physicsType - The const physics body type of this object.
+ * @property {number} physicsType - The const physics body objType of this object.
* @readonly
*/
this.physicsType = Phaser.SPRITE;
@@ -57678,13 +57678,13 @@ THIS SOFTWARE.
PIXI.DisplayObjectContainer.call(this);
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.BITMAPTEXT;
/**
- * @property {number} physicsType - The const physics body type of this object.
+ * @property {number} physicsType - The const physics body objType of this object.
* @readonly
*/
this.physicsType = Phaser.SPRITE;
@@ -58454,7 +58454,7 @@ THIS SOFTWARE.
Phaser.RenderTexture.call(this, game, 100, 100, '', Phaser.scaleModes.NEAREST);
/**
- * @property {number} type - Base Phaser object type.
+ * @property {number} objType - Base Phaser object objType.
*/
this.type = Phaser.RETROFONT;
@@ -58466,98 +58466,98 @@ THIS SOFTWARE.
/**
* Align each line of multi-line text to the left.
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.ALIGN_LEFT = "left";
/**
* Align each line of multi-line text to the right.
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.ALIGN_RIGHT = "right";
/**
* Align each line of multi-line text in the center.
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.ALIGN_CENTER = "center";
/**
* Text Set 1 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET1 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
/**
* Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET2 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ";
/**
* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ";
/**
* Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789";
/**
* Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789";
/**
* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.'
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET6 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ";
/**
* Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET7 = "AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39";
/**
* Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET8 = "0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ";
/**
* Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?!
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET9 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!";
/**
* Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET10 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
/**
* Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.RetroFont.TEXT_SET11 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789";
@@ -58918,7 +58918,7 @@ THIS SOFTWARE.
frame = frame || null;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.ROPE;
@@ -58955,7 +58955,7 @@ THIS SOFTWARE.
* Whether the strip is dirty or not
*
* @property dirty
- * @type Boolean
+ * @objType Boolean
*/
this.dirty = true;
@@ -58963,7 +58963,7 @@ THIS SOFTWARE.
* Triangles in canvas mode are automatically antialiased, use this value to force triangles to overlap a bit with each other.
*
* @property canvasPadding
- * @type Number
+ * @objType Number
*/
this.canvasPadding = 0;
@@ -59741,13 +59741,13 @@ THIS SOFTWARE.
PIXI.Sprite.call(this, new PIXI.Texture(Phaser.Cache.DEFAULT.baseTexture), width, height);
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @readonly
*/
this.type = Phaser.TILESPRITE;
/**
- * @property {number} physicsType - The const physics body type of this object.
+ * @property {number} physicsType - The const physics body objType of this object.
* @readonly
*/
this.physicsType = Phaser.SPRITE;
@@ -60333,7 +60333,7 @@ THIS SOFTWARE.
* The width of the sprite, setting this will actually modify the scale to achieve the value set
*
* @property width
- * @type Number
+ * @objType Number
*/
Object.defineProperty(Phaser.TileSprite.prototype, 'width', {
@@ -60355,7 +60355,7 @@ THIS SOFTWARE.
* The height of the TilingSprite, setting this will actually modify the scale to achieve the value set
*
* @property height
- * @type Number
+ * @objType Number
*/
Object.defineProperty(Phaser.TileSprite.prototype, 'height', {
@@ -60471,7 +60471,7 @@ THIS SOFTWARE.
},
/**
- * Looks up a canvas based on its type, and if found puts it back in the pool, freeing it up for re-use.
+ * Looks up a canvas based on its objType, and if found puts it back in the pool, freeing it up for re-use.
* The canvas has its width and height set to 1, and its parent attribute nulled.
*
* @static
@@ -60555,7 +60555,7 @@ THIS SOFTWARE.
* The pool into which the canvas elements are placed.
*
* @property pool
- * @type Array
+ * @objType Array
* @static
*/
Phaser.CanvasPool.pool = [];
@@ -60565,7 +60565,7 @@ THIS SOFTWARE.
* The total number of canvas elements in the {@link Phaser.CanvasPool.pool pool}.
*
* @property length
- * @type number
+ * @objType number
* @static
* @readonly
*/
@@ -60836,7 +60836,7 @@ THIS SOFTWARE.
this.mspointer = false;
/**
- * @property {?string} wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll'
+ * @property {?string} wheelType - The newest objType of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll'
* @default
* @protected
*/
@@ -61132,7 +61132,7 @@ THIS SOFTWARE.
* _Note_: This signal is removed after the device has been readied; if a handler has not been
* added _before_ `new Phaser.Game(..)` it is probably too late.
*
- * @type {?Phaser.Signal}
+ * @objType {?Phaser.Signal}
* @static
*/
Phaser.Device.onInitialized = new Phaser.Signal();
@@ -61816,7 +61816,7 @@ THIS SOFTWARE.
* @method canPlayAudio
* @memberof Phaser.Device.prototype
* @param {string} type - One of 'mp3, 'ogg', 'm4a', 'wav', 'webm' or 'opus'.
- * @return {boolean} True if the given file type is supported by the browser, otherwise false.
+ * @return {boolean} True if the given file objType is supported by the browser, otherwise false.
*/
Phaser.Device.canPlayAudio = function (type) {
@@ -61852,7 +61852,7 @@ THIS SOFTWARE.
* @method canPlayVideo
* @memberof Phaser.Device.prototype
* @param {string} type - One of 'mp4, 'ogg', 'webm' or 'mpeg'.
- * @return {boolean} True if the given file type is supported by the browser, otherwise false.
+ * @return {boolean} True if the given file objType is supported by the browser, otherwise false.
*/
Phaser.Device.canPlayVideo = function (type) {
@@ -65998,25 +65998,25 @@ THIS SOFTWARE.
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.TweenData.PENDING = 0;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.TweenData.RUNNING = 1;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.TweenData.LOOPED = 2;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.TweenData.COMPLETE = 3;
@@ -67741,28 +67741,28 @@ THIS SOFTWARE.
/**
* Number of milliseconds in a minute.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Timer.MINUTE = 60000;
/**
* Number of milliseconds in a second.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Timer.SECOND = 1000;
/**
* Number of milliseconds in half a second.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Timer.HALF = 500;
/**
* Number of milliseconds in a quarter of a second.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Timer.QUARTER = 250;
@@ -70729,140 +70729,140 @@ THIS SOFTWARE.
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.CANVAS = 1;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.IMAGE = 2;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.TEXTURE = 3;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.SOUND = 4;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.TEXT = 5;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.PHYSICS = 6;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.TILEMAP = 7;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.BINARY = 8;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.BITMAPDATA = 9;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.BITMAPFONT = 10;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.JSON = 11;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.XML = 12;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.VIDEO = 13;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.SHADER = 14;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Cache.RENDER_TEXTURE = 15;
/**
* The default image used for a texture when no other is specified.
* @constant
- * @type {PIXI.Texture}
+ * @objType {PIXI.Texture}
*/
Phaser.Cache.DEFAULT = null;
/**
* Key for the DEFAULT texture.
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.Cache.DEFAULT_KEY = '__default';
/**
* URL for the DEFAULT texture.
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.Cache.DEFAULT_SRC = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg==';
/**
* The default image used for a texture when the source image is missing.
* @constant
- * @type {PIXI.Texture}
+ * @objType {PIXI.Texture}
*/
Phaser.Cache.MISSING = null;
/**
* Key for the MISSING texture.
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.Cache.MISSING_KEY = '__missing';
/**
* URL for the MISSING texture.
* @constant
- * @type {string}
+ * @objType {string}
*/
Phaser.Cache.MISSING_SRC = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg==';
/**
* The maximum amount of time (ms) to wait for the built-in DEFAULT and MISSING images to load.
* @static
- * @type {number}
+ * @objType {number}
* @default
*/
Phaser.Cache.READY_TIMEOUT = 1000;
@@ -71546,7 +71546,7 @@ THIS SOFTWARE.
////////////////////////
/**
- * Checks if a key for the given cache object type exists.
+ * Checks if a key for the given cache object objType exists.
*
* @method Phaser.Cache#checkKey
* @param {integer} cache - The cache to search. One of the Cache consts such as `Phaser.Cache.IMAGE` or `Phaser.Cache.SOUND`.
@@ -73142,37 +73142,37 @@ THIS SOFTWARE.
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Loader.TEXTURE_ATLAS_JSON_ARRAY = 0;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Loader.TEXTURE_ATLAS_JSON_HASH = 1;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Loader.TEXTURE_ATLAS_XML_STARLING = 2;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Loader.PHYSICS_LIME_CORONA_JSON = 3;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Loader.PHYSICS_PHASER_JSON = 4;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Loader.TEXTURE_ATLAS_JSON_PYXEL = 5;
@@ -73239,7 +73239,7 @@ THIS SOFTWARE.
* To access a loaded asset use Phaser.Cache, eg. {@link Phaser.Cache#checkImageKey}
*
* @method Phaser.Loader#checkKeyExists
- * @param {string} type - The type asset you want to check.
+ * @param {string} type - The objType asset you want to check.
* @param {string} key - Key of the asset you want to check.
* @return {boolean} Return true if exists, otherwise return false.
*/
@@ -73255,7 +73255,7 @@ THIS SOFTWARE.
* Only assets in the download file queue will be found.
*
* @method Phaser.Loader#getAssetIndex
- * @param {string} type - The type asset you want to check.
+ * @param {string} type - The objType asset you want to check.
* @param {string} key - Key of the asset you want to check.
* @return {number} The index of this key in the filelist, or -1 if not found.
* The index may change and should only be used immediately following this call
@@ -73287,7 +73287,7 @@ THIS SOFTWARE.
* Only assets in the download file queue will be found.
*
* @method Phaser.Loader#getAsset
- * @param {string} type - The type asset you want to check.
+ * @param {string} type - The objType asset you want to check.
* @param {string} key - Key of the asset you want to check.
* @return {any} Returns an object if found that has 2 properties: `index` and `file`; otherwise a non-true value is returned.
* The index may change and should only be used immediately following this call.
@@ -73358,11 +73358,11 @@ THIS SOFTWARE.
*
* @method Phaser.Loader#addToFileList
* @protected
- * @param {string} type - The type of resource to add to the list (image, audio, xml, etc).
+ * @param {string} type - The objType of resource to add to the list (image, audio, xml, etc).
* @param {string} key - The unique Cache ID key of this resource.
* @param {string} [url] - The URL the asset will be loaded from.
* @param {object} [properties=(none)] - Any additional properties needed to load the file. These are added directly to the added file object and overwrite any defaults.
- * @param {boolean} [overwrite=false] - If true then this will overwrite a file asset of the same type/key. Otherwise it will only add a new asset. If overwrite is true, and the asset is already being loaded (or has been loaded), then it is appended instead.
+ * @param {boolean} [overwrite=false] - If true then this will overwrite a file asset of the same objType/key. Otherwise it will only add a new asset. If overwrite is true, and the asset is already being loaded (or has been loaded), then it is appended instead.
* @param {string} [extension] - If no URL is given the Loader will sometimes auto-generate the URL based on the key, using this as the extension.
* @return {Phaser.Loader} This instance of the Phaser Loader.
*/
@@ -73373,7 +73373,7 @@ THIS SOFTWARE.
}
if (key === undefined || key === '') {
- console.warn("Phaser.Loader: Invalid or no key given of type " + type);
+ console.warn("Phaser.Loader: Invalid or no key given of objType " + type);
return this;
}
@@ -73382,7 +73382,7 @@ THIS SOFTWARE.
url = key + extension;
}
else {
- console.warn("Phaser.Loader: No URL given for file type: " + type + " key: " + key);
+ console.warn("Phaser.Loader: No URL given for file objType: " + type + " key: " + key);
return this;
}
}
@@ -73432,7 +73432,7 @@ THIS SOFTWARE.
*
* @method Phaser.Loader#replaceInFileList
* @protected
- * @param {string} type - The type of resource to add to the list (image, audio, xml, etc).
+ * @param {string} type - The objType of resource to add to the list (image, audio, xml, etc).
* @param {string} key - The unique Cache ID key of this resource.
* @param {string} url - The URL the asset will be loaded from.
* @param {object} properties - Any additional properties needed to load the file.
@@ -73981,9 +73981,9 @@ THIS SOFTWARE.
*
* @method Phaser.Loader#audio
* @param {string} key - Unique asset key of the audio file.
- * @param {string|string[]|object[]} urls - Either a single string or an array of URIs or pairs of `{uri: .., type: ..}`.
+ * @param {string|string[]|object[]} urls - Either a single string or an array of URIs or pairs of `{uri: .., objType: ..}`.
* If an array is specified then the first URI (or URI + mime pair) that is device-compatible will be selected.
- * For example: `"jump.mp3"`, `['jump.mp3', 'jump.ogg', 'jump.m4a']`, or `[{uri: "data:", type: 'opus'}, 'fallback.mp3']`.
+ * For example: `"jump.mp3"`, `['jump.mp3', 'jump.ogg', 'jump.m4a']`, or `[{uri: "data:", objType: 'opus'}, 'fallback.mp3']`.
* BLOB and DATA URIs can be used but only support automatic detection when used in the pair form; otherwise the format must be manually checked before adding the resource.
* @param {boolean} [autoDecode=true] - When using Web Audio the audio files can either be decoded at load time or run-time.
* Audio files can't be played until they are decoded and, if specified, this enables immediate decoding. Decoding is a non-blocking async process, however it consumes huge amounts of CPU time on mobiles especially.
@@ -74100,9 +74100,9 @@ THIS SOFTWARE.
*
* @method Phaser.Loader#video
* @param {string} key - Unique asset key of the video file.
- * @param {string|string[]|object[]} urls - Either a single string or an array of URIs or pairs of `{uri: .., type: ..}`.
+ * @param {string|string[]|object[]} urls - Either a single string or an array of URIs or pairs of `{uri: .., objType: ..}`.
* If an array is specified then the first URI (or URI + mime pair) that is device-compatible will be selected.
- * For example: `"boom.mp4"`, `['boom.mp4', 'boom.ogg', 'boom.webm']`, or `[{uri: "data:", type: 'opus'}, 'fallback.mp4']`.
+ * For example: `"boom.mp4"`, `['boom.mp4', 'boom.ogg', 'boom.webm']`, or `[{uri: "data:", objType: 'opus'}, 'fallback.mp4']`.
* BLOB and DATA URIs can be used but only support automatic detection when used in the pair form; otherwise the format must be manually checked before adding the resource.
* @param {string} [loadEvent='canplaythrough'] - This sets the Video source event to listen for before the load is considered complete.
* 'canplaythrough' implies the video has downloaded enough, and bandwidth is high enough that it can be played to completion.
@@ -74663,7 +74663,7 @@ THIS SOFTWARE.
* This has no effect on already loaded assets.
*
* @method Phaser.Loader#addSyncPoint
- * @param {string} type - The type of resource to turn into a sync point (image, audio, xml, etc).
+ * @param {string} type - The objType of resource to turn into a sync point (image, audio, xml, etc).
* @param {string} key - Key of the file you want to turn into a sync point.
* @return {Phaser.Loader} This Loader instance.
* @see {@link Phaser.Loader#withSyncPoint withSyncPoint}
@@ -74686,7 +74686,7 @@ THIS SOFTWARE.
*
* @method Phaser.Loader#removeFile
* @protected
- * @param {string} type - The type of resource to add to the list (image, audio, xml, etc).
+ * @param {string} type - The objType of resource to add to the list (image, audio, xml, etc).
* @param {string} key - Key of the file you want to remove.
*/
removeFile: function (type, key) {
@@ -75441,7 +75441,7 @@ THIS SOFTWARE.
/**
* Give a bunch of URLs, return the first URL that has an extension this device thinks it can play.
*
- * It is assumed that the device can play "blob:" or "data:" URIs - There is no mime-type checking on data URIs.
+ * It is assumed that the device can play "blob:" or "data:" URIs - There is no mime-objType checking on data URIs.
*
* @method Phaser.Loader#getVideoURL
* @private
@@ -75454,7 +75454,7 @@ THIS SOFTWARE.
var url = urls[i];
var videoType;
- if (url.uri) // {uri: .., type: ..} pair
+ if (url.uri) // {uri: .., objType: ..} pair
{
videoType = url.type;
url = url.uri;
@@ -75491,7 +75491,7 @@ THIS SOFTWARE.
/**
* Give a bunch of URLs, return the first URL that has an extension this device thinks it can play.
*
- * It is assumed that the device can play "blob:" or "data:" URIs - There is no mime-type checking on data URIs.
+ * It is assumed that the device can play "blob:" or "data:" URIs - There is no mime-objType checking on data URIs.
*
* @method Phaser.Loader#getAudioURL
* @private
@@ -75508,7 +75508,7 @@ THIS SOFTWARE.
var url = urls[i];
var audioType;
- if (url.uri) // {uri: .., type: ..} pair
+ if (url.uri) // {uri: .., objType: ..} pair
{
audioType = url.type;
url = url.uri;
@@ -75792,7 +75792,7 @@ THIS SOFTWARE.
*/
xmlLoadComplete: function (file, xhr) {
- // Always try parsing the content as XML, regardless of actually response type
+ // Always try parsing the content as XML, regardless of actually response objType
var data = xhr.responseText;
var xml = this.parseXml(data);
@@ -76164,7 +76164,7 @@ THIS SOFTWARE.
// address: 4, size: 4 bytes flags
// address: 8, size: 8 bytes pixel format
// address: 16, size: 4 bytes color space
- // address: 20, size: 4 bytes channel type
+ // address: 20, size: 4 bytes channel objType
// address: 24, size: 4 bytes height
// address: 28, size: 4 bytes width
// address: 32, size: 4 bytes depth
@@ -76358,8 +76358,8 @@ THIS SOFTWARE.
// ---------------------------------------
// address: 0, size 12 bytes: Identifier '«KTX 11»\r\n\x1A\n'
// address: 12, size 4 bytes: endianness
- // address: 16, size 4 bytes: GL type
- // address: 20, size 4 bytes: GL type size
+ // address: 16, size 4 bytes: GL objType
+ // address: 20, size 4 bytes: GL objType size
// address: 24, size 4 bytes: GL format
// address: 28, size 4 bytes: GL internal format
// address: 32, size 4 bytes: GL base internal format
@@ -76456,7 +76456,7 @@ THIS SOFTWARE.
// ---------------------------------------
// address: 0, size 4 bytes: for 'PKM '
// address: 4, size 2 bytes: for version
- // address: 6, size 2 bytes: for type
+ // address: 6, size 2 bytes: for objType
// address: 8, size 2 bytes: for extended width
// address: 10, size 2 bytes: for extended height
// address: 12, size 2 bytes: for original width
@@ -77796,7 +77796,7 @@ THIS SOFTWARE.
/**
* The Sound Manager is responsible for playing back audio via either the Legacy HTML Audio tag or via Web Audio if the browser supports it.
* Note: On Firefox 25+ on Linux if you have media.gstreamer disabled in about:config then it cannot play back mp3 or m4a files.
- * The audio file type and the encoding of those files are extremely important. Not all browsers can play all audio formats.
+ * The audio file objType and the encoding of those files are extremely important. Not all browsers can play all audio formats.
* There is a good guide to what's supported here: http://hpr.dogphilosophy.net/test/
*
* If you are reloading a Phaser Game on a page that never properly refreshes (such as in an AngularJS project) then you will quickly run out
@@ -79202,7 +79202,7 @@ THIS SOFTWARE.
* A scale mode that stretches content to fill all available space - see {@link Phaser.ScaleManager#scaleMode scaleMode}.
*
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.ScaleManager.EXACT_FIT = 0;
@@ -79210,7 +79210,7 @@ THIS SOFTWARE.
* A scale mode that prevents any scaling - see {@link Phaser.ScaleManager#scaleMode scaleMode}.
*
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.ScaleManager.NO_SCALE = 1;
@@ -79218,7 +79218,7 @@ THIS SOFTWARE.
* A scale mode that shows the entire game while maintaining proportions - see {@link Phaser.ScaleManager#scaleMode scaleMode}.
*
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.ScaleManager.SHOW_ALL = 2;
@@ -79226,7 +79226,7 @@ THIS SOFTWARE.
* A scale mode that causes the Game size to change - see {@link Phaser.ScaleManager#scaleMode scaleMode}.
*
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.ScaleManager.RESIZE = 3;
@@ -79234,7 +79234,7 @@ THIS SOFTWARE.
* A scale mode that allows a custom scale factor - see {@link Phaser.ScaleManager#scaleMode scaleMode}.
*
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.ScaleManager.USER_SCALE = 4;
@@ -81594,7 +81594,7 @@ THIS SOFTWARE.
* @param {Phaser.Rectangle|Phaser.Circle|Phaser.Ellipse|Phaser.Point|Phaser.Line} object - The geometry object to render.
* @param {string} [color] - Color of the debug info to be rendered (format is css color string).
* @param {boolean} [filled=true] - Render the objected as a filled (default, true) or a stroked (false)
- * @param {number} [forceType=0] - Force rendering of a specific type. If 0 no type will be forced, otherwise 1 = Rectangle, 2 = Circle,3 = Point, 4 = Line and 5 = Ellipse.
+ * @param {number} [forceType=0] - Force rendering of a specific objType. If 0 no objType will be forced, otherwise 1 = Rectangle, 2 = Circle,3 = Point, 4 = Line and 5 = Ellipse.
*/
geom: function (object, color, filled, forceType) {
@@ -82202,7 +82202,7 @@ THIS SOFTWARE.
*
* The properties change dynamically.
*
- * @type {Phaser.Rectangle}
+ * @objType {Phaser.Rectangle}
* @property {number} x - Scroll, left offset - eg. "scrollX"
* @property {number} y - Scroll, top offset - eg. "scrollY"
* @property {number} width - Viewport width in pixels.
@@ -82225,7 +82225,7 @@ THIS SOFTWARE.
*
* The properties change dynamically.
*
- * @type {Phaser.Rectangle}
+ * @objType {Phaser.Rectangle}
* @property {number} width - Viewport width in pixels.
* @property {number} height - Viewport height in pixels.
* @readonly
@@ -82239,7 +82239,7 @@ THIS SOFTWARE.
*
* The properties change dynamically.
*
- * @type {Phaser.Rectangle}
+ * @objType {Phaser.Rectangle}
* @property {number} width - Document width in pixels.
* @property {number} height - Document height in pixels.
* @readonly
@@ -83392,35 +83392,35 @@ THIS SOFTWARE.
/**
* A 16 color palette by [Arne](http://androidarts.com/palette/16pal.htm)
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Create.PALETTE_ARNE = 0;
/**
* A 16 color JMP inspired palette.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Create.PALETTE_JMP = 1;
/**
* A 16 color CGA inspired palette.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Create.PALETTE_CGA = 2;
/**
* A 16 color C64 inspired palette.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Create.PALETTE_C64 = 3;
/**
* A 16 color palette inspired by Japanese computers like the MSX.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Create.PALETTE_JAPANESE_MACHINE = 4;
@@ -83944,7 +83944,7 @@ THIS SOFTWARE.
/**
* Should the FlexLayer remain through a State swap?
*
- * @type {boolean}
+ * @objType {boolean}
*/
this.persist = false;
@@ -85556,37 +85556,37 @@ THIS SOFTWARE.
/**
* @const
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.ARCADE = 0;
/**
* @const
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.P2JS = 1;
/**
* @const
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.NINJA = 2;
/**
* @const
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.BOX2D = 3;
/**
* @const
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.CHIPMUNK = 4;
/**
* @const
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.MATTERJS = 5;
@@ -85689,7 +85689,7 @@ THIS SOFTWARE.
* Phaser.Physics.MATTER - A full-body and light-weight advanced physics system (still in development)
* Phaser.Physics.CHIPMUNK is still in development.
*
- * If you require more control over what type of body is created, for example to create a Ninja Physics Circle instead of the default AABB, then see the
+ * If you require more control over what objType of body is created, for example to create a Ninja Physics Circle instead of the default AABB, then see the
* individual physics systems `enable` methods instead of using this generic one.
*
* @method Phaser.Physics#enable
@@ -85975,7 +85975,7 @@ THIS SOFTWARE.
* A constant used for the sortDirection value.
* Use this if you don't wish to perform any pre-collision sorting at all, or will manually sort your Groups.
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.Arcade.SORT_NONE = 0;
@@ -85983,7 +85983,7 @@ THIS SOFTWARE.
* A constant used for the sortDirection value.
* Use this if your game world is wide but short and scrolls from the left to the right (i.e. Mario)
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.Arcade.LEFT_RIGHT = 1;
@@ -85991,7 +85991,7 @@ THIS SOFTWARE.
* A constant used for the sortDirection value.
* Use this if your game world is wide but short and scrolls from the right to the left (i.e. Mario backwards)
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.Arcade.RIGHT_LEFT = 2;
@@ -85999,7 +85999,7 @@ THIS SOFTWARE.
* A constant used for the sortDirection value.
* Use this if your game world is narrow but tall and scrolls from the top to the bottom (i.e. Dig Dug)
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.Arcade.TOP_BOTTOM = 3;
@@ -86007,7 +86007,7 @@ THIS SOFTWARE.
* A constant used for the sortDirection value.
* Use this if your game world is narrow but tall and scrolls from the bottom to the top (i.e. Commando or a vertically scrolling shoot-em-up)
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Physics.Arcade.BOTTOM_TOP = 4;
@@ -87980,7 +87980,7 @@ THIS SOFTWARE.
this.game = sprite.game;
/**
- * @property {number} type - The type of physics system this body belongs to.
+ * @property {number} objType - The objType of physics system this body belongs to.
*/
this.type = Phaser.Physics.ARCADE;
@@ -88282,7 +88282,7 @@ THIS SOFTWARE.
/**
* This flag allows you to disable the custom x separation that takes place by Physics.Arcade.separate.
- * Used in combination with your own collision processHandler you can create whatever type of collision response you need.
+ * Used in combination with your own collision processHandler you can create whatever objType of collision response you need.
* @property {boolean} customSeparateX - Use a custom separation system or the built-in one?
* @default
*/
@@ -88290,7 +88290,7 @@ THIS SOFTWARE.
/**
* This flag allows you to disable the custom y separation that takes place by Physics.Arcade.separate.
- * Used in combination with your own collision processHandler you can create whatever type of collision response you need.
+ * Used in combination with your own collision processHandler you can create whatever objType of collision response you need.
* @property {boolean} customSeparateY - Use a custom separation system or the built-in one?
* @default
*/
@@ -91063,7 +91063,7 @@ THIS SOFTWARE.
/**
* Populates and returns an array of all current Constraints in the world.
* You will get an array of p2 constraints back. This can be of mixed types, for example the array may contain
- * PrismaticConstraints, RevoluteConstraints or any other valid p2 constraint type.
+ * PrismaticConstraints, RevoluteConstraints or any other valid p2 constraint objType.
*
* @method Phaser.Physics.P2#getConstraints
* @return {array} An array containing all current Constraints in the world.
@@ -91113,7 +91113,7 @@ THIS SOFTWARE.
if (bodies[i] instanceof Phaser.Physics.P2.Body && !(filterStatic && bodies[i].data.type === p2.Body.STATIC)) {
query.push(bodies[i].data);
}
- else if (bodies[i] instanceof p2.Body && bodies[i].parent && !(filterStatic && bodies[i].type === p2.Body.STATIC)) {
+ else if (bodies[i] instanceof p2.Body && bodies[i].parent && !(filterStatic && bodies[i].objType === p2.Body.STATIC)) {
query.push(bodies[i]);
}
else if (bodies[i] instanceof Phaser.Sprite && bodies[i].hasOwnProperty('body') && !(filterStatic && bodies[i].body.data.type === p2.Body.STATIC)) {
@@ -92245,7 +92245,7 @@ THIS SOFTWARE.
this.sprite = sprite;
/**
- * @property {number} type - The type of physics system this body belongs to.
+ * @property {number} objType - The objType of physics system this body belongs to.
*/
this.type = Phaser.Physics.P2JS;
@@ -93644,7 +93644,7 @@ THIS SOFTWARE.
/**
* Dynamic body. Dynamic bodies body can move and respond to collisions and forces.
* @property DYNAMIC
- * @type {Number}
+ * @objType {Number}
* @static
*/
Phaser.Physics.P2.Body.DYNAMIC = 1;
@@ -93652,7 +93652,7 @@ THIS SOFTWARE.
/**
* Static body. Static bodies do not move, and they do not respond to forces or collision.
* @property STATIC
- * @type {Number}
+ * @objType {Number}
* @static
*/
Phaser.Physics.P2.Body.STATIC = 2;
@@ -93660,7 +93660,7 @@ THIS SOFTWARE.
/**
* Kinematic body. Kinematic bodies only moves according to its .velocity, and does not respond to collisions or force.
* @property KINEMATIC
- * @type {Number}
+ * @objType {Number}
* @static
*/
Phaser.Physics.P2.Body.KINEMATIC = 4;
@@ -93941,7 +93941,7 @@ THIS SOFTWARE.
/**
* @name Phaser.Physics.P2.Body#motionState
- * @property {number} motionState - The type of motion this body has. Should be one of: Body.STATIC (the body does not move), Body.DYNAMIC (body can move and respond to collisions) and Body.KINEMATIC (only moves according to its .velocity).
+ * @property {number} motionState - The objType of motion this body has. Should be one of: Body.STATIC (the body does not move), Body.DYNAMIC (body can move and respond to collisions) and Body.KINEMATIC (only moves according to its .velocity).
*/
Object.defineProperty(Phaser.Physics.P2.Body.prototype, "motionState", {
@@ -95276,7 +95276,7 @@ THIS SOFTWARE.
* @class Phaser.Tile
* @constructor
* @param {object} layer - The layer in the Tilemap data that this tile belongs to.
- * @param {number} index - The index of this tile type in the core map data.
+ * @param {number} index - The index of this tile objType in the core map data.
* @param {number} x - The x coordinate of this tile.
* @param {number} y - The y coordinate of this tile.
* @param {number} width - Width of the tile.
@@ -95837,37 +95837,37 @@ THIS SOFTWARE.
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Tilemap.CSV = 0;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Tilemap.TILED_JSON = 1;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Tilemap.NORTH = 0;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Tilemap.EAST = 1;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Tilemap.SOUTH = 2;
/**
* @constant
- * @type {number}
+ * @objType {number}
*/
Phaser.Tilemap.WEST = 3;
@@ -97646,16 +97646,16 @@ THIS SOFTWARE.
this.setTexture(new PIXI.Texture(new PIXI.BaseTexture(this.canvas, null, this.game.resolution)));
/**
- * The const type of this object.
- * @property {number} type
+ * The const objType of this object.
+ * @property {number} objType
* @readonly
* @protected
* @default Phaser.TILEMAPLAYER
*/
- this.type = Phaser.TILEMAPLAYER;
+ this.objType = Phaser.TILEMAPLAYER;
/**
- * @property {number} physicsType - The const physics body type of this object.
+ * @property {number} physicsType - The const physics body objType of this object.
* @readonly
*/
this.physicsType = Phaser.TILEMAPLAYER;
@@ -98900,14 +98900,14 @@ THIS SOFTWARE.
/**
* When scanning the Tiled map data the TilemapParser can either insert a null value (true) or
- * a Phaser.Tile instance with an index of -1 (false, the default). Depending on your game type
+ * a Phaser.Tile instance with an index of -1 (false, the default). Depending on your game objType
* depends how this should be configured. If you've a large sparsely populated map and the tile
* data doesn't need to change then setting this value to `true` will help with memory consumption.
* However if your map is small, or you need to update the tiles (perhaps the map dynamically changes
* during the game) then leave the default value set.
*
* @constant
- * @type {boolean}
+ * @objType {boolean}
*/
INSERT_NULL: false,
@@ -99585,7 +99585,7 @@ THIS SOFTWARE.
set = map.tilesets[sid];
- // if that tile type has any properties, add them to the tile object
+ // if that tile objType has any properties, add them to the tile object
if (set.tileProperties && set.tileProperties[tile.index - set.firstgid]) {
tile.properties = Phaser.Utils.mixin(set.tileProperties[tile.index - set.firstgid], tile.properties);
@@ -100169,13 +100169,13 @@ THIS SOFTWARE.
this.name = 'emitter' + this.id;
/**
- * @property {number} type - Internal Phaser Type value.
+ * @property {number} objType - Internal Phaser Type value.
* @protected
*/
this.type = Phaser.EMITTER;
/**
- * @property {number} physicsType - The const physics body type of this object.
+ * @property {number} physicsType - The const physics body objType of this object.
* @readonly
*/
this.physicsType = Phaser.GROUP;
@@ -101423,21 +101423,21 @@ THIS SOFTWARE.
/**
* This is the Phaser.Group that contains all of the bullets managed by this plugin.
- * @type {Phaser.Group}
+ * @objType {Phaser.Group}
*/
this.bullets = null;
/**
* Should the bullet pool run out of bullets (i.e. they are all in flight) then this
* boolean controls if the Group will create a brand new bullet object or not.
- * @type {boolean}
+ * @objType {boolean}
*/
this.autoExpandBulletsGroup = false;
/**
* Will this weapon auto fire? If set to true then a new bullet will be fired
* based on the `fireRate` value.
- * @type {boolean}
+ * @objType {boolean}
*/
this.autofire = false;
@@ -101445,7 +101445,7 @@ THIS SOFTWARE.
* The total number of bullets this Weapon has fired so far.
* You can limit the number of shots allowed (via `fireLimit`), and reset
* this total via `Weapon.resetShots`.
- * @type {number}
+ * @objType {number}
*/
this.shots = 0;
@@ -101453,13 +101453,13 @@ THIS SOFTWARE.
* The maximum number of shots that this Weapon is allowed to fire before it stops.
* When the limit is his the `Weapon.onFireLimit` Signal is dispatched.
* You can reset the shot counter via `Weapon.resetShots`.
- * @type {number}
+ * @objType {number}
*/
this.fireLimit = 0;
/**
* The rate at which this Weapon can fire. The value is given in milliseconds.
- * @type {number}
+ * @objType {number}
*/
this.fireRate = 100;
@@ -101468,7 +101468,7 @@ THIS SOFTWARE.
* to the firing rate of the Weapon. The value is given in milliseconds.
* If you've a `fireRate` of 200 and a `fireRateVariance` of 50 then the actual
* firing rate of the Weapon will be between 150 and 250.
- * @type {number}
+ * @objType {number}
*/
this.fireRateVariance = 0;
@@ -101476,34 +101476,34 @@ THIS SOFTWARE.
* This is a Rectangle from within which the bullets are fired. By default it's a 1x1
* rectangle, the equivalent of a Point. But you can change the width and height, and if
* larger than 1x1 it'll pick a random point within the rectangle to launch the bullet from.
- * @type {Phaser.Rectangle}
+ * @objType {Phaser.Rectangle}
*/
this.fireFrom = new Phaser.Rectangle(0, 0, 1, 1);
/**
* The angle at which the bullets are fired. This can be a const such as Phaser.ANGLE_UP
* or it can be any number from 0 to 360 inclusive, where 0 degrees is to the right.
- * @type {integer}
+ * @objType {integer}
*/
this.fireAngle = Phaser.ANGLE_UP;
/**
* When a Bullet is fired it can optionally inherit the velocity of the `trackedSprite` if set.
- * @type {boolean}
+ * @objType {boolean}
*/
this.bulletInheritSpriteSpeed = false;
/**
* The string based name of the animation that the Bullet will be given on launch.
* This is set via `Weapon.addBulletAnimation`.
- * @type {string}
+ * @objType {string}
*/
this.bulletAnimation = '';
/**
* If you've added a set of frames via `Weapon.setBulletFrames` then you can optionally
* chose for each Bullet fired to pick a random frame from the set.
- * @type {boolean}
+ * @objType {boolean}
*/
this.bulletFrameRandom = false;
@@ -101513,14 +101513,14 @@ THIS SOFTWARE.
* advanced one frame until it reaches the end of the set, then it starts from the start
* again. Cycling frames like this allows you to create varied bullet effects via
* sprite sheets.
- * @type {boolean}
+ * @objType {boolean}
*/
this.bulletFrameCycle = false;
/**
* Should the Bullets wrap around the world bounds? This automatically calls
* `World.wrap` on the Bullet each frame. See the docs for that method for details.
- * @type {boolean}
+ * @objType {boolean}
*/
this.bulletWorldWrap = false;
@@ -101528,7 +101528,7 @@ THIS SOFTWARE.
* If `bulletWorldWrap` is true then you can provide an optional padding value with this
* property. It's added to the calculations determining when the Bullet should wrap around
* the world or not. The value is given in pixels.
- * @type {integer}
+ * @objType {integer}
*/
this.bulletWorldWrapPadding = 0;
@@ -101537,7 +101537,7 @@ THIS SOFTWARE.
* This is useful if for example your bullet sprites have been drawn facing up, instead of
* to the right, and you want to fire them at an angle. In which case you can set the
* angle offset to be 90 and they'll be properly rotated when fired.
- * @type {number}
+ * @objType {number}
*/
this.bulletAngleOffset = 0;
@@ -101546,14 +101546,14 @@ THIS SOFTWARE.
* If you fire from an angle of 90 and have a `bulletAngleVariance` of 20 then the actual
* angle of the Bullets will be between 70 and 110 degrees. This is a quick way to add a
* great 'spread' effect to a Weapon.
- * @type {number}
+ * @objType {number}
*/
this.bulletAngleVariance = 0;
/**
* The speed at which the bullets are fired. This value is given in pixels per second, and
* is used to set the starting velocity of the bullets.
- * @type {number}
+ * @objType {number}
*/
this.bulletSpeed = 200;
@@ -101561,7 +101561,7 @@ THIS SOFTWARE.
* This is a variance added to the speed of Bullets when they are fired.
* If bullets have a `bulletSpeed` value of 200, and a `bulletSpeedVariance` of 50
* then the actual speed of the Bullets will be between 150 and 250 pixels per second.
- * @type {number}
+ * @objType {number}
*/
this.bulletSpeedVariance = 0;
@@ -101569,21 +101569,21 @@ THIS SOFTWARE.
* If you've set `bulletKillType` to `Phaser.Weapon.KILL_LIFESPAN` this controls the amount
* of lifespan the Bullets have set on launch. The value is given in milliseconds.
* When a Bullet hits its lifespan limit it will be automatically killed.
- * @type {number}
+ * @objType {number}
*/
this.bulletLifespan = 0;
/**
* If you've set `bulletKillType` to `Phaser.Weapon.KILL_DISTANCE` this controls the distance
* the Bullet can travel before it is automatically killed. The distance is given in pixels.
- * @type {number}
+ * @objType {number}
*/
this.bulletKillDistance = 0;
/**
* This is the amount of gravity added to the Bullets physics body when fired.
* Gravity is expressed in pixels / second / second.
- * @type {Phaser.Point}
+ * @objType {Phaser.Point}
*/
this.bulletGravity = new Phaser.Point(0, 0);
@@ -101591,41 +101591,41 @@ THIS SOFTWARE.
* Bullets can optionally adjust their rotation in-flight to match their velocity.
* This can create the effect of a bullet 'pointing' to the path it is following, for example
* an arrow being fired from a bow, and works especially well when added to `bulletGravity`.
- * @type {boolean}
+ * @objType {boolean}
*/
this.bulletRotateToVelocity = false;
/**
* The Texture Key that the Bullets use when rendering.
* Changing this has no effect on bullets in-flight, only on newly spawned bullets.
- * @type {string}
+ * @objType {string}
*/
this.bulletKey = '';
/**
* The Texture Frame that the Bullets use when rendering.
* Changing this has no effect on bullets in-flight, only on newly spawned bullets.
- * @type {string|integer}
+ * @objType {string|integer}
*/
this.bulletFrame = '';
/**
* Private var that holds the public `bulletClass` property.
- * @type {function}
+ * @objType {function}
* @private
*/
this._bulletClass = Phaser.Bullet;
/**
* Private var that holds the public `bulletCollideWorldBounds` property.
- * @type {boolean}
+ * @objType {boolean}
* @private
*/
this._bulletCollideWorldBounds = false;
/**
* Private var that holds the public `bulletKillType` property.
- * @type {integer}
+ * @objType {integer}
* @private
*/
this._bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS;
@@ -101633,7 +101633,7 @@ THIS SOFTWARE.
/**
* Holds internal data about custom bullet body sizes.
*
- * @type {Object}
+ * @objType {Object}
* @private
*/
this._data = {
@@ -101650,14 +101650,14 @@ THIS SOFTWARE.
* or `Phaser.Weapon.KILL_STATIC_BOUNDS`. If you are not using either of these kill types then the bounds are ignored.
* If you are tracking a Sprite or Point then the bounds are centered on that object every frame.
*
- * @type {Phaser.Rectangle}
+ * @objType {Phaser.Rectangle}
*/
this.bounds = new Phaser.Rectangle();
/**
* The Rectangle used to calculate the bullet bounds from.
*
- * @type {Phaser.Rectangle}
+ * @objType {Phaser.Rectangle}
* @private
*/
this.bulletBounds = game.world.bounds;
@@ -101665,7 +101665,7 @@ THIS SOFTWARE.
/**
* This array stores the frames added via `Weapon.setBulletFrames`.
*
- * @type {Array}
+ * @objType {Array}
* @protected
*/
this.bulletFrames = [];
@@ -101673,14 +101673,14 @@ THIS SOFTWARE.
/**
* The index of the frame within `Weapon.bulletFrames` that is currently being used.
* This value is only used if `Weapon.bulletFrameCycle` is set to `true`.
- * @type {number}
+ * @objType {number}
* @private
*/
this.bulletFrameIndex = 0;
/**
* An internal object that stores the animation data added via `Weapon.addBulletAnimation`.
- * @type {Object}
+ * @objType {Object}
* @private
*/
this.anims = {};
@@ -101690,7 +101690,7 @@ THIS SOFTWARE.
* _successfully_ launched. The callback is set two arguments: a reference to the bullet sprite itself,
* and a reference to the Weapon that fired the bullet.
*
- * @type {Phaser.Signal}
+ * @objType {Phaser.Signal}
*/
this.onFire = new Phaser.Signal();
@@ -101699,7 +101699,7 @@ THIS SOFTWARE.
* of leaving the Weapon bounds, an expiring lifespan, or exceeding a specified distance.
* The callback is sent one argument: A reference to the bullet sprite itself.
*
- * @type {Phaser.Signal}
+ * @objType {Phaser.Signal}
*/
this.onKill = new Phaser.Signal();
@@ -101709,7 +101709,7 @@ THIS SOFTWARE.
* The callback is sent two arguments: A reference to the Weapon that hit the limit, and the value of
* `Weapon.fireLimit`.
*
- * @type {Phaser.Signal}
+ * @objType {Phaser.Signal}
*/
this.onFireLimit = new Phaser.Signal();
@@ -101717,7 +101717,7 @@ THIS SOFTWARE.
* The Sprite currently being tracked by the Weapon, if any.
* This is set via the `Weapon.trackSprite` method.
*
- * @type {Phaser.Sprite|Object}
+ * @objType {Phaser.Sprite|Object}
*/
this.trackedSprite = null;
@@ -101725,7 +101725,7 @@ THIS SOFTWARE.
* The Pointer currently being tracked by the Weapon, if any.
* This is set via the `Weapon.trackPointer` method.
*
- * @type {Phaser.Pointer}
+ * @objType {Phaser.Pointer}
*/
this.trackedPointer = null;
@@ -101736,14 +101736,14 @@ THIS SOFTWARE.
* This means you can call `fire` (and similar methods) as often as you like in one
* single game update.
*
- * @type {boolean}
+ * @objType {boolean}
*/
this.multiFire = false;
/**
* Internal multiFire test flag.
*
- * @type {boolean}
+ * @objType {boolean}
*/
this._hasFired = false;
@@ -101752,7 +101752,7 @@ THIS SOFTWARE.
* This is useful for a game such as Asteroids, where you want the weapon to fire based
* on the sprites rotation.
*
- * @type {boolean}
+ * @objType {boolean}
*/
this.trackRotation = false;
@@ -101762,14 +101762,14 @@ THIS SOFTWARE.
* in size, but you're tracking a Sprite that is 32x32, then you can set `trackOffset.x = 16` to have
* the bullet launched from the center of the Sprite.
*
- * @type {Phaser.Point}
+ * @objType {Phaser.Point}
*/
this.trackOffset = new Phaser.Point();
/**
* Internal firing rate time tracking variable.
*
- * @type {number}
+ * @objType {number}
* @private
*/
this._nextFire = 0;
@@ -101777,7 +101777,7 @@ THIS SOFTWARE.
/**
* Internal firing rate time tracking variable used by multiFire.
*
- * @type {number}
+ * @objType {number}
* @private
*/
this._tempNextFire = 0;
@@ -101785,7 +101785,7 @@ THIS SOFTWARE.
/**
* Internal firing rotation tracking point.
*
- * @type {Phaser.Point}
+ * @objType {Phaser.Point}
* @private
*/
this._rotatedPoint = new Phaser.Point();
@@ -101798,14 +101798,14 @@ THIS SOFTWARE.
/**
* A `bulletKillType` constant that stops the bullets from ever being destroyed automatically.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Weapon.KILL_NEVER = 0;
/**
* A `bulletKillType` constant that automatically kills the bullets when their `bulletLifespan` expires.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Weapon.KILL_LIFESPAN = 1;
@@ -101813,35 +101813,35 @@ THIS SOFTWARE.
* A `bulletKillType` constant that automatically kills the bullets after they
* exceed the `bulletDistance` from their original firing position.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Weapon.KILL_DISTANCE = 2;
/**
* A `bulletKillType` constant that automatically kills the bullets when they leave the `Weapon.bounds` rectangle.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Weapon.KILL_WEAPON_BOUNDS = 3;
/**
* A `bulletKillType` constant that automatically kills the bullets when they leave the `Camera.bounds` rectangle.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Weapon.KILL_CAMERA_BOUNDS = 4;
/**
* A `bulletKillType` constant that automatically kills the bullets when they leave the `World.bounds` rectangle.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Weapon.KILL_WORLD_BOUNDS = 5;
/**
* A `bulletKillType` constant that automatically kills the bullets when they leave the `Weapon.bounds` rectangle.
* @constant
- * @type {integer}
+ * @objType {integer}
*/
Phaser.Weapon.KILL_STATIC_BOUNDS = 6;
@@ -102649,7 +102649,7 @@ THIS SOFTWARE.
/**
* The Class of the bullets that are launched by this Weapon. Defaults to {@link Phaser.Bullet}, but can be
- * overridden before calling `createBullets` and set to your own class type.
+ * overridden before calling `createBullets` and set to your own class objType.
*
* It should be a constructor function accepting `(game, x, y, key, frame)`.
*
@@ -102971,7 +102971,7 @@ THIS SOFTWARE.
this.height = 0;
/**
- * @property {number} type - The const type of this object.
+ * @property {number} objType - The const objType of this object.
* @default
*/
this.type = Phaser.VIDEO;
diff --git a/mar/phaser/phaser.min.js b/mar/phaser/phaser.min.js
index 226089c..6c715ac 100644
--- a/mar/phaser/phaser.min.js
+++ b/mar/phaser/phaser.min.js
@@ -1,4 +1,4 @@
/* Phaser v2.9.1 - http://phaser.io - @photonstorm - (c) 2016 Photon Storm Ltd. */
-!function(t){if("object"==typeof exports)module.exports=t();else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.p2=t()}}(function(){return function t(e,i,s){function n(o,a){if(!i[o]){if(!e[o]){var h="function"==typeof require&&require;if(!a&&h)return h(o,!0);if(r)return r(o,!0);throw new Error("Cannot find module '"+o+"'")}var l=i[o]={exports:{}};e[o][0].call(l.exports,function(t){var i=e[o][1][t];return n(i||t)},l,l.exports,t,e,i,s)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o=0&&h<=1&&l>=0&&l<=1}},{"./Scalar":4}],2:[function(t,e,i){function s(){}e.exports=s,s.area=function(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])},s.left=function(t,e,i){return s.area(t,e,i)>0},s.leftOn=function(t,e,i){return s.area(t,e,i)>=0},s.right=function(t,e,i){return s.area(t,e,i)<0},s.rightOn=function(t,e,i){return s.area(t,e,i)<=0};var n=[],r=[];s.collinear=function(t,e,i,o){if(o){var a=n,h=r;a[0]=e[0]-t[0],a[1]=e[1]-t[1],h[0]=i[0]-e[0],h[1]=i[1]-e[1];var l=a[0]*h[0]+a[1]*h[1],c=Math.sqrt(a[0]*a[0]+a[1]*a[1]),u=Math.sqrt(h[0]*h[0]+h[1]*h[1]);return Math.acos(l/(c*u))t.vertices.length)throw new Error("lol2");if(e<0)throw new Error("lol3");for(var s=e;se[t][0])&&(t=i);o.left(this.at(t-1),this.at(t),this.at(t+1))||this.reverse()},s.prototype.reverse=function(){for(var t=[],e=0,i=this.vertices.length;e!==i;e++)t.push(this.vertices.pop());this.vertices=t},s.prototype.isReflex=function(t){return o.right(this.at(t-1),this.at(t),this.at(t+1))};var h=[],l=[];s.prototype.canSee=function(t,e){var i,s,n=h,a=l;if(o.leftOn(this.at(t+1),this.at(t),this.at(e))&&o.rightOn(this.at(t-1),this.at(t),this.at(e)))return!1;s=o.sqdist(this.at(t),this.at(e));for(var c=0;c!==this.vertices.length;++c)if((c+1)%this.vertices.length!==t&&c!==t&&o.leftOn(this.at(t),this.at(e),this.at(c+1))&&o.rightOn(this.at(t),this.at(e),this.at(c))&&(n[0]=this.at(t),n[1]=this.at(e),a[0]=this.at(c),a[1]=this.at(c+1),i=r.lineInt(n,a),o.sqdist(this.at(t),i)0?this.slice(t):[this]},s.prototype.slice=function(t){if(0==t.length)return[this];if(t instanceof Array&&t.length&&t[0]instanceof Array&&2==t[0].length&&t[0][0]instanceof Array){for(var e=[this],i=0;ia)return console.warn("quickDecomp: max level ("+a+") reached."),t;for(var T=0;Tm&&(m+=this.vertices.length),g=Number.MAX_VALUE,m3&&i>=0;--i)o.collinear(this.at(i-1),this.at(i),this.at(i+1),t)&&(this.vertices.splice(i%this.vertices.length,1),i--,e++);return e}},{"./Line":1,"./Point":2,"./Scalar":4}],4:[function(t,e,i){function s(){}e.exports=s,s.eq=function(t,e,i){return i=i||0,Math.abs(t-e) (http://steffe.se)",keywords:["p2.js","p2","physics","engine","2d"],main:"./src/p2.js",engines:{node:"*"},repository:{type:"git",url:"https://github.com/schteppe/p2.js.git"},bugs:{url:"https://github.com/schteppe/p2.js/issues"},licenses:[{type:"MIT"}],devDependencies:{grunt:"^0.4.5","grunt-contrib-jshint":"^0.11.2","grunt-contrib-nodeunit":"^0.4.1","grunt-contrib-uglify":"~0.4.0","grunt-contrib-watch":"~0.5.0","grunt-browserify":"~2.0.1","grunt-contrib-concat":"^0.4.0"},dependencies:{"poly-decomp":"0.1.1"}}},{}],7:[function(t,e,i){function s(t){this.lowerBound=n.create(),t&&t.lowerBound&&n.copy(this.lowerBound,t.lowerBound),this.upperBound=n.create(),t&&t.upperBound&&n.copy(this.upperBound,t.upperBound)}var n=t("../math/vec2");t("../utils/Utils");e.exports=s;var r=n.create();s.prototype.setFromPoints=function(t,e,i,s){var o=this.lowerBound,a=this.upperBound;"number"!=typeof i&&(i=0),0!==i?n.rotate(o,t[0],i):n.copy(o,t[0]),n.copy(a,o);for(var h=Math.cos(i),l=Math.sin(i),c=1;ca[f]&&(a[f]=u[f]),u[f]i&&(this.lowerBound[e]=i);var s=t.upperBound[e];this.upperBound[e]h?-1:a}},{"../math/vec2":30,"../utils/Utils":57}],8:[function(t,e,i){function s(t){this.type=t,this.result=[],this.world=null,this.boundingVolumeType=s.AABB}var n=t("../math/vec2"),r=t("../objects/Body");e.exports=s,s.AABB=1,s.BOUNDING_CIRCLE=2,s.prototype.setWorld=function(t){this.world=t},s.prototype.getCollisionPairs=function(t){};var o=n.create();s.boundingRadiusCheck=function(t,e){n.sub(o,t.position,e.position);var i=n.squaredLength(o),s=t.boundingRadius+e.boundingRadius;return i<=s*s},s.aabbCheck=function(t,e){return t.getAABB().overlaps(e.getAABB())},s.prototype.boundingVolumeCheck=function(t,e){var i;switch(this.boundingVolumeType){case s.BOUNDING_CIRCLE:i=s.boundingRadiusCheck(t,e);break;case s.AABB:i=s.aabbCheck(t,e);break;default:throw new Error("Bounding volume type not recognized: "+this.boundingVolumeType)}return i},s.canCollide=function(t,e){var i=r.KINEMATIC,s=r.STATIC;return(t.type!==s||e.type!==s)&&(!(t.type===i&&e.type===s||t.type===s&&e.type===i)&&((t.type!==i||e.type!==i)&&((t.sleepState!==r.SLEEPING||e.sleepState!==r.SLEEPING)&&!(t.sleepState===r.SLEEPING&&e.type===s||e.sleepState===r.SLEEPING&&t.type===s))))},s.NAIVE=1,s.SAP=2},{"../math/vec2":30,"../objects/Body":31}],9:[function(t,e,i){function s(){n.call(this,n.NAIVE)}t("../shapes/Circle"),t("../shapes/Plane"),t("../shapes/Shape"),t("../shapes/Particle");var n=t("../collision/Broadphase");t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.getCollisionPairs=function(t){var e=t.bodies,i=this.result;i.length=0;for(var s=0,r=e.length;s!==r;s++)for(var o=e[s],a=0;az&&Y0)for(G=0;GMath.pow(g,2))return 0;if(u)return!0;var m=this.createContactEquation(t,n,e,r);return a(m.normalA,l,i),o.normalize(m.normalA,m.normalA),o.scale(m.contactPointA,m.normalA,d),o.scale(m.contactPointB,m.normalA,-p),h(m.contactPointA,m.contactPointA,i),a(m.contactPointA,m.contactPointA,t.position),h(m.contactPointB,m.contactPointB,l),a(m.contactPointB,m.contactPointB,n.position),this.contactEquations.push(m),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(m)),1},s.prototype[m.PLANE|m.CONVEX]=s.prototype[m.PLANE|m.BOX]=s.prototype.planeConvex=function(t,e,i,s,n,r,c,u,d){var p=x,f=b,g=_,m=0;o.rotate(f,v,s);for(var y=0;y!==r.vertices.length;y++){var w=r.vertices[y];if(o.rotate(p,w,u),h(p,p,c),a(g,p,i),l(g,f)<=0){if(d)return!0;m++;var T=this.createContactEquation(t,n,e,r);a(g,p,i),o.copy(T.normalA,f);var P=l(g,T.normalA);o.scale(g,T.normalA,P),a(T.contactPointB,p,n.position),a(T.contactPointA,p,g),a(T.contactPointA,T.contactPointA,t.position),this.contactEquations.push(T),this.enableFrictionReduction||this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(T))}}return this.enableFrictionReduction&&this.enableFriction&&m&&this.frictionEquations.push(this.createFrictionFromAverage(m)),m},s.prototype[m.PARTICLE|m.PLANE]=s.prototype.particlePlane=function(t,e,i,s,n,r,h,c,u){var d=x,p=b;c=c||0,a(d,i,h),o.rotate(p,v,c);var f=l(d,p);if(f>0)return 0;if(u)return!0;var g=this.createContactEquation(n,t,r,e);return o.copy(g.normalA,p),o.scale(d,g.normalA,f),a(g.contactPointA,i,d),a(g.contactPointA,g.contactPointA,n.position),a(g.contactPointB,i,t.position),this.contactEquations.push(g),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(g)),1},s.prototype[m.CIRCLE|m.PARTICLE]=s.prototype.circleParticle=function(t,e,i,s,n,r,l,c,u){var d=x;if(a(d,l,i),o.squaredLength(d)>Math.pow(e.radius,2))return 0;if(u)return!0;var p=this.createContactEquation(t,n,e,r);return o.copy(p.normalA,d),o.normalize(p.normalA,p.normalA),o.scale(p.contactPointA,p.normalA,e.radius),h(p.contactPointA,p.contactPointA,i),a(p.contactPointA,p.contactPointA,t.position),a(p.contactPointB,l,n.position),this.contactEquations.push(p),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(p)),1};var K=new f({radius:1}),J=o.create(),Q=o.create();o.create();s.prototype[m.PLANE|m.CAPSULE]=s.prototype.planeCapsule=function(t,e,i,s,n,r,a,l,c){var u=J,d=Q,p=K;o.set(u,-r.length/2,0),o.rotate(u,u,l),h(u,u,a),o.set(d,r.length/2,0),o.rotate(d,d,l),h(d,d,a),p.radius=r.radius;var f;this.enableFrictionReduction&&(f=this.enableFriction,this.enableFriction=!1);var g=this.circlePlane(n,p,u,0,t,e,i,s,c),m=this.circlePlane(n,p,d,0,t,e,i,s,c);if(this.enableFrictionReduction&&(this.enableFriction=f),c)return g||m;var y=g+m;return this.enableFrictionReduction&&y&&this.frictionEquations.push(this.createFrictionFromAverage(y)),y},s.prototype[m.CIRCLE|m.PLANE]=s.prototype.circlePlane=function(t,e,i,s,n,r,c,u,d){var p=t,f=e,g=i,m=n,y=c,w=u;w=w||0;var T=x,P=b,C=_;a(T,g,y),o.rotate(P,v,w);var S=l(P,T);if(S>f.radius)return 0;if(d)return!0;var A=this.createContactEquation(m,p,r,e);return o.copy(A.normalA,P),o.scale(A.contactPointB,A.normalA,-f.radius),h(A.contactPointB,A.contactPointB,g),a(A.contactPointB,A.contactPointB,p.position),o.scale(C,A.normalA,S),a(A.contactPointA,T,C),h(A.contactPointA,A.contactPointA,y),a(A.contactPointA,A.contactPointA,m.position),this.contactEquations.push(A),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(A)),1},s.prototype[m.CONVEX]=s.prototype[m.CONVEX|m.BOX]=s.prototype[m.BOX]=s.prototype.convexConvex=function(t,e,i,n,r,c,u,d,p,f){var g=x,m=b,y=_,v=w,P=T,E=C,M=S,R=A,L=0,f="number"==typeof f?f:0;if(!s.findSeparatingAxis(e,i,n,c,u,d,g))return 0;a(M,u,i),l(g,M)>0&&o.scale(g,g,-1);var B=s.getClosestEdge(e,n,g,!0),I=s.getClosestEdge(c,d,g);if(-1===B||-1===I)return 0;for(var O=0;O<2;O++){var k=B,F=I,D=e,U=c,G=i,N=u,X=n,W=d,j=t,V=r;if(0===O){var q;q=k,k=F,F=q,q=D,D=U,U=q,q=G,G=N,N=q,q=X,X=W,W=q,q=j,j=V,V=q}for(var H=F;H=3){if(p)return!0;var Z=this.createContactEquation(j,V,D,U);L++;var J=D.vertices[k%D.vertices.length],Q=D.vertices[(k+1)%D.vertices.length];o.rotate(y,J,X),o.rotate(v,Q,X),h(y,y,G),h(v,v,G),a(P,v,y),o.rotate90cw(Z.normalA,P),o.normalize(Z.normalA,Z.normalA),a(M,m,y);var $=l(Z.normalA,M);o.scale(E,Z.normalA,$),a(Z.contactPointA,m,G),a(Z.contactPointA,Z.contactPointA,E),h(Z.contactPointA,Z.contactPointA,G),a(Z.contactPointA,Z.contactPointA,j.position),a(Z.contactPointB,m,N),h(Z.contactPointB,Z.contactPointB,N),a(Z.contactPointB,Z.contactPointB,V.position),this.contactEquations.push(Z),this.enableFrictionReduction||this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(Z))}}}return this.enableFrictionReduction&&this.enableFriction&&L&&this.frictionEquations.push(this.createFrictionFromAverage(L)),L};var Z=o.fromValues(0,0);s.projectConvexOntoAxis=function(t,e,i,s,n){var r,a,h=null,c=null,u=Z;o.rotate(u,s,-i);for(var d=0;dh)&&(h=a),(null===c||ah){var p=c;c=h,h=p}var f=l(e,s);o.set(n,c+f,h+f)};var $=o.fromValues(0,0),tt=o.fromValues(0,0),et=o.fromValues(0,0),it=o.fromValues(0,0),st=o.fromValues(0,0),nt=o.fromValues(0,0);s.findSeparatingAxis=function(t,e,i,n,r,h,l){var c=null,u=!1,d=!1,p=$,f=tt,g=et,m=it,v=st,x=nt;if(t instanceof y&&n instanceof y)for(P=0;2!==P;P++){var b=t,_=i;1===P&&(b=n,_=h);for(C=0;2!==C;C++){0===C?o.set(m,0,1):1===C&&o.set(m,1,0),0!==_&&o.rotate(m,m,_),s.projectConvexOntoAxis(t,e,i,m,v),s.projectConvexOntoAxis(n,r,h,m,x);var w=v,T=x;v[0]>x[0]&&(T=v,w=x,!0),u=(S=T[0]-w[1])<=0,(null===c||S>c)&&(o.copy(l,m),c=S,d=u)}}else for(var P=0;2!==P;P++){var b=t,_=i;1===P&&(b=n,_=h);for(var C=0;C!==b.vertices.length;C++){o.rotate(f,b.vertices[C],_),o.rotate(g,b.vertices[(C+1)%b.vertices.length],_),a(p,g,f),o.rotate90cw(m,p),o.normalize(m,m),s.projectConvexOntoAxis(t,e,i,m,v),s.projectConvexOntoAxis(n,r,h,m,x);var w=v,T=x;v[0]>x[0]&&(T=v,w=x,!0);var S=T[0]-w[1];u=S<=0,(null===c||S>c)&&(o.copy(l,m),c=S,d=u)}}return d};var rt=o.fromValues(0,0),ot=o.fromValues(0,0),at=o.fromValues(0,0);s.getClosestEdge=function(t,e,i,s){var n=rt,r=ot,h=at;o.rotate(n,i,-e),s&&o.scale(n,n,-1);for(var c=-1,u=t.vertices.length,d=-1,p=0;p!==u;p++){a(r,t.vertices[(p+1)%u],t.vertices[p%u]),o.rotate90cw(h,r),o.normalize(h,h);var f=l(h,n);(-1===c||f>d)&&(c=p%u,d=f)}return c};var ht=o.create(),lt=o.create(),ct=o.create(),ut=o.create(),dt=o.create(),pt=o.create(),ft=o.create();s.prototype[m.CIRCLE|m.HEIGHTFIELD]=s.prototype.circleHeightfield=function(t,e,i,s,n,r,l,c,u,d){var p=r.heights,d=d||e.radius,f=r.elementWidth,g=lt,m=ht,y=dt,v=ft,x=pt,b=ct,_=ut,w=Math.floor((i[0]-d-l[0])/f),T=Math.ceil((i[0]+d-l[0])/f);w<0&&(w=0),T>=p.length&&(T=p.length-1);for(var P=p[w],C=p[T],S=w;SP&&(P=p[S]);if(i[1]-d>P)return!u&&0;for(var A=!1,S=w;S=b[0]&&m[0]<_[0]&&E<=0){if(u)return!0;A=!0,o.scale(g,x,-E),o.add(y,m,g),o.copy(v,x);M=this.createContactEquation(n,t,r,e);o.copy(M.normalA,v),o.scale(M.contactPointB,M.normalA,-d),h(M.contactPointB,M.contactPointB,i),a(M.contactPointB,M.contactPointB,t.position),o.copy(M.contactPointA,y),o.sub(M.contactPointA,M.contactPointA,n.position),this.contactEquations.push(M),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(M))}}if(A=!1,d>0)for(S=w;S<=T;S++)if(o.set(b,S*f,p[S]),o.add(b,b,l),o.sub(g,i,b),o.squaredLength(g)=c.length&&(y=c.length-1);for(var v=c[m],x=c[y],b=m;bv&&(v=c[b]);if(t.aabb.lowerBound[1]>v)return!l&&0;for(var _=0,b=m;b=0||r.containsPoint(this.from))&&this.intersectBody(t,n)}};var o=r.create();s.prototype.intersectBody=function(t,e){var i=this.checkCollisionResponse;if(!i||e.collisionResponse)for(var s=o,n=0,a=e.shapes.length;ne.boundingRadius*e.boundingRadius||(this._currentBody=r,this._currentShape=e,e.raycast(t,this,s,i),this._currentBody=this._currentShape=null)},s.prototype.getAABB=function(t){var e=this.to,i=this.from;r.set(t.lowerBound,Math.min(e[0],i[0]),Math.min(e[1],i[1])),r.set(t.upperBound,Math.max(e[0],i[0]),Math.max(e[1],i[1]))};r.create();s.prototype.reportIntersection=function(t,e,i,n){this.from,this.to;var o=this._currentShape,a=this._currentBody;if(!(this.skipBackfaces&&r.dot(i,this.direction)>0))switch(this.mode){case s.ALL:t.set(i,o,a,e,n),this.callback(t);break;case s.CLOSEST:(e=0&&!(t[r].aabb.lowerBound[e]<=n.aabb.lowerBound[e]);r--)t[r+1]=t[r];t[r+1]=n}return t},s.prototype.sortList=function(){var t=this.axisList,e=this.axisIndex;s.sortAxisList(t,e)},s.prototype.getCollisionPairs=function(t){var e=this.axisList,i=this.result,s=this.axisIndex;i.length=0;for(var n=e.length;n--;){var o=e[n];o.aabbNeedsUpdate&&o.updateAABB()}this.sortList();for(var a=0,h=0|e.length;a!==h;a++)for(var l=e[a],c=a+1;cthis.upperLimit&&(r.maxForce=0,r.minForce=-this.maxForce,this.distance=this.upperLimit,u=!0),this.lowerLimitEnabled&&this.positioni?(a.scale(n.normalA,l,-1),a.sub(n.contactPointA,c,o.position),a.sub(n.contactPointB,u,h.position),a.scale(f,l,i),a.add(n.contactPointA,n.contactPointA,f),-1===t.indexOf(n)&&t.push(n)):-1!==(b=t.indexOf(n))&&t.splice(b,1),this.lowerLimitEnabled&&va?(f.angle=a,-1===n.indexOf(f)&&n.push(f)):-1!==(y=n.indexOf(f))&&n.splice(y,1),this.lowerLimitEnabled&&m>1;if(e<3)return[];for(var i=[],n=[],r=0;r3;){var a=n[(r+0)%o],h=n[(r+1)%o],l=n[(r+2)%o],c=t[2*a],u=t[2*a+1],d=t[2*h],p=t[2*h+1],f=t[2*l],g=t[2*l+1],m=!1;if(s._convex(c,u,d,p,f,g)){m=!0;for(var y=0;y3*o)break}return i.push(n[0],n[1],n[2]),i},s._PointInTriangle=function(t,e,i,s,n,r,o,a){var h=o-i,l=a-s,c=n-i,u=r-s,d=t-i,p=e-s,f=h*h+l*l,g=h*c+l*u,m=h*d+l*p,y=c*c+u*u,v=c*d+u*p,x=1/(f*y-g*g),b=(y*m-g*v)*x,_=(f*v-g*m)*x;return b>=0&&_>=0&&b+_<1},s._convex=function(t,e,i,s,n,r){return(e-s)*(n-i)+(i-t)*(r-s)>=0},e.exports=s},{}],30:[function(t,e,i){var s=e.exports={},n=t("../utils/Utils");s.crossLength=function(t,e){return t[0]*e[1]-t[1]*e[0]},s.crossVZ=function(t,e,i){return s.rotate(t,e,-Math.PI/2),s.scale(t,t,i),t},s.crossZV=function(t,e,i){return s.rotate(t,i,Math.PI/2),s.scale(t,t,e),t},s.rotate=function(t,e,i){if(0!==i){var s=Math.cos(i),n=Math.sin(i),r=e[0],o=e[1];t[0]=s*r-n*o,t[1]=n*r+s*o}else t[0]=e[0],t[1]=e[1]},s.rotate90cw=function(t,e){var i=e[0],s=e[1];t[0]=s,t[1]=-i},s.toLocalFrame=function(t,e,i,n){s.copy(t,e),s.sub(t,t,i),s.rotate(t,t,-n)},s.toGlobalFrame=function(t,e,i,n){s.copy(t,e),s.rotate(t,t,n),s.add(t,t,i)},s.vectorToLocalFrame=function(t,e,i){s.rotate(t,e,-i)},s.vectorToGlobalFrame=function(t,e,i){s.rotate(t,e,i)},s.centroid=function(t,e,i,n){return s.add(t,e,i),s.add(t,t,n),s.scale(t,t,1/3),t},s.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},s.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},s.fromValues=function(t,e){var i=new n.ARRAY_TYPE(2);return i[0]=t,i[1]=e,i},s.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},s.set=function(t,e,i){return t[0]=e,t[1]=i,t},s.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},s.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},s.sub=s.subtract,s.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},s.mul=s.multiply,s.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},s.div=s.divide,s.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},s.distance=function(t,e){var i=e[0]-t[0],s=e[1]-t[1];return Math.sqrt(i*i+s*s)},s.dist=s.distance,s.squaredDistance=function(t,e){var i=e[0]-t[0],s=e[1]-t[1];return i*i+s*s},s.sqrDist=s.squaredDistance,s.length=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},s.len=s.length,s.squaredLength=function(t){var e=t[0],i=t[1];return e*e+i*i},s.sqrLen=s.squaredLength,s.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},s.normalize=function(t,e){var i=e[0],s=e[1],n=i*i+s*s;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t},s.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},s.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},s.lerp=function(t,e,i,s){var n=e[0],r=e[1];return t[0]=n+s*(i[0]-n),t[1]=r+s*(i[1]-r),t},s.reflect=function(t,e,i){var s=e[0]*i[0]+e[1]*i[1];t[0]=e[0]-2*i[0]*s,t[1]=e[1]-2*i[1]*s},s.getLineSegmentsIntersection=function(t,e,i,n,r){var o=s.getLineSegmentsIntersectionFraction(e,i,n,r);return!(o<0)&&(t[0]=e[0]+o*(i[0]-e[0]),t[1]=e[1]+o*(i[1]-e[1]),!0)},s.getLineSegmentsIntersectionFraction=function(t,e,i,s){var n,r,o=e[0]-t[0],a=e[1]-t[1],h=s[0]-i[0],l=s[1]-i[1];return n=(-a*(t[0]-i[0])+o*(t[1]-i[1]))/(-h*a+o*l),r=(h*(t[1]-i[1])-l*(t[0]-i[0]))/(-h*a+o*l),n>=0&&n<=1&&r>=0&&r<=1?r:-1}},{"../utils/Utils":57}],31:[function(t,e,i){function s(t){t=t||{},c.call(this),this.id=t.id||++s._idCounter,this.world=null,this.shapes=[],this.mass=t.mass||0,this.invMass=0,this.inertia=0,this.invInertia=0,this.invMassSolve=0,this.invInertiaSolve=0,this.fixedRotation=!!t.fixedRotation,this.fixedX=!!t.fixedX,this.fixedY=!!t.fixedY,this.massMultiplier=n.create(),this.position=n.fromValues(0,0),t.position&&n.copy(this.position,t.position),this.interpolatedPosition=n.fromValues(0,0),this.interpolatedAngle=0,this.previousPosition=n.fromValues(0,0),this.previousAngle=0,this.velocity=n.fromValues(0,0),t.velocity&&n.copy(this.velocity,t.velocity),this.vlambda=n.fromValues(0,0),this.wlambda=0,this.angle=t.angle||0,this.angularVelocity=t.angularVelocity||0,this.force=n.create(),t.force&&n.copy(this.force,t.force),this.angularForce=t.angularForce||0,this.damping="number"==typeof t.damping?t.damping:.1,this.angularDamping="number"==typeof t.angularDamping?t.angularDamping:.1,this.type=s.STATIC,void 0!==t.type?this.type=t.type:t.mass?this.type=s.DYNAMIC:this.type=s.STATIC,this.boundingRadius=0,this.aabb=new l,this.aabbNeedsUpdate=!0,this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.wantsToSleep=!1,this.sleepState=s.AWAKE,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.2,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.gravityScale=void 0!==t.gravityScale?t.gravityScale:1,this.collisionResponse=void 0===t.collisionResponse||t.collisionResponse,this.idleTime=0,this.timeLastSleepy=0,this.ccdSpeedThreshold=void 0!==t.ccdSpeedThreshold?t.ccdSpeedThreshold:-1,this.ccdIterations=void 0!==t.ccdIterations?t.ccdIterations:10,this.concavePath=null,this._wakeUpAfterNarrowphase=!1,this.updateMassProperties()}var n=t("../math/vec2"),r=t("poly-decomp"),o=t("../shapes/Convex"),a=t("../collision/RaycastResult"),h=t("../collision/Ray"),l=t("../collision/AABB"),c=t("../events/EventEmitter");e.exports=s,s.prototype=new c,s.prototype.constructor=s,s._idCounter=0,s.prototype.updateSolveMassProperties=function(){this.sleepState===s.SLEEPING||this.type===s.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve=0):(this.invMassSolve=this.invMass,this.invInertiaSolve=this.invInertia)},s.prototype.setDensity=function(t){var e=this.getArea();this.mass=e*t,this.updateMassProperties()},s.prototype.getArea=function(){for(var t=0,e=0;ei&&(i=o+a)}this.boundingRadius=i},s.prototype.addShape=function(t,e,i){if(t.body)throw new Error("A shape can only be added to one body.");t.body=this,e?n.copy(t.position,e):n.set(t.position,0,0),t.angle=i||0,this.shapes.push(t),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0},s.prototype.removeShape=function(t){var e=this.shapes.indexOf(t);return-1!==e&&(this.shapes.splice(e,1),this.aabbNeedsUpdate=!0,t.body=null,!0)},s.prototype.updateMassProperties=function(){if(this.type===s.STATIC||this.type===s.KINEMATIC)this.mass=Number.MAX_VALUE,this.invMass=0,this.inertia=Number.MAX_VALUE,this.invInertia=0;else{var t=this.shapes,e=t.length,i=this.mass/e,r=0;if(this.fixedRotation)this.inertia=Number.MAX_VALUE,this.invInertia=0;else{for(var o=0;o0?1/r:0}this.invMass=1/this.mass,n.set(this.massMultiplier,this.fixedX?0:1,this.fixedY?0:1)}};n.create();s.prototype.applyForce=function(t,e){if(n.add(this.force,this.force,t),e){var i=n.crossLength(e,t);this.angularForce+=i}};var p=n.create(),f=n.create(),g=n.create();s.prototype.applyForceLocal=function(t,e){e=e||g;var i=p,s=f;this.vectorToWorldFrame(i,t),this.vectorToWorldFrame(s,e),this.applyForce(i,s)};var m=n.create();s.prototype.applyImpulse=function(t,e){if(this.type===s.DYNAMIC){var i=m;if(n.scale(i,t,this.invMass),n.multiply(i,this.massMultiplier,i),n.add(this.velocity,i,this.velocity),e){var r=n.crossLength(e,t);r*=this.invInertia,this.angularVelocity+=r}}};var y=n.create(),v=n.create(),x=n.create();s.prototype.applyImpulseLocal=function(t,e){e=e||x;var i=y,s=v;this.vectorToWorldFrame(i,t),this.vectorToWorldFrame(s,e),this.applyImpulse(i,s)},s.prototype.toLocalFrame=function(t,e){n.toLocalFrame(t,e,this.position,this.angle)},s.prototype.toWorldFrame=function(t,e){n.toGlobalFrame(t,e,this.position,this.angle)},s.prototype.vectorToLocalFrame=function(t,e){n.vectorToLocalFrame(t,e,this.angle)},s.prototype.vectorToWorldFrame=function(t,e){n.vectorToGlobalFrame(t,e,this.angle)},s.prototype.fromPolygon=function(t,e){e=e||{};for(h=this.shapes.length;h>=0;--h)this.removeShape(this.shapes[h]);var i=new r.Polygon;if(i.vertices=t,i.makeCCW(),"number"==typeof e.removeCollinearPoints&&i.removeCollinearPoints(e.removeCollinearPoints),void 0===e.skipSimpleCheck&&!i.isSimple())return!1;this.concavePath=i.vertices.slice(0);for(h=0;h=Math.pow(this.sleepSpeedLimit,2)?(this.idleTime=0,this.sleepState=s.AWAKE):(this.idleTime+=i,this.sleepState=s.SLEEPY),this.idleTime>this.sleepTimeLimit&&(e?this.wantsToSleep=!0:this.sleep())}},s.prototype.overlaps=function(t){return this.world.overlapKeeper.bodiesAreOverlapping(this,t)};var T=n.create(),P=n.create();s.prototype.integrate=function(t){var e=this.invMass,i=this.force,s=this.position,r=this.velocity;n.copy(this.previousPosition,this.position),this.previousAngle=this.angle,this.fixedRotation||(this.angularVelocity+=this.angularForce*this.invInertia*t),n.scale(T,i,t*e),n.multiply(T,this.massMultiplier,T),n.add(r,T,r),this.integrateToTimeOfImpact(t)||(n.scale(P,r,t),n.add(s,s,P),this.fixedRotation||(this.angle+=this.angularVelocity*t)),this.aabbNeedsUpdate=!0};var C=new a,S=new h({mode:h.ALL}),A=n.create(),E=n.create(),M=n.create(),R=n.create();s.prototype.integrateToTimeOfImpact=function(t){if(this.ccdSpeedThreshold<0||n.squaredLength(this.velocity)=l&&h=0&&(r.rotate(p,u,s),r.scale(p,p,2*y-1),e.reportIntersection(t,T,p,-1),t.shouldStop(e)))return}for(var x=Math.pow(this.radius,2)+Math.pow(m,2),y=0;y<2;y++){r.set(f,m*(2*y-1),0),r.toGlobalFrame(f,f,i,s);var b=Math.pow(o[0]-n[0],2)+Math.pow(o[1]-n[1],2),_=2*((o[0]-n[0])*(n[0]-f[0])+(o[1]-n[1])*(n[1]-f[1])),w=Math.pow(n[0]-f[0],2)+Math.pow(n[1]-f[1],2)-Math.pow(this.radius,2),T=Math.pow(_,2)-4*b*w;if(!(T<0))if(0===T){if(r.lerp(d,n,o,T),r.squaredDistance(d,i)>x&&(r.sub(p,d,f),r.normalize(p,p),e.reportIntersection(t,T,p,-1),t.shouldStop(e)))return}else{var P=Math.sqrt(T),C=1/(2*b),S=(-_-P)*C,A=(-_+P)*C;if(S>=0&&S<=1&&(r.lerp(d,n,o,S),r.squaredDistance(d,i)>x&&(r.sub(p,d,f),r.normalize(p,p),e.reportIntersection(t,S,p,-1),t.shouldStop(e))))return;if(A>=0&&A<=1&&(r.lerp(d,n,o,A),r.squaredDistance(d,i)>x&&(r.sub(p,d,f),r.normalize(p,p),e.reportIntersection(t,A,p,-1),t.shouldStop(e))))return}}}},{"../math/vec2":30,"./Shape":45}],39:[function(t,e,i){function s(t){"number"==typeof arguments[0]&&(t={radius:arguments[0]},console.warn("The Circle constructor signature has changed. Please use the following format: new Circle({ radius: 1 })")),t=t||{},this.radius=t.radius||1,t.type=n.CIRCLE,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeMomentOfInertia=function(t){var e=this.radius;return t*e*e/2},s.prototype.updateBoundingRadius=function(){this.boundingRadius=this.radius},s.prototype.updateArea=function(){this.area=Math.PI*this.radius*this.radius},s.prototype.computeAABB=function(t,e,i){var s=this.radius;r.set(t.upperBound,s,s),r.set(t.lowerBound,-s,-s),e&&(r.add(t.lowerBound,t.lowerBound,e),r.add(t.upperBound,t.upperBound,e))};var o=r.create(),a=r.create();s.prototype.raycast=function(t,e,i,s){var n=e.from,h=e.to,l=this.radius,c=Math.pow(h[0]-n[0],2)+Math.pow(h[1]-n[1],2),u=2*((h[0]-n[0])*(n[0]-i[0])+(h[1]-n[1])*(n[1]-i[1])),d=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)-Math.pow(l,2),p=Math.pow(u,2)-4*c*d,f=o,g=a;if(!(p<0))if(0===p)r.lerp(f,n,h,p),r.sub(g,f,i),r.normalize(g,g),e.reportIntersection(t,p,g,-1);else{var m=Math.sqrt(p),y=1/(2*c),v=(-u-m)*y,x=(-u+m)*y;if(v>=0&&v<=1&&(r.lerp(f,n,h,v),r.sub(g,f,i),r.normalize(g,g),e.reportIntersection(t,v,g,-1),t.shouldStop(e)))return;x>=0&&x<=1&&(r.lerp(f,n,h,x),r.sub(g,f,i),r.normalize(g,g),e.reportIntersection(t,x,g,-1))}}},{"../math/vec2":30,"./Shape":45}],40:[function(t,e,i){function s(t){Array.isArray(arguments[0])&&(t={vertices:arguments[0],axes:arguments[1]},console.warn("The Convex constructor signature has changed. Please use the following format: new Convex({ vertices: [...], ... })")),t=t||{},this.vertices=[];for(var e=void 0!==t.vertices?t.vertices:[],i=0;in)&&(n=s),(null===o||sn){var l=o;o=n,n=l}r.set(e,o,n)},s.prototype.projectOntoWorldAxis=function(t,e,i,s){var n=h;this.projectOntoLocalAxis(t,s),0!==i?r.rotate(n,t,i):n=t;var o=r.dot(e,n);r.set(s,s[0]+o,s[1]+o)},s.prototype.updateTriangles=function(){this.triangles.length=0;for(var t=[],e=0;ee&&(e=s)}this.boundingRadius=Math.sqrt(e)},s.triangleArea=function(t,e,i){return.5*((e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1]))},s.prototype.updateArea=function(){this.updateTriangles(),this.area=0;for(var t=this.triangles,e=this.vertices,i=0;i!==t.length;i++){var n=t[i],r=e[n[0]],o=e[n[1]],a=e[n[2]],h=s.triangleArea(r,o,a);this.area+=h}},s.prototype.computeAABB=function(t,e,i){t.setFromPoints(this.vertices,e,i,0)};var f=r.create(),g=r.create(),m=r.create();s.prototype.raycast=function(t,e,i,s){var n=f,o=g,a=m,h=this.vertices;r.toLocalFrame(n,e.from,i,s),r.toLocalFrame(o,e.to,i,s);for(var l=h.length,c=0;c=0&&(r.sub(a,d,u),r.rotate(a,a,-Math.PI/2+s),r.normalize(a,a),e.reportIntersection(t,p,a,c))}}},{"../math/polyk":29,"../math/vec2":30,"./Shape":45,"poly-decomp":5}],41:[function(t,e,i){function s(t){if(Array.isArray(arguments[0])){if(t={heights:arguments[0]},"object"==typeof arguments[1])for(var e in arguments[1])t[e]=arguments[1][e];console.warn("The Heightfield constructor signature has changed. Please use the following format: new Heightfield({ heights: [...], ... })")}t=t||{},this.heights=t.heights?t.heights.slice(0):[],this.maxValue=t.maxValue||null,this.minValue=t.minValue||null,this.elementWidth=t.elementWidth||.1,void 0!==t.maxValue&&void 0!==t.minValue||this.updateMaxMinValues(),t.type=n.HEIGHTFIELD,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");t("../utils/Utils");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.updateMaxMinValues=function(){for(var t=this.heights,e=t[0],i=t[0],s=0;s!==t.length;s++){var n=t[s];n>e&&(e=n),nv){var x=y;y=v,v=x}for(var b=0;b=0&&(r.sub(d,f,p),r.rotate(d,d,s+Math.PI/2),r.normalize(d,d),e.reportIntersection(t,_,d,-1),t.shouldStop(e)))return}}},{"../math/vec2":30,"../utils/Utils":57,"./Shape":45}],42:[function(t,e,i){function s(t){"number"==typeof arguments[0]&&(t={length:arguments[0]},console.warn("The Line constructor signature has changed. Please use the following format: new Line({ length: 1, ... })")),t=t||{},this.length=t.length||1,t.type=n.LINE,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeMomentOfInertia=function(t){return t*Math.pow(this.length,2)/12},s.prototype.updateBoundingRadius=function(){this.boundingRadius=this.length/2};var o=[r.create(),r.create()];s.prototype.computeAABB=function(t,e,i){var s=this.length/2;r.set(o[0],-s,0),r.set(o[1],s,0),t.setFromPoints(o,e,i,0)};r.create();var a=r.create(),h=r.create(),l=r.create(),c=r.fromValues(0,1);s.prototype.raycast=function(t,e,i,s){var n=e.from,o=e.to,u=h,d=l,p=this.length/2;r.set(u,-p,0),r.set(d,p,0),r.toGlobalFrame(u,u,i,s),r.toGlobalFrame(d,d,i,s);var f=r.getLineSegmentsIntersectionFraction(u,d,n,o);if(f>=0){var g=a;r.rotate(g,c,s),e.reportIntersection(t,f,g,-1)}}},{"../math/vec2":30,"./Shape":45}],43:[function(t,e,i){function s(t){(t=t||{}).type=n.PARTICLE,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeMomentOfInertia=function(t){return 0},s.prototype.updateBoundingRadius=function(){this.boundingRadius=0},s.prototype.computeAABB=function(t,e,i){r.copy(t.lowerBound,e),r.copy(t.upperBound,e)}},{"../math/vec2":30,"./Shape":45}],44:[function(t,e,i){function s(t){(t=t||{}).type=n.PLANE,n.call(this,t)}var n=t("./Shape"),r=t("../math/vec2");t("../utils/Utils");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.computeMomentOfInertia=function(t){return 0},s.prototype.updateBoundingRadius=function(){this.boundingRadius=Number.MAX_VALUE},s.prototype.computeAABB=function(t,e,i){var s=i%(2*Math.PI),n=r.set,o=t.lowerBound,a=t.upperBound;n(o,-1e7,-1e7),n(a,1e7,1e7),0===s?a[1]=0:s===Math.PI/2?o[0]=0:s===Math.PI?o[1]=0:s===3*Math.PI/2&&(a[0]=0)},s.prototype.updateArea=function(){this.area=Number.MAX_VALUE};var o=r.create(),a=(r.create(),r.create(),r.create()),h=r.create();s.prototype.raycast=function(t,e,i,s){var n=e.from,l=e.to,c=e.direction,u=o,d=a,p=h;r.set(d,0,1),r.rotate(d,d,s),r.sub(p,n,i);var f=r.dot(p,d);if(r.sub(p,l,i),!(f*r.dot(p,d)>0||r.squaredDistance(n,l)p*a&&(g=p*a-u),r[t]+=g,e.addToWlambda(g),g}},{"../equations/FrictionEquation":23,"../math/vec2":30,"../utils/Utils":57,"./Solver":47}],47:[function(t,e,i){function s(t,e){t=t||{},n.call(this),this.type=e,this.equations=[],this.equationSortFunction=t.equationSortFunction||!1}t("../utils/Utils");var n=t("../events/EventEmitter");e.exports=s,(s.prototype=new n).constructor=s,s.prototype.solve=function(t,e){throw new Error("Solver.solve should be implemented by subclasses!")};var r={bodies:[]};s.prototype.solveIsland=function(t,e){this.removeAllEquations(),e.equations.length&&(this.addEquations(e.equations),r.bodies.length=0,e.getBodies(r.bodies),r.bodies.length&&this.solve(t,r))},s.prototype.sortEquations=function(){this.equationSortFunction&&this.equations.sort(this.equationSortFunction)},s.prototype.addEquation=function(t){t.enabled&&this.equations.push(t)},s.prototype.addEquations=function(t){for(var e=0,i=t.length;e!==i;e++){var s=t[e];s.enabled&&this.equations.push(s)}},s.prototype.removeEquation=function(t){var e=this.equations.indexOf(t);-1!==e&&this.equations.splice(e,1)},s.prototype.removeAllEquations=function(){this.equations.length=0},s.GS=1,s.ISLAND=2},{"../events/EventEmitter":26,"../utils/Utils":57}],48:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("../equations/ContactEquation"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.bodyA=t.bodyB=null,this}},{"../equations/ContactEquation":21,"./Pool":55}],49:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("../equations/FrictionEquation"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.bodyA=t.bodyB=null,this}},{"../equations/FrictionEquation":23,"./Pool":55}],50:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("../world/IslandNode"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.reset(),this}},{"../world/IslandNode":60,"./Pool":55}],51:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("../world/Island"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.reset(),this}},{"../world/Island":58,"./Pool":55}],52:[function(t,e,i){function s(){this.overlappingShapesLastState=new n,this.overlappingShapesCurrentState=new n,this.recordPool=new r({size:16}),this.tmpDict=new n,this.tmpArray1=[]}var n=t("./TupleDictionary"),r=(t("./OverlapKeeperRecord"),t("./OverlapKeeperRecordPool"));t("./Utils");e.exports=s,s.prototype.tick=function(){for(var t=this.overlappingShapesLastState,e=this.overlappingShapesCurrentState,i=t.keys.length;i--;){var s=t.keys[i],n=t.getByKey(s);e.getByKey(s);n&&this.recordPool.release(n)}t.reset(),t.copy(e),e.reset()},s.prototype.setOverlapping=function(t,e,i,s){this.overlappingShapesLastState;var n=this.overlappingShapesCurrentState;if(!n.get(e.id,s.id)){var r=this.recordPool.get();r.set(t,e,i,s),n.set(e.id,s.id,r)}},s.prototype.getNewOverlaps=function(t){return this.getDiff(this.overlappingShapesLastState,this.overlappingShapesCurrentState,t)},s.prototype.getEndOverlaps=function(t){return this.getDiff(this.overlappingShapesCurrentState,this.overlappingShapesLastState,t)},s.prototype.bodiesAreOverlapping=function(t,e){for(var i=this.overlappingShapesCurrentState,s=i.keys.length;s--;){var n=i.keys[s],r=i.data[n];if(r.bodyA===t&&r.bodyB===e||r.bodyA===e&&r.bodyB===t)return!0}return!1},s.prototype.getDiff=function(t,e,i){var s=t,n=e;(i=i||[]).length=0;for(var r=n.keys.length;r--;){var o=n.keys[r],a=n.data[o];if(!a)throw new Error("Key "+o+" had no data!");s.data[o]||i.push(a)}return i},s.prototype.isNewOverlap=function(t,e){var i=0|t.id,s=0|e.id,n=this.overlappingShapesLastState,r=this.overlappingShapesCurrentState;return!n.get(i,s)&&!!r.get(i,s)},s.prototype.getNewBodyOverlaps=function(t){this.tmpArray1.length=0;var e=this.getNewOverlaps(this.tmpArray1);return this.getBodyDiff(e,t)},s.prototype.getEndBodyOverlaps=function(t){this.tmpArray1.length=0;var e=this.getEndOverlaps(this.tmpArray1);return this.getBodyDiff(e,t)},s.prototype.getBodyDiff=function(t,e){e=e||[];for(var i=this.tmpDict,s=t.length;s--;){var n=t[s];i.set(0|n.bodyA.id,0|n.bodyB.id,n)}for(s=i.keys.length;s--;)(n=i.getByKey(i.keys[s]))&&e.push(n.bodyA,n.bodyB);return i.reset(),e}},{"./OverlapKeeperRecord":53,"./OverlapKeeperRecordPool":54,"./TupleDictionary":56,"./Utils":57}],53:[function(t,e,i){function s(t,e,i,s){this.shapeA=e,this.shapeB=s,this.bodyA=t,this.bodyB=i}e.exports=s,s.prototype.set=function(t,e,i,n){s.call(this,t,e,i,n)}},{}],54:[function(t,e,i){function s(){r.apply(this,arguments)}var n=t("./OverlapKeeperRecord"),r=t("./Pool");e.exports=s,(s.prototype=new r).constructor=s,s.prototype.create=function(){return new n},s.prototype.destroy=function(t){return t.bodyA=t.bodyB=t.shapeA=t.shapeB=null,this}},{"./OverlapKeeperRecord":53,"./Pool":55}],55:[function(t,e,i){function s(t){t=t||{},this.objects=[],void 0!==t.size&&this.resize(t.size)}e.exports=s,s.prototype.resize=function(t){for(var e=this.objects;e.length>t;)e.pop();for(;e.length(0|e)?t<<16|65535&e:e<<16|65535&t)},s.prototype.getByKey=function(t){return t|=0,this.data[t]},s.prototype.get=function(t,e){return this.data[this.getKey(t,e)]},s.prototype.set=function(t,e,i){if(!i)throw new Error("No data!");var s=this.getKey(t,e);return this.data[s]||this.keys.push(s),this.data[s]=i,s},s.prototype.reset=function(){for(var t=this.data,e=this.keys,i=e.length;i--;)delete t[e[i]];e.length=0},s.prototype.copy=function(t){this.reset(),n.appendArray(this.keys,t.keys);for(var e=t.keys.length;e--;){var i=t.keys[e];this.data[i]=t.data[i]}}},{"./Utils":57}],57:[function(t,e,i){function s(){}e.exports=s,s.appendArray=function(t,e){if(e.length<15e4)t.push.apply(t,e);else for(var i=0,s=e.length;i!==s;++i)t.push(e[i])},s.splice=function(t,e,i){i=i||1;for(var s=e,n=t.length-i;s=t&&s=0;T-=2)for(S=b.length-2;S>=0;S-=2)(w[T]===b[S]&&w[T+1]===b[S+1]||w[T+1]===b[S]&&w[T]===b[S+1])&&b.splice(S,2);q=u.length;for(T=0;T!==q;T++){var C=u[T];if(!C.collideConnected)for(var S=b.length-2;S>=0;S-=2)(C.bodyA===b[S]&&C.bodyB===b[S+1]||C.bodyB===b[S]&&C.bodyA===b[S+1])&&b.splice(S,2)}this.postBroadphaseEvent.pairs=b,this.emit(this.postBroadphaseEvent),this.postBroadphaseEvent.pairs=null,c.reset(this);for(var T=0,A=b.length;T!==A;T+=2)for(var E=b[T],M=b[T+1],R=0,L=E.shapes.length;R!==L;R++)for(var B=E.shapes[R],I=B.position,O=B.angle,k=0,F=M.shapes.length;k!==F;k++){var D=M.shapes[k],U=D.position,G=D.angle,N=this.defaultContactMaterial;if(B.material&&D.material){var X=this.getContactMaterial(B.material,D.material);X&&(N=X)}this.runNarrowphase(c,E,B,I,O,M,D,U,G,N,this.frictionGravity)}for(T=0;T!==h;T++)(H=n[T])._wakeUpAfterNarrowphase&&(H.wakeUp(),H._wakeUpAfterNarrowphase=!1);if(this.has("endContact")){this.overlapKeeper.getEndOverlaps(P);for(var W=this.endContactEvent,k=P.length;k--;){var j=P[k];W.shapeA=j.shapeA,W.shapeB=j.shapeB,W.bodyA=j.bodyA,W.bodyB=j.bodyB,this.emit(W)}P.length=0}var V=this.preSolveEvent;V.contactEquations=c.contactEquations,V.frictionEquations=c.frictionEquations,this.emit(V),V.contactEquations=V.frictionEquations=null;var q=u.length;for(T=0;T!==q;T++)u[T].update();if(c.contactEquations.length||c.frictionEquations.length||q)if(this.islandSplit){for(g.equations.length=0,v.appendArray(g.equations,c.contactEquations),v.appendArray(g.equations,c.frictionEquations),T=0;T!==q;T++)v.appendArray(g.equations,u[T].equations);g.split(this);for(T=0;T!==g.islands.length;T++)(K=g.islands[T]).equations.length&&a.solveIsland(t,K)}else{for(a.addEquations(c.contactEquations),a.addEquations(c.frictionEquations),T=0;T!==q;T++)a.addEquations(u[T].equations);this.solveConstraints&&a.solve(t,this),a.removeAllEquations()}for(T=0;T!==h;T++){var H=n[T];H.integrate(t)}for(T=0;T!==h;T++)n[T].setZeroForce();if(this.emitImpactEvent&&this.has("impact"))for(var Y=this.impactEvent,T=0;T!==c.contactEquations.length;T++){var z=c.contactEquations[T];z.firstImpact&&(Y.bodyA=z.bodyA,Y.bodyB=z.bodyB,Y.shapeA=z.shapeA,Y.shapeB=z.shapeB,Y.contactEquation=z,this.emit(Y))}if(this.sleepMode===s.BODY_SLEEPING)for(T=0;T!==h;T++)n[T].sleepTick(this.time,!1,t);else if(this.sleepMode===s.ISLAND_SLEEPING&&this.islandSplit){for(T=0;T!==h;T++)n[T].sleepTick(this.time,!0,t);for(T=0;T0,t.frictionCoefficient=c.friction;var g;g=e.type===d.STATIC||e.type===d.KINEMATIC?o.mass:o.type===d.STATIC||o.type===d.KINEMATIC?e.mass:e.mass*o.mass/(e.mass+o.mass),t.slipForce=c.friction*u*g,t.restitution=c.restitution,t.surfaceVelocity=c.surfaceVelocity,t.frictionStiffness=c.frictionStiffness,t.frictionRelaxation=c.frictionRelaxation,t.stiffness=c.stiffness,t.relaxation=c.relaxation,t.contactSkinSize=c.contactSkinSize,t.enabledEquations=e.collisionResponse&&o.collisionResponse&&i.collisionResponse&&a.collisionResponse;var m=t[i.type|a.type],y=0;if(m){var v=i.sensor||a.sensor,x=t.frictionEquations.length;y=i.type=2*Math.pow(o.sleepSpeedLimit,2)&&(e._wakeUpAfterNarrowphase=!0),o.allowSleep&&o.type===d.DYNAMIC&&o.sleepState===d.SLEEPING&&e.sleepState===d.AWAKE&&e.type!==d.STATIC&&r.squaredLength(e.velocity)+Math.pow(e.angularVelocity,2)>=2*Math.pow(e.sleepSpeedLimit,2)&&(o._wakeUpAfterNarrowphase=!0),this.overlapKeeper.setOverlapping(e,i,o,a),this.has("beginContact")&&this.overlapKeeper.isNewOverlap(i,a)){var _=this.beginContactEvent;if(_.shapeA=i,_.shapeB=a,_.bodyA=e,_.bodyB=o,_.contactEquations.length=0,"number"==typeof y)for(P=t.contactEquations.length-y;P1)for(var P=t.frictionEquations.length-b;P=0;e--)this.removeConstraint(t[e]);for(var i=this.bodies,e=i.length-1;e>=0;e--)this.removeBody(i[e]);for(var n=this.springs,e=n.length-1;e>=0;e--)this.removeSpring(n[e]);for(var r=this.contactMaterials,e=r.length-1;e>=0;e--)this.removeContactMaterial(r[e]);s.apply(this)};var C=r.create(),S=(r.fromValues(0,0),r.fromValues(0,0));s.prototype.hitTest=function(t,e,i){i=i||0;var s=new d({position:t}),n=new c,u=t,p=C,f=S;s.addShape(n);for(var g=this.narrowphase,m=[],y=0,v=e.length;y!==v;y++)for(var x=e[y],b=0,_=x.shapes.length;b!==_;b++){var w=x.shapes[b];r.rotate(p,w.position,x.angle),r.add(p,p,x.position);var T=w.angle+x.angle;(w instanceof o&&g.circleParticle(x,w,p,T,s,n,u,0,!0)||w instanceof a&&g.particleConvex(s,n,u,0,x,w,p,T,!0)||w instanceof h&&g.particlePlane(s,n,u,0,x,w,p,T,!0)||w instanceof l&&g.particleCapsule(s,n,u,0,x,w,p,T,!0)||w instanceof c&&r.squaredLength(r.sub(f,p,t))0?Math.acos(i/u):-Math.acos(i/u),this.worldScale.x=u,this.worldScale.y=c/u}else if(n||r){var d=Math.sqrt(n*n+r*r);this.worldRotation=Phaser.Math.HALF_PI-(r>0?Math.acos(-n/d):-Math.acos(n/d)),this.worldScale.x=c/d,this.worldScale.y=d}else this.worldScale.x=0,this.worldScale.y=0;return this.worldAlpha=this.alpha*e.worldAlpha,this.worldPosition.x=l.tx,this.worldPosition.y=l.ty,this._currentBounds=null,this.transformCallback&&this.transformCallback.call(this.transformCallbackContext,l,h),this},preUpdate:function(){},generateTexture:function(t,e,i){var n=this.getLocalBounds(),r=new Phaser.RenderTexture(this.game,0|n.width,0|n.height,i,e,t);return s.DisplayObject._tempMatrix.tx=-n.x,s.DisplayObject._tempMatrix.ty=-n.y,r.render(this,s.DisplayObject._tempMatrix),r},updateCache:function(){return this._generateCachedSprite(),this},toGlobal:function(t){return this.updateTransform(),this.worldTransform.apply(t)},toLocal:function(t,e){return e&&(t=e.toGlobal(t)),this.updateTransform(),this.worldTransform.applyInverse(t)},_renderCachedSprite:function(t){this._cachedSprite.worldAlpha=this.worldAlpha,t.gl?s.Sprite.prototype._renderWebGL.call(this._cachedSprite,t):s.Sprite.prototype._renderCanvas.call(this._cachedSprite,t)},_generateCachedSprite:function(){this._cacheAsBitmap=!1;var t=this.getLocalBounds();if(t.width=Math.max(1,Math.ceil(t.width)),t.height=Math.max(1,Math.ceil(t.height)),this.updateTransform(),this._cachedSprite)this._cachedSprite.texture.resize(t.width,t.height);else{var e=0;this.texture&&this.texture.baseTexture&&s._enableMultiTextureToggle&&(e=this.texture.baseTexture.textureIndex);var i=new Phaser.RenderTexture(this.game,t.width,t.height,void 0,void 0,void 0,void 0,e);this._cachedSprite=new s.Sprite(i),this._cachedSprite.worldTransform=this.worldTransform}var n=this._filters;this._filters=null,this._cachedSprite.filters=n,s.DisplayObject._tempMatrix.tx=-t.x,s.DisplayObject._tempMatrix.ty=-t.y,this._cachedSprite.texture.render(this,s.DisplayObject._tempMatrix,!0),this._cachedSprite.anchor.x=-t.x/t.width,this._cachedSprite.anchor.y=-t.y/t.height,this._filters=n,this._cacheAsBitmap=!0},_destroyCachedSprite:function(){this._cachedSprite&&(this._cachedSprite.texture.destroy(!0),this._cachedSprite=null)}},s.DisplayObject.prototype.displayObjectUpdateTransform=s.DisplayObject.prototype.updateTransform,Object.defineProperties(s.DisplayObject.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){if(this.visible){var t=this.parent;if(!t)return this.visible;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}return!1}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.isMask=!1),this._mask=t,t&&(this._mask.isMask=!0)}},filters:{get:function(){return this._filters},set:function(t){if(Array.isArray(t)){for(var e=[],i=0;i=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},s.DisplayObjectContainer.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),s=this.getChildIndex(e);if(i<0||s<0)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[i]=e,this.children[s]=t}},s.DisplayObjectContainer.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},s.DisplayObjectContainer.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The supplied index is out of bounds");var i=this.getChildIndex(t);this.children.splice(i,1),this.children.splice(e,0,t)},s.DisplayObjectContainer.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject must be a child of the caller");return this.children[t]},s.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1!==e)return this.removeChildAt(e)},s.DisplayObjectContainer.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e&&(e.parent=void 0,this.children.splice(t,1)),e},s.DisplayObjectContainer.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var i=e-t;if(i>0&&i<=e){for(var s=this.children.splice(t,i),n=0;na?u:a,d=d>h?d:h);var f=this._bounds;if(!p){var g=(f=new s.Rectangle).x,m=f.width+f.x,y=f.y,v=f.height+f.y,x=this.worldTransform,b=x.a,_=x.b,w=x.c,T=x.d,P=x.tx,C=x.ty,S=b*m+w*v+P,A=T*v+_*m+C,E=b*g+w*v+P,M=T*v+_*g+C,R=b*g+w*y+P,L=T*y+_*g+C,B=b*m+w*y+P,I=T*y+_*m+C;u=S,d=A,c=A,l=B<(l=R<(l=E<(l=S)?E:l)?R:l)?B:l,c=I<(c=L<(c=M(u=R>(u=E>u?E:u)?R:u)?B:u,d=I>(d=L>(d=M>d?M:d)?L:d)?I:d}if(f.x=l,f.y=c,f.width=u-l,f.height=d-c,e)for(t.worldTransform=r,n=0;n(f=T>(f=_>(f=x>f?x:f)?_:f)?T:f)?C:f,g=S>(g=P>(g=w>(g=b>g?b:g)?w:g)?P:g)?S:g}var A=this._bounds;return A.x=m,A.width=f-m,A.y=y,A.height=g-y,this._currentBounds=A,A},s.Sprite.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=Phaser.identityMatrix;for(var e=0;e= "+this.MAX_TEXTURES+".0) { gl_FragColor = BLUE;return;}"," if(isnan(vTextureIndex)) { gl_FragColor = RED;return;}","}"];var n=s.compileProgram(t,this.vertexSrc||s.PixiShader.defaultVertexSrc,this.fragmentSrc);t.useProgram(n),this.uSamplerArray=t.getUniformLocation(n,"uSamplerArray[0]"),this.projectionVector=t.getUniformLocation(n,"projectionVector"),this.offsetVector=t.getUniformLocation(n,"offsetVector"),this.dimensions=t.getUniformLocation(n,"dimensions"),this.aVertexPosition=t.getAttribLocation(n,"aVertexPosition"),this.aTextureCoord=t.getAttribLocation(n,"aTextureCoord"),this.colorAttribute=t.getAttribLocation(n,"aColor"),this.aTextureIndex=t.getAttribLocation(n,"aTextureIndex");var r=[],o=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,o),t.texImage2D(t.TEXTURE_2D,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,null);for(var a=0;a 0.0) gl_Position = vec4(0.0);"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);"," vTextureIndex = aTextureIndex;","}"],s.PixiFastShader=function(t){if(this._UID=Phaser._UID++,this.gl=t,this.program=null,s._enableMultiTextureToggle){var t=this.gl;this.MAX_TEXTURES=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);for(var e="\tif (vTextureIndex == 0.0) { gl_FragColor = texture2D(uSamplerArray[0], vTextureCoord) * vColor;return;}\n",i=1;i= "+this.MAX_TEXTURES+".0) { gl_FragColor = BLUE;return;}"," if(isnan(vTextureIndex)) {gl_FragColor = RED;return;}","}"]}else this.fragmentSrc=["// PixiFastShader Fragment Shader.","precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","varying float vTextureIndex;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor;","}"];this.vertexSrc=["// PixiFastShader Vertex Shader.","attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute float aTextureIndex;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","varying float vTextureIndex;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vTextureIndex = aTextureIndex;"," vColor = aColor;","}"],this.textureCount=0,this.init()},s.PixiFastShader.prototype.constructor=s.PixiFastShader,s.PixiFastShader.prototype.init=function(){var t=this.gl,e=s.compileProgram(t,this.vertexSrc,this.fragmentSrc);if(t.useProgram(e),this.uSampler=s._enableMultiTextureToggle?t.getUniformLocation(e,"uSamplerArray[0]"):t.getUniformLocation(e,"uSampler"),s._enableMultiTextureToggle){var i=[],n=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,null);for(var r=0;r= "+this.MAX_TEXTURES+".0) { gl_FragColor = BLUE;return;}"," if(isnan(vTextureIndex)) {gl_FragColor = RED;return;}","}"]}else this.fragmentSrc=["//StripShader Fragment Shader.","precision mediump float;","varying vec2 vTextureCoord;","varying float vTextureIndex;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);","}"];this.vertexSrc=["//StripShader Vertex Shader.","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aTextureIndex;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying float vTextureIndex;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vTextureIndex = aTextureIndex;","}"],this.init()},s.StripShader.prototype.constructor=s.StripShader,s.StripShader.prototype.init=function(){var t=this.gl,e=s.compileProgram(t,this.vertexSrc,this.fragmentSrc);if(t.useProgram(e),this.uSampler=s._enableMultiTextureToggle?t.getUniformLocation(e,"uSamplerArray[0]"):t.getUniformLocation(e,"uSampler"),s._enableMultiTextureToggle){var i=[],n=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,null);for(var r=0;r>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},i=this.gl,n=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),r=i.getParameter(i.MAX_TEXTURE_SIZE),o=this.game.cache._cache.image,a=null,h=0;h=this.size&&(this.flush(),this.currentBaseTexture=i.baseTexture);var a=i._uvs;if(a){var h,l,c,u,d=t.anchor.x,p=t.anchor.y;if(i.trim){var f=i.trim;h=(l=f.x-d*f.width)+i.crop.width,c=(u=f.y-p*f.height)+i.crop.height}else h=i.frame.width*(1-d),l=i.frame.width*-d,c=i.frame.height*(1-p),u=i.frame.height*-p;var g=this.currentBatchSize*this.vertexSize,m=(this.currentBatchSize,i.baseTexture.resolution),y=i.baseTexture.textureIndex,v=o.a/m,x=o.b/m,b=o.c/m,_=o.d/m,w=o.tx,T=o.ty,P=(i.crop.width,i.crop.height);if(i.rotated){var C=o.a,S=o.b,A=o.c,E=o.d,M=l,R=h;w=o.c*P+w,T=o.d*P+T,v=6.123233995736766e-17*C-A,x=6.123233995736766e-17*S-E,b=C+6.123233995736766e-17*A,_=S+6.123233995736766e-17*E,i._updateUvsInverted(),h=c,l=u,c=R,u=M}var L=this.colors,B=this.positions,I=t.tint,O=(I>>16)+(65280&I)+((255&I)<<16)+(255*t.worldAlpha<<24);this.renderSession.roundPixels?(B[g++]=v*l+b*u+w|0,B[g++]=_*u+x*l+T|0,B[g++]=a.x0,B[g++]=a.y0,L[g++]=O,B[g++]=y,B[g++]=v*h+b*u+w|0,B[g++]=_*u+x*h+T|0,B[g++]=a.x1,B[g++]=a.y1,L[g++]=O,B[g++]=y,B[g++]=v*h+b*c+w|0,B[g++]=_*c+x*h+T|0,B[g++]=a.x2,B[g++]=a.y2,L[g++]=O,B[g++]=y,B[g++]=v*l+b*c+w|0,B[g++]=_*c+x*l+T|0,B[g++]=a.x3,B[g++]=a.y3,L[g++]=O,B[g++]=y):(B[g++]=v*l+b*u+w,B[g++]=_*u+x*l+T,B[g++]=a.x0,B[g++]=a.y0,L[g++]=O,B[g++]=y,B[g++]=v*h+b*u+w,B[g++]=_*u+x*h+T,B[g++]=a.x1,B[g++]=a.y1,L[g++]=O,B[g++]=y,B[g++]=v*h+b*c+w,B[g++]=_*c+x*h+T,B[g++]=a.x2,B[g++]=a.y2,L[g++]=O,B[g++]=y,B[g++]=v*l+b*c+w,B[g++]=_*c+x*l+T,B[g++]=a.x3,B[g++]=a.y3,L[g++]=O,B[g++]=y),this.sprites[this.currentBatchSize++]=t}},s.WebGLSpriteBatch.prototype.renderTilingSprite=function(t){var e=t.tilingTexture,i=e.baseTexture,n=this.gl,r=t.texture.baseTexture.textureIndex;s.WebGLRenderer.textureArray[r]!=i&&(this.flush(),n.activeTexture(n.TEXTURE0+r),n.bindTexture(n.TEXTURE_2D,i._glTextures[n.id]),s.WebGLRenderer.textureArray[r]=i),this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=e.baseTexture),t._uvs||(t._uvs=new s.TextureUvs);var o=t._uvs,a=e.baseTexture.width,h=e.baseTexture.height;t.tilePosition.x%=a*t.tileScaleOffset.x,t.tilePosition.y%=h*t.tileScaleOffset.y;var l=t.tilePosition.x/(a*t.tileScaleOffset.x),c=t.tilePosition.y/(h*t.tileScaleOffset.y),u=t.width/a/(t.tileScale.x*t.tileScaleOffset.x),d=t.height/h/(t.tileScale.y*t.tileScaleOffset.y);o.x0=0-l,o.y0=0-c,o.x1=1*u-l,o.y1=0-c,o.x2=1*u-l,o.y2=1*d-c,o.x3=0-l,o.y3=1*d-c;var p=t.tint,f=(p>>16)+(65280&p)+((255&p)<<16)+(255*t.worldAlpha<<24),g=this.positions,m=this.colors,y=t.width,v=t.height,x=t.anchor.x,b=t.anchor.y,_=y*(1-x),w=y*-x,T=v*(1-b),P=v*-b,C=this.currentBatchSize*this.vertexSize,S=e.baseTexture.resolution,A=t.worldTransform,E=A.a/S,M=A.b/S,R=A.c/S,L=A.d/S,B=A.tx,I=A.ty;g[C++]=E*w+R*P+B,g[C++]=L*P+M*w+I,g[C++]=o.x0,g[C++]=o.y0,m[C++]=f,g[C++]=r,g[C++]=E*_+R*P+B,g[C++]=L*P+M*_+I,g[C++]=o.x1,g[C++]=o.y1,m[C++]=f,g[C++]=r,g[C++]=E*_+R*T+B,g[C++]=L*T+M*_+I,g[C++]=o.x2,g[C++]=o.y2,m[C++]=f,g[C++]=r,g[C++]=E*w+R*T+B,g[C++]=L*T+M*w+I,g[C++]=o.x3,g[C++]=o.y3,m[C++]=f,g[C++]=r,this.sprites[this.currentBatchSize++]=t},s.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.gl;if(this.dirty){this.dirty=!1,t=this.defaultShader.shaders[e.id],e.activeTexture(e.TEXTURE0),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var i=this.vertexSize;e.vertexAttribPointer(t.aVertexPosition,2,e.FLOAT,!1,i,0),e.vertexAttribPointer(t.aTextureCoord,2,e.FLOAT,!1,i,8),e.vertexAttribPointer(t.colorAttribute,4,e.UNSIGNED_BYTE,!0,i,16),e.vertexAttribPointer(t.aTextureIndex,1,e.FLOAT,!1,i,20)}if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer);var n=this.positions.subarray(0,this.currentBatchSize*this.vertexSize);e.bufferSubData(e.ARRAY_BUFFER,0,n)}for(var r,o,a,h,l=0,c=0,u=null,d=this.renderSession.blendModeManager.currentBlendMode,p=null,f=!1,g=!1,m=0,y=this.currentBatchSize;m0&&(v=!1),(f||g)&&(this.renderBatch(u,l,c),c=m,l=0,u=r,f&&(d=o,this.renderSession.blendModeManager.setBlendMode(d)),g)){(t=(p=a).shaders[e.id])||((t=new s.PixiShader(e)).fragmentSrc=p.fragmentSrc,t.uniforms=p.uniforms,t.init(),p.shaders[e.id]=t),this.renderSession.shaderManager.setShader(t),t.dirty&&t.syncUniforms();var x=this.renderSession.projection;e.uniform2f(t.projectionVector,x.x,x.y);var b=this.renderSession.offset;e.uniform2f(t.offsetVector,b.x,b.y)}l++}this.renderBatch(u,l,c),this.currentBatchSize=0}},s.WebGLSpriteBatch.prototype.renderBatch=function(t,e,i){if(0!==e){var s=this.gl;if(t._dirty[s.id]){if(!this.renderSession.renderer.updateTexture(t))return}else s.bindTexture(s.TEXTURE_2D,t._glTextures[s.id]);s.drawElements(s.TRIANGLES,6*e,s.UNSIGNED_SHORT,6*i*2),this.renderSession.drawCount++}},s.WebGLSpriteBatch.prototype.stop=function(){this.flush(),this.dirty=!0},s.WebGLSpriteBatch.prototype.start=function(){this.dirty=!0},s.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},s.WebGLFastSpriteBatch=function(t){this.vertSize=11,this.maxSize=6e3,this.size=this.maxSize;var e=4*this.size*this.vertSize,i=6*this.maxSize;this.vertices=new Float32Array(e),this.indices=new Uint16Array(i),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var s=0,n=0;s=this.size&&this.flush()}},s.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var t=this.gl;if(this.currentBaseTexture._glTextures[t.id]){if(this.currentBatchSize>.5*this.size)t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices);else{var e=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);t.bufferSubData(t.ARRAY_BUFFER,0,e)}t.drawElements(t.TRIANGLES,6*this.currentBatchSize,t.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}else this.renderSession.renderer.updateTexture(this.currentBaseTexture,t)}},s.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},s.WebGLFastSpriteBatch.prototype.start=function(){var t=this.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.renderSession.projection;t.uniform2f(this.shader.projectionVector,e.x,e.y),t.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var i=4*this.vertSize;t.vertexAttribPointer(this.shader.aVertexPosition,2,t.FLOAT,!1,i,0),t.vertexAttribPointer(this.shader.aPositionCoord,2,t.FLOAT,!1,i,8),t.vertexAttribPointer(this.shader.aScale,2,t.FLOAT,!1,i,16),t.vertexAttribPointer(this.shader.aRotation,1,t.FLOAT,!1,i,24),t.vertexAttribPointer(this.shader.aTextureCoord,2,t.FLOAT,!1,i,28),t.vertexAttribPointer(this.shader.colorAttribute,1,t.FLOAT,!1,i,36),t.vertexAttribPointer(this.shader.aTextureIndex,1,t.FLOAT,!1,i,40)},s.WebGLFilterManager=function(){this.filterStack=[],this.offsetX=0,this.offsetY=0},s.WebGLFilterManager.prototype.constructor=s.WebGLFilterManager,s.WebGLFilterManager.prototype.setContext=function(t){this.gl=t,this.texturePool=[],this.initShaderBuffers()},s.WebGLFilterManager.prototype.begin=function(t,e){this.renderSession=t,this.defaultShader=t.shaderManager.defaultShader;var i=this.renderSession.projection;this.width=2*i.x,this.height=2*-i.y,this.buffer=e},s.WebGLFilterManager.prototype.pushFilter=function(t){var e=this.gl,i=this.renderSession.projection,n=this.renderSession.offset;t._filterArea=t.target.filterArea||t.target.getBounds(),t._previous_stencil_mgr=this.renderSession.stencilManager,this.renderSession.stencilManager=new s.WebGLStencilManager,this.renderSession.stencilManager.setContext(e),e.disable(e.STENCIL_TEST),this.filterStack.push(t);var r=t.filterPasses[0];this.offsetX+=t._filterArea.x,this.offsetY+=t._filterArea.y;var o=this.texturePool.pop();o?o.resize(this.width*this.renderSession.resolution,this.height*this.renderSession.resolution):o=new s.FilterTexture(this.gl,this.width*this.renderSession.resolution,this.height*this.renderSession.resolution),e.bindTexture(e.TEXTURE_2D,o.texture);var a=t._filterArea,h=r.padding;a.x-=h,a.y-=h,a.width+=2*h,a.height+=2*h,a.x<0&&(a.x=0),a.width>this.width&&(a.width=this.width),a.y<0&&(a.y=0),a.height>this.height&&(a.height=this.height),e.bindFramebuffer(e.FRAMEBUFFER,o.frameBuffer),e.viewport(0,0,a.width*this.renderSession.resolution,a.height*this.renderSession.resolution),i.x=a.width/2,i.y=-a.height/2,n.x=-a.x,n.y=-a.y,e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t._glFilterTexture=o},s.WebGLFilterManager.prototype.popFilter=function(){var t=this.gl,e=this.filterStack.pop(),i=e._filterArea,n=e._glFilterTexture,r=this.renderSession.projection,o=this.renderSession.offset;if(e.filterPasses.length>1){t.viewport(0,0,i.width*this.renderSession.resolution,i.height*this.renderSession.resolution),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=i.height,this.vertexArray[2]=i.width,this.vertexArray[3]=i.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=i.width,this.vertexArray[7]=0,t.bufferSubData(t.ARRAY_BUFFER,0,this.vertexArray),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=i.width/this.width,this.uvArray[5]=i.height/this.height,this.uvArray[6]=i.width/this.width,this.uvArray[7]=i.height/this.height,t.bufferSubData(t.ARRAY_BUFFER,0,this.uvArray);var a=n,h=this.texturePool.pop();h||(h=new s.FilterTexture(this.gl,this.width*this.renderSession.resolution,this.height*this.renderSession.resolution)),h.resize(this.width*this.renderSession.resolution,this.height*this.renderSession.resolution),t.bindFramebuffer(t.FRAMEBUFFER,h.frameBuffer),t.clear(t.COLOR_BUFFER_BIT),t.disable(t.BLEND);for(var l=0;l0?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.applyFilterPass(d,i,p,f),this.texturePool.push(n),e._glFilterTexture=null},s.WebGLFilterManager.prototype.applyFilterPass=function(t,e,i,n){var r=this.gl,o=t.shaders[r.id];o||((o=new s.PixiShader(r)).fragmentSrc=t.fragmentSrc,o.uniforms=t.uniforms,o.init(!0),t.shaders[r.id]=o),this.renderSession.shaderManager.setShader(o),r.uniform2f(o.projectionVector,i/2,-n/2),r.uniform2f(o.offsetVector,0,0),t.uniforms.dimensions&&(t.uniforms.dimensions.value[0]=this.width,t.uniforms.dimensions.value[1]=this.height,t.uniforms.dimensions.value[2]=this.vertexArray[0],t.uniforms.dimensions.value[3]=this.vertexArray[5]),o.syncUniforms(),r.bindBuffer(r.ARRAY_BUFFER,this.vertexBuffer),r.vertexAttribPointer(o.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,this.uvBuffer),r.vertexAttribPointer(o.aTextureCoord,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,this.colorBuffer),r.vertexAttribPointer(o.colorAttribute,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,this.indexBuffer),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0),this.renderSession.drawCount++},s.WebGLFilterManager.prototype.initShaderBuffers=function(){var t=this.gl;this.vertexBuffer=t.createBuffer(),this.uvBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.vertexArray=new Float32Array([0,0,1,0,0,1,1,1]),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertexArray,t.STATIC_DRAW),this.uvArray=new Float32Array([0,0,1,0,0,1,1,1]),t.bindBuffer(t.ARRAY_BUFFER,this.uvBuffer),t.bufferData(t.ARRAY_BUFFER,this.uvArray,t.STATIC_DRAW),this.colorArray=new Float32Array([1,16777215,1,16777215,1,16777215,1,16777215]),t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colorArray,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,1,3,2]),t.STATIC_DRAW)},s.WebGLFilterManager.prototype.destroy=function(){var t=this.gl;this.filterStack=null,this.offsetX=0,this.offsetY=0;for(var e=0;e=0;t--){var e=this._glTextures[t],i=s.glContexts[t];i&&e&&i.deleteTexture(e)}this._glTextures.length=0,this.dirty()},s.BaseTexture.fromCanvas=function(t,e,i){return 0===t.width&&(t.width=1),0===t.height&&(t.height=1),i=i||1,new s.BaseTexture(t,e,i)},s.TextureSilentFail=!1,s.Texture=function(t,e,i,n){this.noFrame=!1,e||(this.noFrame=!0,e=new s.Rectangle(0,0,1,1)),t instanceof s.Texture&&(t=t.baseTexture),this.baseTexture=t,this.frame=e,this.trim=n,this.valid=!1,this.isTiling=!1,this.requiresUpdate=!1,this.requiresReTint=!1,this._uvs=null,this.width=0,this.height=0,this.crop=i||new s.Rectangle(0,0,1,1),this.rotated=!1,t.hasLoaded&&(this.noFrame&&(e=new s.Rectangle(0,0,t.width,t.height)),this.setFrame(e))},s.Texture.prototype.constructor=s.Texture,s.Texture.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;this.noFrame&&(this.frame=new s.Rectangle(0,0,t.width,t.height)),this.setFrame(this.frame)},s.Texture.prototype.destroy=function(t){t&&this.baseTexture.destroy(),this.valid=!1},s.Texture.prototype.setFrame=function(t){if(this.noFrame=!1,this.frame=t,this.width=t.width,this.height=t.height,this.crop.x=t.x,this.crop.y=t.y,this.crop.width=t.width,this.crop.height=t.height,this.trim||!(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))this.valid=t&&t.width&&t.height&&this.baseTexture.source&&this.baseTexture.hasLoaded,this.trim&&(this.width=this.trim.width,this.height=this.trim.height,this.frame.width=this.trim.width,this.frame.height=this.trim.height),this.valid&&this._updateUvs();else{if(!s.TextureSilentFail)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=!1}},s.Texture.prototype._updateUvs=function(){this._uvs||(this._uvs=new s.TextureUvs);var t=this.crop,e=this.baseTexture.width,i=this.baseTexture.height;this._uvs.x0=t.x/e,this._uvs.y0=t.y/i,this._uvs.x1=(t.x+t.width)/e,this._uvs.y1=t.y/i,this._uvs.x2=(t.x+t.width)/e,this._uvs.y2=(t.y+t.height)/i,this._uvs.x3=t.x/e,this._uvs.y3=(t.y+t.height)/i},s.Texture.prototype._updateUvsInverted=function(){this._uvs||(this._uvs=new s.TextureUvs);var t=this.crop,e=this.baseTexture.width,i=this.baseTexture.height;this._uvs.x0=t.x/e,this._uvs.y0=t.y/i,this._uvs.x1=(t.x+t.height)/e,this._uvs.y1=t.y/i,this._uvs.x2=(t.x+t.height)/e,this._uvs.y2=(t.y+t.width)/i,this._uvs.x3=t.x/e,this._uvs.y3=(t.y+t.width)/i},s.Texture.fromCanvas=function(t,e){var i=s.BaseTexture.fromCanvas(t,e);return new s.Texture(i)},s.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=s),exports.PIXI=s):"undefined"!=typeof define&&define.amd?define("PIXI",i.PIXI=s):i.PIXI=s,s}.call(this),function(){function t(t,e){this._scaleFactor=t,this._deltaMode=e,this.originalEvent=null}var e=this,i=i||{VERSION:"2.9.1",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,WEBGL_MULTI:4,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,POINTER:19,ROPE:20,CIRCLE:21,RECTANGLE:22,LINE:23,MATRIX:24,POINT:25,ROUNDEDRECTANGLE:26,CREATURE:27,VIDEO:28,PENDING_ATLAS:-1,HORIZONTAL:0,VERTICAL:1,LANDSCAPE:0,PORTRAIT:1,ANGLE_UP:270,ANGLE_DOWN:90,ANGLE_LEFT:180,ANGLE_RIGHT:0,ANGLE_NORTH_EAST:315,ANGLE_NORTH_WEST:225,ANGLE_SOUTH_EAST:45,ANGLE_SOUTH_WEST:135,TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12,blendModes:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1},PIXI:PIXI||{},_UID:0};if(Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Function.prototype.bind||(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var r=n.concat(t.call(arguments));s.apply(this instanceof i?this:e,r)}var s=this,n=t.call(arguments,1);if("function"!=typeof s)throw new TypeError;return i.prototype=function t(e){if(e&&(t.prototype=e),!(this instanceof t))return new t}(s.prototype),i}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(void 0===this||null===this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var s=arguments.length>=2?arguments[1]:void 0,n=0;n0&&100*Math.random()<=t},randomChoice:function(t,e){return Math.random()<.5?t:e},parseDimension:function(t,e){var i=0,s=0;return"string"==typeof t?"%"===t.substr(-1)?(i=parseInt(t,10)/100,s=0===e?window.innerWidth*i:window.innerHeight*i):s=parseInt(t,10):s=t,s},pad:function(t,e,i,s){if(void 0===e)var e=0;if(void 0===i)var i=" ";if(void 0===s)var s=3;var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2),o=n-r;t=new Array(o+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t},isPlainObject:function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},extend:function(){var t,e,s,n,r,o,a=arguments[0]||{},h=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},h=2),l===h&&(a=this,--h);h0&&(this._radius=.5*s),this.type=i.CIRCLE},i.Circle.prototype={circumference:function(){return Math.PI*this._radius*2},random:function(t){void 0===t&&(t=new i.Point);var e=2*Math.PI*Math.random(),s=Math.random()+Math.random(),n=s>1?2-s:s,r=n*Math.cos(e),o=n*Math.sin(e);return t.x=this.x+r*this.radius,t.y=this.y+o*this.radius,t},getBounds:function(){return new i.Rectangle(this.x-this.radius,this.y-this.radius,this.diameter,this.diameter)},setTo:function(t,e,i){return this.x=t,this.y=e,this._diameter=i,this._radius=.5*i,this},copyFrom:function(t){return this.setTo(t.x,t.y,t.diameter)},copyTo:function(t){return t.x=this.x,t.y=this.y,t.diameter=this._diameter,t},distance:function(t,e){var s=i.Math.distance(this.x,this.y,t.x,t.y);return e?Math.round(s):s},clone:function(t){return void 0===t||null===t?t=new i.Circle(this.x,this.y,this.diameter):t.setTo(this.x,this.y,this.diameter),t},contains:function(t,e){return i.Circle.contains(this,t,e)},circumferencePoint:function(t,e,s){return i.Circle.circumferencePoint(this,t,e,s)},sample:function(t,e,s,n,r){t||(t=60),null==e&&(e=0),null==s&&(s=i.Math.PI2),r||(r=[]);for(var o=0;o0&&(this._diameter=t,this._radius=.5*t)}}),Object.defineProperty(i.Circle.prototype,"radius",{get:function(){return this._radius},set:function(t){t>0&&(this._radius=t,this._diameter=2*t)}}),Object.defineProperty(i.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(t){t>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-t}}),Object.defineProperty(i.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(t){tthis.y?(this._radius=0,this._diameter=0):this.radius=this.y-t}}),Object.defineProperty(i.Circle.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(t){t0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(i.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(t){!0===t&&this.setTo(0,0,0)}}),i.Circle.contains=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius},i.Circle.equals=function(t,e){return t.x===e.x&&t.y===e.y&&t.diameter===e.diameter},i.Circle.intersects=function(t,e){return i.Math.distance(t.x,t.y,e.x,e.y)<=t.radius+e.radius},i.Circle.circumferencePoint=function(t,e,s,n){return void 0===s&&(s=!1),void 0===n&&(n=new i.Point),!0===s&&(e=i.Math.degToRad(e)),n.x=t.x+t.radius*Math.cos(e),n.y=t.y+t.radius*Math.sin(e),n},i.Circle.intersectsRectangle=function(t,e){var i=Math.abs(t.x-e.x-e.halfWidth);if(i>e.halfWidth+t.radius)return!1;var s=Math.abs(t.y-e.y-e.halfHeight);if(s>e.halfHeight+t.radius)return!1;if(i<=e.halfWidth||s<=e.halfHeight)return!0;var n=i-e.halfWidth,r=s-e.halfHeight;return n*n+r*r<=t.radius*t.radius},i.Circle.intersectsLine=function(t,e,s){var n=t.x,r=t.y,o=(e.end.y-e.start.y)/(e.end.x-e.start.x),a=e.end.y-o*e.end.x,h=t.radius,l=t.radius,c=a+o*n,u=(n*(l*l)-o*(h*h)*(a-r)+h*l*Math.sqrt(h*h*(o*o)+l*l-c*c-r*r+2*c*r))/(h*h*(o*o)+l*l),d=(n*(l*l)-o*(h*h)*(a-r)-h*l*Math.sqrt(h*h*(o*o)+l*l-c*c-r*r+2*c*r))/(h*h*(o*o)+l*l),p=o*u+a,f=o*d+a,g=new i.Point(u,p),m=new i.Point(d,f),y=e.pointOnSegment(g.x,g.y,.01),v=e.pointOnSegment(m.x,m.y,.01);return y&&v?!s||[g,m]:y?!s||[g]:v?!s||[m]:!!s&&[]},PIXI.Circle=i.Circle,i.Ellipse=function(t,e,s,n){t=t||0,e=e||0,s=s||0,n=n||0,this.x=t,this.y=e,this.width=s,this.height=n,this.type=i.ELLIPSE},i.Ellipse.prototype={setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},getBounds:function(){return new i.Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},copyFrom:function(t){return this.setTo(t.x,t.y,t.width,t.height)},copyTo:function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},clone:function(t){return void 0===t||null===t?t=new i.Ellipse(this.x,this.y,this.width,this.height):t.setTo(this.x,this.y,this.width,this.height),t},contains:function(t,e){return i.Ellipse.contains(this,t,e)},random:function(t){void 0===t&&(t=new i.Point);var e=Math.random()*Math.PI*2,s=Math.random();return t.x=Math.sqrt(s)*Math.cos(e),t.y=Math.sqrt(s)*Math.sin(e),t.x=this.x+t.x*this.width/2,t.y=this.y+t.y*this.height/2,t},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},i.Ellipse.prototype.constructor=i.Ellipse,Object.defineProperty(i.Ellipse.prototype,"left",{get:function(){return this.x},set:function(t){this.x=t}}),Object.defineProperty(i.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(t){t=s&&t<=n&&e>=r&&e<=o},random:function(t){void 0===t&&(t=new i.Point);var e=Math.random();return t.x=this.start.x+e*(this.end.x-this.start.x),t.y=this.start.y+e*(this.end.y-this.start.y),t},coordinatesOnLine:function(t,e){void 0===t&&(t=1),void 0===e&&(e=[]);var i=Math.round(this.start.x),s=Math.round(this.start.y),n=Math.round(this.end.x),r=Math.round(this.end.y),o=Math.abs(n-i),a=Math.abs(r-s),h=i-a&&(c-=a,i+=h),d=0&&g<=1&&m>=0&&m<=1?o:null}return o},i.Line.intersects=function(t,e,s,n){return i.Line.intersectsPoints(t.start,t.end,e.start,e.end,s,n)},i.Line.intersectsRectangle=function(t,e){if(0===t.length||e.empty)return!1;var i=t.start.x,s=t.start.y,n=t.end.x,r=t.end.y,o=e.x,a=e.y,h=e.right,l=e.bottom,c=0;if(i>=o&&i<=h&&s>=a&&s<=l||n>=o&&n<=h&&r>=a&&r<=l)return!0;if(i=o){if((c=s+(r-s)*(o-i)/(n-i))>a&&c<=l)return!0}else if(i>h&&n<=h&&(c=s+(r-s)*(h-i)/(n-i))>=a&&c<=l)return!0;if(s=a){if((c=i+(n-i)*(a-s)/(r-s))>=o&&c<=h)return!0}else if(s>l&&r<=l&&(c=i+(n-i)*(l-s)/(r-s))>=o&&c<=h)return!0;return!1},i.Line.intersectionWithRectangle=function(t,e,s){var n=i.Line.intersectionWithRectangle;s||(s=new i.Point),n.edges||(n.edges=[new i.Line,new i.Line,new i.Line,new i.Line]),n.edgeIntersection||(n.edgeIntersection=new i.Point);var r=n.edges,o=n.edgeIntersection.set(0),a=e.x,h=e.y,l=e.right,c=e.bottom,u=1/0;r[0].setTo(a,h,l,h),r[1].setTo(a,c,l,c),r[2].setTo(a,h,a,c),r[3].setTo(l,h,l,c);for(var d,p=0;d=r[p];p++)if(t.intersects(d,!0,o)){var f=t.start.distance(o);fs&&(this.x=s),this.yn&&(this.y=n),this},clone:function(t){return void 0===t||null===t?t=new i.Point(this.x,this.y):t.setTo(this.x,this.y),t},copyTo:function(t){return t.x=this.x,t.y=this.y,t},distance:function(t,e){return i.Point.distance(this,t,e)},equals:function(t){return t.x===this.x&&t.y===this.y},equalsXY:function(t,e){return this.x===t&&this.y===e},fuzzyEquals:function(t,e){return i.Point.fuzzyEquals(this,t,e)},fuzzyEqualsXY:function(t,e,s){return i.Point.fuzzyEqualsXY(this,t,e,s)},angle:function(t,e){return void 0===e&&(e=!1),e?i.Math.radToDeg(Math.atan2(t.y-this.y,t.x-this.x)):Math.atan2(t.y-this.y,t.x-this.x)},rotate:function(t,e,s,n,r){return i.Point.rotate(this,t,e,s,n,r)},getMagnitude:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},getMagnitudeSq:function(){return this.x*this.x+this.y*this.y},setMagnitude:function(t){return this.normalize().multiply(t,t)},normalize:function(){if(!this.isZero()){var t=this.getMagnitude();this.x/=t,this.y/=t}return this},limit:function(t){return this.getMagnitudeSq()>t*t&&this.setMagnitude(t),this},isZero:function(){return 0===this.x&&0===this.y},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},perp:function(){return this.setTo(-this.y,this.x)},rperp:function(){return this.setTo(this.y,-this.x)},normalRightHand:function(){return this.setTo(-1*this.y,this.x)},floor:function(){return this.setTo(Math.floor(this.x),Math.floor(this.y))},ceil:function(){return this.setTo(Math.ceil(this.x),Math.ceil(this.y))},toString:function(){return"[{Point (x="+this.x+" y="+this.y+")}]"}},i.Point.prototype.constructor=i.Point,i.Point.add=function(t,e,s){return void 0===s&&(s=new i.Point),s.x=t.x+e.x,s.y=t.y+e.y,s},i.Point.subtract=function(t,e,s){return void 0===s&&(s=new i.Point),s.x=t.x-e.x,s.y=t.y-e.y,s},i.Point.multiply=function(t,e,s){return void 0===s&&(s=new i.Point),s.x=t.x*e.x,s.y=t.y*e.y,s},i.Point.divide=function(t,e,s){return void 0===s&&(s=new i.Point),s.x=t.x/e.x,s.y=t.y/e.y,s},i.Point.equals=function(t,e){return t.x===e.x&&t.y===e.y},i.Point.equalsXY=function(t,e,i){return t.x===e&&t.y===i},i.Point.fuzzyEquals=function(t,e,s){return i.Math.fuzzyEquals(t.x,e.x,s)&&i.Math.fuzzyEquals(t.y,e.y,s)},i.Point.fuzzyEqualsXY=function(t,e,s,n){return i.Math.fuzzyEquals(t.x,e,n)&&i.Math.fuzzyEquals(t.y,s,n)},i.Point.angle=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},i.Point.negative=function(t,e){return void 0===e&&(e=new i.Point),e.setTo(-t.x,-t.y)},i.Point.multiplyAdd=function(t,e,s,n){return void 0===n&&(n=new i.Point),n.setTo(t.x+e.x*s,t.y+e.y*s)},i.Point.interpolate=function(t,e,s,n){return void 0===n&&(n=new i.Point),n.setTo(t.x+(e.x-t.x)*s,t.y+(e.y-t.y)*s)},i.Point.perp=function(t,e){return void 0===e&&(e=new i.Point),e.setTo(-t.y,t.x)},i.Point.rperp=function(t,e){return void 0===e&&(e=new i.Point),e.setTo(t.y,-t.x)},i.Point.distance=function(t,e,s){var n=i.Math.distance(t.x,t.y,e.x,e.y);return s?Math.round(n):n},i.Point.project=function(t,e,s){void 0===s&&(s=new i.Point);var n=t.dot(e)/e.getMagnitudeSq();return 0!==n&&s.setTo(n*e.x,n*e.y),s},i.Point.projectUnit=function(t,e,s){void 0===s&&(s=new i.Point);var n=t.dot(e);return 0!==n&&s.setTo(n*e.x,n*e.y),s},i.Point.normalRightHand=function(t,e){return void 0===e&&(e=new i.Point),e.setTo(-1*t.y,t.x)},i.Point.normalize=function(t,e){void 0===e&&(e=new i.Point);var s=t.getMagnitude();return 0!==s&&e.setTo(t.x/s,t.y/s),e},i.Point.rotate=function(t,e,s,n,r,o){if(r&&(n=i.Math.degToRad(n)),void 0===o){t.subtract(e,s);var a=Math.sin(n),h=Math.cos(n),l=h*t.x-a*t.y,c=a*t.x+h*t.y;t.x=l+e,t.y=c+s}else{var u=n+Math.atan2(t.y-s,t.x-e);t.x=e+o*Math.cos(u),t.y=s+o*Math.sin(u)}return t},i.Point.centroid=function(t,e){if(void 0===e&&(e=new i.Point),"[object Array]"!==Object.prototype.toString.call(t))throw new Error("Phaser.Point. Parameter 'points' must be an array");var s=t.length;if(s<1)throw new Error("Phaser.Point. Parameter 'points' array must not be empty");if(1===s)return e.copyFrom(t[0]),e;for(var n=0;n0&&this.setTo.apply(this,arguments),this.closed=!0,this.flattened=!1,this.type=i.POLYGON},i.Polygon.prototype={toNumberArray:function(t){void 0===t&&(t=[]);for(var e=0;e0){Array.isArray(t)||(t=Array.prototype.slice.call(arguments));for(var e=Number.MAX_VALUE,i=0,s=t.length;i=this.right?this.width=0:this.width=this.right-t,this.x=t}}),Object.defineProperty(i.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}}),Object.defineProperty(i.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(i.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(i.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(t){this.x=t-this.halfWidth}}),Object.defineProperty(i.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(t){this.y=t-this.halfHeight}}),Object.defineProperty(i.Rectangle.prototype,"randomX",{get:function(){return this.x+Math.random()*this.width}}),Object.defineProperty(i.Rectangle.prototype,"randomY",{get:function(){return this.y+Math.random()*this.height}}),Object.defineProperty(i.Rectangle.prototype,"top",{get:function(){return this.y},set:function(t){t>=this.bottom?(this.height=0,this.y=t):this.height=this.bottom-t}}),Object.defineProperty(i.Rectangle.prototype,"topLeft",{get:function(){return new i.Point(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y}}),Object.defineProperty(i.Rectangle.prototype,"topRight",{get:function(){return new i.Point(this.x+this.width,this.y)},set:function(t){this.right=t.x,this.y=t.y}}),Object.defineProperty(i.Rectangle.prototype,"empty",{get:function(){return!this.width||!this.height},set:function(t){!0===t&&this.setTo(0,0,0,0)}}),i.Rectangle.prototype.constructor=i.Rectangle,i.Rectangle.inflate=function(t,e,i){return t.x-=e,t.width+=2*e,t.y-=i,t.height+=2*i,t},i.Rectangle.inflatePoint=function(t,e){return i.Rectangle.inflate(t,e.x,e.y)},i.Rectangle.size=function(t,e){return void 0===e||null===e?e=new i.Point(t.width,t.height):e.setTo(t.width,t.height),e},i.Rectangle.clone=function(t,e){return void 0===e||null===e?e=new i.Rectangle(t.x,t.y,t.width,t.height):e.setTo(t.x,t.y,t.width,t.height),e},i.Rectangle.createFromBounds=function(t,e){return void 0!==e&&null!==e||(e=new i.Rectangle(t.x,t.y,t.width,t.height)),e.copyFromBounds(t)},i.Rectangle.contains=function(t,e,i){return!(t.width<=0||t.height<=0)&&(e>=t.x&&e=t.y&&i=t&&n=e&&re.volume)&&(t.x>=e.x&&t.y>=e.y&&t.righte.right||t.y>e.bottom)},i.Rectangle.intersectsRaw=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||ns&&(s=t.x),t.xr&&(r=t.y),t.y=i&&t<=i+this.width){var s=this.y;if(e>=s&&e<=s+this.height)return!0}return!1}},i.RoundedRectangle.prototype.constructor=i.RoundedRectangle,PIXI.RoundedRectangle=i.RoundedRectangle,i.Camera=function(t,e,s,n,r,o){this.game=t,this.world=t.world,this.id=0,this.view=new i.Rectangle(s,n,r,o),this.bounds=new i.Rectangle(s,n,r,o),this.deadzone=null,this.visible=!0,this.roundPx=!0,this.atLimit={x:!1,y:!1},this.target=null,this.displayObject=null,this.scale=null,this.totalInView=0,this.lerp=new i.Point(1,1),this.onShakeComplete=new i.Signal,this.onFlashComplete=new i.Signal,this.onFadeComplete=new i.Signal,this.fx=null,this._targetPosition=new i.Point,this._edge=0,this._position=new i.Point,this._shake={intensity:0,duration:0,horizontal:!1,vertical:!1,shakeBounds:!0,x:0,y:0},this._fxDuration=0,this._fxType=0,this._fixedView=new i.Rectangle},i.Camera.FOLLOW_LOCKON=0,i.Camera.FOLLOW_PLATFORMER=1,i.Camera.FOLLOW_TOPDOWN=2,i.Camera.FOLLOW_TOPDOWN_TIGHT=3,i.Camera.SHAKE_BOTH=4,i.Camera.SHAKE_HORIZONTAL=5,i.Camera.SHAKE_VERTICAL=6,i.Camera.ENABLE_FX=!0,i.Camera.prototype={boot:function(){this.displayObject=this.game.world,this.scale=this.game.world.scale,this.game.camera=this,i.Graphics&&i.Camera.ENABLE_FX&&(this.fx=new i.Graphics(this.game),this.game.stage.addChild(this.fx))},preUpdate:function(){this.totalInView=0},follow:function(t,e,s,n){void 0===e&&(e=i.Camera.FOLLOW_LOCKON),void 0===s&&(s=1),void 0===n&&(n=1),this.target=t,this.lerp.set(s,n);var r;switch(e){case i.Camera.FOLLOW_PLATFORMER:var o=this.width/8,a=this.height/3;this.deadzone=new i.Rectangle((this.width-o)/2,(this.height-a)/2-.25*a,o,a);break;case i.Camera.FOLLOW_TOPDOWN:r=Math.max(this.width,this.height)/4,this.deadzone=new i.Rectangle((this.width-r)/2,(this.height-r)/2,r,r);break;case i.Camera.FOLLOW_TOPDOWN_TIGHT:r=Math.max(this.width,this.height)/8,this.deadzone=new i.Rectangle((this.width-r)/2,(this.height-r)/2,r,r);break;case i.Camera.FOLLOW_LOCKON:default:this.deadzone=null}},unfollow:function(){this.target=null},focusOn:function(t){this.setPosition(Math.round(t.x-this.view.halfWidth),Math.round(t.y-this.view.halfHeight))},focusOnXY:function(t,e){this.setPosition(Math.round(t-this.view.halfWidth),Math.round(e-this.view.halfHeight))},shake:function(t,e,s,n,r){return void 0===t&&(t=.05),void 0===e&&(e=500),void 0===s&&(s=!0),void 0===n&&(n=i.Camera.SHAKE_BOTH),void 0===r&&(r=!0),!(!s&&this._shake.duration>0)&&(this._shake.intensity=t,this._shake.duration=e,this._shake.shakeBounds=r,this._shake.x=0,this._shake.y=0,this._shake.horizontal=n===i.Camera.SHAKE_BOTH||n===i.Camera.SHAKE_HORIZONTAL,this._shake.vertical=n===i.Camera.SHAKE_BOTH||n===i.Camera.SHAKE_VERTICAL,!0)},flash:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=500),void 0===i&&(i=!1),void 0===s&&(s=1),!(!this.fx||!i&&this._fxDuration>0)&&(this.fx.clear(),this.fx.beginFill(t,s),this.fx.drawRect(0,0,this.width,this.height),this.fx.endFill(),this.fx.alpha=1,this._fxDuration=e,this._fxType=0,!0)},fade:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=500),void 0===i&&(i=!1),void 0===s&&(s=1),!(!this.fx||!i&&this._fxDuration>0)&&(this.fx.clear(),this.fx.beginFill(t,s),this.fx.drawRect(0,0,this.width,this.height),this.fx.endFill(),this.fx.alpha=0,this._fxDuration=e,this._fxType=1,!0)},update:function(){this._fxDuration>0&&this.updateFX(),this._shake.duration>0&&this.updateShake(),this.bounds&&this.checkBounds(),this.roundPx&&(this.view.floor(),this._shake.x=Math.floor(this._shake.x),this._shake.y=Math.floor(this._shake.y)),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateFX:function(){0===this._fxType?(this.fx.alpha-=this.game.time.elapsedMS/this._fxDuration,this.fx.alpha<=0&&(this._fxDuration=0,this.fx.alpha=0,this.onFlashComplete.dispatch())):(this.fx.alpha+=this.game.time.elapsedMS/this._fxDuration,this.fx.alpha>=1&&(this._fxDuration=0,this.fx.alpha=1,this.onFadeComplete.dispatch()))},updateShake:function(){this._shake.duration-=this.game.time.elapsedMS,this._shake.duration<=0?(this.onShakeComplete.dispatch(),this._shake.x=0,this._shake.y=0):(this._shake.horizontal&&(this._shake.x=this.game.rnd.frac()*this._shake.intensity*this.view.width*2-this._shake.intensity*this.view.width),this._shake.vertical&&(this._shake.y=this.game.rnd.frac()*this._shake.intensity*this.view.height*2-this._shake.intensity*this.view.height))},updateTarget:function(){this._targetPosition.x=this.view.x+this.target.worldPosition.x,this._targetPosition.y=this.view.y+this.target.worldPosition.y,this.deadzone?(this._edge=this._targetPosition.x-this.view.x,this._edgethis.deadzone.right&&(this.view.x=this.game.math.linear(this.view.x,this._targetPosition.x-this.deadzone.right,this.lerp.x)),this._edge=this._targetPosition.y-this.view.y,this._edgethis.deadzone.bottom&&(this.view.y=this.game.math.linear(this.view.y,this._targetPosition.y-this.deadzone.bottom,this.lerp.y))):(this.view.x=this.game.math.linear(this.view.x,this._targetPosition.x-this.view.halfWidth,this.lerp.x),this.view.y=this.game.math.linear(this.view.y,this._targetPosition.y-this.view.halfHeight,this.lerp.y)),this.bounds&&this.checkBounds(),this.roundPx&&this.view.floor(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},setBoundsToWorld:function(){this.bounds&&this.bounds.copyFrom(this.game.world.bounds)},checkBounds:function(){this.atLimit.x=!1,this.atLimit.y=!1;var t=this.view.x+this._shake.x,e=this.view.right+this._shake.x,i=this.view.y+this._shake.y,s=this.view.bottom+this._shake.y;t<=this.bounds.x*this.scale.x?(this.atLimit.x=!0,this.view.x=this.bounds.x*this.scale.x,this._shake.shakeBounds||(this._shake.x=0)):e>=this.bounds.right*this.scale.x&&(this.atLimit.x=!0,this.view.x=this.bounds.right*this.scale.x-this.width,this._shake.shakeBounds||(this._shake.x=0)),i<=this.bounds.top*this.scale.y?(this.atLimit.y=!0,this.view.y=this.bounds.top*this.scale.y,this._shake.shakeBounds||(this._shake.y=0)):s>=this.bounds.bottom*this.scale.y&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom*this.scale.y-this.height,this._shake.shakeBounds||(this._shake.y=0))},setPosition:function(t,e){this.view.x=t,this.view.y=e,this.bounds&&this.checkBounds()},setSize:function(t,e){this.view.width=t,this.view.height=e},reset:function(){this.target=null,this.view.x=0,this.view.y=0,this._shake.duration=0,this._shake.x=0,this._shake.y=0,this.resetFX()},resetFX:function(){this.fx&&(this.fx.clear(),this.fx.alpha=0),this._fxDuration=0}},i.Camera.prototype.constructor=i.Camera,Object.defineProperty(i.Camera.prototype,"x",{get:function(){return this.view.x},set:function(t){this.view.x=t,this.bounds&&this.checkBounds()}}),Object.defineProperty(i.Camera.prototype,"y",{get:function(){return this.view.y},set:function(t){this.view.y=t,this.bounds&&this.checkBounds()}}),Object.defineProperty(i.Camera.prototype,"position",{get:function(){return this._position.set(this.view.x,this.view.y),this._position},set:function(t){void 0!==t.x&&(this.view.x=t.x),void 0!==t.y&&(this.view.y=t.y),this.bounds&&this.checkBounds()}}),Object.defineProperty(i.Camera.prototype,"width",{get:function(){return this.view.width},set:function(t){this.view.width=t}}),Object.defineProperty(i.Camera.prototype,"height",{get:function(){return this.view.height},set:function(t){this.view.height=t}}),Object.defineProperty(i.Camera.prototype,"shakeIntensity",{get:function(){return this._shake.intensity},set:function(t){this._shake.intensity=t}}),Object.defineProperty(i.Camera.prototype,"fixedView",{get:function(){return this._fixedView.setTo(0,0,this.view.width,this.view.height),this._fixedView}}),i.State=function(){this.game=null,this.key="",this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.state=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},i.State.prototype={init:function(){},preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},preRender:function(){},render:function(){},resize:function(){},paused:function(){},resumed:function(){},pauseUpdate:function(){},shutdown:function(){}},i.State.prototype.constructor=i.State,i.StateManager=function(t,e){this.game=t,this.states={},this._pendingState=null,void 0!==e&&null!==e&&(this._pendingState=e),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onStateChange=new i.Signal,this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onResizeCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null,this.onShutDownCallback=null},i.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),null!==this._pendingState&&"string"!=typeof this._pendingState&&this.add("default",this._pendingState,!0)},add:function(t,e,s){void 0===s&&(s=!1);var n;return e instanceof i.State?n=e:"object"==typeof e?(n=e).game=this.game:"function"==typeof e&&(n=new e(this.game)),this.states[t]=n,s&&(this.game.isBooted?this.start(t):this._pendingState=t),n},remove:function(t){this.current===t&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onPreRenderCallback=null,this.onRenderCallback=null,this.onResizeCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null),delete this.states[t]},start:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.checkState(t)&&(this._pendingState=t,this._clearWorld=e,this._clearCache=i,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},restart:function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),this._pendingState=this.current,this._clearWorld=t,this._clearCache=e,arguments.length>2&&(this._args=Array.prototype.slice.call(arguments,2))},dummy:function(){},preUpdate:function(){if(this._pendingState&&this.game.isBooted){var t=this.current;if(this.clearCurrentState(),this.setCurrentState(this._pendingState),this.onStateChange.dispatch(this.current,t),this.current!==this._pendingState)return;this._pendingState=null,this.onPreloadCallback?(this.game.load.reset(!0),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()&&0===this.game.load.totalQueuedPacks()?this.loadComplete():this.game.load.start()):this.loadComplete()}},clearCurrentState:function(){this.current&&(this.onShutDownCallback&&this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this.game.scale.reset(this._clearWorld),this.game.debug&&this.game.debug.reset(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache&&this.game.cache.destroy()))},checkState:function(t){var e=this.states[t];return e?!!(e.preload||e.create||e.update||e.render)||(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):(console.warn("Phaser.StateManager - No state found with the key: "+t),!1)},link:function(t){this.states[t].game=this.game,this.states[t].add=this.game.add,this.states[t].make=this.game.make,this.states[t].camera=this.game.camera,this.states[t].cache=this.game.cache,this.states[t].input=this.game.input,this.states[t].load=this.game.load,this.states[t].math=this.game.math,this.states[t].sound=this.game.sound,this.states[t].scale=this.game.scale,this.states[t].state=this,this.states[t].stage=this.game.stage,this.states[t].time=this.game.time,this.states[t].tweens=this.game.tweens,this.states[t].world=this.game.world,this.states[t].particles=this.game.particles,this.states[t].rnd=this.game.rnd,this.states[t].physics=this.game.physics,this.states[t].key=t},unlink:function(t){this.states[t]&&(this.states[t].game=null,this.states[t].add=null,this.states[t].make=null,this.states[t].camera=null,this.states[t].cache=null,this.states[t].input=null,this.states[t].load=null,this.states[t].math=null,this.states[t].sound=null,this.states[t].scale=null,this.states[t].state=null,this.states[t].stage=null,this.states[t].time=null,this.states[t].tweens=null,this.states[t].world=null,this.states[t].particles=null,this.states[t].rnd=null,this.states[t].physics=null)},setCurrentState:function(t){this.callbackContext=this.states[t],this.link(t),this.onInitCallback=this.states[t].init||this.dummy,this.onPreloadCallback=this.states[t].preload||null,this.onLoadRenderCallback=this.states[t].loadRender||null,this.onLoadUpdateCallback=this.states[t].loadUpdate||null,this.onCreateCallback=this.states[t].create||null,this.onUpdateCallback=this.states[t].update||null,this.onPreRenderCallback=this.states[t].preRender||null,this.onRenderCallback=this.states[t].render||null,this.onResizeCallback=this.states[t].resize||null,this.onPausedCallback=this.states[t].paused||null,this.onResumedCallback=this.states[t].resumed||null,this.onPauseUpdateCallback=this.states[t].pauseUpdate||null,this.onShutDownCallback=this.states[t].shutdown||this.dummy,""!==this.current&&this.game.physics.reset(),this.current=t,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),t===this._pendingState&&(this._args=[]),this.game._kickstart=!0},getCurrentState:function(){return this.states[this.current]},loadComplete:function(){!1===this._created&&this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game),!1===this._created&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created?this.onUpdateCallback&&this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},pauseUpdate:function(){this._created?this.onPauseUpdateCallback&&this.onPauseUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(t){this._created&&this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game,t)},resize:function(t,e){this.onResizeCallback&&this.onResizeCallback.call(this.callbackContext,t,e)},render:function(){this._created?this.onRenderCallback&&(this.game.renderType===i.CANVAS?(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0),this.onRenderCallback.call(this.callbackContext,this.game),this.game.context.restore()):this.onRenderCallback.call(this.callbackContext,this.game)):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this._clearWorld=!0,this._clearCache=!0,this.clearCurrentState(),this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null,this.game=null,this.states={},this._pendingState=null,this.current=""}},i.StateManager.prototype.constructor=i.StateManager,Object.defineProperty(i.StateManager.prototype,"created",{get:function(){return this._created}}),i.Signal=function(){},i.Signal.prototype={_bindings:null,_prevParams:null,memorize:!1,_shouldPropagate:!0,active:!0,_boundDispatch:!1,validateListener:function(t,e){if("function"!=typeof t)throw new Error("Phaser.Signal: listener is a required param of {fn}() and should be a Function.".replace("{fn}",e))},_registerListener:function(t,e,s,n,r){var o,a=this._indexOfListener(t,s);if(-1!==a){if((o=this._bindings[a]).isOnce()!==e)throw new Error("You cannot add"+(e?"":"Once")+"() then add"+(e?"Once":"")+"() the same listener without removing the relationship first.")}else o=new i.SignalBinding(this,t,e,s,n,r),this._addBinding(o);return this.memorize&&this._prevParams&&o.execute(this._prevParams),o},_addBinding:function(t){this._bindings||(this._bindings=[]);var e=this._bindings.length;do{e--}while(this._bindings[e]&&t._priority<=this._bindings[e]._priority);this._bindings.splice(e+1,0,t)},_indexOfListener:function(t,e){if(!this._bindings)return-1;void 0===e&&(e=null);for(var i,s=this._bindings.length;s--;)if((i=this._bindings[s])._listener===t&&i.context===e)return s;return-1},has:function(t,e){return-1!==this._indexOfListener(t,e)},add:function(t,e,i){this.validateListener(t,"add");var s=[];if(arguments.length>3)for(var n=3;n3)for(var n=3;n=this.children.length?-1:this.getChildAt(t)},i.Group.prototype.create=function(t,e,i,s,n,r){void 0===n&&(n=!0);var o=new this.classType(this.game,t,e,i,s);return o.exists=n,o.visible=n,o.alive=n,this.add(o,!1,r)},i.Group.prototype.createMultiple=function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=!1),Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);var o=this,a=[];return e.forEach(function(e){i.forEach(function(i){for(var h=0;hthis.children.length||-1===t&&-1===e)return!1;for(var a=new i.Rectangle(0,0,s,n),h=t*s,l=e*n,c=o;cthis.children.length-1&&(t=0),this.cursor)return this.cursorIndex=t,this.cursor=this.children[this.cursorIndex],this.cursor},i.Group.prototype.next=function(){if(this.cursor)return this.cursorIndex>=this.children.length-1?this.cursorIndex=0:this.cursorIndex++,this.cursor=this.children[this.cursorIndex],this.cursor},i.Group.prototype.previous=function(){if(this.cursor)return 0===this.cursorIndex?this.cursorIndex=this.children.length-1:this.cursorIndex--,this.cursor=this.children[this.cursorIndex],this.cursor},i.Group.prototype.swap=function(t,e){this.swapChildren(t,e),this.updateZ()},i.Group.prototype.bringToTop=function(t){return t.parent===this&&this.getIndex(t)0&&(this.remove(t,!1,!0),this.addAt(t,0,!0)),t},i.Group.prototype.moveUp=function(t){if(t.parent===this&&this.getIndex(t)0){var e=this.getIndex(t),i=this.getAt(e-1);i&&this.swap(t,i)}return t},i.Group.prototype.xy=function(t,e,i){if(t<0||t>this.children.length)return-1;this.getChildAt(t).x=e,this.getChildAt(t).y=i},i.Group.prototype.reverse=function(){this.children.reverse(),this.updateZ()},i.Group.prototype.getIndex=function(t){return this.children.indexOf(t)},i.Group.prototype.getByName=function(t){for(var e=0;e0))return!1;var r=e.length;return 1===r?0===s?t[e[0]]=i:1===s?t[e[0]]+=i:2===s?t[e[0]]-=i:3===s?t[e[0]]*=i:4===s&&(t[e[0]]/=i):2===r?0===s?t[e[0]][e[1]]=i:1===s?t[e[0]][e[1]]+=i:2===s?t[e[0]][e[1]]-=i:3===s?t[e[0]][e[1]]*=i:4===s&&(t[e[0]][e[1]]/=i):3===r?0===s?t[e[0]][e[1]][e[2]]=i:1===s?t[e[0]][e[1]][e[2]]+=i:2===s?t[e[0]][e[1]][e[2]]-=i:3===s?t[e[0]][e[1]][e[2]]*=i:4===s&&(t[e[0]][e[1]][e[2]]/=i):4===r&&(0===s?t[e[0]][e[1]][e[2]][e[3]]=i:1===s?t[e[0]][e[1]][e[2]][e[3]]+=i:2===s?t[e[0]][e[1]][e[2]][e[3]]-=i:3===s?t[e[0]][e[1]][e[2]][e[3]]*=i:4===s&&(t[e[0]][e[1]][e[2]][e[3]]/=i)),!0},i.Group.prototype.checkProperty=function(t,e,s,n){if(void 0===n&&(n=!1),this!==t.parent)return!1;var r=i.Utils.getProperty(t,e);return!(void 0===r&&n||r!==s)},i.Group.prototype.set=function(t,e,i,s,n,r,o){if(void 0===o&&(o=!1),e=e.split("."),void 0===s&&(s=!1),void 0===n&&(n=!1),(!1===s||s&&t.alive)&&(!1===n||n&&t.visible))return this.setProperty(t,e,i,r,o)},i.Group.prototype.setAll=function(t,e,i,s,n,r){void 0===i&&(i=!1),void 0===s&&(s=!1),void 0===r&&(r=!1),t=t.split("."),n=n||0;for(var o=0;o2){i=[];for(s=2;s2){n=[];for(a=2;a=e&&(t=e-1);var i=this.children[t];this.updateOnlyExistingChildren&&!i.exists||i.update()}},i.Group.prototype.postUpdate=function(){this.fixedToCamera&&(this.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var t=0;t2){s=[null];for(var n=2;n2){s=[null];for(var n=2;n2){s=[null];for(var n=2;ne[this._sortProperty]?1:t.ze[this._sortProperty]?-1:0},i.Group.prototype.iterate=function(t,e,s,n,r,o){if(0===this.children.length){if(s===i.Group.RETURN_TOTAL)return 0;if(s===i.Group.RETURN_ALL)return[]}var a=0;if(s===i.Group.RETURN_ALL)var h=[];for(var l=0;l0)return this.children[this.children.length-1]},i.Group.prototype.getBottom=function(){if(this.children.length>0)return this.children[0]},i.Group.prototype.getClosestTo=function(t,e,s){for(var n=Number.MAX_VALUE,r=0,o=null,a=0;an&&(!e||e.call(s,h,r))&&(n=r,o=h)}return o},i.Group.prototype.count=function(t,e){return this.iterate(t,e,i.Group.RETURN_TOTAL)},i.Group.prototype.countLiving=function(){return this.count("alive",!0)},i.Group.prototype.countDead=function(){return this.count("alive",!1)},i.Group.prototype.getRandom=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.children.length),0===e?null:i.ArrayUtils.getRandomItem(this.children,t,e)},i.Group.prototype.getRandomExists=function(t,e){var i=this.getAll("exists",!0,t,e);return this.game.rnd.pick(i)},i.Group.prototype.getAll=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=this.children.length);for(var n=[],r=i;r0&&t instanceof i.Group){do{t.add(this.children[0],e)}while(this.children.length>0);this.hash=[],this.cursor=null}return t},i.Group.prototype.removeAll=function(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=!1),void 0===i&&(i=!1),0!==this.children.length){do{!e&&this.children[0].events&&this.children[0].events.onRemovedFromGroup$dispatch(this.children[0],this);var s=this.removeChild(this.children[0]);this.removeFromHash(s),t&&s&&s.destroy(!0,i)}while(this.children.length>0);this.hash=[],this.cursor=null}},i.Group.prototype.removeBetween=function(t,e,i,s){if(void 0===e&&(e=this.children.length-1),void 0===i&&(i=!1),void 0===s&&(s=!1),0!==this.children.length){if(t>e||t<0||e>this.children.length)return!1;for(var n=e;n>=t;){!s&&this.children[n].events&&this.children[n].events.onRemovedFromGroup$dispatch(this.children[n],this);var r=this.removeChild(this.children[n]);this.removeFromHash(r),i&&r&&r.destroy(!0),this.cursor===this.children[n]&&(this.cursor=null),n--}this.updateZ()}},i.Group.prototype.scatter=function(t,e){null==t&&(t=this.game.world.bounds),this.forEach(function(e){e.position.set(t.randomX,t.randomY)},null,e)},i.Group.prototype.shuffle=function(){i.ArrayUtils.shuffle(this.children),this.updateZ()},i.Group.prototype.destroy=function(t,e){null===this.game||this.ignoreDestroy||(void 0===t&&(t=!0),void 0===e&&(e=!1),this.onDestroy.dispatch(this,t,e),this.removeAll(t),this.cursor=null,this.filters=null,this.pendingDestroy=!1,e||(this.parent&&this.parent.removeChild(this),this.game=null,this.exists=!1))},Object.defineProperty(i.Group.prototype,"total",{get:function(){return this.iterate("exists",!0,i.Group.RETURN_TOTAL)}}),Object.defineProperty(i.Group.prototype,"length",{get:function(){return this.children.length}}),Object.defineProperty(i.Group.prototype,"angle",{get:function(){return i.Math.radToDeg(this.rotation)},set:function(t){this.rotation=i.Math.degToRad(t)}}),Object.defineProperty(i.Group.prototype,"centerX",{get:function(){return this.getBounds(this.parent).centerX},set:function(t){var e=this.getBounds(this.parent),i=this.x-e.x;this.x=t+i-e.halfWidth}}),Object.defineProperty(i.Group.prototype,"centerY",{get:function(){return this.getBounds(this.parent).centerY},set:function(t){var e=this.getBounds(this.parent),i=this.y-e.y;this.y=t+i-e.halfHeight}}),Object.defineProperty(i.Group.prototype,"left",{get:function(){return this.getBounds(this.parent).left},set:function(t){var e=this.getBounds(this.parent),i=this.x-e.x;this.x=t+i}}),Object.defineProperty(i.Group.prototype,"right",{get:function(){return this.getBounds(this.parent).right},set:function(t){var e=this.getBounds(this.parent),i=this.x-e.x;this.x=t+i-e.width}}),Object.defineProperty(i.Group.prototype,"top",{get:function(){return this.getBounds(this.parent).top},set:function(t){var e=this.getBounds(this.parent),i=this.y-e.y;this.y=t+i}}),Object.defineProperty(i.Group.prototype,"bottom",{get:function(){return this.getBounds(this.parent).bottom},set:function(t){var e=this.getBounds(this.parent),i=this.y-e.y;this.y=t+i-e.height}}),i.World=function(t){i.Group.call(this,t,null,"__world",!1),this.bounds=new i.Rectangle(0,0,t.width,t.height),this.camera=null,this._definedSize=!1,this._width=t.width,this._height=t.height,this.game.state.onStateChange.add(this.stateChange,this)},i.World.prototype=Object.create(i.Group.prototype),i.World.prototype.constructor=i.World,i.World.prototype.boot=function(){this.camera=new i.Camera(this.game,0,0,0,this.game.width,this.game.height),this.game.stage.addChild(this),this.camera.boot()},i.World.prototype.stateChange=function(){this.x=0,this.y=0,this.camera.reset()},i.World.prototype.setBounds=function(t,e,i,s){this._definedSize=!0,this._width=i,this._height=s,this.bounds.setTo(t,e,i,s),this.x=t,this.y=e,this.camera.bounds&&this.camera.bounds.setTo(t,e,Math.max(i,this.game.width),Math.max(s,this.game.height)),this.game.physics.setBoundsToWorld()},i.World.prototype.resize=function(t,e){this._definedSize&&(tthis.bounds.right&&(t.x=this.bounds.left)),n&&(t.y+t._currentBounds.heightthis.bounds.bottom&&(t.y=this.bounds.top))):(s&&t.x+ethis.bounds.right&&(t.x=this.bounds.left-e),n&&t.y+ethis.bounds.bottom&&(t.y=this.bounds.top-e))},Object.defineProperty(i.World.prototype,"width",{get:function(){return this.bounds.width},set:function(t){t1&&!this.forceSingleUpdate)this.time.time>this._nextFpsNotification&&(this._nextFpsNotification=this.time.time+1e4,this.fpsProblemNotifier.dispatch()),this._deltaTime=0,this._spiraling=0,this.updateRender(this.time.slowMotion*this.time.desiredFps);else{var e=1e3*this.time.slowMotion/this.time.desiredFps;this._deltaTime+=Math.max(Math.min(3*e,this.time.elapsed),0);var i=0;for(this.updatesThisFrame=Math.floor(this._deltaTime/e),this.forceSingleUpdate&&(this.updatesThisFrame=Math.min(1,this.updatesThisFrame));this._deltaTime>=e&&(this._deltaTime-=e,this.currentUpdateID=i,this.updateLogic(this.time.desiredFpsMult),i++,!this.forceSingleUpdate||1!==i);)this.time.refresh();i>this._lastCount?this._spiraling++:i=i.Input.MAX_POINTERS)return console.warn("Phaser.Input.addPointer: Maximum limit of "+i.Input.MAX_POINTERS+" pointers reached."),null;var t=this.pointers.length+1,e=new i.Pointer(this.game,t,i.PointerMode.TOUCH);return this.pointers.push(e),this["pointer"+t]=e,e},update:function(){if(this.keyboard&&this.keyboard.update(),this.pollRate>0&&this._pollCounter=0&&this.countActivePointers(this.maxPointers)>=this.maxPointers)return null;if(!this.pointer1.active)return this.pointer1.start(t);if(!this.pointer2.active)return this.pointer2.start(t);for(var e=2;e0;i++)this.pointers[i].active&&e--;return t-e},getPointer:function(t){void 0===t&&(t=!1);for(var e=0;e=o&&this.game.camera.x+e.x=a&&this.game.camera.y+e.y=o&&this._localPoint.x=a&&this._localPoint.y=o&&this._localPoint.x=a&&this._localPoint.y0&&this._pollCounterthis.game.time.time},justReleased:function(t){return t=t||250,this.isUp&&this.timeUp+t>this.game.time.time},reset:function(){this.isDown=!1,this.isUp=!0,this.timeDown=this.game.time.time,this.repeats=0,this.altKey=!1,this.shiftKey=!1,this.ctrlKey=!1},destroy:function(){this.onDown.dispose(),this.onUp.dispose(),this.onFloat.dispose(),this.parent=null,this.game=null}},i.DeviceButton.prototype.constructor=i.DeviceButton,Object.defineProperty(i.DeviceButton.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.time-this.timeDown}}),i.Pointer=function(t,e,s){this.game=t,this.id=e,this.type=i.POINTER,this.exists=!0,this.identifier=0,this.pointerId=null,this.pointerMode=s||i.PointerMode.CURSOR|i.PointerMode.CONTACT,this.target=null,this.button=null,this.leftButton=new i.DeviceButton(this,i.Pointer.LEFT_BUTTON),this.middleButton=new i.DeviceButton(this,i.Pointer.MIDDLE_BUTTON),this.rightButton=new i.DeviceButton(this,i.Pointer.RIGHT_BUTTON),this.backButton=new i.DeviceButton(this,i.Pointer.BACK_BUTTON),this.forwardButton=new i.DeviceButton(this,i.Pointer.FORWARD_BUTTON),this.eraserButton=new i.DeviceButton(this,i.Pointer.ERASER_BUTTON),this._holdSent=!1,this._history=[],this._nextDrop=0,this._stateReset=!1,this.withinGame=!1,this.clientX=-1,this.clientY=-1,this.pageX=-1,this.pageY=-1,this.screenX=-1,this.screenY=-1,this.rawMovementX=0,this.rawMovementY=0,this.movementX=0,this.movementY=0,this.x=-1,this.y=-1,this.isMouse=0===e,this.isDown=!1,this.isUp=!0,this.timeDown=0,this.timeUp=0,this.previousTapTime=0,this.totalTouches=0,this.msSinceLastClick=Number.MAX_VALUE,this.targetObject=null,this.interactiveCandidates=[],this.active=!1,this.dirty=!1,this.position=new i.Point,this.positionDown=new i.Point,this.positionUp=new i.Point,this.circle=new i.Circle(0,0,44),this._clickTrampolines=null,this._trampolineTargetObject=null},i.Pointer.NO_BUTTON=0,i.Pointer.LEFT_BUTTON=1,i.Pointer.RIGHT_BUTTON=2,i.Pointer.MIDDLE_BUTTON=4,i.Pointer.BACK_BUTTON=8,i.Pointer.FORWARD_BUTTON=16,i.Pointer.ERASER_BUTTON=32,i.Pointer.prototype={resetButtons:function(){this.isDown=!1,this.isUp=!0,this.isMouse&&(this.leftButton.reset(),this.middleButton.reset(),this.rightButton.reset(),this.backButton.reset(),this.forwardButton.reset(),this.eraserButton.reset())},processButtonsDown:function(t,e){t===i.Mouse.LEFT_BUTTON&&this.leftButton.start(e),t===i.Mouse.RIGHT_BUTTON&&this.rightButton.start(e),t===i.Mouse.MIDDLE_BUTTON&&this.middleButton.start(e),t===i.Mouse.BACK_BUTTON&&this.backButton.start(e),t===i.Mouse.FORWARD_BUTTON&&this.forwardButton.start(e)},processButtonsUp:function(t,e){t===i.Mouse.LEFT_BUTTON&&this.leftButton.stop(e),t===i.Mouse.RIGHT_BUTTON&&this.rightButton.stop(e),t===i.Mouse.MIDDLE_BUTTON&&this.middleButton.stop(e),t===i.Mouse.BACK_BUTTON&&this.backButton.stop(e),t===i.Mouse.FORWARD_BUTTON&&this.forwardButton.stop(e)},processButtonsUpDown:function(t,e){var s="down"===e.type.toLowerCase().substr(-4),n="move"===e.type.toLowerCase().substr(-4);void 0!==t?(s&&1===t&&e.ctrlKey&&(t=2),this.leftButton.startStop(i.Pointer.LEFT_BUTTON&t,e),this.rightButton.startStop(i.Pointer.RIGHT_BUTTON&t,e),this.middleButton.startStop(i.Pointer.MIDDLE_BUTTON&t,e),this.backButton.startStop(i.Pointer.BACK_BUTTON&t,e),this.forwardButton.startStop(i.Pointer.FORWARD_BUTTON&t,e),this.eraserButton.startStop(i.Pointer.ERASER_BUTTON&t,e)):void 0!==e.button?s&&e.ctrlKey&&0===e.button?this.rightButton.start(e):s?this.processButtonsDown(e.button,e):n||this.processButtonsUp(e.button,e):s?e.ctrlKey?this.rightButton.start(e):this.leftButton.start(e):(this.leftButton.stop(e),this.rightButton.stop(e))},updateButtons:function(t){this.button=t.button,this.processButtonsUpDown(t.buttons,t),this.isUp=!0,this.isDown=!1,(this.leftButton.isDown||this.rightButton.isDown||this.middleButton.isDown||this.backButton.isDown||this.forwardButton.isDown||this.eraserButton.isDown)&&(this.isUp=!1,this.isDown=!0)},start:function(t){var e=this.game.input;return t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.isMouse?this.updateButtons(t):(this.isDown=!0,this.isUp=!1),this.active=!0,this.withinGame=!0,this.dirty=!1,this._history=[],this._clickTrampolines=null,this._trampolineTargetObject=null,this.msSinceLastClick=this.game.time.time-this.timeDown,this.timeDown=this.game.time.time,this._holdSent=!1,this.move(t,!0),this.positionDown.setTo(this.x,this.y),(e.multiInputOverride===i.Input.MOUSE_OVERRIDES_TOUCH||e.multiInputOverride===i.Input.MOUSE_TOUCH_COMBINE||e.multiInputOverride===i.Input.TOUCH_OVERRIDES_MOUSE&&0===e.totalActivePointers)&&(e.x=this.x,e.y=this.y,e.position.setTo(this.x,this.y),e.onDown.dispatch(this,t),e.resetSpeed(this.x,this.y)),this._stateReset=!1,this.totalTouches++,null!==this.targetObject&&this.targetObject._touchedHandler(this),this},update:function(){var t=this.game.input;this.active&&(this.dirty&&(t.interactiveItems.total>0&&this.processInteractiveObjects(!1),this.dirty=!1),!1===this._holdSent&&this.duration>=t.holdRate&&((t.multiInputOverride===i.Input.MOUSE_OVERRIDES_TOUCH||t.multiInputOverride===i.Input.MOUSE_TOUCH_COMBINE||t.multiInputOverride===i.Input.TOUCH_OVERRIDES_MOUSE&&0===t.totalActivePointers)&&t.onHold.dispatch(this),this._holdSent=!0),t.recordPointerHistory&&this.game.time.time>=this._nextDrop&&(this._nextDrop=this.game.time.time+t.recordRate,this._history.push({x:this.position.x,y:this.position.y}),this._history.length>t.recordLimit&&this._history.shift()))},move:function(t,e){var s=this.game.input;if(!s.pollLocked){void 0===e&&(e=!1),void 0!==t.button&&(this.button=t.button),this.isMouse&&this.updateButtons(t),this.clientX=t.clientX,this.clientY=t.clientY,this.pageX=t.pageX,this.pageY=t.pageY,this.screenX=t.screenX,this.screenY=t.screenY,this.isMouse&&s.mouse.locked&&!e&&(this.rawMovementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.rawMovementY=t.movementY||t.mozMovementY||t.webkitMovementY||0,this.movementX+=this.rawMovementX,this.movementY+=this.rawMovementY),this.x=(this.pageX-this.game.scale.offset.x)*s.scale.x,this.y=(this.pageY-this.game.scale.offset.y)*s.scale.y,this.position.setTo(this.x,this.y),this.circle.x=this.x,this.circle.y=this.y,(s.multiInputOverride===i.Input.MOUSE_OVERRIDES_TOUCH||s.multiInputOverride===i.Input.MOUSE_TOUCH_COMBINE||s.multiInputOverride===i.Input.TOUCH_OVERRIDES_MOUSE&&0===s.totalActivePointers)&&(s.activePointer=this,s.x=this.x,s.y=this.y,s.position.setTo(s.x,s.y),s.circle.x=s.x,s.circle.y=s.y),this.withinGame=this.game.scale.bounds.contains(this.pageX,this.pageY);for(var n=s.moveCallbacks.length;n--;)s.moveCallbacks[n].callback.call(s.moveCallbacks[n].context,this,this.x,this.y,e);return null===this.targetObject||this.game.paused&&!this.targetObject.noPause||!0!==this.targetObject.isDragged?s.interactiveItems.total>0&&this.processInteractiveObjects(e):!1===this.targetObject.update(this)&&(this.targetObject=null),this}},processInteractiveObjects:function(t){var e=0,i=-1,s=null,n=this.game.input.interactiveItems.first;for(this.interactiveCandidates=[];n;)n.checked=!1,!n.validForInput(i,e,!1)||this.game.paused&&!n.sprite.noPause||(n.checked=!0,(t&&n.checkPointerDown(this,!0)||!t&&n.checkPointerOver(this,!0))&&(e=n.sprite.renderOrderID,i=n.priorityID,s=n,this.interactiveCandidates.push(n))),n=this.game.input.interactiveItems.next;for(n=this.game.input.interactiveItems.first;n;)!n.checked&&n.validForInput(i,e,!0)&&(t&&n.checkPointerDown(this,!1)||!t&&n.checkPointerOver(this,!1))&&(e=n.sprite.renderOrderID,i=n.priorityID,s=n,this.interactiveCandidates.push(n)),n=this.game.input.interactiveItems.next;return this.game.input.customCandidateHandler&&(s=this.game.input.customCandidateHandler.call(this.game.input.customCandidateHandlerContext,this,this.interactiveCandidates,s)),this.swapTarget(s,!1),null!==this.targetObject},swapTarget:function(t,e){void 0===e&&(e=!1),null===t?this.targetObject&&(this.targetObject._pointerOutHandler(this,e),this.targetObject=null):null===this.targetObject?(this.targetObject=t,t._pointerOverHandler(this,e)):this.targetObject===t?!1===t.update(this)&&(this.targetObject=null):(this.targetObject._pointerOutHandler(this,e),this.targetObject=t,this.targetObject._pointerOverHandler(this,e))},leave:function(t){this.withinGame=!1,this.move(t,!1)},stop:function(t){var e=this.game.input;{if(!this._stateReset||!this.withinGame)return this.timeUp=this.game.time.time,(e.multiInputOverride===i.Input.MOUSE_OVERRIDES_TOUCH||e.multiInputOverride===i.Input.MOUSE_TOUCH_COMBINE||e.multiInputOverride===i.Input.TOUCH_OVERRIDES_MOUSE&&0===e.totalActivePointers)&&(e.onUp.dispatch(this,t),this.duration>=0&&this.duration<=e.tapRate&&(this.timeUp-this.previousTapTime0&&(this.active=!1),this.withinGame=this.game.scale.bounds.contains(t.pageX,t.pageY),this.pointerId=null,this.identifier=null,this.positionUp.setTo(this.x,this.y),!1===this.isMouse&&e.currentPointers--,e.interactiveItems.callAll("_releasedHandler",this),this._clickTrampolines&&(this._trampolineTargetObject=this.targetObject),this.targetObject=null,this;t.preventDefault()}},justPressed:function(t){return t=t||this.game.input.justPressedRate,!0===this.isDown&&this.timeDown+t>this.game.time.time},justReleased:function(t){return t=t||this.game.input.justReleasedRate,this.isUp&&this.timeUp+t>this.game.time.time},addClickTrampoline:function(t,e,i,s){if(this.isDown){for(var n=this._clickTrampolines=this._clickTrampolines||[],r=0;rt||this.priorityID===t&&this.sprite.renderOrderID>e))},isPixelPerfect:function(){return this.pixelPerfectClick||this.pixelPerfectOver},pointerX:function(t){return t=t||0,this._pointerData[t].x},pointerY:function(t){return t=t||0,this._pointerData[t].y},pointerDown:function(t){return t=t||0,this._pointerData[t].isDown},pointerUp:function(t){return t=t||0,this._pointerData[t].isUp},pointerTimeDown:function(t){return t=t||0,this._pointerData[t].timeDown},pointerTimeUp:function(t){return t=t||0,this._pointerData[t].timeUp},pointerOver:function(t){if(!this.enabled)return!1;if(void 0===t){for(var e=0;e<10;e++)if(this._pointerData[e].isOver)return!0;return!1}return this._pointerData[t].isOver},pointerOut:function(t){if(!this.enabled)return!1;if(void 0!==t)return this._pointerData[t].isOut;for(var e=0;e<10;e++)if(this._pointerData[e].isOut)return!0},pointerTimeOver:function(t){return t=t||0,this._pointerData[t].timeOver},pointerTimeOut:function(t){return t=t||0,this._pointerData[t].timeOut},pointerDragged:function(t){return t=t||0,this._pointerData[t].isDragged},checkPointerDown:function(t,e){return!!(t.isDown&&this.enabled&&this.sprite&&this.sprite.parent&&this.sprite.visible&&this.sprite.parent.visible&&0!==this.sprite.worldScale.x&&0!==this.sprite.worldScale.y)&&(!!this.game.input.hitTest(this.sprite,t,this._tempPoint)&&(void 0===e&&(e=!1),!(!e&&this.pixelPerfectClick)||this.checkPixel(this._tempPoint.x,this._tempPoint.y)))},checkPointerOver:function(t,e){return!!(this.enabled&&this.sprite&&this.sprite.parent&&this.sprite.visible&&this.sprite.parent.visible&&0!==this.sprite.worldScale.x&&0!==this.sprite.worldScale.y)&&(!!this.game.input.hitTest(this.sprite,t,this._tempPoint)&&(void 0===e&&(e=!1),!(!e&&this.pixelPerfectOver)||this.checkPixel(this._tempPoint.x,this._tempPoint.y)))},checkPixel:function(t,e,i){if(this.sprite.texture.baseTexture.source){if(null===t&&null===e){this.game.input.getLocalPosition(this.sprite,i,this._tempPoint);var t=this._tempPoint.x,e=this._tempPoint.y}if(0!==this.sprite.anchor.x&&(t-=-this.sprite.texture.frame.width*this.sprite.anchor.x),0!==this.sprite.anchor.y&&(e-=-this.sprite.texture.frame.height*this.sprite.anchor.y),t+=this.sprite.texture.frame.x,e+=this.sprite.texture.frame.y,this.sprite.texture.trim&&(t-=this.sprite.texture.trim.x,e-=this.sprite.texture.trim.y,tthis.sprite.texture.crop.right||ethis.sprite.texture.crop.bottom))return this._dx=t,this._dy=e,!1;if(this._dx=t,this._dy=e,this.game.input.hitContext.clearRect(0,0,1,1),this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source,t,e,1,1,0,0,1,1),this.game.input.hitContext.getImageData(0,0,1,1).data[3]>=this.pixelPerfectAlpha)return!0}return!1},update:function(t){if(null!==this.sprite&&void 0!==this.sprite.parent)return this.enabled&&this.sprite.visible&&this.sprite.parent.visible?this._pendingDrag?(this._dragDistancePass||(this._dragDistancePass=i.Math.distance(t.x,t.y,this.downPoint.x,this.downPoint.y)>=this.dragDistanceThreshold),this._dragDistancePass&&this._dragTimePass&&this.startDrag(t),!0):this.draggable&&this._draggedPointerID===t.id?this.updateDrag(t,!1):this._pointerData[t.id].isOver?this.checkPointerOver(t)?(this._pointerData[t.id].x=t.x-this.sprite.x,this._pointerData[t.id].y=t.y-this.sprite.y,!0):(this._pointerOutHandler(t),!1):void 0:(this._pointerOutHandler(t),!1)},_pointerOverHandler:function(t,e){if(null!==this.sprite){var i=this._pointerData[t.id];if(!1===i.isOver||t.dirty){var s=!1===i.isOver;i.isOver=!0,i.isOut=!1,i.timeOver=this.game.time.time,i.x=t.x-this.sprite.x,i.y=t.y-this.sprite.y,this.useHandCursor&&!1===i.isDragged&&(this.game.canvas.style.cursor="pointer",this._setHandCursor=!0),!e&&s&&this.sprite&&this.sprite.events&&this.sprite.events.onInputOver$dispatch(this.sprite,t),this.sprite.parent&&this.sprite.parent.onChildInputOver&&this.sprite.parent.onChildInputOver.dispatch(this.sprite,t)}}},_pointerOutHandler:function(t,e){if(null!==this.sprite){var i=this._pointerData[t.id];i.isOver=!1,i.isOut=!0,i.timeOut=this.game.time.time,this.useHandCursor&&!1===i.isDragged&&(this.game.canvas.style.cursor="",this._setHandCursor=!1),!e&&this.sprite&&this.sprite.events&&(this.sprite.events.onInputOut$dispatch(this.sprite,t),this.sprite&&this.sprite.parent&&this.sprite.parent.onChildInputOut&&this.sprite.parent.onChildInputOut.dispatch(this.sprite,t))}},_touchedHandler:function(t){if(null!==this.sprite){var e=this._pointerData[t.id];if(!e.isDown&&e.isOver){if(this.pixelPerfectClick&&!this.checkPixel(null,null,t))return;if(e.isDown=!0,e.isUp=!1,e.timeDown=this.game.time.time,this.downPoint.set(t.x,t.y),t.dirty=!0,this.sprite&&this.sprite.events&&(this.sprite.events.onInputDown$dispatch(this.sprite,t),this.sprite&&this.sprite.parent&&this.sprite.parent.onChildInputDown&&this.sprite.parent.onChildInputDown.dispatch(this.sprite,t),null===this.sprite))return;this.draggable&&!1===this.isDragged&&(0===this.dragTimeThreshold&&0===this.dragDistanceThreshold?this.startDrag(t):(this._pendingDrag=!0,this._dragDistancePass=0===this.dragDistanceThreshold,this.dragTimeThreshold>0?(this._dragTimePass=!1,this.game.time.events.add(this.dragTimeThreshold,this.dragTimeElapsed,this,t)):this._dragTimePass=!0)),this.bringToTop&&this.sprite.bringToTop()}}},dragTimeElapsed:function(t){this._dragTimePass=!0,this._pendingDrag&&this.sprite&&this._dragDistancePass&&this.startDrag(t)},_releasedHandler:function(t){if(null!==this.sprite){var e=this._pointerData[t.id];if(e.isDown&&t.isUp){e.isDown=!1,e.isUp=!0,e.timeUp=this.game.time.time,e.downDuration=e.timeUp-e.timeDown;var i=this.checkPointerOver(t);this.sprite&&this.sprite.events&&(this.dragStopBlocksInputUp&&(!this.dragStopBlocksInputUp||this.draggable&&this.isDragged&&this._draggedPointerID===t.id)||this.sprite.events.onInputUp$dispatch(this.sprite,t,i),this.sprite&&this.sprite.parent&&this.sprite.parent.onChildInputUp&&this.sprite.parent.onChildInputUp.dispatch(this.sprite,t,i),i&&(i=this.checkPointerOver(t))),e.isOver=i,!i&&this.useHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),t.dirty=!0,this._pendingDrag=!1,this.draggable&&this.isDragged&&this._draggedPointerID===t.id&&this.stopDrag(t)}}},updateDrag:function(t,e){if(void 0===e&&(e=!1),t.isUp)return this.stopDrag(t),!1;var i=this.globalToLocal(t),s=i.x+this._dragPoint.x+this.dragOffset.x,n=i.y+this._dragPoint.y+this.dragOffset.y;if(this.sprite.fixedToCamera)this.allowHorizontalDrag&&(this.sprite.cameraOffset.x=s-this.game.camera.x),this.allowVerticalDrag&&(this.sprite.cameraOffset.y=n-this.game.camera.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY,this.snapPoint.set(this.sprite.cameraOffset.x,this.sprite.cameraOffset.y));else{var r=this.game.camera.x-this._pointerData[t.id].camX,o=this.game.camera.y-this._pointerData[t.id].camY;this.allowHorizontalDrag&&(this.sprite.x=s+r),this.allowVerticalDrag&&(this.sprite.y=n+o),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY,this.snapPoint.set(this.sprite.x,this.sprite.y))}return this.sprite.events.onDragUpdate.dispatch(this.sprite,t,s,n,this.snapPoint,e),!0},justOver:function(t,e){return t=t||0,e=e||500,this._pointerData[t].isOver&&this.overDuration(t)this.boundsRect.right&&(this.sprite.cameraOffset.x=this.boundsRect.right-this.sprite.width),this.sprite.cameraOffset.ythis.boundsRect.bottom&&(this.sprite.cameraOffset.y=this.boundsRect.bottom-this.sprite.height)):(this.sprite.leftthis.boundsRect.right&&(this.sprite.x=this.boundsRect.right-(this.sprite.width-this.sprite.offsetX)),this.sprite.topthis.boundsRect.bottom&&(this.sprite.y=this.boundsRect.bottom-(this.sprite.height-this.sprite.offsetY)))},checkBoundsSprite:function(){this.sprite.fixedToCamera&&this.boundsSprite.fixedToCamera?(this.sprite.cameraOffset.xthis.boundsSprite.cameraOffset.x+this.boundsSprite.width&&(this.sprite.cameraOffset.x=this.boundsSprite.cameraOffset.x+this.boundsSprite.width-this.sprite.width),this.sprite.cameraOffset.ythis.boundsSprite.cameraOffset.y+this.boundsSprite.height&&(this.sprite.cameraOffset.y=this.boundsSprite.cameraOffset.y+this.boundsSprite.height-this.sprite.height)):(this.sprite.leftthis.boundsSprite.right&&(this.sprite.x=this.boundsSprite.right-(this.sprite.width-this.sprite.offsetX)),this.sprite.topthis.boundsSprite.bottom&&(this.sprite.y=this.boundsSprite.bottom-(this.sprite.height-this.sprite.offsetY)))}},i.InputHandler.prototype.constructor=i.InputHandler,i.Gamepad=function(t){this.game=t,this._gamepadIndexMap={},this._rawPads=[],this._active=!1,this.enabled=!0,this._gamepadSupportAvailable=!!navigator.webkitGetGamepads||!!navigator.webkitGamepads||-1!==navigator.userAgent.indexOf("Firefox/")||!!navigator.getGamepads,this._prevRawGamepadTypes=[],this._prevTimestamps=[],this.callbackContext=this,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null,this._ongamepadconnected=null,this._gamepaddisconnected=null,this._gamepads=[new i.SinglePad(t,this),new i.SinglePad(t,this),new i.SinglePad(t,this),new i.SinglePad(t,this)]},i.Gamepad.prototype={addCallbacks:function(t,e){void 0!==e&&(this.onConnectCallback="function"==typeof e.onConnect?e.onConnect:this.onConnectCallback,this.onDisconnectCallback="function"==typeof e.onDisconnect?e.onDisconnect:this.onDisconnectCallback,this.onDownCallback="function"==typeof e.onDown?e.onDown:this.onDownCallback,this.onUpCallback="function"==typeof e.onUp?e.onUp:this.onUpCallback,this.onAxisCallback="function"==typeof e.onAxis?e.onAxis:this.onAxisCallback,this.onFloatCallback="function"==typeof e.onFloat?e.onFloat:this.onFloatCallback,this.callbackContext=t)},start:function(){if(!this._active){this._active=!0;var t=this;this._onGamepadConnected=function(e){return t.onGamepadConnected(e)},this._onGamepadDisconnected=function(e){return t.onGamepadDisconnected(e)},window.addEventListener("gamepadconnected",this._onGamepadConnected,!1),window.addEventListener("gamepaddisconnected",this._onGamepadDisconnected,!1)}},onGamepadConnected:function(t){var e=t.gamepad;this._rawPads.push(e),this._gamepads[e.index].connect(e)},onGamepadDisconnected:function(t){var e=t.gamepad;for(var i in this._rawPads)this._rawPads[i].index===e.index&&this._rawPads.splice(i,1);this._gamepads[e.index].disconnect()},update:function(){this._pollGamepads(),this.pad1.pollStatus(),this.pad2.pollStatus(),this.pad3.pollStatus(),this.pad4.pollStatus()},_pollGamepads:function(){if(this._active){if(navigator.getGamepads)t=navigator.getGamepads();else if(navigator.webkitGetGamepads)t=navigator.webkitGetGamepads();else if(navigator.webkitGamepads)var t=navigator.webkitGamepads();if(t){this._rawPads=[];for(var e=!1,i=0;i0&&s>this.deadZone||s<0&&s<-this.deadZone?this.processAxisChange(i,s):this.processAxisChange(i,0)}this._prevTimestamp=this._rawPad.timestamp}},connect:function(t){var e=!this.connected;this.connected=!0,this.index=t.index,this._rawPad=t,this._buttons=[],this._buttonsLen=t.buttons.length,this._axes=[],this._axesLen=t.axes.length;for(var s=0;sthis.maxHealth&&(this.health=this.maxHealth),this},heal:function(t){return this.alive&&(this.health+=t,this.health>this.maxHealth&&(this.health=this.maxHealth)),this}},i.Component.InCamera=function(){},i.Component.InCamera.prototype={inCamera:{get:function(){return this.game.world.camera.view.intersects(this._bounds)}}},i.Component.InputEnabled=function(){},i.Component.InputEnabled.prototype={input:null,inputEnabled:{get:function(){return this.input&&this.input.enabled},set:function(t){t?null===this.input?(this.input=new i.InputHandler(this),this.input.start()):this.input&&!this.input.enabled&&this.input.start():this.input&&this.input.enabled&&this.input.stop()}}},i.Component.InWorld=function(){},i.Component.InWorld.preUpdate=function(){if(this.autoCull||this.checkWorldBounds){if(this._bounds.copyFrom(this.getBounds()),this._bounds.x+=this.game.camera.view.x,this._bounds.y+=this.game.camera.view.y,this.autoCull)if(this.game.world.camera.view.intersects(this._bounds))this.renderable=!0,this.game.world.camera.totalInView++;else if(this.renderable=!1,this.outOfCameraBoundsKill)return this.kill(),!1;if(this.checkWorldBounds)if(this._outOfBoundsFired&&this.game.world.bounds.intersects(this._bounds))this._outOfBoundsFired=!1,this.events.onEnterBounds$dispatch(this);else if(!this._outOfBoundsFired&&!this.game.world.bounds.intersects(this._bounds)&&(this._outOfBoundsFired=!0,this.events.onOutOfBounds$dispatch(this),this.outOfBoundsKill))return this.kill(),!1}return!0},i.Component.InWorld.prototype={checkWorldBounds:!1,outOfBoundsKill:!1,outOfCameraBoundsKill:!1,_outOfBoundsFired:!1,inWorld:{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}},i.Component.LifeSpan=function(){},i.Component.LifeSpan.preUpdate=function(){return!(this.lifespan>0&&(this.lifespan-=this.game.time.physicsElapsedMS,this.lifespan<=0))||(this.kill(),!1)},i.Component.LifeSpan.prototype={alive:!0,lifespan:0,revive:function(t){return void 0===t&&(t=100),this.alive=!0,this.exists=!0,this.visible=!0,"function"==typeof this.setHealth&&this.setHealth(t),this.events&&this.events.onRevived$dispatch(this),this},kill:function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled$dispatch(this),this}},i.Component.LoadTexture=function(){},i.Component.LoadTexture.prototype={customRender:!1,_frame:null,loadTexture:function(t,e,s){t===i.PENDING_ATLAS?(t=e,e=0):e=e||0,(s||void 0===s)&&this.animations&&this.animations.stop(),this.key=t,this.customRender=!1;var n=this.game.cache,r=!0,o=!this.texture.baseTexture.scaleMode;if(i.RenderTexture&&t instanceof i.RenderTexture)this.key=t.key,this.setTexture(t);else if(i.BitmapData&&t instanceof i.BitmapData)this.customRender=!0,this.setTexture(t.texture),r=n.hasFrameData(t.key,i.Cache.BITMAPDATA)?!this.animations.loadFrameData(n.getFrameData(t.key,i.Cache.BITMAPDATA),e):!this.animations.loadFrameData(t.frameData,0);else if(i.Video&&t instanceof i.Video){this.customRender=!0;var a=t.texture.valid;this.setTexture(t.texture),this.setFrame(t.texture.frame.clone()),t.onChangeSource.add(this.resizeFrame,this),this.texture.valid=a}else if(i.Tilemap&&t instanceof i.TilemapLayer)this.setTexture(PIXI.Texture.fromCanvas(t.canvas));else if(t instanceof PIXI.Texture)this.setTexture(t);else{var h=n.getImage(t,!0);this.key=h.key,this.setTexture(new PIXI.Texture(h.base)),this.texture.baseTexture.skipRender="__default"===t,r=!this.animations.loadFrameData(h.frameData,e)}r&&(this._frame=i.Rectangle.clone(this.texture.frame)),o||(this.texture.baseTexture.scaleMode=1)},setFrame:function(t){this._frame=t,this.texture.frame.x=t.x,this.texture.frame.y=t.y,this.texture.frame.width=t.width,this.texture.frame.height=t.height,this.texture.crop.x=t.x,this.texture.crop.y=t.y,this.texture.crop.width=t.width,this.texture.crop.height=t.height,t.trimmed?(this.texture.trim?(this.texture.trim.x=t.spriteSourceSizeX,this.texture.trim.y=t.spriteSourceSizeY,this.texture.trim.width=t.sourceSizeW,this.texture.trim.height=t.sourceSizeH):this.texture.trim={x:t.spriteSourceSizeX,y:t.spriteSourceSizeY,width:t.sourceSizeW,height:t.sourceSizeH},this.texture.width=t.sourceSizeW,this.texture.height=t.sourceSizeH,this.texture.frame.width=t.sourceSizeW,this.texture.frame.height=t.sourceSizeH):!t.trimmed&&this.texture.trim&&(this.texture.trim=null),t.rotated&&(this.texture.rotated=!0),this.cropRect&&this.updateCrop(),this.texture.requiresReTint=!0,this.texture._updateUvs(),this.tilingTexture&&(this.refreshTexture=!0)},resizeFrame:function(t,e,i){this.texture.frame.resize(e,i),this.texture.setFrame(this.texture.frame)},resetFrame:function(){this._frame&&this.setFrame(this._frame)},frame:{get:function(){return this.animations.frame},set:function(t){this.animations.frame=t}},frameName:{get:function(){return this.animations.frameName},set:function(t){this.animations.frameName=t}}},i.Component.Overlap=function(){},i.Component.Overlap.prototype={overlap:function(t){return i.Rectangle.intersects(this.getBounds(),t.getBounds())}},i.Component.PhysicsBody=function(){},i.Component.PhysicsBody.preUpdate=function(){return this.fresh&&this.exists?(this.world.setTo(this.parent.position.x+this.position.x,this.parent.position.y+this.position.y),this.worldTransform.tx=this.world.x,this.worldTransform.ty=this.world.y,this.previousPosition.set(this.world.x,this.world.y),this.previousRotation=this.rotation,this.body&&this.body.preUpdate(),this.fresh=!1,this.preUpdateChildren(),!1):(this.previousPosition.set(this.world.x,this.world.y),this.previousRotation=this.rotation,!(!this._exists||!this.parent.exists)||(this.renderOrderID=-1,!1))},i.Component.PhysicsBody.postUpdate=function(){this.exists&&this.body&&this.body.postUpdate()},i.Component.PhysicsBody.prototype={body:null,x:{get:function(){return this.position.x},set:function(t){this.position.x=t,this.body&&!this.body.dirty&&(this.body._reset=!0)}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t,this.body&&!this.body.dirty&&(this.body._reset=!0)}}},i.Component.Reset=function(){},i.Component.Reset.prototype.reset=function(t,e,i){return void 0===i&&(i=1),this.world.set(t,e),this.position.set(t,e),this.fresh=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this.components.InWorld&&(this._outOfBoundsFired=!1),this.components.LifeSpan&&(this.alive=!0,this.health=i),this.components.PhysicsBody&&this.body&&this.body.reset(t,e,!1,!1),this},i.Component.ScaleMinMax=function(){},i.Component.ScaleMinMax.prototype={transformCallback:null,transformCallbackContext:this,scaleMin:null,scaleMax:null,checkTransform:function(t){this.scaleMin&&(t.athis.scaleMax.x&&(t.a=this.scaleMax.x),t.d>this.scaleMax.y&&(t.d=this.scaleMax.y))},setScaleMinMax:function(t,e,s,n){void 0===e?e=s=n=t:void 0===s&&(s=n=e,e=t),null===t?this.scaleMin=null:this.scaleMin?this.scaleMin.set(t,e):this.scaleMin=new i.Point(t,e),null===s?this.scaleMax=null:this.scaleMax?this.scaleMax.set(s,n):this.scaleMax=new i.Point(s,n),null===this.scaleMin?this.transformCallback=null:(this.transformCallback=this.checkTransform,this.transformCallbackContext=this)}},i.Component.Smoothed=function(){},i.Component.Smoothed.prototype={smoothed:{get:function(){return!this.texture.baseTexture.scaleMode},set:function(t){t?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}},i.GameObjectFactory=function(t){this.game=t,this.world=this.game.world},i.GameObjectFactory.prototype={existing:function(t){return this.world.add(t)},weapon:function(t,e,s,n,r){var o=this.game.plugins.add(i.Weapon);return r&&(o.bulletClass=r),o.createBullets(t,e,s,n),o},image:function(t,e,s,n,r){return void 0===r&&(r=this.world),r.add(new i.Image(this.game,t,e,s,n))},sprite:function(t,e,i,s,n){return void 0===n&&(n=this.world),n.create(t,e,i,s)},creature:function(t,e,s,n,r){void 0===r&&(r=this.world);var o=new i.Creature(this.game,t,e,s,n);return r.add(o),o},tween:function(t){return this.game.tweens.create(t)},group:function(t,e,s,n,r){return new i.Group(this.game,t,e,s,n,r)},physicsGroup:function(t,e,s,n){return new i.Group(this.game,e,s,n,!0,t)},spriteBatch:function(t,e,s){return void 0===t&&(t=null),void 0===e&&(e="group"),void 0===s&&(s=!1),new i.SpriteBatch(this.game,t,e,s)},audio:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},sound:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},audioSprite:function(t){return this.game.sound.addSprite(t)},tileSprite:function(t,e,s,n,r,o,a){return void 0===a&&(a=this.world),a.add(new i.TileSprite(this.game,t,e,s,n,r,o))},rope:function(t,e,s,n,r,o){return void 0===o&&(o=this.world),o.add(new i.Rope(this.game,t,e,s,n,r))},text:function(t,e,s,n,r){return void 0===r&&(r=this.world),r.add(new i.Text(this.game,t,e,s,n))},button:function(t,e,s,n,r,o,a,h,l,c){return void 0===c&&(c=this.world),c.add(new i.Button(this.game,t,e,s,n,r,o,a,h,l))},graphics:function(t,e,s){return void 0===s&&(s=this.world),s.add(new i.Graphics(this.game,t,e))},emitter:function(t,e,s){return this.game.particles.add(new i.Particles.Arcade.Emitter(this.game,t,e,s))},retroFont:function(t,e,s,n,r,o,a,h,l){return new i.RetroFont(this.game,t,e,s,n,r,o,a,h,l)},bitmapText:function(t,e,s,n,r,o){return void 0===o&&(o=this.world),o.add(new i.BitmapText(this.game,t,e,s,n,r))},tilemap:function(t,e,s,n,r){return new i.Tilemap(this.game,t,e,s,n,r)},renderTexture:function(t,e,s,n){void 0!==s&&""!==s||(s=this.game.rnd.uuid()),void 0===n&&(n=!1);var r=new i.RenderTexture(this.game,t,e,s);return n&&this.game.cache.addRenderTexture(s,r),r},video:function(t,e){return new i.Video(this.game,t,e)},bitmapData:function(t,e,s,n){void 0===n&&(n=!1),void 0!==s&&""!==s||(s=this.game.rnd.uuid());var r=new i.BitmapData(this.game,s,t,e);return n&&this.game.cache.addBitmapData(s,r),r},filter:function(t){var e=Array.prototype.slice.call(arguments,1);return(t=new i.Filter[t](this.game)).init.apply(t,e),t},plugin:function(t){return this.game.plugins.add(t)}},i.GameObjectFactory.prototype.constructor=i.GameObjectFactory,i.GameObjectCreator=function(t){this.game=t,this.world=this.game.world},i.GameObjectCreator.prototype={image:function(t,e,s,n){return new i.Image(this.game,t,e,s,n)},sprite:function(t,e,s,n){return new i.Sprite(this.game,t,e,s,n)},tween:function(t){return new i.Tween(t,this.game,this.game.tweens)},group:function(t,e,s,n,r){return new i.Group(this.game,t,e,s,n,r)},spriteBatch:function(t,e,s){return void 0===e&&(e="group"),void 0===s&&(s=!1),new i.SpriteBatch(this.game,t,e,s)},audio:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},audioSprite:function(t){return this.game.sound.addSprite(t)},sound:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},tileSprite:function(t,e,s,n,r,o){return new i.TileSprite(this.game,t,e,s,n,r,o)},rope:function(t,e,s,n,r){return new i.Rope(this.game,t,e,s,n,r)},text:function(t,e,s,n){return new i.Text(this.game,t,e,s,n)},button:function(t,e,s,n,r,o,a,h,l){return new i.Button(this.game,t,e,s,n,r,o,a,h,l)},graphics:function(t,e){return new i.Graphics(this.game,t,e)},emitter:function(t,e,s){return new i.Particles.Arcade.Emitter(this.game,t,e,s)},retroFont:function(t,e,s,n,r,o,a,h,l){return new i.RetroFont(this.game,t,e,s,n,r,o,a,h,l)},bitmapText:function(t,e,s,n,r,o){return new i.BitmapText(this.game,t,e,s,n,r,o)},tilemap:function(t,e,s,n,r){return new i.Tilemap(this.game,t,e,s,n,r)},renderTexture:function(t,e,s,n){void 0!==s&&""!==s||(s=this.game.rnd.uuid()),void 0===n&&(n=!1);var r=new i.RenderTexture(this.game,t,e,s);return n&&this.game.cache.addRenderTexture(s,r),r},bitmapData:function(t,e,s,n){void 0===n&&(n=!1),void 0!==s&&""!==s||(s=this.game.rnd.uuid());var r=new i.BitmapData(this.game,s,t,e);return n&&this.game.cache.addBitmapData(s,r),r},filter:function(t){var e=Array.prototype.slice.call(arguments,1);return(t=new i.Filter[t](this.game)).init.apply(t,e),t}},i.GameObjectCreator.prototype.constructor=i.GameObjectCreator,i.Sprite=function(t,e,s,n,r){e=e||0,s=s||0,n=n||null,r=r||null,this.type=i.SPRITE,this.physicsType=i.SPRITE,PIXI.Sprite.call(this,i.Cache.DEFAULT),i.Component.Core.init.call(this,t,e,s,n,r)},i.Sprite.prototype=Object.create(PIXI.Sprite.prototype),i.Sprite.prototype.constructor=i.Sprite,i.Component.Core.install.call(i.Sprite.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Delta","Destroy","FixedToCamera","Health","InCamera","InputEnabled","InWorld","LifeSpan","LoadTexture","Overlap","PhysicsBody","Reset","ScaleMinMax","Smoothed"]),i.Sprite.prototype.preUpdatePhysics=i.Component.PhysicsBody.preUpdate,i.Sprite.prototype.preUpdateLifeSpan=i.Component.LifeSpan.preUpdate,i.Sprite.prototype.preUpdateInWorld=i.Component.InWorld.preUpdate,i.Sprite.prototype.preUpdateCore=i.Component.Core.preUpdate,i.Sprite.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},i.Image=function(t,e,s,n,r){e=e||0,s=s||0,n=n||null,r=r||null,this.type=i.IMAGE,PIXI.Sprite.call(this,i.Cache.DEFAULT),i.Component.Core.init.call(this,t,e,s,n,r)},i.Image.prototype=Object.create(PIXI.Sprite.prototype),i.Image.prototype.constructor=i.Image,i.Component.Core.install.call(i.Image.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Destroy","FixedToCamera","InputEnabled","LifeSpan","LoadTexture","Overlap","Reset","ScaleMinMax","Smoothed"]),i.Image.prototype.preUpdateLifeSpan=i.Component.LifeSpan.preUpdate,i.Image.prototype.preUpdateInWorld=i.Component.InWorld.preUpdate,i.Image.prototype.preUpdateCore=i.Component.Core.preUpdate,i.Image.prototype.preUpdate=function(){return!(!this.preUpdateInWorld()||!this.preUpdateLifeSpan())&&this.preUpdateCore()},i.Button=function(t,e,s,n,r,o,a,h,l,c){e=e||0,s=s||0,n=n||null,r=r||null,o=o||this,i.Image.call(this,t,e,s,n,h),this.type=i.BUTTON,this.physicsType=i.SPRITE,this._onOverFrame=null,this._onOutFrame=null,this._onDownFrame=null,this._onUpFrame=null,this.onOverSound=null,this.onOutSound=null,this.onDownSound=null,this.onUpSound=null,this.onOverSoundMarker="",this.onOutSoundMarker="",this.onDownSoundMarker="",this.onUpSoundMarker="",this.onInputOver=new i.Signal,this.onInputOut=new i.Signal,this.onInputDown=new i.Signal,this.onInputUp=new i.Signal,this.onOverMouseOnly=!0,this.justReleasedPreventsOver=i.PointerMode.TOUCH,this.freezeFrames=!1,this.forceOut=!1,this.inputEnabled=!0,this.input.start(0,!0),this.input.useHandCursor=!0,this.setFrames(a,h,l,c),null!==r&&this.onInputUp.add(r,o),this.events.onInputOver.add(this.onInputOverHandler,this),this.events.onInputOut.add(this.onInputOutHandler,this),this.events.onInputDown.add(this.onInputDownHandler,this),this.events.onInputUp.add(this.onInputUpHandler,this)},i.Button.prototype=Object.create(i.Image.prototype),i.Button.prototype.constructor=i.Button;return i.Button.prototype.clearFrames=function(){this.setFrames(null,null,null,null)},i.Button.prototype.setStateFrame=function(t,e,i){var s="_on"+t+"Frame";null!==e?(this[s]=e,i&&this.changeStateFrame(t)):this[s]=null},i.Button.prototype.changeStateFrame=function(t){if(this.freezeFrames)return!1;var e=this["_on"+t+"Frame"];return"string"==typeof e?(this.frameName=e,!0):"number"==typeof e&&(this.frame=e,!0)},i.Button.prototype.setFrames=function(t,e,i,s){this.setStateFrame("Over",t,this.input.pointerOver()),this.setStateFrame("Out",e,!this.input.pointerOver()),this.setStateFrame("Down",i,this.input.pointerDown()),this.setStateFrame("Up",s,this.input.pointerUp())},i.Button.prototype.setStateSound=function(t,e,s){var n="on"+t+"Sound",r="on"+t+"SoundMarker";e instanceof i.Sound||e instanceof i.AudioSprite?(this[n]=e,this[r]="string"==typeof s?s:""):(this[n]=null,this[r]="")},i.Button.prototype.playStateSound=function(t){var e=this["on"+t+"Sound"];if(e){var i=this["on"+t+"SoundMarker"];return e.play(i),!0}return!1},i.Button.prototype.setSounds=function(t,e,i,s,n,r,o,a){this.setStateSound("Over",t,e),this.setStateSound("Out",n,r),this.setStateSound("Down",i,s),this.setStateSound("Up",o,a)},i.Button.prototype.setOverSound=function(t,e){this.setStateSound("Over",t,e)},i.Button.prototype.setOutSound=function(t,e){this.setStateSound("Out",t,e)},i.Button.prototype.setDownSound=function(t,e){this.setStateSound("Down",t,e)},i.Button.prototype.setUpSound=function(t,e){this.setStateSound("Up",t,e)},i.Button.prototype.onInputOverHandler=function(t,e){e.justReleased()&&(this.justReleasedPreventsOver&e.pointerMode)===e.pointerMode||(this.changeStateFrame("Over"),this.onOverMouseOnly&&!e.isMouse||(this.playStateSound("Over"),this.onInputOver&&this.onInputOver.dispatch(this,e)))},i.Button.prototype.onInputOutHandler=function(t,e){this.changeStateFrame("Out"),this.playStateSound("Out"),this.onInputOut&&this.onInputOut.dispatch(this,e)},i.Button.prototype.onInputDownHandler=function(t,e){this.changeStateFrame("Down"),this.playStateSound("Down"),this.onInputDown&&this.onInputDown.dispatch(this,e)},i.Button.prototype.onInputUpHandler=function(t,e,i){this.playStateSound("Up"),this.onInputUp&&this.onInputUp.dispatch(this,e,i),this.freezeFrames||(!0===this.forceOut||(this.forceOut&e.pointerMode)===e.pointerMode?this.changeStateFrame("Out"):this.changeStateFrame("Up")||(i?this.changeStateFrame("Over"):this.changeStateFrame("Out")))},i.SpriteBatch=function(t,e,s,n){void 0!==e&&null!==e||(e=t.world),i.Group.call(this,t,e,s,n),this.type=i.SPRITEBATCH,this.fastSpriteBatch=null,this.ready=!1},i.SpriteBatch.prototype=Object.create(i.Group.prototype),i.SpriteBatch.prototype.constructor=i.SpriteBatch,i.SpriteBatch.prototype._renderWebGL=function(t){!this.visible||this.alpha<=0||!this.children.length||(this.ready||(this.fastSpriteBatch=new PIXI.WebGLFastSpriteBatch(t.gl),this.ready=!0),this.fastSpriteBatch.gl!==t.gl&&this.fastSpriteBatch.setContext(t.gl),t.spriteBatch.stop(),t.shaderManager.setShader(t.shaderManager.fastShader),this.fastSpriteBatch.begin(this,t),this.fastSpriteBatch.render(this),t.spriteBatch.start())},i.SpriteBatch.prototype._renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.children.length){var e=t.context;e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var i=this.worldTransform,s=!0,n=0;n=0&&t<=this.width&&e>=0&&e<=this.height&&(i.Device.LITTLE_ENDIAN?this.pixels[e*this.width+t]=o<<24|r<<16|n<<8|s:this.pixels[e*this.width+t]=s<<24|n<<16|r<<8|o,a&&(this.context.putImageData(this.imageData,0,0),this.dirty=!0)),this},setPixel:function(t,e,i,s,n,r){return this.setPixel32(t,e,i,s,n,255,r)},getPixel:function(t,e,s){s||(s=i.Color.createColor());var n=~~(t+e*this.width);return n*=4,s.r=this.data[n],s.g=this.data[++n],s.b=this.data[++n],s.a=this.data[++n],s},getPixel32:function(t,e){if(t>=0&&t<=this.width&&e>=0&&e<=this.height)return this.pixels[e*this.width+t]},getPixelRGB:function(t,e,s,n,r){return i.Color.unpackPixel(this.getPixel32(t,e),s,n,r)},getPixels:function(t){return this.context.getImageData(t.x,t.y,t.width,t.height)},getFirstPixel:function(t){void 0===t&&(t=0);var e=i.Color.createColor(),s=0,n=0,r=1,o=!1;1===t?(r=-1,n=this.height):3===t&&(r=-1,s=this.width);do{i.Color.unpackPixel(this.getPixel32(s,n),e),0===t||1===t?++s===this.width&&(s=0,((n+=r)>=this.height||n<=0)&&(o=!0)):2!==t&&3!==t||++n===this.height&&(n=0,((s+=r)>=this.width||s<=0)&&(o=!0))}while(0===e.a&&!o);return e.x=s,e.y=n,e},getBounds:function(t){return void 0===t&&(t=new i.Rectangle),t.x=this.getFirstPixel(2).x,t.x===this.width?t.setTo(0,0,0,0):(t.y=this.getFirstPixel(0).y,t.width=this.getFirstPixel(3).x-t.x+1,t.height=this.getFirstPixel(1).y-t.y+1,t)},addToWorld:function(t,e,i,s,n,r){n=n||1,r=r||1;var o=this.game.add.image(t,e,this);return o.anchor.set(i,s),o.scale.set(n,r),o},copy:function(t,e,s,n,r,o,a,h,l,c,u,d,p,f,g,m,y){if(void 0!==t&&null!==t||(t=this),t instanceof i.RenderTexture&&(t=t.getCanvas()),this._image=t,t instanceof i.Sprite||t instanceof i.Image||t instanceof i.Text||t instanceof PIXI.Sprite)this._pos.set(t.texture.crop.x,t.texture.crop.y),this._size.set(t.texture.crop.width,t.texture.crop.height),this._scale.set(t.scale.x,t.scale.y),this._anchor.set(t.anchor.x,t.anchor.y),this._rotate=t.rotation,this._alpha.current=t.alpha,t.texture instanceof i.RenderTexture?this._image=t.texture.getCanvas():this._image=t.texture.baseTexture.source,void 0!==o&&null!==o||(o=t.x),void 0!==a&&null!==a||(a=t.y),t.texture.trim&&(o+=t.texture.trim.x-t.anchor.x*t.texture.trim.width,a+=t.texture.trim.y-t.anchor.y*t.texture.trim.height),16777215!==t.tint&&(t.cachedTint!==t.tint&&(t.cachedTint=t.tint,t.tintedTexture=PIXI.CanvasTinter.getTintedTexture(t,t.tint)),this._image=t.tintedTexture,this._pos.set(0));else{if(this._pos.set(0),this._scale.set(1),this._anchor.set(0),this._rotate=0,this._alpha.current=1,t instanceof i.BitmapData)this._image=t.canvas;else if("string"==typeof t){if(null===(t=this.game.cache.getImage(t)))return;this._image=t}this._size.set(this._image.width,this._image.height)}if(void 0!==e&&null!==e||(e=0),void 0!==s&&null!==s||(s=0),n&&(this._size.x=n),r&&(this._size.y=r),void 0!==o&&null!==o||(o=e),void 0!==a&&null!==a||(a=s),void 0!==h&&null!==h||(h=this._size.x),void 0!==l&&null!==l||(l=this._size.y),"number"==typeof c&&(this._rotate=c),"number"==typeof u&&(this._anchor.x=u),"number"==typeof d&&(this._anchor.y=d),"number"==typeof p&&(this._scale.x=p),"number"==typeof f&&(this._scale.y=f),"number"==typeof g&&(this._alpha.current=g),void 0===m&&(m=null),void 0===y&&(y=!1),!(this._alpha.current<=0||0===this._scale.x||0===this._scale.y||0===this._size.x||0===this._size.y)){var v=this.context;return this._alpha.prev=v.globalAlpha,v.save(),v.globalAlpha=this._alpha.current,m&&(this.op=m),y&&(o|=0,a|=0),v.translate(o,a),v.scale(this._scale.x,this._scale.y),v.rotate(this._rotate),v.drawImage(this._image,this._pos.x+e,this._pos.y+s,this._size.x,this._size.y,-h*this._anchor.x,-l*this._anchor.y,h,l),v.restore(),v.globalAlpha=this._alpha.prev,this.dirty=!0,this}},copyTransform:function(t,e,s){if(void 0===e&&(e=null),void 0===s&&(s=!1),!t.hasOwnProperty("worldTransform")||!t.worldVisible||0===t.worldAlpha)return this;var n=t.worldTransform;if(this._pos.set(t.texture.crop.x,t.texture.crop.y),this._size.set(t.texture.crop.width,t.texture.crop.height),0===n.a||0===n.d||0===this._size.x||0===this._size.y)return this;t.texture instanceof i.RenderTexture?this._image=t.texture.getCanvas():this._image=t.texture.baseTexture.source;var r=n.tx,o=n.ty;t.texture.trim&&(r+=t.texture.trim.x-t.anchor.x*t.texture.trim.width,o+=t.texture.trim.y-t.anchor.y*t.texture.trim.height),16777215!==t.tint&&(t.cachedTint!==t.tint&&(t.cachedTint=t.tint,t.tintedTexture=PIXI.CanvasTinter.getTintedTexture(t,t.tint)),this._image=t.tintedTexture,this._pos.set(0)),s&&(r|=0,o|=0);var a=this.context;return this._alpha.prev=a.globalAlpha,a.save(),a.globalAlpha=this._alpha.current,e&&(this.op=e),a[this.smoothProperty]=t.texture.baseTexture.scaleMode===PIXI.scaleModes.LINEAR,a.setTransform(n.a,n.b,n.c,n.d,r,o),a.drawImage(this._image,this._pos.x,this._pos.y,this._size.x,this._size.y,-this._size.x*t.anchor.x,-this._size.y*t.anchor.y,this._size.x,this._size.y),a.restore(),a.globalAlpha=this._alpha.prev,this.dirty=!0,this},copyRect:function(t,e,i,s,n,r,o){return this.copy(t,e.x,e.y,e.width,e.height,i,s,e.width,e.height,0,0,0,1,1,n,r,o)},draw:function(t,e,i,s,n,r,o){return this.copy(t,null,null,null,null,e,i,s,n,null,null,null,null,null,null,r,o)},drawGroup:function(t,e,i){return t.total>0&&t.forEachExists(this.drawGroupProxy,this,e,i),this},drawGroupProxy:function(t,e,s){if(t.hasOwnProperty("texture")&&this.copyTransform(t,e,s),t.type===i.GROUP&&t.exists)this.drawGroup(t,e,s);else if(t.hasOwnProperty("children")&&t.children.length>0)for(var n=0;ne.width&&(n=e.width);var r=this.context;return r.fillStyle=r.createPattern(e,s),this._circle=new i.Circle(t.start.x,t.start.y,e.height),this._circle.circumferencePoint(t.angle-1.5707963267948966,!1,this._pos),r.save(),r.translate(this._pos.x,this._pos.y),r.rotate(t.angle),r.fillRect(0,0,n,e.height),r.restore(),this.dirty=!0,this}},render:function(){return!this.disableTextureUpload&&this.dirty&&(this.baseTexture.dirty(),this.dirty=!1),this},destroy:function(){this.frameData.destroy(),this.texture.destroy(!0),i.CanvasPool.remove(this)},blendReset:function(){return this.op="source-over",this},blendSourceOver:function(){return this.op="source-over",this},blendSourceIn:function(){return this.op="source-in",this},blendSourceOut:function(){return this.op="source-out",this},blendSourceAtop:function(){return this.op="source-atop",this},blendDestinationOver:function(){return this.op="destination-over",this},blendDestinationIn:function(){return this.op="destination-in",this},blendDestinationOut:function(){return this.op="destination-out",this},blendDestinationAtop:function(){return this.op="destination-atop",this},blendXor:function(){return this.op="xor",this},blendAdd:function(){return this.op="lighter",this},blendMultiply:function(){return this.op="multiply",this},blendScreen:function(){return this.op="screen",this},blendOverlay:function(){return this.op="overlay",this},blendDarken:function(){return this.op="darken",this},blendLighten:function(){return this.op="lighten",this},blendColorDodge:function(){return this.op="color-dodge",this},blendColorBurn:function(){return this.op="color-burn",this},blendHardLight:function(){return this.op="hard-light",this},blendSoftLight:function(){return this.op="soft-light",this},blendDifference:function(){return this.op="difference",this},blendExclusion:function(){return this.op="exclusion",this},blendHue:function(){return this.op="hue",this},blendSaturation:function(){return this.op="saturation",this},blendColor:function(){return this.op="color",this},blendLuminosity:function(){return this.op="luminosity",this},copyBitmapData:function(t,e,i){t.update();for(var s,n=0;n80*s){h=c=t[0],l=u=t[1];for(var g=s;gc&&(c=d),p>u&&(u=p);f=Math.max(c-h,u-l)}return i.EarCut.earcutLinked(o,a,s,h,l,f),a},i.EarCut.linkedList=function(t,e,s,n,r){var o,a,h,l=0;for(o=e,a=s-n;o0)for(o=e;o=e;o-=n)h=i.EarCut.insertNode(o,t[o],t[o+1],h);return h},i.EarCut.filterPoints=function(t,e){if(!t)return t;e||(e=t);var s,n=t;do{if(s=!1,n.steiner||!i.EarCut.equals(n,n.next)&&0!==i.EarCut.area(n.prev,n,n.next))n=n.next;else{if(i.EarCut.removeNode(n),(n=e=n.prev)===n.next)return null;s=!0}}while(s||n!==e);return e},i.EarCut.earcutLinked=function(t,e,s,n,r,o,a){if(t){!a&&o&&i.EarCut.indexCurve(t,n,r,o);for(var h,l,c=t;t.prev!==t.next;)if(h=t.prev,l=t.next,o?i.EarCut.isEarHashed(t,n,r,o):i.EarCut.isEar(t))e.push(h.i/s),e.push(t.i/s),e.push(l.i/s),i.EarCut.removeNode(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?(t=i.EarCut.cureLocalIntersections(t,e,s),i.EarCut.earcutLinked(t,e,s,n,r,o,2)):2===a&&i.EarCut.splitEarcut(t,e,s,n,r,o):i.EarCut.earcutLinked(i.EarCut.filterPoints(t),e,s,n,r,o,1);break}}},i.EarCut.isEar=function(t){var e=t.prev,s=t,n=t.next;if(i.EarCut.area(e,s,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(i.EarCut.pointInTriangle(e.x,e.y,s.x,s.y,n.x,n.y,r.x,r.y)&&i.EarCut.area(r.prev,r,r.next)>=0)return!1;r=r.next}return!0},i.EarCut.isEarHashed=function(t,e,s,n){var r=t.prev,o=t,a=t.next;if(i.EarCut.area(r,o,a)>=0)return!1;for(var h=r.xo.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,u=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,d=i.EarCut.zOrder(h,l,e,s,n),p=i.EarCut.zOrder(c,u,e,s,n),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&i.EarCut.pointInTriangle(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&i.EarCut.area(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=d;){if(f!==t.prev&&f!==t.next&&i.EarCut.pointInTriangle(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&i.EarCut.area(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0},i.EarCut.cureLocalIntersections=function(t,e,s){var n=t;do{var r=n.prev,o=n.next.next;i.EarCut.intersects(r,n,n.next,o)&&i.EarCut.locallyInside(r,o)&&i.EarCut.locallyInside(o,r)&&(e.push(r.i/s),e.push(n.i/s),e.push(o.i/s),i.EarCut.removeNode(n),i.EarCut.removeNode(n.next),n=t=o),n=n.next}while(n!==t);return n},i.EarCut.splitEarcut=function(t,e,s,n,r,o){var a=t;do{for(var h=a.next.next;h!==a.prev;){if(a.i!==h.i&&i.EarCut.isValidDiagonal(a,h)){var l=i.EarCut.splitPolygon(a,h);return a=i.EarCut.filterPoints(a,a.next),l=i.EarCut.filterPoints(l,l.next),i.EarCut.earcutLinked(a,e,s,n,r,o),void i.EarCut.earcutLinked(l,e,s,n,r,o)}h=h.next}a=a.next}while(a!==t)},i.EarCut.eliminateHoles=function(t,e,s,n){var r,o,a,h,l,c=[];for(r=0,o=e.length;r=n.next.y){var h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);h<=r&&h>a&&(a=h,s=n.x=n.x&&n.x>=s.x&&i.EarCut.pointInTriangle(os.x)&&i.EarCut.locallyInside(n,t)&&(s=n,u=l),n=n.next;return s},i.EarCut.indexCurve=function(t,e,s,n){var r=t;do{null===r.z&&(r.z=i.EarCut.zOrder(r.x,r.y,e,s,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,i.EarCut.sortLinked(r)},i.EarCut.sortLinked=function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e0||h>0&&s;)0===a?(n=s,s=s.nextZ,h--):0!==h&&s?i.z<=s.z?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--):(n=i,i=i.nextZ,a--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1);return t},i.EarCut.zOrder=function(t,e,i,s,n){return t=32767*(t-i)/n,e=32767*(e-s)/n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},i.EarCut.getLeftmost=function(t){var e=t,i=t;do{e.x=0&&(t-o)*(s-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(n-o)*(s-a)>=0},i.EarCut.isValidDiagonal=function(t,e){return i.EarCut.equals(t,e)||t.next.i!==e.i&&t.prev.i!==e.i&&!i.EarCut.intersectsPolygon(t,e)&&i.EarCut.locallyInside(t,e)&&i.EarCut.locallyInside(e,t)&&i.EarCut.middleInside(t,e)},i.EarCut.area=function(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)},i.EarCut.equals=function(t,e){return t.x===e.x&&t.y===e.y},i.EarCut.intersects=function(t,e,s,n){return i.EarCut.area(t,e,s)>0!=i.EarCut.area(t,e,n)>0&&i.EarCut.area(s,n,t)>0!=i.EarCut.area(s,n,e)>0},i.EarCut.intersectsPolygon=function(t,e){var s=t;do{if(s.i!==t.i&&s.next.i!==t.i&&s.i!==e.i&&s.next.i!==e.i&&i.EarCut.intersects(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1},i.EarCut.locallyInside=function(t,e){return i.EarCut.area(t.prev,t,t.next)<0?i.EarCut.area(t,e,t.next)>=0&&i.EarCut.area(t,t.prev,e)>=0:i.EarCut.area(t,e,t.prev)<0||i.EarCut.area(t,t.next,e)<0},i.EarCut.middleInside=function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s},i.EarCut.splitPolygon=function(t,e){var s=new i.EarCut.Node(t.i,t.x,t.y),n=new i.EarCut.Node(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,n.next=s,s.prev=n,o.next=n,n.prev=o,n},i.EarCut.insertNode=function(t,e,s,n){var r=new i.EarCut.Node(t,e,s);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r},i.EarCut.removeNode=function(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)},i.EarCut.Node=function(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1},PIXI.WebGLGraphics=function(){},PIXI.WebGLGraphics.stencilBufferLimit=6,PIXI.WebGLGraphics.renderGraphics=function(t,e){var s,n=e.gl,r=e.projection,o=e.offset,a=e.shaderManager.primitiveShader;t.dirty&&PIXI.WebGLGraphics.updateGraphics(t,n);var h=t._webGL[n.id];if(h)for(var l=0;l=PIXI.WebGLGraphics.stencilBufferLimit&&(a.points.length<2*PIXI.WebGLGraphics.stencilBufferLimit?(o=PIXI.WebGLGraphics.switchMode(s,0),PIXI.WebGLGraphics.buildPoly(a,o)||(o=PIXI.WebGLGraphics.switchMode(s,1),PIXI.WebGLGraphics.buildComplexPoly(a,o))):(o=PIXI.WebGLGraphics.switchMode(s,1),PIXI.WebGLGraphics.buildComplexPoly(a,o))),a.lineWidth>0&&(o=PIXI.WebGLGraphics.switchMode(s,0),PIXI.WebGLGraphics.buildLine(a,o))):(o=PIXI.WebGLGraphics.switchMode(s,0),a.type===i.RECTANGLE?PIXI.WebGLGraphics.buildRectangle(a,o):a.type===i.CIRCLE||a.type===i.ELLIPSE?PIXI.WebGLGraphics.buildCircle(a,o):a.type===i.ROUNDEDRECTANGLE&&PIXI.WebGLGraphics.buildRoundedRectangle(a,o)),s.lastIndex++}for(n=0;n19600?(_=y-x,w=v-b,_/=R=Math.sqrt(_*_+w*w),w/=R,_*=F,w*=F,L.push(p-_,f-w),L.push(G,N,X,U),L.push(p+_,f+w),L.push(G,N,X,U),L.push(p-_,f-w),L.push(G,N,X,U),O++):(L.push(l,c),L.push(G,N,X,U),L.push(p-(l-p),f-(c-f)),L.push(G,N,X,U));for(u=n[2*(I-2)],d=n[2*(I-2)+1],p=n[2*(I-1)],y=-(d-(f=n[2*(I-1)+1])),v=u-p,y/=R=Math.sqrt(y*y+v*v),v/=R,y*=F,v*=F,L.push(p-y,f-v),L.push(G,N,X,U),L.push(p+y,f+v),L.push(G,N,X,U),B.push(k),s=0;sh?r:h,l=oc?o:c;s.push(a,l,h,l,h,c,a,c);var d=s.length/2;for(u=0;uS?S:C,e.beginPath(),e.moveTo(_,w+C),e.lineTo(_,w+P-C),e.quadraticCurveTo(_,w+P,_+C,w+P),e.lineTo(_+T-C,w+P),e.quadraticCurveTo(_+T,w+P,_+T,w+P-C),e.lineTo(_+T,w+C),e.quadraticCurveTo(_+T,w,_+T-C,w),e.lineTo(_+C,w),e.quadraticCurveTo(_,w,_,w+C),e.closePath(),(r.fillColor||0===r.fillColor)&&(e.globalAlpha=r.fillAlpha*s,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),r.lineWidth&&(e.globalAlpha=r.lineAlpha*s,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.stroke())}}},PIXI.CanvasGraphics.renderGraphicsMask=function(t,e){var s=t.graphicsData.length;if(0!==s){e.beginPath();for(var n=0;nP?P:T,e.moveTo(x,b+T),e.lineTo(x,b+w-T),e.quadraticCurveTo(x,b+w,x+T,b+w),e.lineTo(x+_-T,b+w),e.quadraticCurveTo(x+_,b+w,x+_,b+w-T),e.lineTo(x+_,b+T),e.quadraticCurveTo(x+_,b,x+_-T,b),e.lineTo(x+T,b),e.quadraticCurveTo(x,b,x,b+T),e.closePath()}}}},PIXI.CanvasGraphics.updateGraphicsTint=function(t){if(16777215!==t.tint)for(var e=(t.tint>>16&255)/255,i=(t.tint>>8&255)/255,s=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((o>>8&255)/255*i*255<<8)+(255&o)/255*s*255,r._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*i*255<<8)+(255&a)/255*s*255}},i.GraphicsData=function(t,e,i,s,n,r,o){this.lineWidth=t,this.lineColor=e,this.lineAlpha=i,this._lineTint=e,this.fillColor=s,this.fillAlpha=n,this._fillTint=s,this.fill=r,this.shape=o,this.type=o.type},i.GraphicsData.prototype.constructor=i.GraphicsData,i.GraphicsData.prototype.clone=function(){return new i.GraphicsData(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.fill,this.shape)},i.Graphics=function(t,e,s){void 0===e&&(e=0),void 0===s&&(s=0),this.type=i.GRAPHICS,this.physicsType=i.SPRITE,this.anchor=new i.Point,PIXI.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this.blendMode=PIXI.blendModes.NORMAL,this.currentPath=null,this._webGL=[],this.isMask=!1,this.boundsPadding=0,this._localBounds=new i.Rectangle(0,0,1,1),this.dirty=!0,this._boundsDirty=!1,this.webGLDirty=!1,this.cachedSpriteDirty=!1,i.Component.Core.init.call(this,t,e,s,"",null)},i.Graphics.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),i.Graphics.prototype.constructor=i.Graphics,i.Component.Core.install.call(i.Graphics.prototype,["Angle","AutoCull","Bounds","Destroy","FixedToCamera","InputEnabled","InWorld","LifeSpan","PhysicsBody","Reset"]),i.Graphics.prototype.preUpdatePhysics=i.Component.PhysicsBody.preUpdate,i.Graphics.prototype.preUpdateLifeSpan=i.Component.LifeSpan.preUpdate,i.Graphics.prototype.preUpdateInWorld=i.Component.InWorld.preUpdate,i.Graphics.prototype.preUpdateCore=i.Component.Core.preUpdate,i.Graphics.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},i.Graphics.prototype.postUpdate=function(){i.Component.PhysicsBody.postUpdate.call(this),i.Component.FixedToCamera.postUpdate.call(this),this._boundsDirty&&(this.updateLocalBounds(),this._boundsDirty=!1);for(var t=0;t0&&this.drawPolygon(s)}else this.drawPolygon(s)},i.Graphics.prototype.drawTriangles=function(t,e,s){void 0===s&&(s=!1);var n,r=new i.Point,o=new i.Point,a=new i.Point,h=[];if(e)if(t[0]instanceof i.Point)for(n=0;nc*a)}return this.dirty=!0,this._boundsDirty=!0,this},i.Graphics.prototype.arc=function(t,e,i,s,n,r,o){if(s===n)return this;void 0===r&&(r=!1),void 0===o&&(o=40),!r&&n<=s?n+=2*Math.PI:r&&s<=n&&(s+=2*Math.PI);var a=r?-1*(s-n):n-s,h=Math.ceil(Math.abs(a)/(2*Math.PI))*o;if(0===a)return this;var l=t+Math.cos(s)*i,c=e+Math.sin(s)*i;r&&this.filling?this.moveTo(t,e):this.moveTo(l,c);for(var u=this.currentPath.shape.points,d=a/(2*h),p=2*d,f=Math.cos(d),g=Math.sin(d),m=h-1,y=m%1/m,v=0;v<=m;v++){var x=d+s+p*(v+y*v),b=Math.cos(x),_=-Math.sin(x);u.push((f*b+g*_)*i+t,(f*-_+g*b)*i+e)}return this.dirty=!0,this._boundsDirty=!0,this},i.Graphics.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},i.Graphics.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},i.Graphics.prototype.drawRect=function(t,e,s,n){return this.drawShape(new i.Rectangle(t,e,s,n)),this},i.Graphics.prototype.drawRoundedRect=function(t,e,s,n,r){return this.drawShape(new i.RoundedRectangle(t,e,s,n,r)),this},i.Graphics.prototype.drawCircle=function(t,e,s){return this.drawShape(new i.Circle(t,e,s)),this},i.Graphics.prototype.drawEllipse=function(t,e,s,n){return this.drawShape(new i.Ellipse(t,e,s,n)),this},i.Graphics.prototype.drawPolygon=function(t){t instanceof i.Polygon&&(t=t.points);var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var s=0;sw?m:w,w=v>w?v:w,w=b>w?b:w,T=y>T?y:T,T=x>T?x:T,T=_>T?_:T,this._bounds.x=P,this._bounds.width=w-P,this._bounds.y=C,this._bounds.height=T-C,this._currentBounds=this._bounds,this._currentBounds},i.Graphics.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=i.identityMatrix;for(var e=0;ee?a+l:e,s=hn?h+c:n;else if(p===i.CIRCLE)a=r.x,h=r.y,l=r.radius+f/2,c=r.radius+f/2,t=a-le?a+l:e,s=h-cn?h+c:n;else if(p===i.ELLIPSE)a=r.x,h=r.y,l=r.width+f/2,c=r.height+f/2,t=a-le?a+l:e,s=h-cn?h+c:n;else{o=r.points;for(var g=0;ge?a+f:e,s=h-fn?h+f:n}}else t=0,e=0,s=0,n=0;var m=this.boundsPadding;this._localBounds.x=t-m,this._localBounds.width=e-t+2*m,this._localBounds.y=s-m,this._localBounds.height=n-s+2*m},i.Graphics.prototype._generateCachedSprite=function(){var t=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(t.width,t.height);else{var e=new PIXI.CanvasBuffer(t.width,t.height),i=PIXI.Texture.fromCanvas(e.canvas);this._cachedSprite=new PIXI.Sprite(i),this._cachedSprite.buffer=e,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-t.x/t.width,this._cachedSprite.anchor.y=-t.y/t.height,this._cachedSprite.buffer.context.translate(-t.x,-t.y),this.worldAlpha=1,PIXI.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context),this._cachedSprite.alpha=this.alpha},i.Graphics.prototype.updateCachedSpriteTexture=function(){var t=this._cachedSprite,e=t.texture,i=t.buffer.canvas;e.baseTexture.width=i.width,e.baseTexture.height=i.height,e.crop.width=e.frame.width=i.width,e.crop.height=e.frame.height=i.height,t._width=i.width,t._height=i.height,e.baseTexture.dirty()},i.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},i.Graphics.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null,t instanceof i.Polygon&&(t=t.clone()).flatten();var e=new i.GraphicsData(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===i.POLYGON&&(e.shape.closed=this.filling,this.currentPath=e),this.dirty=!0,this._boundsDirty=!0,e},Object.defineProperty(i.Graphics.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(t){this._cacheAsBitmap=t,this._cacheAsBitmap?this._generateCachedSprite():this.destroyCachedSprite(),this.dirty=!0,this.webGLDirty=!0}}),i.RenderTexture=function(t,e,s,n,r,o,a,h){if(void 0===e&&(e=100),void 0===s&&(s=100),void 0===n&&(n=""),void 0===r&&(r=i.scaleModes.DEFAULT),void 0===o&&(o=1),void 0===a&&(a=PIXI.defaultRenderer),void 0===h&&(h=0),this.game=t,this.key=n,this.type=i.RENDERTEXTURE,this._tempMatrix=new i.Matrix,this.width=e,this.height=s,this.resolution=o,this.frame=new i.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.crop=this.frame.clone(),this.baseTexture=new PIXI.BaseTexture,this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution,this.baseTexture._glTextures=[],this.baseTexture.resolution=this.resolution,this.baseTexture.scaleMode=r,this.baseTexture.hasLoaded=!0,PIXI.Texture.call(this,this.baseTexture,this.frame.clone()),this.renderer=a,this.renderer.type===i.WEBGL){var l=this.renderer.gl;this.baseTexture.textureIndex=h,this.baseTexture._dirty[l.id]=!1,this.textureBuffer=new PIXI.FilterTexture(l,this.width,this.height,this.baseTexture.scaleMode,h),this.baseTexture._glTextures[l.id]=this.textureBuffer.texture,this.projection=new i.Point(.5*this.width,.5*-this.height)}else this.textureBuffer=new PIXI.CanvasBuffer(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this.tempMatrix=new i.Matrix,this._updateUvs()},i.RenderTexture.prototype=Object.create(PIXI.Texture.prototype),i.RenderTexture.prototype.constructor=i.RenderTexture,i.RenderTexture.prototype.renderXY=function(t,e,s,n){t.updateTransform(),this._tempMatrix.copyFrom(t.worldTransform),this._tempMatrix.tx=e,this._tempMatrix.ty=s,this.renderer.type===i.WEBGL?this._renderWebGL(t,this._tempMatrix,n):this._renderCanvas(t,this._tempMatrix,n)},i.RenderTexture.prototype.renderRawXY=function(t,e,s,n){this._tempMatrix.identity().translate(e,s),this.renderer.type===i.WEBGL?this._renderWebGL(t,this._tempMatrix,n):this._renderCanvas(t,this._tempMatrix,n)},i.RenderTexture.prototype.render=function(t,e,s){void 0===e||null===e?this._tempMatrix.copyFrom(t.worldTransform):this._tempMatrix.copyFrom(e),this.renderer.type===i.WEBGL?this._renderWebGL(t,this._tempMatrix,s):this._renderCanvas(t,this._tempMatrix,s)},i.RenderTexture.prototype.resize=function(t,e,s){t===this.width&&e===this.height||(this.valid=t>0&&e>0,this.width=t,this.height=e,this.frame.width=this.crop.width=t*this.resolution,this.frame.height=this.crop.height=e*this.resolution,s&&(this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution),this.renderer.type===i.WEBGL&&(this.projection.x=this.width/2,this.projection.y=-this.height/2),this.valid&&this.textureBuffer.resize(this.width,this.height))},i.RenderTexture.prototype.clear=function(){this.valid&&(this.renderer.type===i.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},i.RenderTexture.prototype._renderWebGL=function(t,e,i){if(this.valid&&0!==t.alpha){var s=t.worldTransform;s.identity(),s.translate(0,2*this.projection.y),e&&s.append(e),s.scale(1,-1);for(var n=0;n-1&&this.characterLimitSize0&&this.style.maxLines0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?l+=this.measureLine(e[a]):l+=this.context.measureText(e[a]).width,this.style.wordWrap&&(l-=this.context.measureText(" ").width)}else{var h=e[a].split(/(?:\t)/),l=this.padding.x+this.style.strokeThickness;if(Array.isArray(i))for(var c=0,u=0;u0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?this.measureLine(h[u]):Math.ceil(this.context.measureText(h[u]).width),u>0&&(c+=i[u-1]),l=c+d}else for(u=0;u0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?l+=this.measureLine(h[u]):l+=Math.ceil(this.context.measureText(h[u]).width),l+=this.game.math.snapToCeil(l,i)-l}s[a]=Math.ceil(l),n=Math.max(n,s[a])}this.canvas.width=n*this._res;var p=r.fontSize+this.style.strokeThickness+this.padding.y,f=p*o,g=this._lineSpacing;g<0&&Math.abs(g)>p&&(g=-p),0!==g&&(f+=g>0?g*e.length:g*(e.length-1)),this.canvas.height=f*this._res,this.context.scale(this._res,this._res),navigator.isCocoonJS&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.style.backgroundColor&&(this.context.fillStyle=this.style.backgroundColor,this.context.fillRect(0,0,this.canvas.width,this.canvas.height)),this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.textBaseline="alphabetic",this.context.lineWidth=this.style.strokeThickness,this.context.lineCap="round",this.context.lineJoin="round";var m,y;for(this._charCount=0,a=0;a0&&(y+=g*a),"right"===this.style.align?m+=n-s[a]:"center"===this.style.align&&(m+=(n-s[a])/2),this.autoRound&&(m=Math.round(m),y=Math.round(y)),this.colors.length>0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?this.updateLine(e[a],m,y):(this.style.stroke&&this.style.strokeThickness&&(this.updateShadow(this.style.shadowStroke),0===i?this.context.strokeText(e[a],m,y):this.renderTabLine(e[a],m,y,!1)),this.style.fill&&(this.updateShadow(this.style.shadowFill),0===i?this.context.fillText(e[a],m,y):this.renderTabLine(e[a],m,y,!0)));this.updateTexture(),this.dirty=!1},i.Text.prototype.renderTabLine=function(t,e,i,s){var n=t.split(/(?:\t)/),r=this.style.tabs,o=0;if(Array.isArray(r))for(var a=0,h=0;h0&&(a+=r[h-1]),o=e+a,s?this.context.fillText(n[h],o,i):this.context.strokeText(n[h],o,i);else for(h=0;h0||this.fontStyles.length>0){var n=this.fontToComponents(this.context.font);this.fontStyles[this._charCount]&&(n.fontStyle=this.fontStyles[this._charCount]),this.fontWeights[this._charCount]&&(n.fontWeight=this.fontWeights[this._charCount]),this.context.font=this.componentsToFont(n)}this.style.stroke&&this.style.strokeThickness&&(this.strokeColors[this._charCount]&&(this.context.strokeStyle=this.strokeColors[this._charCount]),this.updateShadow(this.style.shadowStroke)),this.style.fill&&(this.colors[this._charCount]&&(this.context.fillStyle=this.colors[this._charCount]),this.updateShadow(this.style.shadowFill)),e+=this.context.measureText(s).width,this._charCount++}return Math.ceil(e)},i.Text.prototype.updateLine=function(t,e,i){for(var s=0;s0||this.fontStyles.length>0){var r=this.fontToComponents(this.context.font);this.fontStyles[this._charCount]&&(r.fontStyle=this.fontStyles[this._charCount]),this.fontWeights[this._charCount]&&(r.fontWeight=this.fontWeights[this._charCount]),this.context.font=this.componentsToFont(r)}this.style.stroke&&this.style.strokeThickness&&(this.strokeColors[this._charCount]&&(this.context.strokeStyle=this.strokeColors[this._charCount]),this.updateShadow(this.style.shadowStroke),this.context.strokeText(n,e,i)),this.style.fill&&(this.colors[this._charCount]&&(this.context.fillStyle=this.colors[this._charCount]),this.updateShadow(this.style.shadowFill),this.context.fillText(n,e,i)),e+=this.context.measureText(n).width,this._charCount++}},i.Text.prototype.clearColors=function(){return this.colors=[],this.strokeColors=[],this.dirty=!0,this},i.Text.prototype.clearFontValues=function(){return this.fontStyles=[],this.fontWeights=[],this.dirty=!0,this},i.Text.prototype.addColor=function(t,e){return this.colors[e]=t,this.dirty=!0,this},i.Text.prototype.addStrokeColor=function(t,e){return this.strokeColors[e]=t,this.dirty=!0,this},i.Text.prototype.addFontStyle=function(t,e){return this.fontStyles[e]=t,this.dirty=!0,this},i.Text.prototype.addFontWeight=function(t,e){return this.fontWeights[e]=t,this.dirty=!0,this},i.Text.prototype.precalculateWordWrap=function(t){return this.texture.baseTexture.resolution=this._res,this.context.font=this.style.font,this.runWordWrap(t).split(/(?:\r\n|\r|\n)/)},i.Text.prototype.runWordWrap=function(t){return this.useAdvancedWrap?this.advancedWordWrap(t):this.basicWordWrap(t)},i.Text.prototype.advancedWordWrap=function(t){for(var e=this.context,i=this.style.wordWrapWidth,s="",n=t.replace(/ +/gi," ").split(/\r?\n/gi),r=n.length,o=0;ol){if(0===u){for(var g=p;g.length&&(g=g.slice(0,-1),!((f=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var m=d.substr(g.length);c[u]=m,h+=g}var y=c[u].length?u:u+1,v=c.slice(y).join(" ").replace(/[ \n]*$/gi,"");n[o+1]=v+" "+(n[o+1]||""),r=n.length;break}h+=p,l-=f}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},i.Text.prototype.basicWordWrap=function(t){for(var e="",i=t.split("\n"),s=0;sn?(o>0&&(e+="\n"),e+=r[o]+" ",n=this.style.wordWrapWidth-a):(n-=h,e+=r[o]+" ")}ss&&(this.style.wordWrapWidth=s)),this.updateTexture(),this},i.Text.prototype.updateTexture=function(){var t=this.texture.baseTexture,e=this.texture.crop,i=this.texture.frame,s=this.canvas.width,n=this.canvas.height;if(t.width=s,t.height=n,e.width=s,e.height=n,i.width=s,i.height=n,this.texture.width=s,this.texture.height=n,this._width=s,this._height=n,this.textBounds){var r=this.textBounds.x,o=this.textBounds.y;"right"===this.style.boundsAlignH?r+=this.textBounds.width-this.canvas.width/this.resolution:"center"===this.style.boundsAlignH&&(r+=this.textBounds.halfWidth-this.canvas.width/this.resolution/2),"bottom"===this.style.boundsAlignV?o+=this.textBounds.height-this.canvas.height/this.resolution:"middle"===this.style.boundsAlignV&&(o+=this.textBounds.halfHeight-this.canvas.height/this.resolution/2),this.pivot.x=-r,this.pivot.y=-o}this.renderable=0!==s&&0!==n,this.texture.requiresReTint=!0,this.texture.baseTexture.dirty()},i.Text.prototype._renderWebGL=function(t){this.dirty&&(this.updateText(),this.dirty=!1),PIXI.Sprite.prototype._renderWebGL.call(this,t)},i.Text.prototype._renderCanvas=function(t){this.dirty&&(this.updateText(),this.dirty=!1),PIXI.Sprite.prototype._renderCanvas.call(this,t)},i.Text.prototype.determineFontProperties=function(t){var e=i.Text.fontPropertiesCache[t];if(!e){e={};var s=i.Text.fontPropertiesCanvas,n=i.Text.fontPropertiesContext;n.font=t;var r=Math.ceil(n.measureText("|MÉq").width),o=Math.ceil(n.measureText("|MÉq").width),a=2*o;if(o=1.4*o|0,s.width=r,s.height=a,n.fillStyle="#f00",n.fillRect(0,0,r,a),n.font=t,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText("|MÉq",0,o),!n.getImageData(0,0,r,a))return e.ascent=o,e.descent=o+6,e.fontSize=e.ascent+e.descent,i.Text.fontPropertiesCache[t]=e,e;var h,l,c=n.getImageData(0,0,r,a).data,u=c.length,d=4*r,p=0,f=!1;for(h=0;ho;h--){for(l=0;l0?this._maxWidth:null,l=[],c=0;c=h&&r>-1)return{width:o||n,text:i.substr(0,c-(c-r)),end:u,chars:l};n+=(p.xAdvance+g)*e,l.push(s+(p.xOffset+g)*e),s+=(p.xAdvance+g)*e,a=d}return{width:n,text:i,end:u,chars:l}},i.BitmapText.prototype.cleanText=function(t,e){void 0===e&&(e="");var i=this._data.font;if(!i)return"";for(var s=/\r\n|\n\r|\n|\r/g,n=t.replace(s,"\n").split("\n"),r=0;rthis.textWidth&&(this.textWidth=c.width),n+=t.lineHeight*i,e=e.substr(c.text.length+1)}while(!1===c.end);this.textHeight=n;for(var r=0,o=0,a=this.textWidth*this.anchor.x,h=this.textHeight*this.anchor.y,l=0;l0&&(this._fontSize=t,this.updateText())}}),Object.defineProperty(i.BitmapText.prototype,"text",{get:function(){return this._text},set:function(t){t!==this._text&&(this._text=t.toString()||"",this.updateText())}}),Object.defineProperty(i.BitmapText.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){t!==this._maxWidth&&(this._maxWidth=t,this.updateText())}}),Object.defineProperty(i.BitmapText.prototype,"smoothed",{get:function(){return!this._data.base.scaleMode},set:function(t){this._data.base.scaleMode=t?0:1}}),i.RetroFont=function(t,e,s,n,r,o,a,h,l,c){if(!t.cache.checkImageKey(e))return!1;void 0!==o&&null!==o||(o=t.cache.getImage(e).width/s),this.characterWidth=s,this.characterHeight=n,this.characterSpacingX=a||0,this.characterSpacingY=h||0,this.characterPerRow=o,this.offsetX=l||0,this.offsetY=c||0,this.align="left",this.multiLine=!1,this.autoUpperCase=!0,this.customSpacingX=0,this.customSpacingY=0,this.fixedWidth=0,this.fontSet=t.cache.getImage(e),this._text="",this.grabData=[],this.frameData=new i.FrameData;for(var u=this.offsetX,d=this.offsetY,p=0,f=0;f?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",i.RetroFont.TEXT_SET2=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",i.RetroFont.TEXT_SET3="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",i.RetroFont.TEXT_SET4="ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",i.RetroFont.TEXT_SET5="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",i.RetroFont.TEXT_SET6="ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",i.RetroFont.TEXT_SET7="AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",i.RetroFont.TEXT_SET8="0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",i.RetroFont.TEXT_SET9="ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",i.RetroFont.TEXT_SET10="ABCDEFGHIJKLMNOPQRSTUVWXYZ",i.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",i.RetroFont.prototype.setFixedWidth=function(t,e){void 0===e&&(e="left"),this.fixedWidth=t,this.align=e},i.RetroFont.prototype.setText=function(t,e,i,s,n,r){this.multiLine=e||!1,this.customSpacingX=i||0,this.customSpacingY=s||0,this.align=n||"left",this.autoUpperCase=!r,t.length>0&&(this.text=t)},i.RetroFont.prototype.buildRetroFontText=function(){var t=0,e=0;if(this.clear(),this.multiLine){var s=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,s.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY,!0):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),s.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY,!0);for(var n=0;n0?this.resize(this.fixedWidth,this.characterHeight,!0):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight,!0),t=0,this.align===i.RetroFont.ALIGN_RIGHT?t=this.width-this._text.length*(this.characterWidth+this.customSpacingX):this.align===i.RetroFont.ALIGN_CENTER&&(t=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,t+=this.customSpacingX/2),t<0&&(t=0),this.pasteLine(this._text,t,0,this.customSpacingX);this.requiresReTint=!0},i.RetroFont.prototype.pasteLine=function(t,e,i,s){for(var n=0;n=0&&(this.stamp.frame=this.grabData[t.charCodeAt(n)],this.renderXY(this.stamp,e,i,!1),(e+=this.characterWidth+s)>this.width))break},i.RetroFont.prototype.getLongestLine=function(){var t=0;if(this._text.length>0)for(var e=this._text.split("\n"),i=0;it&&(t=e[i].length);return t},i.RetroFont.prototype.removeUnsupportedCharacters=function(t){for(var e="",i=0;i=0||!t&&"\n"===s)&&(e=e.concat(s))}return e},i.RetroFont.prototype.updateOffset=function(t,e){if(this.offsetX!==t||this.offsetY!==e){for(var i=t-this.offsetX,s=e-this.offsetY,n=this.game.cache.getFrameData(this.stamp.key).getFrames(),r=n.length;r--;)n[r].x+=i,n[r].y+=s;this.buildRetroFontText()}},Object.defineProperty(i.RetroFont.prototype,"text",{get:function(){return this._text},set:function(t){var e;(e=this.autoUpperCase?t.toUpperCase():t)!==this._text&&(this._text=e,this.removeUnsupportedCharacters(this.multiLine),this.buildRetroFontText())}}),Object.defineProperty(i.RetroFont.prototype,"smoothed",{get:function(){return this.stamp.smoothed},set:function(t){this.stamp.smoothed=t,this.buildRetroFontText()}}),i.Rope=function(t,e,s,n,r,o){this.points=[],this.points=o,this._hasUpdateAnimation=!1,this._updateAnimationCallback=null,e=e||0,s=s||0,n=n||null,r=r||null,this.type=i.ROPE,this.points=o,PIXI.DisplayObjectContainer.call(this),this.texture=i.Cache.DEFAULT,this.uvs=new Float32Array([0,1,1,1,1,0,0,1]),this.vertices=new Float32Array([0,0,100,0,100,100,0,100]),this.colors=new Float32Array([1,1,1,1]),this.indices=new Uint16Array([0,1,2,3]),o&&(this.vertices=new Float32Array(4*o.length),this.uvs=new Float32Array(4*o.length),this.colors=new Float32Array(2*o.length),this.indices=new Uint16Array(2*o.length)),this.dirty=!0,this.canvasPadding=0,this.drawMode=i.Rope.TRIANGLE_STRIP,i.Component.Core.init.call(this,t,e,s,n,r),this.refresh()},i.Rope.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),i.Rope.prototype.constructor=i.Rope,i.Component.Core.install.call(i.Rope.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Delta","Destroy","FixedToCamera","InWorld","LifeSpan","LoadTexture","Overlap","PhysicsBody","Reset","ScaleMinMax","Smoothed"]),i.Rope.prototype.preUpdatePhysics=i.Component.PhysicsBody.preUpdate,i.Rope.prototype.preUpdateLifeSpan=i.Component.LifeSpan.preUpdate,i.Rope.prototype.preUpdateInWorld=i.Component.InWorld.preUpdate,i.Rope.prototype.preUpdateCore=i.Component.Core.preUpdate,i.Rope.TRIANGLE_STRIP=0,i.Rope.TRIANGLES=1,i.Rope.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},i.Rope.prototype.update=function(){this._hasUpdateAnimation&&this.updateAnimation.call(this)},i.Rope.prototype.reset=function(t,e){return i.Component.Reset.prototype.reset.call(this,t,e),this},i.Rope.prototype.refresh=function(){var t=this.points;if(!(t.length<1)){var e=this.uvs,i=this.indices,s=this.colors;this.count-=.2,e[0]=0,e[1]=0,e[2]=0,e[3]=1,s[0]=1,s[1]=1,i[0]=0,i[1]=1;for(var n,r,o=t.length,a=1;a1&&1,o=Math.sqrt(s.x*s.x+s.y*s.y),a=this.texture.height/2,s.x/=o,s.y/=o,s.x*=a,s.y*=a,h[r]=n.x+s.x,h[r+1]=n.y+s.y,h[r+2]=n.x-s.x,h[r+3]=n.y-s.y,i=n;PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)}},i.Rope.prototype.setTexture=function(t){this.texture=t},i.Rope.prototype._renderWebGL=function(t){!this.visible||this.alpha<=0||(t.spriteBatch.stop(),this._vertexBuffer||this._initWebGL(t),t.shaderManager.setShader(t.shaderManager.stripShader),this._renderStrip(t),t.spriteBatch.start())},i.Rope.prototype._initWebGL=function(t){var e=t.gl;this._vertexBuffer=e.createBuffer(),this._indexBuffer=e.createBuffer(),this._uvBuffer=e.createBuffer(),this._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this._uvBuffer),e.bufferData(e.ARRAY_BUFFER,this.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this._colorBuffer),e.bufferData(e.ARRAY_BUFFER,this.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,e.STATIC_DRAW)},i.Rope.prototype._renderStrip=function(t){var e=t.gl,s=t.projection,n=t.offset,r=t.shaderManager.stripShader,o=this.drawMode===i.Rope.TRIANGLE_STRIP?e.TRIANGLE_STRIP:e.TRIANGLES;t.blendModeManager.setBlendMode(this.blendMode),e.uniformMatrix3fv(r.translationMatrix,!1,this.worldTransform.toArray(!0)),e.uniform2f(r.projectionVector,s.x,-s.y),e.uniform2f(r.offsetVector,-n.x,-n.y),e.uniform1f(r.alpha,this.worldAlpha),this.dirty?(this.dirty=!1,e.bindBuffer(e.ARRAY_BUFFER,this._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices,e.STATIC_DRAW),e.vertexAttribPointer(r.aVertexPosition,2,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,this._uvBuffer),e.bufferData(e.ARRAY_BUFFER,this.uvs,e.STATIC_DRAW),e.vertexAttribPointer(r.aTextureCoord,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE0),this.texture.baseTexture._dirty[e.id]?t.renderer.updateTexture(this.texture.baseTexture):e.bindTexture(e.TEXTURE_2D,this.texture.baseTexture._glTextures[e.id]),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,e.STATIC_DRAW)):(e.bindBuffer(e.ARRAY_BUFFER,this._vertexBuffer),e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices),e.vertexAttribPointer(r.aVertexPosition,2,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,this._uvBuffer),e.vertexAttribPointer(r.aTextureCoord,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE0),this.texture.baseTexture._dirty[e.id]?t.renderer.updateTexture(this.texture.baseTexture):e.bindTexture(e.TEXTURE_2D,this.texture.baseTexture._glTextures[e.id]),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._indexBuffer)),e.drawElements(o,this.indices.length,e.UNSIGNED_SHORT,0)},i.Rope.prototype._renderCanvas=function(t){var e=t.context,s=this.worldTransform,n=s.tx*t.resolution+t.shakeX,r=s.ty*t.resolution+t.shakeY;t.roundPixels?e.setTransform(s.a,s.b,s.c,s.d,0|n,0|r):e.setTransform(s.a,s.b,s.c,s.d,n,r),this.drawMode===i.Rope.TRIANGLE_STRIP?this._renderCanvasTriangleStrip(e):this._renderCanvasTriangles(e)},i.Rope.prototype._renderCanvasTriangleStrip=function(t){var e=this.vertices,i=this.uvs,s=e.length/2;this.count++;for(var n=0;n0){var _=this.canvasPadding/this.worldTransform.a,w=this.canvasPadding/this.worldTransform.d,T=(l+c+u)/3,P=(d+p+f)/3,C=l-T,S=d-P,A=Math.sqrt(C*C+S*S);l=T+C/A*(A+_),d=P+S/A*(A+w),S=p-P,c=T+(C=c-T)/(A=Math.sqrt(C*C+S*S))*(A+_),p=P+S/A*(A+w),S=f-P,u=T+(C=u-T)/(A=Math.sqrt(C*C+S*S))*(A+_),f=P+S/A*(A+w)}t.save(),t.beginPath(),t.moveTo(l,d),t.lineTo(c,p),t.lineTo(u,f),t.closePath(),t.clip();var E=g*x+v*y+m*b-x*y-v*m-g*b,M=l*x+v*u+c*b-x*u-v*c-l*b,R=g*c+l*y+m*u-c*y-l*m-g*u,L=g*x*u+v*c*y+l*m*b-l*x*y-v*m*u-g*c*b,B=d*x+v*f+p*b-x*f-v*p-d*b,I=g*p+d*y+m*f-p*y-d*m-g*f,O=g*x*f+v*p*y+d*m*b-d*x*y-v*m*f-g*p*b;t.transform(M/E,B/E,R/E,I/E,L/E,O/E),t.drawImage(o,0,0),t.restore()},i.Rope.prototype.renderStripFlat=function(t){var e=this.context,i=t.vertices,s=i.length/2;this.count++,e.beginPath();for(var n=1;nh?m:h,l=y>l?y:l}if(c===-1/0||l===1/0)return PIXI.EmptyRectangle;var v=this._bounds;return v.x=c,v.width=h-c,v.y=u,v.height=l-u,this._currentBounds=v,v},Object.defineProperty(i.Rope.prototype,"updateAnimation",{get:function(){return this._updateAnimation},set:function(t){t&&"function"==typeof t?(this._hasUpdateAnimation=!0,this._updateAnimation=t):(this._hasUpdateAnimation=!1,this._updateAnimation=null)}}),Object.defineProperty(i.Rope.prototype,"segments",{get:function(){for(var t,e,s,n,r,o,a,h,l=[],c=0;c(_=y>(_=g>(_=p>_?p:_)?g:_)?y:_)?x:_,w=b>(w=v>(w=m>(w=f>w?f:w)?m:w)?v:w)?b:w;var C=this._bounds;return C.x=T,C.width=_-T,C.y=P,C.height=w-P,this._currentBounds=C,C},Object.defineProperty(i.TileSprite.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t}}),Object.defineProperty(i.TileSprite.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t}}),i.CanvasPool={create:function(t,e,s){var n,r=i.CanvasPool.getFirst();if(-1===r){var o={parent:t,canvas:document.createElement("canvas")};i.CanvasPool.pool.push(o),n=o.canvas}else i.CanvasPool.pool[r].parent=t,n=i.CanvasPool.pool[r].canvas;return void 0!==e&&(n.width=e,n.height=s),n},getFirst:function(){for(var t=i.CanvasPool.pool,e=0;e=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var e=parseInt(RegExp.$1,10),i=parseInt(RegExp.$2,10);(10===e&&i>=11||e>10)&&(s.dolby=!0)}}catch(t){}}(),function(){var t=document.createElement("video");try{!!t.canPlayType&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(s.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(s.h264Video=!0,s.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(s.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(s.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(s.hlsVideo=!0))}catch(t){}}(),function(){var t,e=document.createElement("p"),i={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(e,null);for(var n in i)void 0!==e.style[n]&&(e.style[n]="translate3d(1px,1px,1px)",t=window.getComputedStyle(e).getPropertyValue(i[n]));document.body.removeChild(e),s.css3D=void 0!==t&&t.length>0&&"none"!==t}(),s.pixelRatio=window.devicePixelRatio||1,s.iPhone=-1!==navigator.userAgent.toLowerCase().indexOf("iphone"),s.iPhone4=2===s.pixelRatio&&s.iPhone,s.iPad=-1!==navigator.userAgent.toLowerCase().indexOf("ipad"),"undefined"!=typeof Int8Array?s.typedArray=!0:s.typedArray=!1,"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(s.littleEndian=t(),s.LITTLE_ENDIAN=s.littleEndian),s.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==s.littleEndian&&e(),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(s.vibration=!0),function(){s.canvas=!!window.CanvasRenderingContext2D||s.cocoonJS;try{s.localStorage=!!localStorage.getItem}catch(t){s.localStorage=!1}s.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),s.fileSystem=!!window.requestFileSystem,s.webGL=function(){try{var t=document.createElement("canvas");return t.screencanvas=!1,!!window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))}catch(t){return!1}}(),s.webGL=!!s.webGL,s.worker=!!window.Worker,s.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,s.quirksMode="CSS1Compat"!==document.compatMode,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,s.getUserMedia=s.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(s.getUserMedia=!1),!s.iOS&&(s.ie||s.firefox||s.chrome)&&(s.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(s.canvasBitBltShift=!1)}(),function(){var t=i.CanvasPool.create(this,6,1),e=t.getContext("2d");e.fillStyle="rgba(10, 20, 30, 0.5)",e.fillRect(0,0,1,1);var n=e.getImageData(0,0,1,1);if(n){e.putImageData(n,1,0);var r=e.getImageData(1,0,1,1);s.canHandleAlpha=r.data[0]===n.data[0]&&r.data[1]===n.data[1]&&r.data[2]===n.data[2]&&r.data[3]===n.data[3]}e.globalCompositeOperation="multiply",s.canUseMultiply="multiply"===e.globalCompositeOperation,i.CanvasPool.removeByCanvas(t),PIXI.CanvasTinter.tintMethod=s.canUseMultiply?PIXI.CanvasTinter.tintWithMultiply:PIXI.CanvasTinter.tintWithPerPixel}(),function(){for(var t=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],e=document.createElement("div"),i=0;i=1)&&(s.touch=!0),(window.PointerEvent||window.MSPointerEvent||window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&(s.mspointer=!0),s.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?s.wheelEvent="wheel":"onmousewheel"in window?s.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(s.wheelEvent="DOMMouseScroll"))},i.Device.canPlayAudio=function(t){return!("mp3"!==t||!this.mp3)||(!("ogg"!==t||!this.ogg&&!this.opus)||(!("m4a"!==t||!this.m4a)||(!("opus"!==t||!this.opus)||(!("wav"!==t||!this.wav)||(!("webm"!==t||!this.webm)||!("mp4"!==t||!this.dolby))))))},i.Device.canPlayVideo=function(t){return!("webm"!==t||!this.webmVideo&&!this.vp9Video)||(!("mp4"!==t||!this.mp4Video&&!this.h264Video)||(!("ogg"!==t&&"ogv"!==t||!this.oggVideo)||!("mpeg"!==t||!this.hlsVideo)))},i.Device.needsTouchUnlock=function(){return!!(!this.cocoonJS&&(this.iOS||this.android)||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock)},i.Device.isConsoleOpen=function(){return console.warn("Phaser.Device.isConsoleOpen is deprecated and will be removed."),!1},i.Device.isAndroidStockBrowser=function(){var t=window.navigator.userAgent.match(/Android.*AppleWebKit\/([\d.]+)/);return t&&t[1]<537},i.Canvas={create:function(t,e,s,n,r){e=e||256,s=s||256;var o=r?document.createElement("canvas"):i.CanvasPool.create(t,e,s);return"string"==typeof n&&""!==n&&(o.id=n),o.width=e,o.height=s,o.style.display="block",o},setBackgroundColor:function(t,e){return e=e||"rgb(0,0,0)",t.style.backgroundColor=e,t},setTouchAction:function(t,e){return e=e||"none",t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t},setUserSelect:function(t,e){return e=e||"none",t.style["-webkit-touch-callout"]=e,t.style["-webkit-user-select"]=e,t.style["-khtml-user-select"]=e,t.style["-moz-user-select"]=e,t.style["-ms-user-select"]=e,t.style["user-select"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t},addToDOM:function(t,e,i){var s;return void 0===i&&(i=!0),e&&("string"==typeof e?s=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(s=e)),s||(s=document.body),i&&s.style&&(s.style.overflow="hidden"),s.appendChild(t),t},removeFromDOM:function(t){t.parentNode&&t.parentNode.removeChild(t)},setTransform:function(t,e,i,s,n,r,o){return t.setTransform(s,r,o,n,e,i),t},setSmoothingEnabled:function(t,e){var s=i.Canvas.getSmoothingPrefix(t);return s&&(t[s]=e),t},getSmoothingPrefix:function(t){var e=["i","webkitI","msI","mozI","oI"];for(var i in e){var s=e[i]+"mageSmoothingEnabled";if(s in t)return s}return null},getSmoothingEnabled:function(t){var e=i.Canvas.getSmoothingPrefix(t);if(e)return t[e]},setImageRenderingCrisp:function(t){for(var e=["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"],i=0;i0&&0==(t&t-1))return t;for(var e=1;e0&&0==(t&t-1)&&e>0&&0==(e&e-1)},random:function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=1),t===e)return t;if(t>e){var i=t;t=e,e=i}return Math.random()*(e-t)+t},between:function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=1),t===e)return t;if(t>e){var i=t;t=e,e=i}return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t},fuzzyEqual:function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)e-i},fuzzyCeil:function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)},fuzzyFloor:function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)},average:function(){for(var t=0,e=arguments.length,i=0;i=i.Math.PI2-s?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=s:e