diff --git a/dist/js/j2ds.min.js b/dist/js/j2ds.min.js index 7a7a487..e21701e 100644 --- a/dist/js/j2ds.min.js +++ b/dist/js/j2ds.min.js @@ -3,7 +3,7 @@ * * @authors Skaner, DeVinterX * @license zlib - * @version 0.6.2 + * @version 0.6.3 */ if (global === undefined) { @@ -19,6 +19,6 @@ if (typeof define !== 'function' || !define.amd) { utils: {} }; } -!function(e,t){"function"==typeof define&&define.amd?define("utils/MathUtil",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(){};return e.v2f=function(e,t){return{x:e,y:t}},e.v2i=function(e,t){return{x:e>>0,y:t>>0}},e.toInt=function(e){return e>>0},e.rndColor=function(t,o,i){return"rgba("+e.random(t,o)+", "+e.random(t,o)+", "+e.random(t,o)+", "+i+")"},e.random=function(t,o,i){var s=Math.floor(Math.random()*(o-t+1)+t);return i&&0==s?e.random(t,o,i):s},e.rad=function(e){return e*(Math.PI/180)},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.MathUtil=e),void 0!==global.j2Ds&&(global.modules.utils.MathUtil=e),e}),function(e,t){"function"==typeof define&&define.amd?define("utils/TextureUtil",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e};return e.prototype.createImageMap=function(e,t,o){var i=this;i.j2Ds.resources.add();var s={img:null,loaded:!1,width:e,height:t};return s.img=document.createElement("canvas"),s.context=s.img.getContext("2d"),s.img.width=s.width,s.img.height=s.height,o(s.context),s.loaded=!0,s.getAnimation=function(e,t,o,i,s){return{imageMap:this,sourceX:e,sourceY:t,sourceW:o,sourceH:i,frameCount:s-1}},i.j2Ds.resources.ok("createImageMap_"+w+"x"+h),s},e.prototype.loadImageMap=function(e){var t=this;t.j2Ds.resources.add();var i={img:null,width:0,height:0,loaded:!1};return i.img=document.createElement("img"),i.crossOrigin="anonymous",i.img.src=e,i.img.addEventListener("load",function(){i.width=o.img.width,i.height=o.img.height,i.loaded=!0,t.j2Ds.resources.ok(e)}),i.img.addEventListener("error",function(){i.width=0,i.height=0,i.loaded=!1}),i.getAnimation=function(e,t,o,i,s){return{imageMap:this,sourceX:e,sourceY:t,sourceW:o,sourceH:i,frameCount:s-1}},i},e.prototype.templates={ellipse:function(e,t,o){},fillRect:function(e,t,o){e.fillStyle=o,e.fillRect(0,0,t.x,t.y)},strokeRect:function(e,t,o,i){e.strokeStyle=o,e.lineWidth=i,e.strokeRect(0,0,t.x,t.y)},gradientL:function(e,t,o,i){var s=e.createLinearGradient(0,0,t.x,0),n=1/o.length;i||(s=e.createLinearGradient(0,0,0,t.y));for(var r=n/2,a=0;ai;i+=1)o.events[e][i].id==t&&o.events[e].splice(i,1)},e.prototype.onEvent=function(e,t){for(var o=this,i=0,s=o.events[e].length;s>i;i+=1)if(o.events[e])try{o.events[e][i].callback(t||"")}catch(n){o.j2Ds.errorManager.showError(n)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.Events=e),void 0!==global.j2Ds&&(global.modules.core.Events=e),e}),function(e,t){"function"==typeof define&&define.amd?define("nodes/BaseNode",["utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil")):t(e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e){"use strict";var t,o=function(e,o,i){t=e,this.visible=!0,this.alpha=1,this.pos=o,this.size=i,this.parent=!1,this.angle=0,this.layer=t.scene,this.box={offset:{x:0,y:0},size:{x:0,y:0}},t.scene.nodes.push(this)};return o.prototype.resizeBox=function(e,t){this.box.offset=e,this.box.size=t},o.prototype.setLayer=function(e){this.layer=e?t.layers.layer(e):t.scene},o.prototype.getLayer=function(){return this.layer},o.prototype.setVisible=function(e){this.visible=!!e},o.prototype.isVisible=function(){return this.visible},o.prototype.setAlpha=function(e){0>e&&(e=0),e>1&&(e=1),this.alpha=e},o.prototype.getAlpha=function(){return this.alpha},o.prototype.moveTo=function(t,o){o=o?o:1,this.move(e.v2f((t.x-this.getPosition().x)/o,(t.y-this.getPosition().y)/o))},o.prototype.setPosition=function(t){return t?void(this.pos=e.v2f(t.x-Math.ceil(this.size.x/2),t.y-Math.ceil(this.size.y/2))):this.pos},o.prototype.move=function(e){this.pos.x+=e.x,this.pos.y+=e.y},o.prototype.getPosition=function(){return e.v2f(this.pos.x+Math.ceil(this.size.x/2),this.pos.y+Math.ceil(this.size.y/2))},o.prototype.setSize=function(e){return e?void(this.size=e):this.size},o.prototype.getSize=function(){return this.size},o.prototype.setParent=function(e){this.parent=e},o.prototype.getDistance=function(e){return Math.ceil(Math.sqrt(Math.pow(e.getPosition().x-this.getPosition().x,2)+Math.pow(e.getPosition().y-this.getPosition().y,2)))},o.prototype.getDistanceXY=function(t){return e.v2f(Math.abs(t.getPosition().x-this.getPosition().x),Math.abs(t.getPosition().y-this.getPosition().y))},o.prototype.isIntersect=function(e){var t={x1:this.pos.x+this.box.offset.x,x2:e.pos.x+e.box.offset.x,y1:this.pos.y+this.box.offset.y,y2:e.pos.y+e.box.offset.y},o={x1:this.size.x+this.box.size.x,x2:e.size.x+e.box.size.x,y1:this.size.y+this.box.size.y,y2:e.size.y+e.box.size.y};return t.y1+o.y1>=t.y2&&t.x1+o.x1>=t.x2&&t.x1t.scene.view.pos.x+t.scene.width||this.pos.x+this.size.xt.scene.view.pos.y+t.scene.height||this.pos.y+this.size.y=t.scene.view.pos.x+t.scene.width?e.x=1:this.pos.x<=t.scene.view.pos.x?e.x=-1:e.x=0,this.pos.y+this.size.y>=t.scene.view.pos.y+t.scene.height?e.y=1:this.pos.y<=t.scene.view.pos.y?e.y=-1:e.y=0,e.all=e.x||e.y,e},o.prototype.moveDir=function(t){this.pos.x+=t*Math.cos(e.rad(this.angle)),this.pos.y+=t*Math.sin(e.rad(this.angle))},o.prototype.drawBox=function(){var e=this.layer.context;e.lineWidth=2,e.strokeStyle="black",e.beginPath(),e.rect(this.pos.x-t.scene.view.pos.x,this.pos.y-t.scene.view.pos.y,this.size.x,this.size.y),e.stroke(),e.strokeStyle="yellow",e.beginPath(),e.rect(this.box.offset.x+this.pos.x-t.scene.view.pos.x,this.box.offset.y+this.pos.y-t.scene.view.pos.y,this.box.size.x+this.size.x,this.box.size.y+this.size.y),e.stroke()},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.BaseNode=o),void 0!==global.j2Ds&&(global.modules.nodes.BaseNode=o),o}),function(e,t){"function"==typeof define&&define.amd?define("nodes/CircleNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(i,s,n,r){o=i,e.call(this,i,s,t.v2f(2*n,2*n)),this.color=r,this.radius=n};return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.draw=function(){var e=this.layer.context;if(this.visible&&this.isLookScene()){if(1!=this.alpha){var t=e.globalAlpha;e.globalAlpha=this.alpha}e.lineWidth=0,e.fillStyle=this.color,e.beginPath(),e.arc(this.pos.x-o.scene.view.pos.x+this.radius,this.pos.y-o.scene.view.pos.y+this.radius,this.radius,0,2*Math.PI,!0),e.stroke(),e.fill(),1!=this.alpha&&(e.globalAlpha=t)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.CircleNode=i),void 0!==global.j2Ds&&(global.modules.nodes.CircleNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("nodes/LineNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(i,s,n,r,a,h,l,d){o=i,e.call(this,i,s,t.v2f(0,0)),this.color=a,this.points=n,this.fill=l||!1,this.scale=r||0,this.cFill=d,this.lineWidth=h};return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.draw=function(){var e=this.layer.context;if(this.visible&&this.isLookScene()){if(1!=this.alpha){var t=e.globalAlpha;e.globalAlpha=this.alpha}e.strokeStyle=this.color,e.lineWidth=this.lineWidth,e.beginPath(),e.moveTo(this.pos.x-o.scene.view.pos.x,this.pos.y-o.scene.view.pos.y);for(var i=0,s=this.points.length;s>i;i+=1)e.lineTo(this.pos.x+this.points[i][0]*this.scale-o.scene.view.pos.x,this.pos.y+this.points[i][1]*this.scale-o.scene.view.pos.y);e.stroke(),this.fill&&(e.fillStyle=this.cFill,e.fill()),e.lineWidth=0,1!=this.alpha&&(e.globalAlpha=t)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.LineNode=i),void 0!==global.j2Ds&&(global.modules.nodes.LineNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("nodes/RectNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(t,i,s,n){o=t,e.call(this,t,i,s),this.color=n};return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.draw=function(){var e=this.layer.context;if(this.visible&&this.isLookScene()){if(1!=this.alpha){var i=e.globalAlpha;e.globalAlpha=this.alpha}this.angle&&(e.save(),e.translate(this.getPosition().x-o.scene.view.pos.x,this.getPosition().y-o.scene.view.pos.y),e.rotate(t.rad(this.angle)),e.translate(-(this.getPosition().x-o.scene.view.pos.x),-(this.getPosition().y-o.scene.view.pos.y))),e.fillStyle=this.color,e.lineWidth=0,e.fillRect(this.pos.x-o.scene.view.pos.x,this.pos.y-o.scene.view.pos.y,this.size.x,this.size.y),this.angle&&e.restore(),1!=this.alpha&&(e.globalAlpha=i)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.RectNode=i),void 0!==global.j2Ds&&(global.modules.nodes.RectNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("nodes/SpriteNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(t,i,s,n){o=t,e.call(this,t,i,s),this.tmpSpeed=0,this.frame=0,this.animation=n,this.flip={x:!1,y:!1}};return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.setFlip=function(e,t){this.flip={x:e,y:t}},i.prototype.draw=function(e){this.visible&&this.isLookScene()&&(e=e||1,this.frame>this.animation.frameCount&&(this.frame=0),this.drawFrame(this.frame+1),this.tmpSpeed>e?(this.frame+=1,this.tmpSpeed=0):this.tmpSpeed+=1)},i.prototype.drawFrame=function(e){if(!this.animation.imageMap.loaded)return err.show("Invalid ImageMap","red");var i=this.layer.context;if(this.visible&&this.isLookScene()){if(1!=this.alpha){var s=i.globalAlpha;i.globalAlpha=this.alpha}i.lineWidth=0,(this.angle||this.flip.x||this.flip.y)&&(i.save(),i.translate(this.getPosition().x-o.scene.view.pos.x,this.getPosition().y-o.scene.view.pos.y),i.rotate(t.rad(this.angle)),i.scale(this.flip.x?-1:1,this.flip.y?-1:1),i.translate(-(this.getPosition().x-o.scene.view.pos.x),-(this.getPosition().y-o.scene.view.pos.y))),e=e?e-1:0,i.drawImage(this.animation.imageMap.img,this.animation.sourceX+this.animation.sourceW*e,this.animation.sourceY,this.animation.sourceW,this.animation.sourceH,this.pos.x-o.scene.view.pos.x,this.pos.y-o.scene.view.pos.y,this.size.x,this.size.y),(this.angle||this.flip.x||this.flip.y)&&i.restore(),1!=this.alpha&&(i.globalAlpha=s)}},i.prototype.setAnimation=function(e){this.animation!=e&&(this.animation=e)},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.SpriteNode=i),void 0!==global.j2Ds&&(global.modules.nodes.SpriteNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("nodes/TextNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(i,s,n,r,a,h,l,d){o=i,e.call(this,i,s,t.v2f(0,0)),this.vAlign="top",this.hAlign="left",this.color=a?a:"black",this.family=h?h:"serif",this.sizePx=r?r:20,this.box.offset.y=t.toInt(.26*this.sizePx),this.box.size.y=-t.toInt(.26*this.sizePx),this.lineWidth=l?l:0,this.colorL=d?d:"black",this.font=this.sizePx+"px "+this.family,this.fullText=n,this.maxWidth=0,this.lines=n.split("\n"),o.scene.context.font=this.font;for(var u=0,c=this.lines.length;c>u;u+=1)this.maxWidth=this.maxWidthi;i+=1)this.maxWidth=this.maxWidtha;a+=1)this.lineWidth&&s.strokeText(n[a],t.x,t.y+this.sizePx*a),s.fillText(n[a],t.x,t.y+this.sizePx*a);1!=this.alpha&&(s.globalAlpha=r),s.lineWidth=0,s.strokeStyle="black"},i.prototype.getText=function(){return this.fullText},i.prototype.setText=function(e){this.fullText=e,this.maxWidth=0,this.lines=e.split("\n"),o.scene.context.font=this.font,this.box.offset.y=t.toInt(.26*this.sizePx),this.box.size.y=-t.toInt(.26*this.sizePx);for(var i=0,s=this.lines.length;s>i;i+=1)this.maxWidth=this.maxWidths;s+=1)this.lineWidth&&e.strokeText(this.lines[s],this.pos.x-o.scene.view.pos.x,this.pos.y+this.sizePx*s-o.scene.view.pos.y),e.fillText(this.lines[s],this.pos.x-o.scene.view.pos.x,this.pos.y+this.sizePx*s-o.scene.view.pos.y);e.lineWidth=0,e.strokeStyle="black",this.angle&&e.restore(),1!=this.alpha&&(e.globalAlpha=i)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.TextNode=i),void 0!==global.j2Ds&&(global.modules.nodes.TextNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("managers/DeviceManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(){return{width:parseInt(document.documentElement.clientWidth)RUN",o.style.padding="5px",o.align="center",o.style.position="fixed",o.style.zIndex=2e4,o.style.left="0px",o.style.top=-20+t.j2Ds.getDeviceManager().height+"px",o.style.fontSize="8pt",o.style.backgroundColor="#B8FFB8",o.style.height="12px",o.style.width="50px",o.style.cursor="pointer",o.onmousedown=function(e){e.stopPropagation()},o.onclick=function(e){return e.stopPropagation(),t.show("Выполнение продолжено"),t.j2Ds.runEngine(t.j2Ds),!1},t.j2Ds.dom.attach(o),t.logListener.elems.push(o);var i=document.createElement("div");i.innerHTML="PAUSE",i.style.padding="5px",i.align="center",i.style.position="fixed",i.style.zIndex=2e4,i.style.left="60px",i.style.top=-20+t.j2Ds.getDeviceManager().height+"px",i.style.fontSize="8pt",i.style.backgroundColor="#FFFFBD",i.style.height="12px",i.style.width="50px",i.style.cursor="pointer",i.onmousedown=function(e){e.stopPropagation()},i.onclick=function(e){return e.stopPropagation(),t.show("Выполнение приостановлено"),t.j2Ds.stopEngine(),!1},t.j2Ds.dom.attach(i),t.logListener.elems.push(i);var s=document.createElement("div");s.innerHTML="RELOAD",s.style.padding="5px",s.align="center",s.style.position="fixed",s.style.zIndex=2e4,s.style.left="120px",s.style.top=-20+t.j2Ds.getDeviceManager().height+"px",s.style.fontSize="8pt",s.style.backgroundColor="#E2E2E2",s.style.color="black",s.style.height="12px",s.style.width="50px",s.style.cursor="pointer",s.onmousedown=function(e){e.stopPropagation()},s.onclick=function(e){return e.stopPropagation(),t.j2Ds.dom.reloadURL(),!1},t.j2Ds.dom.attach(s),t.logListener.elems.push(s),t.j2Ds.events.addEvent("dom:loaded",function(){t.j2Ds.window.onerror=function(e){t.show(e)}})},e.prototype.show=function(e){console.log("[j2Ds]: "+e)},e.prototype.setMode=function(e){this.mode=e,"neverShow"==e&&(this.enabled=!1)},e.prototype.debug=function(e){this.enabled&&(this.j2Ds.stopEngine(),"neverShow"!=this.mode&&this.show(e||"Точка останова достигнута"))},e.prototype.showError=function(e,t){if("neverShow"!=this.mode){var o=e.stack.toString();o=o.split(/\n/);for(var i=0,s=o.length;s>i;i+=1)if(o[i].match(/\:\d/)){o=o[i].split(/\s/);break}o=o[o.length-1],o=o.replace(/([\(\)]|[\w]+:\/\/)/g,"");var n=o.split(":"),r=n[1],a=n[2];n=decodeURI(n[0]),n.match(/(|\bj2Ds.js)/)&&(n="<Функция-аргумент или строка>");var h='Тип ошибки: "'+e.name+'"\nСообщение: "'+e.message+'"\nФайл с ошибкой: "'+n+'"\nСтрока: '+r+", символ: "+a;t&&(h+="\nОшибка в теле функции: \n"+t.toString()),this.show(h),"stopAndShow"==this.mode&&(this.j2Ds.stopEngine(),this.show("Выполнение приостановлено"))}},e.prototype.logListener={domId:"",count:0,execLine:"",elems:[]},e.prototype.lightSyntax=function(e,t){var o=(""+e).toString();return"boolean"==t?o=o.replace(/true/gi,'$&').replace(/false/gi,'$&'):"code"==t&&(o=o.replace(/(this|var|typeof|new|return|if|else|for|in|while|break|do|continue|switch|case)([^a-z0-9\$_])/gi,'$1$2').replace(/(function|object)/gi,'$1').replace(/(width|height|window|document|scene|j2Ds|value)/gi,'$1').replace(/([a-z\_\$][a-z0-9_]*)\(/gi,'$1(').replace(/(\{|\}|\]|\[|\|)/gi,'$1').replace(/('.*?')/g,'$1').replace(/(#[a-z0-9]{3,8};)/,'$1').replace(/(\t)/g,"  "),o=o.replace(/true/gi,'$&').replace(/false/gi,'$&')),o},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.ErrorManager=e),void 0!==global.j2Ds&&(global.modules.managers.ErrorManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/FpsManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.enabled=!1,this.fps=this.j2Ds.frameLimit,this.tmp_of_fps=1,this.tmp_of_time=Date.now()};return e.prototype.init=function(){var e=this;e.enabled=!0,this.j2Ds.events.addEvent("engine:after",function(){e.update()})},e.prototype.update=function(){this.enabled&&(this.tmp_of_fps+=1,this.j2Ds.now-this.tmp_of_time>=1e3&&(this.fps=this.tmp_of_fps,this.tmp_of_fps=1,this.tmp_of_time=this.j2Ds.now))},e.prototype.getFPS=function(){return this.fps<=this.j2Ds.frameLimit?this.fps:this.j2Ds.frameLimit},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.FpsManager=e),void 0!==global.j2Ds&&(global.modules.managers.FpsManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/ResourceManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.added=0,this.loaded=0,this.failed=0,this.add=function(){this.added+=1},this.ok=function(e){this.loaded+=1,this.j2Ds.errorManager.show('loaded: "'+decodeURI(e))},this.fail=function(e){this.failed+=1,this.j2Ds.errorManager.show('error load: "'+decodeURI(e))},this.show=function(){return{added:this.added,loaded:this.loaded,failed:this.failed}},this.isLoaded=function(){return this.added==this.loaded},this.getProgress=function(){return Math.ceil(this.loaded/this.added*100)}};return"object"==typeof module&&"object"==typeof module.exports&&(module.exports.ResourceManager=e),void 0!==global.j2Ds&&(global.modules.managers.ResourceManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/StorageManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e,t){this.j2Ds=e,this.id=t,this.ls=this.j2Ds.window.localStorage?this.j2Ds.window.localStorage:!1,this.ls||alert('j2Ds ERROR in "createLocal('+t+')" \nОбъект "localStorage" не поддерживается.')};return e.prototype.saveNode=function(e,t){return this.ls?void this.ls.setItem(this.id+e,JSON.stringify(t)):!1},e.prototype.load=function(e){return this.ls?this.ls.getItem(this.id+e):!1},e.prototype.is=function(e){return this.ls?!!this.ls.getItem(this.id+e):!1},e.prototype.save=function(e,t){return this.ls?void this.ls.setItem(this.id+e,t):!1},e.prototype.loadNode=function(e){return this.ls?JSON.parse(this.ls.getItem(this.id+e)):!1},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.StorageManager=e),void 0!==global.j2Ds&&(global.modules.managers.StorageManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/TimeManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.times={},this.insert=function(e){this.times[e]||(this.times[e]=this.j2Ds.now)},this.get=function(e){return this.times[e]}};return"object"==typeof module&&"object"==typeof module.exports&&(module.exports.TimeManager=e),void 0!==global.j2Ds&&(global.modules.managers.TimeManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/TriggerManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.enabled=!1,this.triggers={}};return e.prototype.add=function(e,t){var o=this,i={command:t,count:0,state:"stop",last:!1};return i.run=function(e){return"job"==this.state?void this.command():void(o.j2Ds.now-this.last>e&&(this.last&&(this.state="job",this.count+=1,this.command()),this.last=o.j2Ds.now))},i.job=function(e){o.j2Ds.now-this.last>e&&"run"!=this.state&&(this.last&&(this.state="run",this.count+=1,this.command()),this.last=o.j2Ds.now)},i.loop=function(e){o.j2Ds.now-this.last>e&&(this.last&&(this.state="run",this.count+=1,this.command()),this.last=o.j2Ds.now)},i.reset=function(){this.count=0,this.state="stop",this.last=!1},this.triggers[e]=i,i},e.prototype.get=function(e){return this.triggers[e]},e.prototype.init=function(){this.enabled=!0},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.TriggerManager=e),void 0!==global.j2Ds&&(global.modules.managers.TriggerManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/ViewManager",["utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil")):t(e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e){"use strict";var t=function(e){this.j2Ds=e,this.views={}};return t.prototype.add=function(t,o){var i=this,s={focusNode:!1};return s.pos=o?e.v2f(o.x,o.y):e.v2f(0,0),s.setPosition=function(t){return t?void(this.pos=e.v2f(t.x-i.j2Ds.scene.width/2,t.y-i.j2Ds.scene.height/2)):this},s.getPosition=function(){return this.pos},s.move=function(e){this.pos.x+=e.x,this.pos.y+=e.y},i.j2Ds.viewManager.views[t]=s,s},t.prototype.get=function(e){return this.j2Ds.viewManager.views[e]},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.ViewManager=t),void 0!==global.j2Ds&&(global.modules.managers.ViewManager=t),t}),function(e,t){"function"==typeof define&&define.amd?define("io/AudioHandler",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(){this.audios={},this.enabled=!1};return e.prototype.init=function(){var e=this;this.enabled=!0,e.j2Ds.events.addEvent("scene:deactivate",function(){e.deactivate()}),e.j2Ds.events.addEvent("scene:activate",function(){e.activate()})},e.prototype.load=function(e,t,o){var i=this;i.j2Ds.resources.add();for(var s=document.createElement("audio"),n=0,r=t.length;r>n;n+=1){var a=document.createElement("source");a.src=t[n],s.appendChild(a)}s.id="audio_"+e,o&&(s.volume=1>=o&&o>=0?o:1);var h={id:e,files:t,domEl:s,ready:!1,len:0,state:"stop",lock:!1,volume:s.volume,onePlay:!1};return h.domEl.addEventListener("loadeddata",function(e){h.ready=!0;var t=e.explicitOriginalTarget||e.path[0];i.j2Ds.resources.ok(t.currentSrc)}),h.domEl.addEventListener("error",function(e){h.setLock(!0)}),h.domEl.addEventListener("ended",function(){h.state="stop"}),h.play=function(e){e&&this.setLock(!1),this.lock||("play"==this.state&&(this.domEl.currentTime=0),this.domEl.play(),this.state="play")},h.loop=function(){this.lock||(this.domEl.play(),this.state="play")},h.pause=function(e){"play"==this.state&&(this.setLock(e),this.domEl.pause(),this.state="pause")},h.stop=function(e){this.domEl.pause(),this.domEl.currentTime=0,this.state="stop",e&&this.setLock(e)},h.setLock=function(e){this.lock=!!e},h.setVolume=function(e){this.domEl.volume=1>=e&&e>=0?e:1,this.volume=this.domEl.volume},h.getVolume=function(e){return this.volume},h.getState=function(e){return this.state},h.getPlayPosition=function(){return this.domEl.currentTime},h.domEl.load(),this.audios[e]=h,h},e.prototype.get=function(e){return this.audios[e]},e.prototype.pause=function(e){for(var t in this.audios)this.audios[t].pause(e)},e.prototype.stop=function(e){for(var t in this.audios)this.audios[t].stop(e)},e.prototype.play=function(e){for(var t in this.audios)this.audios[t].play(e)},e.prototype.deactivate=function(){for(var e in this.audios)"play"==this.audios[e].state&&(this.audios[e].pause(),this.audios[e].state="deactivated")},e.prototype.activate=function(){for(var e in this.audios)"deactivated"==this.audios[e].state&&this.audios[e].play()},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.AudioHandler=e),void 0!==global.j2Ds&&(global.modules.io.AudioHandler=e),e}),function(e,t){"function"==typeof define&&define.amd?define("io/InputHandler",["utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil")):t(e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e){"use strict";var t=function(e){this.j2Ds=e,this.pos={x:0,y:0},this.x=0,this.y=0,this.screenPos={x:0,y:0},this.keyDown=[],this.keyPress=[],this.keyPressed=[],this.keyUp=[],this.keyUped=!1,this.mouseDown=[],this.mousePress=[], -this.mousePressed=[],this.mouseUp=[],this.mouseUpped=!1,this.mouseWheel=0,this.canceled=!1,this.body=!1,this.anyKey=!1,this.anyMouse=!1,this.writeMode=!1,this.displayCursor="",this.visible=!0,this.enabled=!1};return t.prototype.mKey={LEFT:1,MIDDLE:2,RIGHT:3},t.prototype.jKey={LEFT:37,RIGHT:39,UP:38,DOWN:40,SPACE:32,CTRL:17,SHIFT:16,ALT:18,ESC:27,ENTER:13,MINUS:189,PLUS:187,CAPS_LOCK:20,BACKSPACE:8,TAB:9,Q:81,W:87,E:69,R:82,T:84,Y:89,U:85,I:73,O:79,P:80,A:65,S:83,D:68,F:70,G:71,H:72,J:74,K:75,L:76,Z:90,X:88,V:86,B:66,N:78,M:77,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,C:67,9:57,NUM_0:45,NUM_1:35,NUM_2:40,NUM_3:34,NUM_4:37,NUM_5:12,NUM_6:39,NUM_7:36,NUM_8:38,NUM_9:33,NUM_MINUS:109,NUM_PLUS:107,NUM_LOCK:144,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123},t.prototype.keyList=function(){var e=[];for(var t in this.jKey)e.push(t);return e},t.prototype.reset=function(){return this.enabled?(this.keyPress=[],this.keyUp=[],this.mousePress=[],this.mouseUp=[],void(this.mouseWheel=0)):!1},t.prototype.isKeyDown=function(e){return this.keyDown[this.jKey[e]]},t.prototype.isKeyPress=function(e){return this.keyPress[this.jKey[e]]},t.prototype.isKeyUp=function(e){return this.keyUp[this.jKey[e]]},t.prototype.getPosition=function(){return e.v2f(this.pos.x,this.pos.y)},t.prototype.getScreenPosition=function(){return e.v2f(this.screenPos.x,this.screenPos.y)},t.prototype.setWriteMode=function(e){this.writeMode=e},t.prototype.isWriteMode=function(){return this.writeMode},t.prototype.keyEvent=function(e){if(!this.enabled)return!1;if("keydown"==e.type)this.keyPressed[e.keyCode]||(this.keyPress[e.keyCode]=!0,this.keyPressed[e.keyCode]=!0),this.writeMode?this.j2Ds.events.onEvent("writeMode:keyPress",""):e.preventDefault();else if("keyup"==e.type)this.keyPressed[e.keyCode]&&(e.preventDefault(),this.keyPress[e.keyCode]=!1,this.keyPressed[e.keyCode]=!1,this.keyUp[e.keyCode]=!0,this.keyUped=!0);else if("keypress"==e.type&&this.writeMode){var t="";0!=e.which&&0!=e.charCode&&e.which>=32&&(t=String.fromCharCode(e.which)),this.j2Ds.events.onEvent("writeMode:keyPress",t)}return this.keyDown[e.keyCode]="keydown"==e.type&&!this.canceled,this.anyKey=e.keyCode,!1},t.prototype.cancel=function(e){e?this.keyDown[this.jKey[e]]=!1:(this.canceled=!0,this.keyDown=[],this.mouseDown=[])},t.prototype.onNode=function(e){return e.layer.visible?this.pos.x>e.pos.x&&this.pos.xe.pos.y&&this.pos.y0||"DOWN"==e&&this.mouseWheel<0},t.prototype.onMouseWheel=function(e){return this.enabled?(e.preventDefault(),this.mouseWheel=e.wheelDelta?e.wheelDelta:-e.detail,!1):!1},t.prototype.onMouseEvent=function(e){return this.enabled?(e.preventDefault(),!e.which&&e.button&&(1&e.button?e.which=1:4&e.button?e.which=2:2&e.button&&(e.which=3)),"mousedown"==e.type?this.mousePressed[e.which]||(this.mousePress[e.which]=!0,this.mousePressed[e.which]=!0):"mouseup"==e.type&&this.mousePressed[e.which]&&(this.mousePress[e.which]=!1,this.mousePressed[e.which]=!1,this.mouseUp[e.which]=!0,this.mouseUped=!0),this.mouseDown[e.which]="mousedown"==e.type&&!this.canceled,this.j2Ds.window.focus(),!1):!1},t.prototype.setCursorImage=function(e){this.j2Ds.dom.tag("body")[0].style.cursor='url("'+e+'"), auto'},t.prototype.setVisible=function(e){this.visible=e,e?this.j2Ds.dom.tag("body")[0].style.cursor=this.displayCursor:(this.displayCursor=this.j2Ds.dom.tag("body")[0].style.cursor,this.j2Ds.dom.tag("body")[0].style.cursor="none")},t.prototype.isVisible=function(){return this.visible},t.prototype.init=function(){var e=this;e.enabled=!0,e.j2Ds.events.addEvent("engine:before",function(){e.upd()}),e.j2Ds.events.addEvent("engine:after",function(){e.reset()}),e.j2Ds.events.addEvent("dom:loaded",function(){e.j2Ds.window.oncontextmenu=function(){return!1},e.j2Ds.window.onselectstart=e.j2Ds.window.oncontextmenu,e.j2Ds.window.ondragstart=e.j2Ds.window.oncontextmenu,e.j2Ds.window.onmousedown=e.onMouseEvent,e.j2Ds.window.onmouseup=function(t){e.canceled=!1,e.onMouseEvent(t)},e.j2Ds.window.onmousemove=function(t){e.onMove(t)},e.j2Ds.window.onkeydown=function(t){e.keyEvent(t)},e.j2Ds.window.onkeyup=function(t){e.canceled=!1,e.keyEvent(t)},e.j2Ds.window.onkeypress=function(t){e.keyEvent(t)},e.j2Ds.window.onmousewheel=function(t){e.onMouseWheel(t)},e.j2Ds.window.addEventListener&&e.j2Ds.window.addEventListener("DOMMouseScroll",function(t){e.onMouseWheel(t)},!1)})},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.InputHandler=t),void 0!==global.j2Ds&&(global.modules.io.InputHandler=t),t}),function(e,t){"function"==typeof define&&define.amd?define("io/TouchHandler",["utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil")):t(e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e){"use strict";var t=function(e){this.j2Ds=e,this.enabled=!1,this.pos={x:0,y:0},this.screenPos={x:0,y:0},this.canceled=!1,this.touchs=[],this.tapDown=!1,this.tapPress=!1,this.tapUp=!1,this.body=!1};return t.prototype.getPosition=function(){return e.v2f(this.pos.x,this.pos.y)},t.prototype.getScreenPosition=function(){return e.v2f(this.screenPos.x,this.screenPos.y)},t.prototype.upd=function(){if(!this.enabled)return!1;this.j2Ds.scene.offsetWidth/this.j2Ds.scene.width,this.j2Ds.scene.offsetHeight/this.j2Ds.scene.height},t.prototype.reset=function(){return this.enabled?void 0:!1},t.prototype.cancel=function(){return this.enabled?void 0:!1},t.prototype.isTapDown=function(){},t.prototype.isTapPress=function(){},t.prototype.isTapUp=function(){},t.prototype.getTouch=function(){},t.prototype.onTouchEvent=function(){return this.enabled?void 0:!1},t.prototype.init=function(){var e=this;e.enabled=!0,e.j2Ds.events.addEvent("engine:before",function(){e.upd()}),e.j2Ds.events.addEvent("engine:after",function(){e.reset()}),e.j2Ds.events.addEvent("dom:loaded",function(){})},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.TouchHandler=t),void 0!==global.j2Ds&&(global.modules.io.TouchHandler=t),t}),function(e,t){"function"==typeof define&&define.amd?define("core/Layers",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.layersList={}};return e.prototype.layer=function(e){return this.layersList[e]},e.prototype.add=function(e,t,o){if(this.layersList[e])return!1;var i={layerName:e};return o?i.canvas=this.j2Ds.dom.id(e):i.canvas=document.createElement("canvas"),i.canvas.style.position=this.j2Ds.scene.stylePosition,i.canvas.id=e,i.canvas.style.zIndex=1e3+t,i.canvas.style.left=this.j2Ds.scene.offsetLeft+"px",i.canvas.style.top=this.j2Ds.scene.offsetTop+"px",i.canvas.width=this.j2Ds.scene.width,i.canvas.height=this.j2Ds.scene.height,i.width=this.j2Ds.scene.width,i.height=this.j2Ds.scene.height,i.context=i.canvas.getContext("2d"),i.context.shadowColor="rgba(0,0,0,0)",i.alpha=1,i.angle=0,i.visible=1,i.onContext=function(e){e(this.context)},i.fill=function(e){this.context.fillStyle=e,this.context.fillRect(0,0,this.width,this.height)},i.setAlpha=function(e){this.canvas.style.opacity=e,this.alpha=e},i.getAlpha=function(){return this.alpha},i.setVisible=function(e){e?(this.canvas.style.display="block",this.visible=!0):(this.canvas.style.display="none",this.visible=!1)},i.isVisible=function(){return this.visible},i.setIndex=function(e){this.canvas.style.zIndex=1e3+e},i.clear=function(){this.context.clearRect(0,0,this.width,this.height)},i.clearNode=function(e){var t=this;e.isLookScene()&&this.context.clearRect(e.pos.x-t.j2Ds.scene.view.pos.x,e.pos.y-t.j2Ds.scene.view.pos.y,e.size.x,e.size.y)},i.setContextSettings=function(e){for(var t in e)"undefined"!=typeof this.context[t]&&(this.context[t]=e[t])},i.clearRect=function(e,t){var o=this;this.context.clearRect(e.x-o.j2Ds.scene.view.pos.x,e.y-o.j2Ds.scene.view.pos.y,t.x,t.y)},this.layersList[e]=i,o||this.j2Ds.dom.attach(this.layersList[e].canvas),i},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.Layers=e),void 0!==global.j2Ds&&(global.modules.core.Layers=e),e}),function(e,t){"function"==typeof define&&define.amd?define("core/Scene",["nodes/BaseNode","nodes/CircleNode","nodes/LineNode","nodes/RectNode","nodes/SpriteNode","nodes/TextNode","utils/TextureUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("nodes/CircleNode"),require("nodes/LineNode"),require("nodes/RectNode"),require("nodes/SpriteNode"),require("nodes/TextNode"),require("utils/TextureUtil")):t(e.modules.nodes.BaseNode,e.modules.nodes.CircleNode,e.modules.nodes.LineNode,e.modules.nodes.RectNode,e.modules.nodes.SpriteNode,e.modules.nodes.TextNode,e.modules.utils.TextureUtil)}("undefined"!=typeof window?window:global,function(e,t,o,i,s,n,r){"use strict";var a=function(e){e=this.j2Ds=e,this.nodes=[],this.layerName="sceneNode",this.stylePosition="fixed",this.layers=e.layers,this.view=!1,this.gameStateName=!1,this.canFullScreen=!0,this.texture=new r(this.j2Ds)};return a.prototype.setView=function(e){this.view=this.j2Ds.viewManager.views[e]},a.prototype.getView=function(){return this.view},a.prototype.setAutoDraw=function(e){var t=this;e?t.j2Ds.events.addEvent("engine:after",function(){t.drawAllNodes()},"autoDraw"):t.j2Ds.events.destroyEvent("engine:after","autoDraw")},a.prototype.setAutoClear=function(e){var t=this;e?t.j2Ds.events.addEvent("engine:before",function(){t.clear()},"autoClear"):t.j2Ds.events.destroyEvent("engine:before","autoClear")},a.prototype.setGameState=function(e){this.j2Ds.gameStates.states[e].start&&this.j2Ds.gameStates.states[e].start(),this.j2Ds.gameStates.states[e].state&&this.j2Ds.setActiveEngine(this.j2Ds.gameStates.states[e].state),this.gameStateName=e,this.j2Ds.events.onEvent("scene:changedGameState")},a.prototype.getGameState=function(){return this.gameStateName},a.prototype.start=function(e,t){this.j2Ds.events.onEvent("scene:beforeStart"),this.j2Ds.gameStates.states[e].start&&this.j2Ds.gameStates.states[e].start(),this.j2Ds.gameStates.states[e]&&this.j2Ds.start(this.j2Ds.gameStates.states[e].state,t),this.j2Ds.events.onEvent("scene:afterStart")},a.prototype.fullScreen=function(e){if(this.canFullScreen){var t,o=document.createElement("canvas"),i=o.getContext("2d");if(e){this.origWidth=this.width,this.origHeight=this.height,this.width=this.j2Ds.getDeviceManager().width,this.height=this.j2Ds.getDeviceManager().height;for(var s in this.j2Ds.layers.list)t=this.j2Ds.layers.list[s],o.width=t.width,o.height=t.height,i.drawImage(t.canvas,0,0),t.canvas.width=this.width,t.canvas.height=this.height,t.width=this.width,t.height=this.height,this.offsetWidth=this.width,this.offsetHeight=this.height,t.context.drawImage(o,0,0,t.width,t.height)}else{this.width=this.origWidth,this.height=this.origHeight;for(var s in this.j2Ds.layers.list)t=this.j2Ds.layers.list[s],t.width=this.origWidth,t.height=this.origHeight,t.canvas.width=this.origWidth,t.canvas.height=this.origHeight,this.offsetWidth=this.origWidth,this.offsetHeight=this.origHeight}}},a.prototype.fullScale=function(e){if(this.canFullScreen){var t;if(e)for(var o in this.j2Ds.layers.list)t=this.j2Ds.layers.list[o].canvas,t.style.width=this.j2Ds.getDeviceManager().width+"px",t.style.height=this.j2Ds.getDeviceManager().height+"px",this.offsetWidth=this.j2Ds.getDeviceManager().width,this.offsetHeight=this.j2Ds.getDeviceManager().height;else for(var o in this.j2Ds.layers.list)t=this.j2Ds.layers.list[o].canvas,t.style.width=this.width+"px",t.style.height=this.height+"px",this.offsetWidth=this.width,this.offsetHeight=this.height}},a.prototype.clear=function(){this.getLayer().clear()},a.prototype.getLayer=function(){return this.j2Ds.layers.layer(this.layerName)},a.prototype.drawAllNodes=function(){for(var e=0,t=this.nodes.length;t>e;e+=1)this.nodes[e].draw&&this.nodes[e].draw()},a.prototype.init=function(e,t,o){var i=this;i.j2Ds.events.onEvent("scene:beforeInit"),i.width=e,i.height=t,i.origWidth=e,i.origHeight=t,i.offsetWidth=e,i.offsetHeight=t,i.offsetLeft=0,i.offsetTop=0,i.j2Ds.canDeactivate=0!=o,i.j2Ds.layers.add("sceneNode",0),i.context=i.j2Ds.layers.layer(i.layerName).context,i.canvas=i.j2Ds.layers.layer(i.layerName).canvas,i.visible=!0,i.cancelClear=!1,i.view=i.j2Ds.viewManager.add("sceneView"),i.j2Ds.events.onEvent("scene:afterInit"),i.j2Ds.window.onload=function(){i.j2Ds.window.focus(),i.j2Ds.window.onblur=function(){0==i.j2Ds.stopAll&&(i.j2Ds.stopEngine(),i.j2Ds.events.onEvent("scene:deactivate"))},i.j2Ds.window.onfocus=function(){1==i.j2Ds.stopAll&&(i.j2Ds.runEngine(i.j2Ds),i.j2Ds.events.onEvent("scene:activate"))};for(var e in i.j2Ds.layers.list)i.j2Ds.dom.attach(i.j2Ds.layers.layer(e).canvas);i.j2Ds.ready=!0,i.j2Ds.events.onEvent("dom:loaded")}},a.prototype.initCanvas=function(e,t){var o=this;o.canFullScreen=!1,o.layerName=e,o.j2Ds.events.onEvent("scene:beforeInit"),o.width=parseInt(o.j2Ds.dom.id(e).width),o.height=parseInt(o.j2Ds.dom.id(e).height),o.origWidth=o.width,o.origHeight=o.height,o.offsetWidth=parseInt(o.j2Ds.dom.id(e).offsetWidth),o.offsetHeight=parseInt(o.j2Ds.dom.id(e).offsetHeight),o.offsetLeft=parseInt(o.j2Ds.dom.id(e).offsetLeft),o.offsetTop=parseInt(o.j2Ds.dom.id(e).offsetTop),o.stylePosition="fixed"==o.j2Ds.dom.id(e).style.position?"fixed":"absolute",o.j2Ds.canDeactivate=0!=t,o.j2Ds.layers.add(e,0,1),o.context=o.j2Ds.layers.layer(e).context,o.canvas=o.j2Ds.layers.layer(e).canvas,o.visible=!0,o.cancelClear=!1,o.view=o.j2Ds.viewManager.add("sceneView"),o.j2Ds.events.onEvent("scene:afterInit"),o.j2Ds.window.onload=function(){o.j2Ds.window.focus(),o.j2Ds.window.onblur=function(){0==o.j2Ds.stopAll&&(o.j2Ds.stopEngine(),o.j2Ds.events.onEvent("scene:deactivate"))},o.j2Ds.window.onfocus=function(){1==o.j2Ds.stopAll&&(o.j2Ds.runEngine(o.j2Ds),o.j2Ds.events.onEvent("scene:activate"))};for(var e in o.j2Ds.layers.list)o.j2Ds.dom.attach(o.j2Ds.layers.layer(e).canvas);o.j2Ds.ready=!0,o.j2Ds.events.onEvent("dom:loaded")}},a.prototype.addBaseNode=function(t,o){return new e(this.j2Ds,t,o)},a.prototype.addCircleNode=function(e,o,i){return new t(this.j2Ds,e,o,i)},a.prototype.addLineNode=function(e,t,i,s,n,r,a){return new o(this.j2Ds,e,t,i,s,n,r,a)},a.prototype.addRectNode=function(e,t,o){return new i(this.j2Ds,e,t,o)},a.prototype.addSpriteNode=function(e,t,o){return new s(this.j2Ds,e,t,o)},a.prototype.addTextNode=function(e,t,o,i,s,r,a){return new n(this.j2Ds,e,t,o,i,s,r,a)},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.Scene=a),void 0!==global.j2Ds&&(global.modules.core.Scene=a),a}),function(e,t){"function"==typeof define&&define.amd?define("j2Ds",["core/Dom","core/Gui","core/Events","core/Layers","core/Scene","io/AudioHandler","io/InputHandler","io/TouchHandler","managers/DeviceManager","managers/ErrorManager","managers/FpsManager","managers/ResourceManager","managers/StorageManager","managers/TimeManager","managers/TriggerManager","managers/ViewManager","utils/MathUtil","utils/TextureUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("core/Dom"),require("core/Gui"),require("core/Events"),require("core/Layers"),require("core/Scene"),require("io/AudioHandler"),require("io/InputHandler"),require("io/TouchHandler"),require("managers/DeviceManager"),require("managers/ErrorManager"),require("managers/FpsManager"),require("managers/ResourceManager"),require("managers/StorageManager"),require("managers/TimeManager"),require("managers/TriggerManager"),require("managers/ViewManager"),require("utils/MathUtil"),require("utils/TextureUtil")):t(e.modules.core.Dom,e.modules.core.Gui,e.modules.core.Events,e.modules.core.Layers,e.modules.core.Scene,e.modules.io.AudioHandler,e.modules.io.InputHandler,e.modules.io.TouchHandler,e.modules.managers.DeviceManager,e.modules.managers.ErrorManager,e.modules.managers.FpsManager,e.modules.managers.ResourceManager,e.modules.managers.StorageManager,e.modules.managers.TimeManager,e.modules.managers.TriggerManager,e.modules.managers.ViewManager,e.modules.utils.MathUtil,e.modules.utils.TextureUtil)}("undefined"!=typeof window?window:global,function(e,t,o,i,s,n,r,a,h,l,d,u,c,p,f,y,m){"use strict";var g=60,v=function(){this.vector={},this.math={},this.dom={},this.now=Date.now(),this.dt=0,this.stopAll=0,this.frameLimit=60,this.sceneStartTime=0,this.sceneSkipTime=0,this.engine=function(){this.errorManager.show("Не инициализировано ни одно игровое состояние","red"),this.stopEngine()},this.ready=!1,this.window=window,this.canDeactivate=!0,this.getInfo=function(){return{name:"j2DsEngine",version:"0.6.2",git:"https://github.com/SkanerSoft/j2DsEngine",site:"http://j2DsEngine.ru",description:"HTML5 2D Game Engine",author:"Skaner"}},this.getFPSManager=function(){return this.fpsManager.init(),this.fpsManager},this.getSceneManager=function(){return this.scene},this.getLayerManager=function(){return this.layers},this.getTextureManager=function(){return this.scene.texture},this.getAudioManager=function(){return this.audio.init(),this.audio},this.getPaintManager=function(){return this.paint},this.getIO=function(){return this.input.init(),this.input},this.getTouchIO=function(){return this.touch.init(),this.touch},this.getDOMManager=function(){return this.dom},this.getTriggerManager=function(){return this.trigger.init(),this.trigger},this.getMathManager=function(){return m},this.getGameStateManager=function(){return this.gameStates},this.getViewManager=function(){return this.viewManager},this.getDeviceManager=function(){return this.deviceManager},this.getErrorManager=function(){return this.errorManager.init(),this.errorManager},this.getTimeManager=function(){return this.timeManager},this.getResourceManager=function(){return this.resources},this.setWindow=function(e){this.window=e?e:window},this.setFrameLimit=function(e){this.frameLimit=e>0&&60>=e?e:60,g=this.frameLimit},this.setActiveEngine=function(e){this.engine="function"==typeof e?e:this.errorManager.show('Error in "GameStateManager"')},this.events=new o(this),this.dom=new e(this),this.gui=new t(this),this.resources=new u(this),this.timeManager=new p(this),this.deviceManager=h(),this.errorManager=new l(this),this.fpsManager=new d(this),this.input=new r(this),this.layers=new i(this),this.viewManager=new y(this),this.scene=new s(this),this.createLocal=function(e){new c(this,e)}};v.prototype.gameStates={states:{},add:function(e,t,o,i){var s={};s.state=t,s.start=o||!1,s.end=i||!1,this.states[e]=s}},v.prototype.start=function(e,t){this.setActiveEngine(e),this.frameLimit=t||60,this.sceneSkipTime=1e3/this.frameLimit,this.lastTime=Date.now(),this.dt=0,this.sceneStartTime=this.lastTime,this.gameEngine(this)},v.prototype.gameEngine=function(e){e.now=Date.now(),setTimeout(function(){if(!e.stopAll){e.dt=(e.now-e.lastTime)/100,e.sceneStartTime=e.now,e.dt>e.sceneSkipTime/2&&(e.dt=0),e.events.onEvent("engine:before");try{e.engine()}catch(t){e.errorManager.showError(t)}e.events.onEvent("engine:after"),e.lastTime=e.now,w(function(){e.gameEngine(e)})}},e.frameLimit<60?e.sceneSkipTime:0)};var w=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/g)}}();return v.prototype.stopEngine=function(){this.canDeactivate&&(this.stopAll=!0)},v.prototype.runEngine=function(e){e=e||this,e.canDeactivate&&e.stopAll&&(e.stopAll=!1,w(function(){e.gameEngine(e)}))},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.j2Ds=v),void 0!==global.j2Ds&&(global.modules.core.j2Ds=v),void 0!==global.j2Ds&&(global.j2Ds=new v),v}); +!function(e,t){"function"==typeof define&&define.amd?define("utils/MathUtil",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(){};return e.v2f=function(e,t){return{x:e,y:t}},e.v2i=function(e,t){return{x:e>>0,y:t>>0}},e.toInt=function(e){return e>>0},e.rndColor=function(t,o,i){return"rgba("+e.random(t,o)+", "+e.random(t,o)+", "+e.random(t,o)+", "+i+")"},e.random=function(t,o,i){var s=Math.floor(Math.random()*(o-t+1)+t);return i&&0==s?e.random(t,o,i):s},e.rad=function(e){return e*(Math.PI/180)},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.MathUtil=e),void 0!==global.j2Ds&&(global.modules.utils.MathUtil=e),e}),function(e,t){"function"==typeof define&&define.amd?define("utils/TextureUtil",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e};return e.prototype.createImageMap=function(e,t,o){var i=this;i.j2Ds.resources.add();var s={img:null,loaded:!1,width:e,height:t};return s.img=document.createElement("canvas"),s.context=s.img.getContext("2d"),s.img.width=s.width,s.img.height=s.height,o(s.context),s.loaded=!0,s.getAnimation=function(e,t,o,i,s){return{imageMap:this,sourceX:e,sourceY:t,sourceW:o,sourceH:i,frameCount:s-1}},i.j2Ds.resources.ok("createImageMap_"+e+"x"+t),s},e.prototype.loadImageMap=function(e){var t=this;t.j2Ds.resources.add();var o={img:null,width:0,height:0,loaded:!1};return o.img=document.createElement("img"),o.crossOrigin="anonymous",o.img.src=e,o.img.addEventListener("load",function(){o.width=o.img.width,o.height=o.img.height,o.loaded=!0,t.j2Ds.resources.ok(e)}),o.img.addEventListener("error",function(){o.width=0,o.height=0,o.loaded=!1}),o.getAnimation=function(e,t,o,i,s){return{imageMap:this,sourceX:e,sourceY:t,sourceW:o,sourceH:i,frameCount:s-1}},o},e.prototype.templates={ellipse:function(e,t,o){},fillRect:function(e,t,o){e.fillStyle=o,e.fillRect(0,0,t.x,t.y)},strokeRect:function(e,t,o,i){e.strokeStyle=o,e.lineWidth=i,e.strokeRect(0,0,t.x,t.y)},gradientL:function(e,t,o,i){var s=e.createLinearGradient(0,0,t.x,0),n=1/o.length;i||(s=e.createLinearGradient(0,0,0,t.y));for(var r=n/2,a=0;ai;i+=1)o.events[e][i].id==t&&o.events[e].splice(i,1)},e.prototype.onEvent=function(e,t){for(var o=this,i=0,s=o.events[e].length;s>i;i+=1)if(o.events[e])try{o.events[e][i].callback(t||"")}catch(n){o.j2Ds.errorManager.showError(n)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.Events=e),void 0!==global.j2Ds&&(global.modules.core.Events=e),e}),function(e,t){"function"==typeof define&&define.amd?define("nodes/BaseNode",["utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil")):t(e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e){"use strict";var t,o=function(e,o,i){t=e,this.visible=!0,this.alpha=1,this.pos=o,this.size=i,this.parent=!1,this.angle=0,this.layer=t.scene,this.box={offset:{x:0,y:0},size:{x:0,y:0}},t.scene.nodes.push(this)};return o.prototype.resizeBox=function(e,t){this.box.offset=e,this.box.size=t},o.prototype.setLayer=function(e){this.layer=e?t.layers.layer(e):t.scene},o.prototype.getLayer=function(){return this.layer},o.prototype.setVisible=function(e){this.visible=!!e},o.prototype.isVisible=function(){return this.visible},o.prototype.setAlpha=function(e){0>e&&(e=0),e>1&&(e=1),this.alpha=e},o.prototype.getAlpha=function(){return this.alpha},o.prototype.moveTo=function(t,o){o=o?o:1,this.move(e.v2f((t.x-this.getPosition().x)/o,(t.y-this.getPosition().y)/o))},o.prototype.setPosition=function(t){return t?void(this.pos=e.v2f(t.x-Math.ceil(this.size.x/2),t.y-Math.ceil(this.size.y/2))):this.pos},o.prototype.move=function(e){this.pos.x+=e.x,this.pos.y+=e.y},o.prototype.getPosition=function(){return e.v2f(this.pos.x+Math.ceil(this.size.x/2),this.pos.y+Math.ceil(this.size.y/2))},o.prototype.setSize=function(e){return e?void(this.size=e):this.size},o.prototype.getSize=function(){return this.size},o.prototype.setParent=function(e){this.parent=e},o.prototype.getDistance=function(e){return Math.ceil(Math.sqrt(Math.pow(e.getPosition().x-this.getPosition().x,2)+Math.pow(e.getPosition().y-this.getPosition().y,2)))},o.prototype.getDistanceXY=function(t){return e.v2f(Math.abs(t.getPosition().x-this.getPosition().x),Math.abs(t.getPosition().y-this.getPosition().y))},o.prototype.isIntersect=function(e){var t={x1:this.pos.x+this.box.offset.x,x2:e.pos.x+e.box.offset.x,y1:this.pos.y+this.box.offset.y,y2:e.pos.y+e.box.offset.y},o={x1:this.size.x+this.box.size.x,x2:e.size.x+e.box.size.x,y1:this.size.y+this.box.size.y,y2:e.size.y+e.box.size.y};return t.y1+o.y1>=t.y2&&t.x1+o.x1>=t.x2&&t.x1t.scene.view.pos.x+t.scene.width||this.pos.x+this.size.xt.scene.view.pos.y+t.scene.height||this.pos.y+this.size.y=t.scene.view.pos.x+t.scene.width?e.x=1:this.pos.x<=t.scene.view.pos.x?e.x=-1:e.x=0,this.pos.y+this.size.y>=t.scene.view.pos.y+t.scene.height?e.y=1:this.pos.y<=t.scene.view.pos.y?e.y=-1:e.y=0,e.all=e.x||e.y,e},o.prototype.moveDir=function(t){this.pos.x+=t*Math.cos(e.rad(this.angle)),this.pos.y+=t*Math.sin(e.rad(this.angle))},o.prototype.drawBox=function(){var e=this.layer.context;e.lineWidth=2,e.strokeStyle="black",e.beginPath(),e.rect(this.pos.x-t.scene.view.pos.x,this.pos.y-t.scene.view.pos.y,this.size.x,this.size.y),e.stroke(),e.strokeStyle="yellow",e.beginPath(),e.rect(this.box.offset.x+this.pos.x-t.scene.view.pos.x,this.box.offset.y+this.pos.y-t.scene.view.pos.y,this.box.size.x+this.size.x,this.box.size.y+this.size.y),e.stroke()},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.BaseNode=o),void 0!==global.j2Ds&&(global.modules.nodes.BaseNode=o),o}),function(e,t){"function"==typeof define&&define.amd?define("nodes/CircleNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(i,s,n,r){o=i,e.call(this,i,s,t.v2f(2*n,2*n)),this.color=r,this.radius=n};return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.draw=function(){var e=this.layer.context;if(this.visible&&this.isLookScene()){if(1!=this.alpha){var t=e.globalAlpha;e.globalAlpha=this.alpha}e.lineWidth=0,e.fillStyle=this.color,e.beginPath(),e.arc(this.pos.x-o.scene.view.pos.x+this.radius,this.pos.y-o.scene.view.pos.y+this.radius,this.radius,0,2*Math.PI,!0),e.stroke(),e.fill(),1!=this.alpha&&(e.globalAlpha=t)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.CircleNode=i),void 0!==global.j2Ds&&(global.modules.nodes.CircleNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("nodes/LineNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(i,s,n,r,a,h,l,d){o=i,e.call(this,i,s,t.v2f(0,0)),this.color=a,this.points=n,this.fill=l||!1,this.scale=r||0,this.cFill=d,this.lineWidth=h};return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.draw=function(){var e=this.layer.context;if(this.visible&&this.isLookScene()){if(1!=this.alpha){var t=e.globalAlpha;e.globalAlpha=this.alpha}e.strokeStyle=this.color,e.lineWidth=this.lineWidth,e.beginPath(),e.moveTo(this.pos.x-o.scene.view.pos.x,this.pos.y-o.scene.view.pos.y);for(var i=0,s=this.points.length;s>i;i+=1)e.lineTo(this.pos.x+this.points[i][0]*this.scale-o.scene.view.pos.x,this.pos.y+this.points[i][1]*this.scale-o.scene.view.pos.y);e.stroke(),this.fill&&(e.fillStyle=this.cFill,e.fill()),e.lineWidth=0,1!=this.alpha&&(e.globalAlpha=t)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.LineNode=i),void 0!==global.j2Ds&&(global.modules.nodes.LineNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("nodes/RectNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(t,i,s,n){o=t,e.call(this,t,i,s),this.color=n};return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.draw=function(){var e=this.layer.context;if(this.visible&&this.isLookScene()){if(1!=this.alpha){var i=e.globalAlpha;e.globalAlpha=this.alpha}this.angle&&(e.save(),e.translate(this.getPosition().x-o.scene.view.pos.x,this.getPosition().y-o.scene.view.pos.y),e.rotate(t.rad(this.angle)),e.translate(-(this.getPosition().x-o.scene.view.pos.x),-(this.getPosition().y-o.scene.view.pos.y))),e.fillStyle=this.color,e.lineWidth=0,e.fillRect(this.pos.x-o.scene.view.pos.x,this.pos.y-o.scene.view.pos.y,this.size.x,this.size.y),this.angle&&e.restore(),1!=this.alpha&&(e.globalAlpha=i)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.RectNode=i),void 0!==global.j2Ds&&(global.modules.nodes.RectNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("nodes/SpriteNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(t,i,s,n){o=t,e.call(this,t,i,s),this.tmpSpeed=0,this.frame=0,this.animation=n,this.flip={x:!1,y:!1}};return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.setFlip=function(e,t){this.flip={x:e,y:t}},i.prototype.draw=function(e){this.visible&&this.isLookScene()&&(e=e||1,this.frame>this.animation.frameCount&&(this.frame=0),this.drawFrame(this.frame+1),this.tmpSpeed>e?(this.frame+=1,this.tmpSpeed=0):this.tmpSpeed+=1)},i.prototype.drawFrame=function(e){if(!this.animation.imageMap.loaded)return err.show("Invalid ImageMap","red");var i=this.layer.context;if(this.visible&&this.isLookScene()){if(1!=this.alpha){var s=i.globalAlpha;i.globalAlpha=this.alpha}i.lineWidth=0,(this.angle||this.flip.x||this.flip.y)&&(i.save(),i.translate(this.getPosition().x-o.scene.view.pos.x,this.getPosition().y-o.scene.view.pos.y),i.rotate(t.rad(this.angle)),i.scale(this.flip.x?-1:1,this.flip.y?-1:1),i.translate(-(this.getPosition().x-o.scene.view.pos.x),-(this.getPosition().y-o.scene.view.pos.y))),e=e?e-1:0,i.drawImage(this.animation.imageMap.img,this.animation.sourceX+this.animation.sourceW*e,this.animation.sourceY,this.animation.sourceW,this.animation.sourceH,this.pos.x-o.scene.view.pos.x,this.pos.y-o.scene.view.pos.y,this.size.x,this.size.y),(this.angle||this.flip.x||this.flip.y)&&i.restore(),1!=this.alpha&&(i.globalAlpha=s)}},i.prototype.setAnimation=function(e){this.animation!=e&&(this.animation=e)},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.SpriteNode=i),void 0!==global.j2Ds&&(global.modules.nodes.SpriteNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("nodes/TextNode",["nodes/BaseNode","utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("utils/MathUtil")):t(e.modules.nodes.BaseNode,e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o,i=function(i,s,n,r,a,h,l,d){o=i,e.call(this,i,s,t.v2f(0,0)),this.vAlign="top",this.hAlign="left",this.color=a?a:"black",this.family=h?h:"serif",this.sizePx=r?r:20,this.box.offset.y=t.toInt(.26*this.sizePx),this.box.size.y=-t.toInt(.26*this.sizePx),this.lineWidth=l?l:0,this.colorL=d?d:"black",this.font=this.sizePx+"px "+this.family,this.fullText=n,this.maxWidth=0,this.lines=n.split("\n"),o.scene.context.font=this.font;for(var u=0,c=this.lines.length;c>u;u+=1)this.maxWidth=this.maxWidthi;i+=1)this.maxWidth=this.maxWidtha;a+=1)this.lineWidth&&s.strokeText(n[a],t.x,t.y+this.sizePx*a),s.fillText(n[a],t.x,t.y+this.sizePx*a);1!=this.alpha&&(s.globalAlpha=r),s.lineWidth=0,s.strokeStyle="black"},i.prototype.getText=function(){return this.fullText},i.prototype.setText=function(e){this.fullText=e,this.maxWidth=0,this.lines=e.split("\n"),o.scene.context.font=this.font,this.box.offset.y=t.toInt(.26*this.sizePx),this.box.size.y=-t.toInt(.26*this.sizePx);for(var i=0,s=this.lines.length;s>i;i+=1)this.maxWidth=this.maxWidths;s+=1)this.lineWidth&&e.strokeText(this.lines[s],this.pos.x-o.scene.view.pos.x,this.pos.y+this.sizePx*s-o.scene.view.pos.y),e.fillText(this.lines[s],this.pos.x-o.scene.view.pos.x,this.pos.y+this.sizePx*s-o.scene.view.pos.y);e.lineWidth=0,e.strokeStyle="black",this.angle&&e.restore(),1!=this.alpha&&(e.globalAlpha=i)}},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.TextNode=i),void 0!==global.j2Ds&&(global.modules.nodes.TextNode=i),i}),function(e,t){"function"==typeof define&&define.amd?define("managers/DeviceManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(){return{width:parseInt(document.documentElement.clientWidth)RUN",o.style.padding="5px",o.align="center",o.style.position="fixed",o.style.zIndex=2e4,o.style.left="0px",o.style.top=-20+t.j2Ds.getDeviceManager().height+"px",o.style.fontSize="8pt",o.style.backgroundColor="#B8FFB8",o.style.height="12px",o.style.width="50px",o.style.cursor="pointer",o.onmousedown=function(e){e.stopPropagation()},o.onclick=function(e){return e.stopPropagation(),t.show("Выполнение продолжено"),t.j2Ds.runEngine(t.j2Ds),!1},t.j2Ds.dom.attach(o),t.logListener.elems.push(o);var i=document.createElement("div");i.innerHTML="PAUSE",i.style.padding="5px",i.align="center",i.style.position="fixed",i.style.zIndex=2e4,i.style.left="60px",i.style.top=-20+t.j2Ds.getDeviceManager().height+"px",i.style.fontSize="8pt",i.style.backgroundColor="#FFFFBD",i.style.height="12px",i.style.width="50px",i.style.cursor="pointer",i.onmousedown=function(e){e.stopPropagation()},i.onclick=function(e){return e.stopPropagation(),t.show("Выполнение приостановлено"),t.j2Ds.stopEngine(),!1},t.j2Ds.dom.attach(i),t.logListener.elems.push(i);var s=document.createElement("div");s.innerHTML="RELOAD",s.style.padding="5px",s.align="center",s.style.position="fixed",s.style.zIndex=2e4,s.style.left="120px",s.style.top=-20+t.j2Ds.getDeviceManager().height+"px",s.style.fontSize="8pt",s.style.backgroundColor="#E2E2E2",s.style.color="black",s.style.height="12px",s.style.width="50px",s.style.cursor="pointer",s.onmousedown=function(e){e.stopPropagation()},s.onclick=function(e){return e.stopPropagation(),t.j2Ds.dom.reloadURL(),!1},t.j2Ds.dom.attach(s),t.logListener.elems.push(s),t.j2Ds.events.addEvent("dom:loaded",function(){t.j2Ds.window.onerror=function(e){t.show(e)}})},e.prototype.show=function(e){console.log("[j2Ds]: "+e)},e.prototype.setMode=function(e){this.mode=e,"neverShow"==e&&(this.enabled=!1)},e.prototype.debug=function(e){this.enabled&&(this.j2Ds.stopEngine(),"neverShow"!=this.mode&&this.show(e||"Точка останова достигнута"))},e.prototype.showError=function(e,t){if("neverShow"!=this.mode){var o=e.stack.toString();o=o.split(/\n/);for(var i=0,s=o.length;s>i;i+=1)if(o[i].match(/\:\d/)){o=o[i].split(/\s/);break}o=o[o.length-1],o=o.replace(/([\(\)]|[\w]+:\/\/)/g,"");var n=o.split(":"),r=n[1],a=n[2];n=decodeURI(n[0]),n.match(/(|\bj2Ds.js)/)&&(n="<Функция-аргумент или строка>");var h='Тип ошибки: "'+e.name+'"\nСообщение: "'+e.message+'"\nФайл с ошибкой: "'+n+'"\nСтрока: '+r+", символ: "+a;t&&(h+="\nОшибка в теле функции: \n"+t.toString()),this.show(h),"stopAndShow"==this.mode&&(this.j2Ds.stopEngine(),this.show("Выполнение приостановлено"))}},e.prototype.logListener={domId:"",count:0,execLine:"",elems:[]},e.prototype.lightSyntax=function(e,t){var o=(""+e).toString();return"boolean"==t?o=o.replace(/true/gi,'$&').replace(/false/gi,'$&'):"code"==t&&(o=o.replace(/(this|var|typeof|new|return|if|else|for|in|while|break|do|continue|switch|case)([^a-z0-9\$_])/gi,'$1$2').replace(/(function|object)/gi,'$1').replace(/(width|height|window|document|scene|j2Ds|value)/gi,'$1').replace(/([a-z\_\$][a-z0-9_]*)\(/gi,'$1(').replace(/(\{|\}|\]|\[|\|)/gi,'$1').replace(/('.*?')/g,'$1').replace(/(#[a-z0-9]{3,8};)/,'$1').replace(/(\t)/g,"  "),o=o.replace(/true/gi,'$&').replace(/false/gi,'$&')),o},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.ErrorManager=e),void 0!==global.j2Ds&&(global.modules.managers.ErrorManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/FpsManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.enabled=!1,this.fps=this.j2Ds.frameLimit,this.tmp_of_fps=1,this.tmp_of_time=Date.now()};return e.prototype.init=function(){var e=this;e.enabled=!0,this.j2Ds.events.addEvent("engine:after",function(){e.update()})},e.prototype.update=function(){this.enabled&&(this.tmp_of_fps+=1,this.j2Ds.now-this.tmp_of_time>=1e3&&(this.fps=this.tmp_of_fps,this.tmp_of_fps=1,this.tmp_of_time=this.j2Ds.now))},e.prototype.getFPS=function(){return this.fps<=this.j2Ds.frameLimit?this.fps:this.j2Ds.frameLimit},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.FpsManager=e),void 0!==global.j2Ds&&(global.modules.managers.FpsManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/ResourceManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.added=0,this.loaded=0,this.failed=0,this.add=function(){this.added+=1},this.ok=function(e){this.loaded+=1,this.j2Ds.errorManager.show('loaded: "'+decodeURI(e))},this.fail=function(e){this.failed+=1,this.j2Ds.errorManager.show('error load: "'+decodeURI(e))},this.show=function(){return{added:this.added,loaded:this.loaded,failed:this.failed}},this.isLoaded=function(){return this.added==this.loaded},this.getProgress=function(){return Math.ceil(this.loaded/this.added*100)}};return"object"==typeof module&&"object"==typeof module.exports&&(module.exports.ResourceManager=e),void 0!==global.j2Ds&&(global.modules.managers.ResourceManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/StorageManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e,t){this.j2Ds=e,this.id=t,this.ls=this.j2Ds.window.localStorage?this.j2Ds.window.localStorage:!1,this.ls||alert('j2Ds ERROR in "createLocal('+t+')" \nОбъект "localStorage" не поддерживается.')};return e.prototype.saveNode=function(e,t){return this.ls?void this.ls.setItem(this.id+e,JSON.stringify(t)):!1},e.prototype.load=function(e){return this.ls?this.ls.getItem(this.id+e):!1},e.prototype.is=function(e){return this.ls?!!this.ls.getItem(this.id+e):!1},e.prototype.save=function(e,t){return this.ls?void this.ls.setItem(this.id+e,t):!1},e.prototype.loadNode=function(e){return this.ls?JSON.parse(this.ls.getItem(this.id+e)):!1},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.StorageManager=e),void 0!==global.j2Ds&&(global.modules.managers.StorageManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/TimeManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.times={},this.insert=function(e){this.times[e]||(this.times[e]=this.j2Ds.now)},this.get=function(e){return this.times[e]}};return"object"==typeof module&&"object"==typeof module.exports&&(module.exports.TimeManager=e),void 0!==global.j2Ds&&(global.modules.managers.TimeManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/TriggerManager",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.enabled=!1,this.triggers={}};return e.prototype.add=function(e,t){var o=this,i={command:t,count:0,state:"stop",last:!1};return i.run=function(e){return"job"==this.state?void this.command():void(o.j2Ds.now-this.last>e&&(this.last&&(this.state="job",this.count+=1,this.command()),this.last=o.j2Ds.now))},i.job=function(e){o.j2Ds.now-this.last>e&&"run"!=this.state&&(this.last&&(this.state="run",this.count+=1,this.command()),this.last=o.j2Ds.now)},i.loop=function(e){o.j2Ds.now-this.last>e&&(this.last&&(this.state="run",this.count+=1,this.command()),this.last=o.j2Ds.now)},i.reset=function(){this.count=0,this.state="stop",this.last=!1},this.triggers[e]=i,i},e.prototype.get=function(e){return this.triggers[e]},e.prototype.init=function(){this.enabled=!0},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.TriggerManager=e),void 0!==global.j2Ds&&(global.modules.managers.TriggerManager=e),e}),function(e,t){"function"==typeof define&&define.amd?define("managers/ViewManager",["utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil")):t(e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e){"use strict";var t=function(e){this.j2Ds=e,this.views={}};return t.prototype.add=function(t,o){var i=this,s={focusNode:!1};return s.pos=o?e.v2f(o.x,o.y):e.v2f(0,0),s.setPosition=function(t){return t?void(this.pos=e.v2f(t.x-i.j2Ds.scene.width/2,t.y-i.j2Ds.scene.height/2)):this},s.getPosition=function(){return this.pos},s.move=function(e){this.pos.x+=e.x,this.pos.y+=e.y},i.j2Ds.viewManager.views[t]=s,s},t.prototype.get=function(e){return this.j2Ds.viewManager.views[e]},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.ViewManager=t),void 0!==global.j2Ds&&(global.modules.managers.ViewManager=t),t}),function(e,t){"function"==typeof define&&define.amd?define("io/AudioHandler",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(){this.audios={},this.enabled=!1};return e.prototype.init=function(){var e=this;this.enabled=!0,e.j2Ds.events.addEvent("scene:deactivate",function(){e.deactivate()}),e.j2Ds.events.addEvent("scene:activate",function(){e.activate()})},e.prototype.load=function(e,t,o){var i=this;i.j2Ds.resources.add();for(var s=document.createElement("audio"),n=0,r=t.length;r>n;n+=1){var a=document.createElement("source");a.src=t[n],s.appendChild(a)}s.id="audio_"+e,o&&(s.volume=1>=o&&o>=0?o:1);var h={id:e,files:t,domEl:s,ready:!1,len:0,state:"stop",lock:!1,volume:s.volume,onePlay:!1};return h.domEl.addEventListener("loadeddata",function(e){h.ready=!0;var t=e.explicitOriginalTarget||e.path[0];i.j2Ds.resources.ok(t.currentSrc)}),h.domEl.addEventListener("error",function(e){h.setLock(!0)}),h.domEl.addEventListener("ended",function(){h.state="stop"}),h.play=function(e){e&&this.setLock(!1),this.lock||("play"==this.state&&(this.domEl.currentTime=0),this.domEl.play(),this.state="play")},h.loop=function(){this.lock||(this.domEl.play(),this.state="play")},h.pause=function(e){"play"==this.state&&(this.setLock(e),this.domEl.pause(),this.state="pause")},h.stop=function(e){this.domEl.pause(),this.domEl.currentTime=0,this.state="stop",e&&this.setLock(e)},h.setLock=function(e){this.lock=!!e},h.setVolume=function(e){this.domEl.volume=1>=e&&e>=0?e:1,this.volume=this.domEl.volume},h.getVolume=function(e){return this.volume},h.getState=function(e){return this.state},h.getPlayPosition=function(){return this.domEl.currentTime},h.domEl.load(),this.audios[e]=h,h},e.prototype.get=function(e){return this.audios[e]},e.prototype.pause=function(e){for(var t in this.audios)this.audios[t].pause(e)},e.prototype.stop=function(e){for(var t in this.audios)this.audios[t].stop(e)},e.prototype.play=function(e){for(var t in this.audios)this.audios[t].play(e)},e.prototype.deactivate=function(){for(var e in this.audios)"play"==this.audios[e].state&&(this.audios[e].pause(),this.audios[e].state="deactivated")},e.prototype.activate=function(){for(var e in this.audios)"deactivated"==this.audios[e].state&&this.audios[e].play()},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.AudioHandler=e),void 0!==global.j2Ds&&(global.modules.io.AudioHandler=e),e}),function(e,t){"function"==typeof define&&define.amd?define("io/InputHandler",["utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil")):t(e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e){"use strict";var t=function(e){this.j2Ds=e,this.pos={x:0,y:0},this.x=0,this.y=0, +this.screenPos={x:0,y:0},this.keyDown=[],this.keyPress=[],this.keyPressed=[],this.keyUp=[],this.keyUped=!1,this.mouseDown=[],this.mousePress=[],this.mousePressed=[],this.mouseUp=[],this.mouseUpped=!1,this.mouseWheel=0,this.canceled=!1,this.body=!1,this.anyKey=!1,this.anyMouse=!1,this.writeMode=!1,this.displayCursor="",this.visible=!0,this.enabled=!1};return t.prototype.mKey={LEFT:1,MIDDLE:2,RIGHT:3},t.prototype.jKey={LEFT:37,RIGHT:39,UP:38,DOWN:40,SPACE:32,CTRL:17,SHIFT:16,ALT:18,ESC:27,ENTER:13,MINUS:189,PLUS:187,CAPS_LOCK:20,BACKSPACE:8,TAB:9,Q:81,W:87,E:69,R:82,T:84,Y:89,U:85,I:73,O:79,P:80,A:65,S:83,D:68,F:70,G:71,H:72,J:74,K:75,L:76,Z:90,X:88,V:86,B:66,N:78,M:77,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,C:67,9:57,NUM_0:45,NUM_1:35,NUM_2:40,NUM_3:34,NUM_4:37,NUM_5:12,NUM_6:39,NUM_7:36,NUM_8:38,NUM_9:33,NUM_MINUS:109,NUM_PLUS:107,NUM_LOCK:144,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123},t.prototype.keyList=function(){var e=[];for(var t in this.jKey)e.push(t);return e},t.prototype.reset=function(){return this.enabled?(this.keyPress=[],this.keyUp=[],this.mousePress=[],this.mouseUp=[],void(this.mouseWheel=0)):!1},t.prototype.isKeyDown=function(e){return this.keyDown[this.jKey[e]]},t.prototype.isKeyPress=function(e){return this.keyPress[this.jKey[e]]},t.prototype.isKeyUp=function(e){return this.keyUp[this.jKey[e]]},t.prototype.getPosition=function(){return e.v2f(this.pos.x,this.pos.y)},t.prototype.getScreenPosition=function(){return e.v2f(this.screenPos.x,this.screenPos.y)},t.prototype.setWriteMode=function(e){this.writeMode=e},t.prototype.isWriteMode=function(){return this.writeMode},t.prototype.keyEvent=function(e){if(!this.enabled)return!1;if("keydown"==e.type)this.keyPressed[e.keyCode]||(this.keyPress[e.keyCode]=!0,this.keyPressed[e.keyCode]=!0),this.writeMode?this.j2Ds.events.onEvent("writeMode:keyPress",""):e.preventDefault();else if("keyup"==e.type)this.keyPressed[e.keyCode]&&(e.preventDefault(),this.keyPress[e.keyCode]=!1,this.keyPressed[e.keyCode]=!1,this.keyUp[e.keyCode]=!0,this.keyUped=!0);else if("keypress"==e.type&&this.writeMode){var t="";0!=e.which&&0!=e.charCode&&e.which>=32&&(t=String.fromCharCode(e.which)),this.j2Ds.events.onEvent("writeMode:keyPress",t)}return this.keyDown[e.keyCode]="keydown"==e.type&&!this.canceled,this.anyKey=e.keyCode,!1},t.prototype.cancel=function(e){e?this.keyDown[this.jKey[e]]=!1:(this.canceled=!0,this.keyDown=[],this.mouseDown=[])},t.prototype.onNode=function(e){return e.layer.visible?this.pos.x>e.pos.x&&this.pos.xe.pos.y&&this.pos.y0||"DOWN"==e&&this.mouseWheel<0},t.prototype.onMouseWheel=function(e){return this.enabled?(e.preventDefault(),this.mouseWheel=e.wheelDelta?e.wheelDelta:-e.detail,!1):!1},t.prototype.onMouseEvent=function(e){return this.enabled?(e.preventDefault(),!e.which&&e.button&&(1&e.button?e.which=1:4&e.button?e.which=2:2&e.button&&(e.which=3)),"mousedown"==e.type?this.mousePressed[e.which]||(this.mousePress[e.which]=!0,this.mousePressed[e.which]=!0):"mouseup"==e.type&&this.mousePressed[e.which]&&(this.mousePress[e.which]=!1,this.mousePressed[e.which]=!1,this.mouseUp[e.which]=!0,this.mouseUped=!0),this.mouseDown[e.which]="mousedown"==e.type&&!this.canceled,this.j2Ds.window.focus(),!1):!1},t.prototype.setCursorImage=function(e){this.j2Ds.dom.tag("body")[0].style.cursor='url("'+e+'"), auto'},t.prototype.setVisible=function(e){this.visible=e,e?this.j2Ds.dom.tag("body")[0].style.cursor=this.displayCursor:(this.displayCursor=this.j2Ds.dom.tag("body")[0].style.cursor,this.j2Ds.dom.tag("body")[0].style.cursor="none")},t.prototype.isVisible=function(){return this.visible},t.prototype.init=function(){var e=this;e.enabled=!0,e.j2Ds.events.addEvent("engine:before",function(){e.upd()}),e.j2Ds.events.addEvent("engine:after",function(){e.reset()}),e.j2Ds.events.addEvent("dom:loaded",function(){e.j2Ds.window.oncontextmenu=function(){return!1},e.j2Ds.window.onselectstart=e.j2Ds.window.oncontextmenu,e.j2Ds.window.ondragstart=e.j2Ds.window.oncontextmenu,e.j2Ds.window.onmousedown=e.onMouseEvent,e.j2Ds.window.onmouseup=function(t){e.canceled=!1,e.onMouseEvent(t)},e.j2Ds.window.onmousemove=function(t){e.onMove(t)},e.j2Ds.window.onkeydown=function(t){e.keyEvent(t)},e.j2Ds.window.onkeyup=function(t){e.canceled=!1,e.keyEvent(t)},e.j2Ds.window.onkeypress=function(t){e.keyEvent(t)},e.j2Ds.window.onmousewheel=function(t){e.onMouseWheel(t)},e.j2Ds.window.addEventListener&&e.j2Ds.window.addEventListener("DOMMouseScroll",function(t){e.onMouseWheel(t)},!1)})},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.InputHandler=t),void 0!==global.j2Ds&&(global.modules.io.InputHandler=t),t}),function(e,t){"function"==typeof define&&define.amd?define("io/TouchHandler",["utils/MathUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil")):t(e.modules.utils.MathUtil)}("undefined"!=typeof window?window:global,function(e){"use strict";var t=function(e){this.j2Ds=e,this.enabled=!1,this.pos={x:0,y:0},this.screenPos={x:0,y:0},this.canceled=!1,this.touchs=[],this.tapDown=!1,this.tapPress=!1,this.tapUp=!1,this.body=!1};return t.prototype.getPosition=function(){return e.v2f(this.pos.x,this.pos.y)},t.prototype.getScreenPosition=function(){return e.v2f(this.screenPos.x,this.screenPos.y)},t.prototype.upd=function(){if(!this.enabled)return!1;this.j2Ds.scene.offsetWidth/this.j2Ds.scene.width,this.j2Ds.scene.offsetHeight/this.j2Ds.scene.height},t.prototype.reset=function(){return this.enabled?void 0:!1},t.prototype.cancel=function(){return this.enabled?void 0:!1},t.prototype.isTapDown=function(){},t.prototype.isTapPress=function(){},t.prototype.isTapUp=function(){},t.prototype.getTouch=function(){},t.prototype.onTouchEvent=function(){return this.enabled?void 0:!1},t.prototype.init=function(){var e=this;e.enabled=!0,e.j2Ds.events.addEvent("engine:before",function(){e.upd()}),e.j2Ds.events.addEvent("engine:after",function(){e.reset()}),e.j2Ds.events.addEvent("dom:loaded",function(){})},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.TouchHandler=t),void 0!==global.j2Ds&&(global.modules.io.TouchHandler=t),t}),function(e,t){"function"==typeof define&&define.amd?define("core/Layers",[],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():t()}("undefined"!=typeof window?window:global,function(){"use strict";var e=function(e){this.j2Ds=e,this.layersList={}};return e.prototype.layer=function(e){return this.layersList[e]},e.prototype.add=function(e,t,o){if(this.layersList[e])return!1;var i={layerName:e};return o?i.canvas=this.j2Ds.dom.id(e):i.canvas=document.createElement("canvas"),i.canvas.style.position=this.j2Ds.scene.stylePosition,i.canvas.id=e,i.canvas.style.zIndex=1e3+t,i.canvas.style.left=this.j2Ds.scene.offsetLeft+"px",i.canvas.style.top=this.j2Ds.scene.offsetTop+"px",i.canvas.width=this.j2Ds.scene.width,i.canvas.height=this.j2Ds.scene.height,i.width=this.j2Ds.scene.width,i.height=this.j2Ds.scene.height,i.context=i.canvas.getContext("2d"),i.context.shadowColor="rgba(0,0,0,0)",i.alpha=1,i.angle=0,i.visible=1,i.onContext=function(e){e(this.context)},i.fill=function(e){this.context.fillStyle=e,this.context.fillRect(0,0,this.width,this.height)},i.setAlpha=function(e){this.canvas.style.opacity=e,this.alpha=e},i.getAlpha=function(){return this.alpha},i.setVisible=function(e){e?(this.canvas.style.display="block",this.visible=!0):(this.canvas.style.display="none",this.visible=!1)},i.isVisible=function(){return this.visible},i.setIndex=function(e){this.canvas.style.zIndex=1e3+e},i.clear=function(){this.context.clearRect(0,0,this.width,this.height)},i.clearNode=function(e){var t=this;e.isLookScene()&&this.context.clearRect(e.pos.x-t.j2Ds.scene.view.pos.x,e.pos.y-t.j2Ds.scene.view.pos.y,e.size.x,e.size.y)},i.setContextSettings=function(e){for(var t in e)"undefined"!=typeof this.context[t]&&(this.context[t]=e[t])},i.clearRect=function(e,t){var o=this;this.context.clearRect(e.x-o.j2Ds.scene.view.pos.x,e.y-o.j2Ds.scene.view.pos.y,t.x,t.y)},this.layersList[e]=i,o||this.j2Ds.dom.attach(this.layersList[e].canvas),i},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.Layers=e),void 0!==global.j2Ds&&(global.modules.core.Layers=e),e}),function(e,t){"function"==typeof define&&define.amd?define("core/Scene",["nodes/BaseNode","nodes/CircleNode","nodes/LineNode","nodes/RectNode","nodes/SpriteNode","nodes/TextNode","utils/TextureUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("nodes/BaseNode"),require("nodes/CircleNode"),require("nodes/LineNode"),require("nodes/RectNode"),require("nodes/SpriteNode"),require("nodes/TextNode"),require("utils/TextureUtil")):t(e.modules.nodes.BaseNode,e.modules.nodes.CircleNode,e.modules.nodes.LineNode,e.modules.nodes.RectNode,e.modules.nodes.SpriteNode,e.modules.nodes.TextNode,e.modules.utils.TextureUtil)}("undefined"!=typeof window?window:global,function(e,t,o,i,s,n,r){"use strict";var a=function(e){e=this.j2Ds=e,this.nodes=[],this.layerName="sceneNode",this.stylePosition="fixed",this.layers=e.layers,this.view=!1,this.gameStateName=!1,this.canFullScreen=!0,this.texture=new r(this.j2Ds)};return a.prototype.setView=function(e){this.view=this.j2Ds.viewManager.views[e]},a.prototype.getView=function(){return this.view},a.prototype.setAutoDraw=function(e){var t=this;e?t.j2Ds.events.addEvent("engine:after",function(){t.drawAllNodes()},"autoDraw"):t.j2Ds.events.destroyEvent("engine:after","autoDraw")},a.prototype.setAutoClear=function(e){var t=this;e?t.j2Ds.events.addEvent("engine:before",function(){t.clear()},"autoClear"):t.j2Ds.events.destroyEvent("engine:before","autoClear")},a.prototype.setGameState=function(e){this.j2Ds.gameStates.states[e].start&&this.j2Ds.gameStates.states[e].start(),this.j2Ds.gameStates.states[e].state&&this.j2Ds.setActiveEngine(this.j2Ds.gameStates.states[e].state),this.gameStateName=e,this.j2Ds.events.onEvent("scene:changedGameState")},a.prototype.getGameState=function(){return this.gameStateName},a.prototype.start=function(e,t){this.j2Ds.events.onEvent("scene:beforeStart"),this.j2Ds.gameStates.states[e].start&&this.j2Ds.gameStates.states[e].start(),this.j2Ds.gameStates.states[e]&&this.j2Ds.start(this.j2Ds.gameStates.states[e].state,t),this.j2Ds.events.onEvent("scene:afterStart")},a.prototype.fullScreen=function(e){if(this.canFullScreen){var t,o=document.createElement("canvas"),i=o.getContext("2d");if(e){this.origWidth=this.width,this.origHeight=this.height,this.width=this.j2Ds.getDeviceManager().width,this.height=this.j2Ds.getDeviceManager().height;for(var s in this.j2Ds.layers.layersList)t=this.j2Ds.layers.layersList[s],o.width=t.width,o.height=t.height,i.drawImage(t.canvas,0,0),t.canvas.width=this.width,t.canvas.height=this.height,t.width=this.width,t.height=this.height,this.offsetWidth=this.width,this.offsetHeight=this.height,t.context.drawImage(o,0,0,t.width,t.height)}else{this.width=this.origWidth,this.height=this.origHeight;for(var s in this.j2Ds.layers.layersList)t=this.j2Ds.layers.layersList[s],t.width=this.origWidth,t.height=this.origHeight,t.canvas.width=this.origWidth,t.canvas.height=this.origHeight,this.offsetWidth=this.origWidth,this.offsetHeight=this.origHeight}}},a.prototype.fullScale=function(e){if(this.canFullScreen){var t;if(e)for(var o in this.j2Ds.layers.layersList)t=this.j2Ds.layers.layersList[o].canvas,t.style.width=this.j2Ds.getDeviceManager().width+"px",t.style.height=this.j2Ds.getDeviceManager().height+"px",this.offsetWidth=this.j2Ds.getDeviceManager().width,this.offsetHeight=this.j2Ds.getDeviceManager().height;else for(var o in this.j2Ds.layers.layersList)t=this.j2Ds.layers.layersList[o].canvas,t.style.width=this.width+"px",t.style.height=this.height+"px",this.offsetWidth=this.width,this.offsetHeight=this.height}},a.prototype.clear=function(){this.getLayer().clear()},a.prototype.getLayer=function(){return this.j2Ds.layers.layer(this.layerName)},a.prototype.drawAllNodes=function(){for(var e=0,t=this.nodes.length;t>e;e+=1)this.nodes[e].draw&&this.nodes[e].draw()},a.prototype.init=function(e,t,o){var i=this;i.j2Ds.events.onEvent("scene:beforeInit"),i.width=e,i.height=t,i.origWidth=e,i.origHeight=t,i.offsetWidth=e,i.offsetHeight=t,i.offsetLeft=0,i.offsetTop=0,i.j2Ds.canDeactivate=0!=o,i.j2Ds.layers.add("sceneNode",0),i.context=i.j2Ds.layers.layer(i.layerName).context,i.canvas=i.j2Ds.layers.layer(i.layerName).canvas,i.visible=!0,i.cancelClear=!1,i.view=i.j2Ds.viewManager.add("sceneView"),i.j2Ds.events.onEvent("scene:afterInit"),i.j2Ds.window.onload=function(){i.j2Ds.window.focus(),i.j2Ds.window.onblur=function(){0==i.j2Ds.stopAll&&(i.j2Ds.stopEngine(),i.j2Ds.events.onEvent("scene:deactivate"))},i.j2Ds.window.onfocus=function(){1==i.j2Ds.stopAll&&(i.j2Ds.runEngine(i.j2Ds),i.j2Ds.events.onEvent("scene:activate"))};for(var e in i.j2Ds.layers.layersList)i.j2Ds.dom.attach(i.j2Ds.layers.layer(e).canvas);i.j2Ds.ready=!0,i.j2Ds.events.onEvent("dom:loaded")}},a.prototype.initCanvas=function(e,t){var o=this;o.canFullScreen=!1,o.layerName=e,o.j2Ds.events.onEvent("scene:beforeInit"),o.width=parseInt(o.j2Ds.dom.id(e).width),o.height=parseInt(o.j2Ds.dom.id(e).height),o.origWidth=o.width,o.origHeight=o.height,o.offsetWidth=parseInt(o.j2Ds.dom.id(e).offsetWidth),o.offsetHeight=parseInt(o.j2Ds.dom.id(e).offsetHeight),o.offsetLeft=parseInt(o.j2Ds.dom.id(e).offsetLeft),o.offsetTop=parseInt(o.j2Ds.dom.id(e).offsetTop),o.stylePosition="fixed"==o.j2Ds.dom.id(e).style.position?"fixed":"absolute",o.j2Ds.canDeactivate=0!=t,o.j2Ds.layers.add(e,0,1),o.context=o.j2Ds.layers.layer(e).context,o.canvas=o.j2Ds.layers.layer(e).canvas,o.visible=!0,o.cancelClear=!1,o.view=o.j2Ds.viewManager.add("sceneView"),o.j2Ds.events.onEvent("scene:afterInit"),o.j2Ds.window.onload=function(){o.j2Ds.window.focus(),o.j2Ds.window.onblur=function(){0==o.j2Ds.stopAll&&(o.j2Ds.stopEngine(),o.j2Ds.events.onEvent("scene:deactivate"))},o.j2Ds.window.onfocus=function(){1==o.j2Ds.stopAll&&(o.j2Ds.runEngine(o.j2Ds),o.j2Ds.events.onEvent("scene:activate"))};for(var e in o.j2Ds.layers.layersList)o.j2Ds.dom.attach(o.j2Ds.layers.layer(e).canvas);o.j2Ds.ready=!0,o.j2Ds.events.onEvent("dom:loaded")}},a.prototype.addBaseNode=function(t,o){return new e(this.j2Ds,t,o)},a.prototype.addCircleNode=function(e,o,i){return new t(this.j2Ds,e,o,i)},a.prototype.addLineNode=function(e,t,i,s,n,r,a){return new o(this.j2Ds,e,t,i,s,n,r,a)},a.prototype.addRectNode=function(e,t,o){return new i(this.j2Ds,e,t,o)},a.prototype.addSpriteNode=function(e,t,o){return new s(this.j2Ds,e,t,o)},a.prototype.addTextNode=function(e,t,o,i,s,r,a){return new n(this.j2Ds,e,t,o,i,s,r,a)},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.Scene=a),void 0!==global.j2Ds&&(global.modules.core.Scene=a),a}),function(e,t){"function"==typeof define&&define.amd?define("j2Ds",["core/Dom","core/Gui","core/Events","core/Layers","core/Scene","io/AudioHandler","io/InputHandler","io/TouchHandler","managers/DeviceManager","managers/ErrorManager","managers/FpsManager","managers/ResourceManager","managers/StorageManager","managers/TimeManager","managers/TriggerManager","managers/ViewManager","utils/MathUtil","utils/TextureUtil"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("core/Dom"),require("core/Gui"),require("core/Events"),require("core/Layers"),require("core/Scene"),require("io/AudioHandler"),require("io/InputHandler"),require("io/TouchHandler"),require("managers/DeviceManager"),require("managers/ErrorManager"),require("managers/FpsManager"),require("managers/ResourceManager"),require("managers/StorageManager"),require("managers/TimeManager"),require("managers/TriggerManager"),require("managers/ViewManager"),require("utils/MathUtil"),require("utils/TextureUtil")):t(e.modules.core.Dom,e.modules.core.Gui,e.modules.core.Events,e.modules.core.Layers,e.modules.core.Scene,e.modules.io.AudioHandler,e.modules.io.InputHandler,e.modules.io.TouchHandler,e.modules.managers.DeviceManager,e.modules.managers.ErrorManager,e.modules.managers.FpsManager,e.modules.managers.ResourceManager,e.modules.managers.StorageManager,e.modules.managers.TimeManager,e.modules.managers.TriggerManager,e.modules.managers.ViewManager,e.modules.utils.MathUtil,e.modules.utils.TextureUtil)}("undefined"!=typeof window?window:global,function(e,t,o,i,s,n,r,a,h,l,d,u,c,p,f,y,m){"use strict";var g=60,v=function(){this.vector={},this.math={},this.dom={},this.now=Date.now(),this.dt=0,this.stopAll=0,this.frameLimit=60,this.sceneStartTime=0,this.sceneSkipTime=0,this.engine=function(){this.errorManager.show("Не инициализировано ни одно игровое состояние","red"),this.stopEngine()},this.ready=!1,this.window=window,this.canDeactivate=!0,this.getInfo=function(){return{name:"j2Ds",version:"0.6.3",git:"https://github.com/SkanerSoft/j2Ds",site:"http://j2ds.ru",description:"HTML5 2D Game Engine",author:"Skaner"}},this.getFPSManager=function(){return this.fpsManager.init(),this.fpsManager},this.getSceneManager=function(){return this.scene},this.getLayerManager=function(){return this.layers},this.getTextureManager=function(){return this.scene.texture},this.getAudioManager=function(){return this.audio.init(),this.audio},this.getPaintManager=function(){return this.paint},this.getIO=function(){return this.input.init(),this.input},this.getTouchIO=function(){return this.touch.init(),this.touch},this.getDOMManager=function(){return this.dom},this.getTriggerManager=function(){return this.trigger.init(),this.trigger},this.getMathManager=function(){return m},this.getGameStateManager=function(){return this.gameStates},this.getViewManager=function(){return this.viewManager},this.getDeviceManager=function(){return this.deviceManager},this.getErrorManager=function(){return this.errorManager.init(),this.errorManager},this.getTimeManager=function(){return this.timeManager},this.getResourceManager=function(){return this.resources},this.setWindow=function(e){this.window=e?e:window},this.setFrameLimit=function(e){this.frameLimit=e>0&&60>=e?e:60,g=this.frameLimit},this.setActiveEngine=function(e){this.engine="function"==typeof e?e:this.errorManager.show('Error in "GameStateManager"')},this.events=new o(this),this.dom=new e(this),this.gui=new t(this),this.resources=new u(this),this.trigger=new f(this),this.timeManager=new p(this),this.deviceManager=h(),this.errorManager=new l(this),this.fpsManager=new d(this),this.input=new r(this),this.layers=new i(this),this.viewManager=new y(this),this.scene=new s(this),this.createLocal=function(e){new c(this,e)}};v.prototype.gameStates={states:{},add:function(e,t,o,i){var s={};s.state=t,s.start=o||!1,s.end=i||!1,this.states[e]=s}},v.prototype.start=function(e,t){this.setActiveEngine(e),this.frameLimit=t||60,this.sceneSkipTime=1e3/this.frameLimit,this.lastTime=Date.now(),this.dt=0,this.sceneStartTime=this.lastTime,this.gameEngine(this)},v.prototype.gameEngine=function(e){e.now=Date.now(),setTimeout(function(){if(!e.stopAll){e.dt=(e.now-e.lastTime)/100,e.sceneStartTime=e.now,e.dt>e.sceneSkipTime/2&&(e.dt=0),e.events.onEvent("engine:before");try{e.engine()}catch(t){e.errorManager.showError(t)}e.events.onEvent("engine:after"),e.lastTime=e.now,w(function(){e.gameEngine(e)})}},e.frameLimit<60?e.sceneSkipTime:0)};var w=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/g)}}();return v.prototype.stopEngine=function(){this.canDeactivate&&(this.stopAll=!0)},v.prototype.runEngine=function(e){e=e||this,e.canDeactivate&&e.stopAll&&(e.stopAll=!1,w(function(){e.gameEngine(e)}))},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.j2Ds=v),void 0!==global.j2Ds&&(global.modules.core.j2Ds=v),void 0!==global.j2Ds&&(global.j2Ds=new v),v}); //# sourceMappingURL=j2ds.min.map diff --git a/dist/js/j2ds.min.map b/dist/js/j2ds.min.map index a303067..2a7e3ad 100644 --- a/dist/js/j2ds.min.map +++ b/dist/js/j2ds.min.map @@ -1 +1 @@ -{"version":3,"sources":["j2ds.js","MathUtil.js","TextureUtil.js","Dom.js","Gui.js","Events.js","BaseNode.js","CircleNode.js","LineNode.js","RectNode.js","SpriteNode.js","TextNode.js","DeviceManager.js","ErrorManager.js","FpsManager.js","ResourceManager.js","StorageManager.js","TimeManager.js","TriggerManager.js","ViewManager.js","AudioHandler.js","InputHandler.js","TouchHandler.js","Layers.js","Scene.js","j2Ds.js"],"names":["root","factory","define","amd","module","exports","window","global","MathUtil","v2f","x","y","v2i","toInt","number","rndColor","min","max","opacity","random","omitZero","Math","floor","rad","num","PI","undefined","j2Ds","modules","utils","TextureUtil","this","prototype","createImageMap","_w","_h","callback","textureUtil","resources","add","image","img","loaded","width","height","document","createElement","context","getContext","getAnimation","sourceX","sourceY","sourceW","sourceH","frameCount","imageMap","ok","w","h","loadImageMap","path","crossOrigin","src","addEventListener","o","templates","ellipse","size","color","fillRect","fillStyle","strokeRect","lineWidth","strokeStyle","gradientL","colors","isHorizontal","gradient","createLinearGradient","step","length","i","j","addColorStop","gradientR","pos1","r1","pos2","r2","createRadialGradient","Dom","id","_id","getElementById","name","getElementsByName","tag","_parent","finder","getElementsByTagName","goURL","_url","location","href","reloadURL","attach","dom","events","addEvent","appendChild","injectJavaScript","_code","code","toString","replace","callJava","send","_path","_func","ajax","XMLHttpRequest","open","onreadystatechange","readyState","status","responseText","core","Gui","nodes","Events","scene:deactivate","scene:activate","scene:beforeInit","scene:afterInit","scene:beforeStart","scene:afterStart","engine:before","engine:after","scene:changedGameState","writeMode:keyPress","dom:loaded","eventType","push","now","ready","onEvent","destroyEvent","len","splice","args","err","errorManager","showError","require","BaseNode","_j2Ds","pos","visible","alpha","parent","angle","layer","scene","box","offset","resizeBox","setLayer","layers","getLayer","setVisible","isVisible","setAlpha","getAlpha","moveTo","to","t","move","getPosition","setPosition","ceil","setSize","getSize","setParent","getDistance","sqrt","pow","getDistanceXY","abs","isIntersect","x1","x2","y1","y2","isCollision","result","isLookScene","view","turn","setRotation","getRotation","isOutScene","vector","all","moveDir","speed","cos","sin","drawBox","beginPath","rect","stroke","CircleNode","radius","call","Object","create","constructor","draw","tmpAlpha","globalAlpha","arc","fill","LineNode","points","scale","cFill","lineTo","RectNode","save","translate","rotate","restore","SpriteNode","animation","tmpSpeed","frame","flip","setFlip","drawFrame","show","drawImage","setAnimation","TextNode","text","sizePx","family","colorL","vAlign","hAlign","font","fullText","maxWidth","lines","split","measureText","drawSimpleText","textAlign","textBaseline","strokeText","fillText","getText","setText","DeviceManager","parseInt","documentElement","clientWidth","screen","clientHeight","managers","ErrorManager","mode","enabled","init","_true","runBtn","innerHTML","style","padding","align","position","zIndex","left","top","getDeviceManager","fontSize","backgroundColor","cursor","onmousedown","e","stopPropagation","onclick","runEngine","logListener","elems","pauseBtn","stopEngine","reloadBtn","onerror","string","console","log","setMode","debug","stack","match","file","line","decodeURI","errMess","message","domId","count","execLine","lightSyntax","_type","FpsManager","fps","frameLimit","tmp_of_fps","tmp_of_time","Date","fpsManager","update","getFPS","ResourceManager","added","failed","fail","isLoaded","getProgress","StorageManager","ls","localStorage","alert","saveNode","setItem","JSON","stringify","load","getItem","is","value","loadNode","parse","TimeManager","times","insert","get","TriggerManager","triggers","triggerManager","trigger","command","state","last","run","mSec","job","loop","reset","ViewManager","views","viewManager","viewport","focusNode","AudioHandler","audios","audioHandler","deactivate","activate","files","vol","audio","source","volume","sound","domEl","lock","onePlay","explicitOriginalTarget","currentSrc","setLock","play","unlock","currentTime","pause","stop","setVolume","getVolume","getState","getPlayPosition","snd","io","InputHandler","screenPos","keyDown","keyPress","keyPressed","keyUp","keyUped","mouseDown","mousePress","mousePressed","mouseUp","mouseUpped","mouseWheel","canceled","body","anyKey","anyMouse","writeMode","displayCursor","mKey","LEFT","MIDDLE","RIGHT","jKey","UP","DOWN","SPACE","CTRL","SHIFT","ALT","ESC","ENTER","MINUS","PLUS","CAPS_LOCK","BACKSPACE","TAB","Q","W","E","R","T","Y","U","I","O","P","A","S","D","F","G","H","J","K","L","Z","X","V","B","N","M","0","1","2","3","4","5","6","7","8","C","9","NUM_0","NUM_1","NUM_2","NUM_3","NUM_4","NUM_5","NUM_6","NUM_7","NUM_8","NUM_9","NUM_MINUS","NUM_PLUS","NUM_LOCK","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","keyList","isKeyDown","isKeyPress","isKeyUp","getScreenPosition","setWriteMode","isWriteMode","keyEvent","type","keyCode","preventDefault","char","which","charCode","String","fromCharCode","cancel","onNode","upd","dX","offsetWidth","dY","offsetHeight","onMove","offsetLeft","pageX","offsetTop","pageY","isMouseDown","isMousePress","isMouseUp","isMouseWheel","onMouseWheel","wheelDelta","detail","onMouseEvent","button","mouseUped","focus","setCursorImage","curImg","input","oncontextmenu","onselectstart","ondragstart","onmouseup","onmousemove","onkeydown","onkeyup","onkeypress","onmousewheel","TouchHandler","touchs","tapDown","tapPress","tapUp","isTapDown","isTapPress","isTapUp","getTouch","onTouchEvent","touchHandler","Layers","layersList","index","notDOM","layerName","canvas","stylePosition","shadowColor","onContext","display","setIndex","clear","clearRect","clearNode","node","setContextSettings","settings","Scene","gameStateName","canFullScreen","texture","setView","getView","setAutoDraw","toggle","drawAllNodes","setAutoClear","setGameState","gameStates","states","start","setActiveEngine","getGameState","fullScreen","tmpCanvas","tmpContext","origWidth","origHeight","list","fullScale","_canDeactivate","canDeactivate","cancelClear","onload","onblur","stopAll","onfocus","initCanvas","addBaseNode","addCircleNode","addLineNode","addRectNode","addSpriteNode","addTextNode","DOM","GUI","FPSManager","j2DsEngine","math","dt","sceneStartTime","sceneSkipTime","engine","getInfo","version","git","site","description","author","getFPSManager","getSceneManager","getLayerManager","getTextureManager","getAudioManager","getPaintManager","paint","getIO","getTouchIO","touch","getDOMManager","getTriggerManager","getMathManager","getGameStateManager","getViewManager","deviceManager","getErrorManager","getTimeManager","timeManager","getResourceManager","setWindow","_window","setFrameLimit","gui","createLocal","_state","end","lastTime","gameEngine","setTimeout","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CCbA,SAAAA,EAAAC,GACA,kBAAAC,SAAAA,OAAAC,IACAD,OAAA,oBAAAD,GACA,gBAAAG,SAAA,gBAAAA,QAAAC,QACAD,OAAAC,QAAAJ,IAEAA,KAEA,mBAAAK,QAAAA,OAAAC,OAAA,WACA,YAEA,IAAAC,GAAA,YAoCA,OAjCAA,GAAAC,IAAA,SAAAC,EAAAC,GACA,OAAAD,EAAAA,EAAAC,EAAAA,IAGAH,EAAAI,IAAA,SAAAF,EAAAC,GACA,OAAAD,EAAAA,GAAA,EAAAC,EAAAA,GAAA,IAGAH,EAAAK,MAAA,SAAAC,GACA,MAAAA,IAAA,GAGAN,EAAAO,SAAA,SAAAC,EAAAC,EAAAC,GACA,MAAA,QACAV,EAAAW,OAAAH,EAAAC,GAAA,KACAT,EAAAW,OAAAH,EAAAC,GAAA,KACAT,EAAAW,OAAAH,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engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('utils/MathUtil', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var MathUtil = function () {\r\n };\r\n\r\n MathUtil.v2f = function (x, y) {\r\n return {x: x, y: y};\r\n };\r\n\r\n MathUtil.v2i = function (x, y) {\r\n return {x: (x >> 0), y: (y >> 0)};\r\n };\r\n\r\n MathUtil.toInt = function (number) {\r\n return number >> 0;\r\n };\r\n\r\n MathUtil.rndColor = function (min, max, opacity) {\r\n return 'rgba('\r\n + MathUtil.random(min, max) + ', '\r\n + MathUtil.random(min, max) + ', '\r\n + MathUtil.random(min, max) + ', '\r\n + opacity + ')';\r\n };\r\n\r\n MathUtil.random = function (min, max, omitZero) {\r\n var random = (Math.floor(Math.random() * (max - min + 1) + min));\r\n return (omitZero && random == 0)\r\n ? MathUtil.random(min, max, omitZero)\r\n : random;\r\n };\r\n\r\n MathUtil.rad = function (num) {\r\n return num * (Math.PI / 180);\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.MathUtil = MathUtil;\r\n if (global.j2Ds !== undefined) global.modules.utils.MathUtil = MathUtil;\r\n return MathUtil;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('utils/TextureUtil', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var TextureUtil = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n };\r\n\r\n TextureUtil.prototype.createImageMap = function (_w, _h, callback) {\r\n var textureUtil = this;\r\n textureUtil.j2Ds.resources.add();\r\n var image = {\r\n img: null,\r\n loaded: false,\r\n width: _w,\r\n height: _h\r\n };\r\n\r\n image.img = document.createElement('canvas');\r\n image.context = image.img.getContext('2d');\r\n image.img.width = image.width;\r\n image.img.height = image.height;\r\n\r\n callback(image.context);\r\n image.loaded = true;\r\n\r\n /* Функции */\r\n image.getAnimation = function (sourceX, sourceY, sourceW, sourceH, frameCount) {\r\n return {\r\n imageMap: this,\r\n sourceX: sourceX,\r\n sourceY: sourceY,\r\n sourceW: sourceW,\r\n sourceH: sourceH,\r\n frameCount: frameCount - 1\r\n };\r\n };\r\n\r\n textureUtil.j2Ds.resources.ok('createImageMap_' + w + 'x' + h);\r\n\r\n return image;\r\n };\r\n\r\n TextureUtil.prototype.loadImageMap = function (path) {\r\n var textureUtil = this;\r\n textureUtil.j2Ds.resources.add();\r\n var image = {\r\n img: null,\r\n width: 0,\r\n height: 0,\r\n loaded: false\r\n };\r\n\r\n image.img = document.createElement('img');\r\n image.crossOrigin = 'anonymous';\r\n image.img.src = path;\r\n\r\n image.img.addEventListener('load', function () {\r\n image.width = o.img.width;\r\n image.height = o.img.height;\r\n image.loaded = true;\r\n textureUtil.j2Ds.resources.ok(path);\r\n });\r\n\r\n image.img.addEventListener('error', function () {\r\n image.width = 0;\r\n image.height = 0;\r\n image.loaded = false;\r\n //textureUtil.j2Ds.resources.fail(path);\r\n });\r\n /* Свойства */\r\n\r\n /* Функции */\r\n image.getAnimation = function (sourceX, sourceY, sourceW, sourceH, frameCount) {\r\n return {\r\n imageMap: this,\r\n sourceX: sourceX,\r\n sourceY: sourceY,\r\n sourceW: sourceW,\r\n sourceH: sourceH,\r\n frameCount: frameCount - 1\r\n };\r\n };\r\n\r\n return image;\r\n };\r\n\r\n /* -------------------- */\r\n\r\n TextureUtil.prototype.templates = {\r\n ellipse: function (context, size, color) { // TODO??\r\n },\r\n fillRect: function (context, size, color) {\r\n context.fillStyle = color;\r\n context.fillRect(0, 0, size.x, size.y);\r\n },\r\n strokeRect: function (context, size, color, lineWidth) {\r\n context.strokeStyle = color;\r\n context.lineWidth = lineWidth;\r\n context.strokeRect(0, 0, size.x, size.y);\r\n },\r\n gradientL: function (context, size, colors, isHorizontal) {\r\n var gradient = context.createLinearGradient(0, 0, size.x, 0);\r\n var step = 1 / colors.length;\r\n if (!isHorizontal) {\r\n gradient = context.createLinearGradient(0, 0, 0, size.y);\r\n }\r\n for (var i = step / 2, j = 0; j < colors.length; j += 1, i += step) {\r\n gradient.addColorStop(i, colors[j]);\r\n }\r\n context.fillStyle = gradient;\r\n context.fillRect(0, 0, size.x, size.y);\r\n },\r\n gradientR: function (context, size, pos1, r1, pos2, r2, colors) {\r\n var gradient = context.createRadialGradient(pos1.x, pos1.y, r1, pos2.x, pos2.y, r2);\r\n var step = 1 / colors.length;\r\n for (var i = step / 2, j = 0; j < colors.length; j += 1, i += step) {\r\n gradient.addColorStop(i, colors[j]);\r\n }\r\n context.fillStyle = gradient;\r\n context.fillRect(0, 0, size.x, size.y);\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TextureUtil = TextureUtil;\r\n if (global.j2Ds !== undefined) global.modules.utils.TextureUtil = TextureUtil;\r\n return TextureUtil;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Dom', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n /*----------- DOM ---------------*/\r\n var Dom = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n };\r\n\r\n Dom.prototype.id = function (_id) {\r\n return document.getElementById(_id);\r\n };\r\n\r\n Dom.prototype.name = function (_id) {\r\n return document.getElementsByName(_id)[0];\r\n };\r\n\r\n Dom.prototype.tag = function (_id, _parent) {\r\n var finder = _parent || document;\r\n return finder.getElementsByTagName(_id);\r\n };\r\n\r\n Dom.prototype.goURL = function (_url) {\r\n document.location.href = _url;\r\n };\r\n\r\n Dom.prototype.reloadURL = function () {\r\n document.location.href = document.location.href;\r\n };\r\n\r\n Dom.prototype.attach = function (_id, _parent) {\r\n var dom = this;\r\n this.j2Ds.events.addEvent('dom:loaded', function (_parent) {\r\n if (!_parent) {\r\n dom.tag('body')[0].appendChild(_id);\r\n } else {\r\n dom.id(_parent).appendChild(_id);\r\n }\r\n });\r\n };\r\n\r\n Dom.prototype.injectJavaScript = function (_code) {\r\n var code = _code.toString();\r\n code = code.replace(/[\\n\\r\\t]/g, ';');\r\n document.location.href = 'javascript: var injectFunction = (function() {setTimeout(' + code + ', 0);}); injectFunction();';\r\n };\r\n\r\n Dom.prototype.callJava = function (_code) {\r\n document.location.href = 'javacall:' + _code;\r\n };\r\n\r\n Dom.prototype.send = function (_path, _func) {\r\n var ajax = new XMLHttpRequest();\r\n ajax.open('GET', _path, true);\r\n ajax.onreadystatechange = function () {\r\n if (ajax.readyState == 4) {\r\n if (ajax.status == 200) {\r\n _func(ajax.responseText);\r\n }\r\n }\r\n };\r\n ajax.send(null);\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Dom = Dom;\r\n if (global.j2Ds !== undefined) global.modules.core.Dom = Dom;\r\n return Dom;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Gui', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n /*----------- GUI ---------------*/\r\n var Gui = function () {\r\n this.nodes = {};\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Gui = Gui;\r\n if (global.j2Ds !== undefined) global.modules.core.Gui = Gui;\r\n return Gui;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Events', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var Events = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.events = {\r\n 'scene:deactivate': [],\r\n 'scene:activate': [],\r\n\r\n 'scene:beforeInit': [],\r\n 'scene:afterInit': [],\r\n 'scene:beforeStart': [],\r\n 'scene:afterStart': [],\r\n\r\n 'engine:before': [],\r\n 'engine:after': [],\r\n\r\n 'scene:changedGameState': [],\r\n\r\n 'writeMode:keyPress': [],\r\n\r\n 'dom:loaded': []\r\n };\r\n };\r\n\r\n\r\n Events.prototype.addEvent = function (eventType, callback, id) {\r\n this.events[eventType].push({\r\n id: id || this.j2Ds.now,\r\n callback: callback\r\n });\r\n if (this.j2Ds.ready && eventType == 'dom:loaded') {\r\n this.onEvent('dom:loaded');\r\n return true;\r\n }\r\n };\r\n\r\n Events.prototype.destroyEvent = function (eventType, id) {\r\n var events = this;\r\n for (var i = 0, len = events.events[eventType].length; i < len; i += 1) {\r\n if (events.events[eventType][i]['id'] == id) {\r\n events.events[eventType].splice(i, 1);\r\n }\r\n }\r\n };\r\n\r\n Events.prototype.onEvent = function (eventType, args) {\r\n var events = this;\r\n for (var i = 0, len = events.events[eventType].length; i < len; i += 1) {\r\n if (events.events[eventType]) {\r\n try {\r\n events.events[eventType][i]['callback'](args || '');\r\n } catch (err) {\r\n events.j2Ds.errorManager.showError(err);\r\n }\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Events = Events;\r\n if (global.j2Ds !== undefined) global.modules.core.Events = Events;\r\n return Events;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/BaseNode', ['utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var BaseNode = function (_j2Ds, pos, size) {\r\n j2Ds = _j2Ds;\r\n this.visible = true;\r\n this.alpha = 1;\r\n this.pos = pos;\r\n this.size = size;\r\n this.parent = false;\r\n this.angle = 0;\r\n this.layer = j2Ds.scene;\r\n this.box = {\r\n offset: {\r\n x: 0,\r\n y: 0\r\n },\r\n size: {\r\n x: 0,\r\n y: 0\r\n }\r\n };\r\n j2Ds.scene.nodes.push(this);\r\n };\r\n\r\n BaseNode.prototype.resizeBox = function (offset, size) {\r\n this.box.offset = offset;\r\n this.box.size = size;\r\n };\r\n\r\n BaseNode.prototype.setLayer = function (layer) {\r\n this.layer = layer ? j2Ds.layers.layer(layer) : j2Ds.scene;\r\n };\r\n\r\n BaseNode.prototype.getLayer = function () {\r\n return this.layer;\r\n };\r\n\r\n BaseNode.prototype.setVisible = function (visible) {\r\n this.visible = !!visible;\r\n };\r\n\r\n BaseNode.prototype.isVisible = function () {\r\n return this.visible;\r\n };\r\n\r\n BaseNode.prototype.setAlpha = function (alpha) {\r\n if (alpha < 0) alpha = 0;\r\n if (alpha > 1) alpha = 1;\r\n this.alpha = alpha;\r\n };\r\n\r\n BaseNode.prototype.getAlpha = function () {\r\n return this.alpha;\r\n };\r\n\r\n BaseNode.prototype.moveTo = function (to, t) {\r\n t = t ? t : 1;\r\n this.move(MathUtil.v2f(\r\n ((to.x - this.getPosition().x) / t),\r\n ((to.y - this.getPosition().y) / t)\r\n ));\r\n };\r\n\r\n BaseNode.prototype.setPosition = function (pos) {\r\n if (pos) {\r\n this.pos = MathUtil.v2f(pos.x - Math.ceil(this.size.x / 2), pos.y - Math.ceil(this.size.y / 2));\r\n } else {\r\n return this.pos;\r\n }\r\n };\r\n\r\n BaseNode.prototype.move = function (pos) {\r\n this.pos.x += pos.x;\r\n this.pos.y += pos.y;\r\n };\r\n\r\n BaseNode.prototype.getPosition = function () {\r\n return MathUtil.v2f(this.pos.x + Math.ceil(this.size.x / 2), this.pos.y + Math.ceil(this.size.y / 2));\r\n };\r\n\r\n BaseNode.prototype.setSize = function (size) {\r\n if (size) {\r\n this.size = size;\r\n } else {\r\n return this.size;\r\n }\r\n };\r\n\r\n BaseNode.prototype.getSize = function () {\r\n return this.size;\r\n };\r\n\r\n BaseNode.prototype.setParent = function (id) {\r\n this.parent = id;\r\n };\r\n\r\n BaseNode.prototype.getDistance = function (id) {\r\n return Math.ceil(Math.sqrt(\r\n Math.pow(id.getPosition().x - this.getPosition().x, 2) +\r\n Math.pow(id.getPosition().y - this.getPosition().y, 2)\r\n )\r\n );\r\n };\r\n\r\n BaseNode.prototype.getDistanceXY = function (id) {\r\n return MathUtil.v2f(Math.abs(id.getPosition().x - this.getPosition().x), Math.abs(id.getPosition().y - this.getPosition().y));\r\n };\r\n\r\n BaseNode.prototype.isIntersect = function (id) {\r\n var pos = {\r\n x1: this.pos.x + this.box.offset.x,\r\n x2: id.pos.x + id.box.offset.x,\r\n y1: this.pos.y + this.box.offset.y,\r\n y2: id.pos.y + id.box.offset.y\r\n };\r\n\r\n var size = {\r\n x1: this.size.x + this.box.size.x,\r\n x2: id.size.x + id.box.size.x,\r\n y1: this.size.y + this.box.size.y,\r\n y2: id.size.y + id.box.size.y\r\n };\r\n\r\n return (\r\n (pos.y1 + size.y1 >= pos.y2) &&\r\n (pos.x1 + size.x1 >= pos.x2)\r\n ) && (\r\n (pos.x1 < pos.x2 + size.x2) &&\r\n (pos.y1 < pos.y2 + size.y2)\r\n );\r\n };\r\n\r\n BaseNode.prototype.isCollision = function (id) {\r\n var result = false;\r\n if (\r\n (this.getDistanceXY(id).x < (this.size.x / 2 + id.size.x / 2)) &&\r\n (this.getDistanceXY(id).y < (this.size.y / 2 + id.size.y / 2))\r\n ) {\r\n result = true;\r\n }\r\n return result;\r\n };\r\n\r\n BaseNode.prototype.isLookScene = function () {\r\n return (this.pos.x > j2Ds.scene.view.pos.x + j2Ds.scene.width || this.pos.x + this.size.x < j2Ds.scene.view.pos.x)\r\n || (this.pos.y > j2Ds.scene.view.pos.y + j2Ds.scene.height || this.pos.y + this.size.y < j2Ds.scene.view.pos.y);\r\n };\r\n\r\n BaseNode.prototype.turn = function (angle) {\r\n this.angle = (this.angle % 360);\r\n this.angle += angle;\r\n };\r\n\r\n BaseNode.prototype.setRotation = function (angle) {\r\n this.angle = angle % 360;\r\n };\r\n\r\n BaseNode.prototype.getRotation = function () {\r\n return this.angle;\r\n };\r\n\r\n BaseNode.prototype.isOutScene = function () {\r\n var vector = {};\r\n\r\n if (this.pos.x + this.size.x >= j2Ds.scene.view.pos.x + j2Ds.scene.width) {\r\n vector.x = 1;\r\n } else if (this.pos.x <= j2Ds.scene.view.pos.x) {\r\n vector.x = -1;\r\n } else {\r\n vector.x = 0;\r\n }\r\n\r\n if (this.pos.y + this.size.y >= j2Ds.scene.view.pos.y + j2Ds.scene.height) {\r\n vector.y = 1;\r\n } else if (this.pos.y <= j2Ds.scene.view.pos.y) {\r\n vector.y = -1;\r\n } else {\r\n vector.y = 0;\r\n }\r\n\r\n vector.all = (vector.x || vector.y);\r\n\r\n return vector;\r\n };\r\n\r\n BaseNode.prototype.moveDir = function (speed) {\r\n this.pos.x += speed * (Math.cos(MathUtil.rad(this.angle)));\r\n this.pos.y += speed * (Math.sin(MathUtil.rad(this.angle)));\r\n };\r\n\r\n BaseNode.prototype.drawBox = function () {\r\n var context = this.layer.context;\r\n context.lineWidth = 2;\r\n context.strokeStyle = 'black';\r\n\r\n context.beginPath();\r\n context.rect(\r\n this.pos.x - j2Ds.scene.view.pos.x,\r\n this.pos.y - j2Ds.scene.view.pos.y,\r\n this.size.x, this.size.y);\r\n context.stroke();\r\n\r\n context.strokeStyle = 'yellow';\r\n\r\n context.beginPath();\r\n context.rect(this.box.offset.x + this.pos.x - j2Ds.scene.view.pos.x, this.box.offset.y + this.pos.y - j2Ds.scene.view.pos.y,\r\n this.box.size.x + this.size.x, this.box.size.y + this.size.y);\r\n context.stroke();\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.BaseNode = BaseNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.BaseNode = BaseNode;\r\n return BaseNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/CircleNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var CircleNode = function (_j2Ds, pos, radius, color) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, MathUtil.v2f(radius * 2, radius * 2));\r\n\r\n /*Свойства*/\r\n this.color = color;\r\n this.radius = radius;\r\n };\r\n\r\n CircleNode.prototype = Object.create(BaseNode.prototype);\r\n CircleNode.prototype.constructor = CircleNode;\r\n\r\n CircleNode.prototype.draw = function () {\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n context.lineWidth = 0;\r\n context.fillStyle = this.color;\r\n\r\n context.beginPath();\r\n context.arc(this.pos.x - j2Ds.scene.view.pos.x + this.radius,\r\n this.pos.y - j2Ds.scene.view.pos.y + this.radius,\r\n this.radius, 0, 2 * Math.PI, true);\r\n context.stroke();\r\n context.fill();\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.CircleNode = CircleNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.CircleNode = CircleNode;\r\n return CircleNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/LineNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var LineNode = function (_j2Ds, pos, points, scale, color, width, fill, cFill) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, MathUtil.v2f(0, 0));\r\n\r\n /*Свойства*/\r\n this.color = color;\r\n this.points = points;\r\n this.fill = fill || false;\r\n this.scale = scale || 0;\r\n this.cFill = cFill;\r\n this.lineWidth = width;\r\n };\r\n\r\n LineNode.prototype = Object.create(BaseNode.prototype);\r\n LineNode.prototype.constructor = LineNode;\r\n\r\n LineNode.prototype.draw = function () {\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n context.strokeStyle = this.color;\r\n context.lineWidth = this.lineWidth;\r\n\r\n context.beginPath();\r\n context.moveTo(this.pos.x - j2Ds.scene.view.pos.x,\r\n this.pos.y - j2Ds.scene.view.pos.y);\r\n\r\n for (var i = 0, len = this.points.length; i < len; i += 1) {\r\n context.lineTo(\r\n this.pos.x + this.points[i][0] * this.scale - j2Ds.scene.view.pos.x,\r\n this.pos.y + this.points[i][1] * this.scale - j2Ds.scene.view.pos.y);\r\n }\r\n\r\n context.stroke();\r\n if (this.fill) {\r\n context.fillStyle = this.cFill;\r\n context.fill();\r\n }\r\n\r\n context.lineWidth = 0;\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.LineNode = LineNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.LineNode = LineNode;\r\n return LineNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/RectNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n /**\r\n * @param _j2Ds\r\n * @param pos\r\n * @param size\r\n * @param color\r\n * @constructor\r\n */\r\n var RectNode = function (_j2Ds, pos, size, color) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, size);\r\n\r\n this.color = color;\r\n };\r\n\r\n RectNode.prototype = Object.create(BaseNode.prototype);\r\n RectNode.prototype.constructor = RectNode;\r\n\r\n RectNode.prototype.draw = function () {\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n if (this.angle) {\r\n context.save();\r\n context.translate(this.getPosition().x - j2Ds.scene.view.pos.x, this.getPosition().y - j2Ds.scene.view.pos.y);\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.translate(-(this.getPosition().x - j2Ds.scene.view.pos.x), -(this.getPosition().y - j2Ds.scene.view.pos.y));\r\n }\r\n\r\n context.fillStyle = this.color;\r\n context.lineWidth = 0;\r\n\r\n context.fillRect(\r\n this.pos.x - j2Ds.scene.view.pos.x,\r\n this.pos.y - j2Ds.scene.view.pos.y,\r\n this.size.x, this.size.y);\r\n\r\n if (this.angle) {\r\n context.restore();\r\n }\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.RectNode = RectNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.RectNode = RectNode;\r\n return RectNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/SpriteNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var SpriteNode = function (_j2Ds, pos, size, animation) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, size);\r\n\r\n this.tmpSpeed = 0;\r\n this.frame = 0;\r\n this.animation = animation;\r\n this.flip = {x: false, y: false};\r\n };\r\n\r\n SpriteNode.prototype = Object.create(BaseNode.prototype);\r\n SpriteNode.prototype.constructor = SpriteNode;\r\n\r\n SpriteNode.prototype.setFlip = function (x, y) {\r\n this.flip = {x: x, y: y};\r\n };\r\n\r\n SpriteNode.prototype.draw = function (speed) {\r\n if (this.visible && this.isLookScene()) {\r\n speed = speed || 1;\r\n\r\n if (this.frame > this.animation.frameCount) {\r\n this.frame = 0;\r\n }\r\n this.drawFrame(this.frame + 1);\r\n\r\n if (this.tmpSpeed > speed) {\r\n this.frame += 1;\r\n this.tmpSpeed = 0;\r\n }\r\n else {\r\n this.tmpSpeed += 1;\r\n }\r\n }\r\n };\r\n\r\n // отрисовка одного кадра\r\n SpriteNode.prototype.drawFrame = function (frame) {\r\n if (!this.animation.imageMap.loaded) return (err.show('Invalid ImageMap', 'red'));\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n context.lineWidth = 0;\r\n\r\n if (this.angle || this.flip.x || this.flip.y) {\r\n context.save();\r\n context.translate(this.getPosition().x - j2Ds.scene.view.pos.x, this.getPosition().y - j2Ds.scene.view.pos.y);\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.scale(this.flip.x ? -1 : 1, this.flip.y ? -1 : 1);\r\n context.translate(-(this.getPosition().x - j2Ds.scene.view.pos.x), -(this.getPosition().y - j2Ds.scene.view.pos.y));\r\n }\r\n\r\n frame = frame ? (frame - 1) : 0;\r\n\r\n context.drawImage(\r\n this.animation.imageMap.img,\r\n (this.animation.sourceX + (this.animation.sourceW * frame)), this.animation.sourceY,\r\n this.animation.sourceW, this.animation.sourceH,\r\n this.pos.x - j2Ds.scene.view.pos.x, this.pos.y - j2Ds.scene.view.pos.y,\r\n this.size.x, this.size.y);\r\n\r\n if (this.angle || this.flip.x || this.flip.y) {\r\n context.restore();\r\n }\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n SpriteNode.prototype.setAnimation = function (id) {\r\n if (this.animation != id) {\r\n this.animation = id;\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.SpriteNode = SpriteNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.SpriteNode = SpriteNode;\r\n return SpriteNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/TextNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var TextNode = function (_j2Ds, pos, text, sizePx, color, family, width, colorL) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, MathUtil.v2f(0, 0));\r\n\r\n /*Свойства*/\r\n\r\n this.vAlign = 'top';\r\n this.hAlign = 'left';\r\n this.color = color ? color : 'black';\r\n\r\n this.family = family ? family : 'serif';\r\n this.sizePx = sizePx ? sizePx : 20;\r\n\r\n this.box.offset.y = MathUtil.toInt(this.sizePx * 0.26);\r\n this.box.size.y = -MathUtil.toInt(this.sizePx * 0.26);\r\n\r\n this.lineWidth = width ? width : 0;\r\n this.colorL = colorL ? colorL : 'black';\r\n\r\n this.font = this.sizePx + 'px ' + this.family;\r\n\r\n this.fullText = text;\r\n this.maxWidth = 0;\r\n this.lines = text.split(\"\\n\");\r\n\r\n j2Ds.scene.context.font = this.font;\r\n\r\n for (var i = 0, len = this.lines.length; i < len; i += 1) {\r\n this.maxWidth = (this.maxWidth < j2Ds.scene.context.measureText(this.lines[i]).width ?\r\n j2Ds.scene.context.measureText(this.lines[i]).width :\r\n this.maxWidth);\r\n }\r\n\r\n this.size.x = this.maxWidth;\r\n this.size.y = this.lines.length * this.sizePx;\r\n };\r\n\r\n TextNode.prototype = Object.create(BaseNode.prototype);\r\n TextNode.prototype.constructor = TextNode;\r\n\r\n TextNode.prototype.setSize = function (sizePx) {\r\n this.sizePx = sizePx;\r\n this.font = this.sizePx + 'px ' + this.family;\r\n j2Ds.scene.context.font = this.font;\r\n\r\n this.box.offset.y = MathUtil.toInt(this.sizePx * 0.26);\r\n this.box.size.y = -MathUtil.toInt(this.sizePx * 0.26);\r\n\r\n for (var i = 0, len = this.lines.length; i < len; i += 1) {\r\n this.maxWidth = (this.maxWidth < j2Ds.scene.context.measureText(this.lines[i]).width ?\r\n j2Ds.scene.context.measureText(this.lines[i]).width :\r\n this.maxWidth);\r\n }\r\n this.size.x = this.maxWidth;\r\n this.size.y = this.lines.length * this.sizePx;\r\n };\r\n\r\n TextNode.prototype.getSize = function () {\r\n return this.sizePx;\r\n };\r\n\r\n TextNode.prototype.drawSimpleText = function (text, pos, color, colorL) {\r\n var context = this.layer.context;\r\n context.fillStyle = color ? color : this.color;\r\n context.textAlign = this.hAlign;\r\n context.textBaseline = this.vAlign;\r\n context.font = this.font;\r\n context.lineWidth = this.lineWidth;\r\n context.strokeStyle = colorL ? colorL : this.colorL;\r\n\r\n var lines = text.split(\"\\n\");\r\n\r\n pos = pos ? pos : this.pos;\r\n\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n for (var i = 0, len = lines.length; i < len; i += 1) {\r\n if (this.lineWidth) {\r\n context.strokeText(lines[i], pos.x, pos.y + this.sizePx * i);\r\n }\r\n context.fillText(lines[i], pos.x, pos.y + this.sizePx * i);\r\n }\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n\r\n context.lineWidth = 0;\r\n context.strokeStyle = 'black';\r\n };\r\n\r\n TextNode.prototype.getText = function () {\r\n return this.fullText;\r\n };\r\n\r\n TextNode.prototype.setText = function (text) {\r\n this.fullText = text;\r\n this.maxWidth = 0;\r\n this.lines = text.split(\"\\n\");\r\n\r\n j2Ds.scene.context.font = this.font;\r\n\r\n this.box.offset.y = MathUtil.toInt(this.sizePx * 0.26);\r\n this.box.size.y = -MathUtil.toInt(this.sizePx * 0.26);\r\n\r\n for (var i = 0, len = this.lines.length; i < len; i += 1) {\r\n this.maxWidth = (this.maxWidth < j2Ds.scene.context.measureText(this.lines[i]).width ?\r\n j2Ds.scene.context.measureText(this.lines[i]).width :\r\n this.maxWidth);\r\n }\r\n this.size.x = this.maxWidth;\r\n this.size.y = this.lines.length * this.sizePx;\r\n };\r\n\r\n TextNode.prototype.draw = function () {\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n if (this.angle) {\r\n context.save();\r\n context.translate(this.getPosition().x - j2Ds.scene.view.pos.x, this.getPosition().y - j2Ds.scene.view.pos.y);\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.translate(-(this.getPosition().x - j2Ds.scene.view.pos.x), -(this.getPosition().y - j2Ds.scene.view.pos.y));\r\n }\r\n\r\n context.fillStyle = this.color;\r\n context.textAlign = this.hAlign;\r\n context.textBaseline = this.vAlign;\r\n context.font = this.font;\r\n context.lineWidth = this.lineWidth;\r\n context.strokeStyle = this.colorL;\r\n\r\n for (var i = 0, len = this.lines.length; i < len; i += 1) {\r\n if (this.lineWidth) {\r\n context.strokeText(this.lines[i], this.pos.x - j2Ds.scene.view.pos.x, this.pos.y + this.sizePx * i - j2Ds.scene.view.pos.y);\r\n }\r\n context.fillText(this.lines[i], this.pos.x - j2Ds.scene.view.pos.x, this.pos.y + this.sizePx * i - j2Ds.scene.view.pos.y);\r\n }\r\n\r\n context.lineWidth = 0;\r\n context.strokeStyle = 'black';\r\n\r\n if (this.angle) {\r\n context.restore();\r\n }\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TextNode = TextNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.TextNode = TextNode;\r\n return TextNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/DeviceManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var DeviceManager = function () {\r\n return {\r\n width: (parseInt(document.documentElement.clientWidth) < parseInt(screen.width))\r\n ? parseInt(document.documentElement.clientWidth)\r\n : parseInt(screen.width),\r\n height: (parseInt(document.documentElement.clientHeight) < parseInt(screen.height))\r\n ? parseInt(document.documentElement.clientHeight)\r\n : parseInt(screen.height)\r\n };\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.DeviceManager = DeviceManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.DeviceManager = DeviceManager;\r\n return DeviceManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/ErrorManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var ErrorManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.mode = 'neverShow'; // values: onlyShow|stopAndShow|neverShow\r\n this.enabled = false;\r\n };\r\n\r\n ErrorManager.prototype.init = function (_true) {\r\n var errorManager = this;\r\n errorManager.enabled = true;\r\n\r\n var runBtn = document.createElement('div');\r\n runBtn.innerHTML = 'RUN';\r\n runBtn.style.padding = '5px';\r\n runBtn.align = 'center';\r\n runBtn.style.position = 'fixed';\r\n runBtn.style.zIndex = 20000;\r\n runBtn.style.left = '0px';\r\n runBtn.style.top = -20 + errorManager.j2Ds.getDeviceManager().height + 'px';\r\n runBtn.style.fontSize = '8pt';\r\n runBtn.style.backgroundColor = '#B8FFB8';\r\n runBtn.style.height = '12px';\r\n runBtn.style.width = '50px';\r\n runBtn.style.cursor = 'pointer';\r\n\r\n runBtn.onmousedown = function (e) {\r\n e.stopPropagation();\r\n };\r\n\r\n runBtn.onclick = function (e) {\r\n e.stopPropagation();\r\n errorManager.show('Выполнение продолжено');\r\n errorManager.j2Ds.runEngine(errorManager.j2Ds);\r\n return false;\r\n };\r\n\r\n errorManager.j2Ds.dom.attach(runBtn);\r\n errorManager.logListener.elems.push(runBtn);\r\n\r\n\r\n var pauseBtn = document.createElement('div');\r\n pauseBtn.innerHTML = 'PAUSE';\r\n pauseBtn.style.padding = '5px';\r\n pauseBtn.align = 'center';\r\n pauseBtn.style.position = 'fixed';\r\n pauseBtn.style.zIndex = 20000;\r\n pauseBtn.style.left = '60px';\r\n pauseBtn.style.top = -20 + errorManager.j2Ds.getDeviceManager().height + 'px';\r\n pauseBtn.style.fontSize = '8pt';\r\n pauseBtn.style.backgroundColor = '#FFFFBD';\r\n pauseBtn.style.height = '12px';\r\n pauseBtn.style.width = '50px';\r\n pauseBtn.style.cursor = 'pointer';\r\n\r\n pauseBtn.onmousedown = function (e) {\r\n e.stopPropagation();\r\n };\r\n\r\n pauseBtn.onclick = function (e) {\r\n e.stopPropagation();\r\n errorManager.show('Выполнение приостановлено');\r\n errorManager.j2Ds.stopEngine();\r\n return false;\r\n };\r\n\r\n errorManager.j2Ds.dom.attach(pauseBtn);\r\n errorManager.logListener.elems.push(pauseBtn);\r\n\r\n var reloadBtn = document.createElement('div');\r\n reloadBtn.innerHTML = 'RELOAD';\r\n reloadBtn.style.padding = '5px';\r\n reloadBtn.align = 'center';\r\n reloadBtn.style.position = 'fixed';\r\n reloadBtn.style.zIndex = 20000;\r\n reloadBtn.style.left = '120px';\r\n reloadBtn.style.top = -20 + errorManager.j2Ds.getDeviceManager().height + 'px';\r\n reloadBtn.style.fontSize = '8pt';\r\n reloadBtn.style.backgroundColor = '#E2E2E2';\r\n reloadBtn.style.color = 'black';\r\n reloadBtn.style.height = '12px';\r\n reloadBtn.style.width = '50px';\r\n reloadBtn.style.cursor = 'pointer';\r\n\r\n reloadBtn.onmousedown = function (e) {\r\n e.stopPropagation();\r\n };\r\n\r\n reloadBtn.onclick = function (e) {\r\n e.stopPropagation();\r\n errorManager.j2Ds.dom.reloadURL();\r\n return false;\r\n };\r\n\r\n errorManager.j2Ds.dom.attach(reloadBtn);\r\n errorManager.logListener.elems.push(reloadBtn);\r\n\r\n errorManager.j2Ds.events.addEvent('dom:loaded', function () {\r\n errorManager.j2Ds.window.onerror = function (e) {\r\n errorManager.show(e);\r\n };\r\n });\r\n };\r\n\r\n ErrorManager.prototype.show = function (string) {\r\n console.log('[j2Ds]: ' + string);\r\n };\r\n\r\n ErrorManager.prototype.setMode = function (mode) {\r\n this.mode = mode;\r\n if (mode == 'neverShow') {\r\n this.enabled = false;\r\n }\r\n };\r\n\r\n ErrorManager.prototype.debug = function (string) {\r\n if (!this.enabled) return;\r\n this.j2Ds.stopEngine();\r\n if (this.mode != 'neverShow') {\r\n this.show(string || 'Точка останова достигнута');\r\n }\r\n };\r\n\r\n ErrorManager.prototype.showError = function (err, _func) {\r\n if (this.mode == 'neverShow') return;\r\n\r\n var stack = err.stack.toString();\r\n stack = stack.split(/\\n/);\r\n\r\n for (var i = 0, len = stack.length; i < len; i += 1) {\r\n if (stack[i].match(/\\:\\d/)) {\r\n stack = stack[i].split(/\\s/);\r\n break;\r\n }\r\n }\r\n\r\n stack = stack[stack.length - 1];\r\n stack = stack.replace(/([\\(\\)]|[\\w]+:\\/\\/)/g, '');\r\n var file = stack.split(':'),\r\n line = file[1],\r\n number = file[2];\r\n file = decodeURI(file[0]);\r\n\r\n if (file.match(/(|\\bj2Ds.js)/)) {\r\n file = '<Функция-аргумент или строка>';\r\n }\r\n\r\n var errMess = 'Тип ошибки: \"' + err.name + '\"' +\r\n '\\nСообщение: \"' + err.message + '\"' +\r\n '\\nФайл с ошибкой: \"' + file + '\"' +\r\n '\\nСтрока: ' + line +\r\n ', символ: ' + number;\r\n\r\n if (_func) {\r\n errMess += '\\nОшибка в теле функции: \\n' + _func.toString();\r\n }\r\n\r\n this.show(errMess);\r\n\r\n if (this.mode == 'stopAndShow') {\r\n this.j2Ds.stopEngine();\r\n this.show('Выполнение приостановлено');\r\n }\r\n\r\n };\r\n\r\n ErrorManager.prototype.logListener = {\r\n domId: '',\r\n count: 0,\r\n execLine: '',\r\n elems: []\r\n };\r\n\r\n ErrorManager.prototype.lightSyntax = function (_code, _type) {\r\n var code = ('' + _code).toString();\r\n\r\n if (_type == 'boolean') {\r\n code = code.replace(/true/gi, '$&')\r\n .replace(/false/gi, '$&');\r\n } else if (_type == 'code') {\r\n code = code.replace(/(this|var|typeof|new|return|if|else|for|in|while|break|do|continue|switch|case)([^a-z0-9\\$_])/gi,\r\n '$1$2')\r\n .replace(/(function|object)/gi,\r\n '$1')\r\n .replace(/(width|height|window|document|scene|j2Ds|value)/gi,\r\n '$1')\r\n .replace(/([a-z\\_\\$][a-z0-9_]*)\\(/gi, '$1(')\r\n .replace(/(\\{|\\}|\\]|\\[|\\|)/gi, '$1')\r\n .replace(/('.*?')/g, '$1')\r\n .replace(/(#[a-z0-9]{3,8};)/, '$1')\r\n .replace(/(\\t)/g, '  ');\r\n\r\n code = code.replace(/true/gi, '$&')\r\n .replace(/false/gi, '$&');\r\n }\r\n\r\n return code;\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.ErrorManager = ErrorManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.ErrorManager = ErrorManager;\r\n return ErrorManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/FpsManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var FpsManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n\r\n this.enabled = false;\r\n this.fps = this.j2Ds.frameLimit;\r\n this.tmp_of_fps = 1;\r\n this.tmp_of_time = Date.now();\r\n };\r\n\r\n FpsManager.prototype.init = function () {\r\n var fpsManager = this;\r\n fpsManager.enabled = true;\r\n\r\n this.j2Ds.events.addEvent('engine:after', function () {\r\n fpsManager.update();\r\n });\r\n\r\n };\r\n\r\n FpsManager.prototype.update = function () {\r\n if (!this.enabled) return;\r\n this.tmp_of_fps += 1;\r\n if (this.j2Ds.now - this.tmp_of_time >= 1000) {\r\n this.fps = this.tmp_of_fps;\r\n this.tmp_of_fps = 1;\r\n this.tmp_of_time = this.j2Ds.now;\r\n }\r\n };\r\n\r\n FpsManager.prototype.getFPS = function () {\r\n return this.fps <= this.j2Ds.frameLimit ? this.fps : this.j2Ds.frameLimit;\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.FpsManager = FpsManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.FpsManager = FpsManager;\r\n return FpsManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/ResourceManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var ResourceManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n\r\n this.added = 0;\r\n this.loaded = 0;\r\n this.failed = 0;\r\n\r\n this.add = function () {\r\n this.added += 1;\r\n };\r\n\r\n this.ok = function (file) {\r\n this.loaded += 1;\r\n this.j2Ds.errorManager.show('loaded: \"' + decodeURI(file));\r\n };\r\n\r\n this.fail = function (file) {\r\n this.failed += 1;\r\n this.j2Ds.errorManager.show('error load: \"' + decodeURI(file));\r\n };\r\n\r\n this.show = function () {\r\n return {'added': this.added, 'loaded': this.loaded, 'failed': this.failed};\r\n };\r\n\r\n this.isLoaded = function () {\r\n return this.added == this.loaded;\r\n };\r\n\r\n this.getProgress = function () {\r\n return Math.ceil(this.loaded / this.added * 100);\r\n };\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.ResourceManager = ResourceManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.ResourceManager = ResourceManager;\r\n return ResourceManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/StorageManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var StorageManager = function (j2Ds, id) {\r\n this.j2Ds = j2Ds;\r\n this.id = id;\r\n this.ls = this.j2Ds.window.localStorage ? this.j2Ds.window.localStorage : false;\r\n if (!this.ls) alert('j2Ds ERROR in \"createLocal(' + id + ')\" \\n' + 'Объект \"localStorage\" не поддерживается.');\r\n };\r\n\r\n StorageManager.prototype.saveNode = function (name, o) {\r\n if (!this.ls) return false;\r\n this.ls.setItem(this.id + name, JSON.stringify(o));\r\n };\r\n\r\n StorageManager.prototype.load = function (name) {\r\n if (!this.ls) {\r\n return false;\r\n }\r\n return this.ls.getItem(this.id + name);\r\n };\r\n\r\n StorageManager.prototype.is = function (name) {\r\n if (!this.ls) {\r\n return false;\r\n }\r\n return !!(this.ls.getItem(this.id + name));\r\n };\r\n\r\n StorageManager.prototype.save = function (name, value) {\r\n if (!this.ls) {\r\n return false;\r\n }\r\n this.ls.setItem(this.id + name, value);\r\n };\r\n\r\n StorageManager.prototype.loadNode = function (name) {\r\n if (!this.ls) {\r\n return false;\r\n }\r\n return JSON.parse(this.ls.getItem(this.id + name));\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.StorageManager = StorageManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.StorageManager = StorageManager;\r\n return StorageManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/TimeManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var TimeManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.times = {};\r\n\r\n this.insert = function (id) {\r\n if (!this.times[id]) {\r\n this.times[id] = this.j2Ds.now;\r\n }\r\n };\r\n\r\n this.get = function (id) {\r\n return this.times[id];\r\n };\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TimeManager = TimeManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.TimeManager = TimeManager;\r\n return TimeManager;\r\n}));\r\n\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/TriggerManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var TriggerManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.enabled = false;\r\n this.triggers = {};\r\n };\r\n\r\n TriggerManager.prototype.add = function (id, callback) {\r\n var triggerManager = this;\r\n var trigger = {\r\n command: callback,\r\n count: 0,\r\n state: 'stop',\r\n last: false\r\n };\r\n\r\n trigger.run = function (mSec) {\r\n if (this.state == 'job') {\r\n this.command();\r\n return;\r\n }\r\n if (triggerManager.j2Ds.now - this.last > mSec) {\r\n if (this.last) {\r\n this.state = 'job';\r\n this.count += 1;\r\n this.command();\r\n }\r\n this.last = triggerManager.j2Ds.now;\r\n }\r\n };\r\n\r\n trigger.job = function (mSec) {\r\n if (triggerManager.j2Ds.now - this.last > mSec && this.state != 'run') {\r\n if (this.last) {\r\n this.state = 'run';\r\n this.count += 1;\r\n this.command();\r\n }\r\n this.last = triggerManager.j2Ds.now;\r\n }\r\n };\r\n\r\n trigger.loop = function (mSec) {\r\n if (triggerManager.j2Ds.now - this.last > mSec) {\r\n if (this.last) {\r\n this.state = 'run';\r\n this.count += 1;\r\n this.command();\r\n }\r\n this.last = triggerManager.j2Ds.now;\r\n }\r\n };\r\n\r\n trigger.reset = function () {\r\n this.count = 0;\r\n this.state = 'stop';\r\n this.last = false;\r\n };\r\n\r\n this.triggers[id] = trigger;\r\n return trigger;\r\n };\r\n\r\n TriggerManager.prototype.get = function (id) {\r\n return this.triggers[id];\r\n };\r\n\r\n TriggerManager.prototype.init = function () {\r\n this.enabled = true;\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TriggerManager = TriggerManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.TriggerManager = TriggerManager;\r\n return TriggerManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/ViewManager', ['utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil) {\r\n \"use strict\";\r\n\r\n var ViewManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.views = {};\r\n };\r\n\r\n ViewManager.prototype.add = function (id, pos) {\r\n var viewManager = this;\r\n var viewport = {\r\n focusNode: false\r\n };\r\n\r\n viewport.pos = pos ? MathUtil.v2f(pos.x, pos.y) : MathUtil.v2f(0, 0);\r\n\r\n viewport.setPosition = function (pos) {\r\n if (!pos) return this;\r\n this.pos = MathUtil.v2f(pos.x - viewManager.j2Ds.scene.width / 2, pos.y - viewManager.j2Ds.scene.height / 2);\r\n };\r\n\r\n viewport.getPosition = function () {\r\n return this.pos;\r\n };\r\n\r\n viewport.move = function (pos) {\r\n this.pos.x += pos.x;\r\n this.pos.y += pos.y;\r\n };\r\n\r\n viewManager.j2Ds.viewManager.views[id] = viewport;\r\n return viewport;\r\n };\r\n\r\n ViewManager.prototype.get = function (id) {\r\n return this.j2Ds.viewManager.views[id];\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.ViewManager = ViewManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.ViewManager = ViewManager;\r\n return ViewManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('io/AudioHandler', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var AudioHandler = function () {\r\n this.audios = {};\r\n this.enabled = false\r\n };\r\n\r\n AudioHandler.prototype.init = function () {\r\n var audioHandler = this;\r\n this.enabled = true;\r\n\r\n audioHandler.j2Ds.events.addEvent('scene:deactivate', function () {\r\n audioHandler.deactivate();\r\n });\r\n\r\n audioHandler.j2Ds.events.addEvent('scene:activate', function () {\r\n audioHandler.activate();\r\n });\r\n\r\n };\r\n\r\n AudioHandler.prototype.load = function (id, files, vol) {\r\n var audioHandler = this;\r\n audioHandler.j2Ds.resources.add();\r\n var audio = document.createElement('audio');\r\n\r\n for (var i = 0, len = files.length; i < len; i += 1) {\r\n var source = document.createElement('source');\r\n source.src = files[i];\r\n audio.appendChild(source);\r\n }\r\n\r\n audio.id = 'audio_' + id;\r\n\r\n if (vol) {\r\n audio.volume = (vol <= 1 && vol >= 0) ? vol : 1;\r\n }\r\n\r\n var sound = {\r\n id: id,\r\n files: files,\r\n domEl: audio, // DOMElement\r\n ready: false,\r\n len: 0,\r\n state: 'stop',\r\n lock: false,\r\n volume: audio.volume,\r\n onePlay: false\r\n };\r\n\r\n sound.domEl.addEventListener('loadeddata', function (e) {\r\n sound.ready = true;\r\n var file = e.explicitOriginalTarget || e.path[0];\r\n audioHandler.j2Ds.resources.ok(file.currentSrc);\r\n });\r\n\r\n sound.domEl.addEventListener('error', function (e) {\r\n sound.setLock(true);\r\n //var file = e.srcElement || e.target;\r\n //audioHandler.j2Ds.resources.fail(file.src);\r\n });\r\n\r\n sound.domEl.addEventListener('ended', function () {\r\n sound.state = 'stop';\r\n });\r\n\r\n sound.play = function (unlock) {\r\n if (unlock) {\r\n this.setLock(false);\r\n }\r\n if (this.lock) return;\r\n if (this.state == 'play') {\r\n this.domEl.currentTime = 0;\r\n }\r\n this.domEl.play();\r\n this.state = 'play';\r\n };\r\n\r\n sound.loop = function () {\r\n if (this.lock) return;\r\n this.domEl.play();\r\n this.state = 'play';\r\n };\r\n\r\n sound.pause = function (lock) {\r\n if (this.state == 'play') {\r\n this.setLock(lock);\r\n this.domEl.pause();\r\n this.state = 'pause';\r\n }\r\n };\r\n\r\n sound.stop = function (lock) {\r\n this.domEl.pause();\r\n this.domEl.currentTime = 0;\r\n this.state = 'stop';\r\n if (lock) {\r\n this.setLock(lock);\r\n }\r\n };\r\n\r\n sound.setLock = function (lock) {\r\n this.lock = lock ? true : false;\r\n };\r\n\r\n sound.setVolume = function (vol) {\r\n this.domEl.volume = (vol <= 1 && vol >= 0) ? vol : 1;\r\n this.volume = this.domEl.volume;\r\n };\r\n\r\n sound.getVolume = function (id) {\r\n return this.volume;\r\n };\r\n\r\n sound.getState = function (id) {\r\n return this.state;\r\n };\r\n\r\n sound.getPlayPosition = function () {\r\n return this.domEl.currentTime;\r\n };\r\n\r\n sound.domEl.load();\r\n\r\n this.audios[id] = sound;\r\n return sound;\r\n };\r\n\r\n AudioHandler.prototype.get = function (id) {\r\n return this.audios[id];\r\n };\r\n\r\n AudioHandler.prototype.pause = function (lock) {\r\n for (var snd in this.audios) {\r\n this.audios[snd].pause(lock);\r\n }\r\n };\r\n\r\n AudioHandler.prototype.stop = function (lock) {\r\n for (var snd in this.audios) {\r\n this.audios[snd].stop(lock);\r\n }\r\n };\r\n\r\n AudioHandler.prototype.play = function (unlock) {\r\n for (var snd in this.audios) {\r\n this.audios[snd].play(unlock);\r\n }\r\n };\r\n\r\n AudioHandler.prototype.deactivate = function () {\r\n for (var snd in this.audios) {\r\n if (this.audios[snd].state == 'play') {\r\n this.audios[snd].pause();\r\n this.audios[snd].state = 'deactivated';\r\n }\r\n }\r\n };\r\n\r\n AudioHandler.prototype.activate = function () {\r\n for (var snd in this.audios) {\r\n if (this.audios[snd].state == 'deactivated') {\r\n this.audios[snd].play();\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.AudioHandler = AudioHandler;\r\n if (global.j2Ds !== undefined) global.modules.io.AudioHandler = AudioHandler;\r\n return AudioHandler;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('io/InputHandler', ['utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil) {\r\n \"use strict\";\r\n\r\n var InputHandler = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n\r\n this.pos = {x: 0, y: 0};\r\n this.x = 0;\r\n this.y = 0;\r\n this.screenPos = {x: 0, y: 0};\r\n this.keyDown = [];\r\n this.keyPress = [];\r\n this.keyPressed = [];\r\n this.keyUp = [];\r\n this.keyUped = false;\r\n this.mouseDown = [];\r\n this.mousePress = [];\r\n this.mousePressed = [];\r\n this.mouseUp = [];\r\n this.mouseUpped = false;\r\n this.mouseWheel = 0;\r\n this.canceled = false;\r\n this.body = false;\r\n this.anyKey = false;\r\n this.anyMouse = false;\r\n this.writeMode = false;\r\n this.displayCursor = '';\r\n this.visible = true;\r\n this.enabled = false;\r\n };\r\n\r\n InputHandler.prototype.mKey = {\r\n 'LEFT': 1,\r\n 'MIDDLE': 2,\r\n 'RIGHT': 3\r\n };\r\n\r\n InputHandler.prototype.jKey = {\r\n 'LEFT': 37,\r\n 'RIGHT': 39,\r\n 'UP': 38,\r\n 'DOWN': 40,\r\n 'SPACE': 32,\r\n 'CTRL': 17,\r\n 'SHIFT': 16,\r\n 'ALT': 18,\r\n 'ESC': 27,\r\n 'ENTER': 13,\r\n 'MINUS': 189,\r\n 'PLUS': 187,\r\n 'CAPS_LOCK': 20,\r\n 'BACKSPACE': 8,\r\n 'TAB': 9,\r\n 'Q': 81,\r\n 'W': 87,\r\n 'E': 69,\r\n 'R': 82,\r\n 'T': 84,\r\n 'Y': 89,\r\n 'U': 85,\r\n 'I': 73,\r\n 'O': 79,\r\n 'P': 80,\r\n 'A': 65,\r\n 'S': 83,\r\n 'D': 68,\r\n 'F': 70,\r\n 'G': 71,\r\n 'H': 72,\r\n 'J': 74,\r\n 'K': 75,\r\n 'L': 76,\r\n 'Z': 90,\r\n 'X': 88,\r\n 'V': 86,\r\n 'B': 66,\r\n 'N': 78,\r\n 'M': 77,\r\n '0': 48,\r\n '1': 49,\r\n '2': 50,\r\n '3': 51,\r\n '4': 52,\r\n '5': 53,\r\n '6': 54,\r\n '7': 55,\r\n '8': 56,\r\n 'C': 67,\r\n '9': 57,\r\n 'NUM_0': 45,\r\n 'NUM_1': 35,\r\n 'NUM_2': 40,\r\n 'NUM_3': 34,\r\n 'NUM_4': 37,\r\n 'NUM_5': 12,\r\n 'NUM_6': 39,\r\n 'NUM_7': 36,\r\n 'NUM_8': 38,\r\n 'NUM_9': 33,\r\n 'NUM_MINUS': 109,\r\n 'NUM_PLUS': 107,\r\n 'NUM_LOCK': 144,\r\n 'F1': 112,\r\n 'F2': 113,\r\n 'F3': 114,\r\n 'F4': 115,\r\n 'F5': 116,\r\n 'F6': 117,\r\n 'F7': 118,\r\n 'F8': 119,\r\n 'F9': 120,\r\n 'F10': 121,\r\n 'F11': 122,\r\n 'F12': 123\r\n };\r\n\r\n InputHandler.prototype.keyList = function () {\r\n var o = [];\r\n for (var i in this.jKey) {\r\n o.push(i);\r\n }\r\n return o;\r\n };\r\n\r\n InputHandler.prototype.reset = function () {\r\n if (!this.enabled) return false;\r\n this.keyPress = [];\r\n this.keyUp = [];\r\n this.mousePress = [];\r\n this.mouseUp = [];\r\n this.mouseWheel = 0;\r\n };\r\n\r\n InputHandler.prototype.isKeyDown = function (code) {\r\n return this.keyDown[this.jKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isKeyPress = function (code) {\r\n return this.keyPress[this.jKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isKeyUp = function (code) {\r\n return this.keyUp[this.jKey[code]];\r\n };\r\n\r\n InputHandler.prototype.getPosition = function () {\r\n return MathUtil.v2f(this.pos.x, this.pos.y);\r\n };\r\n\r\n InputHandler.prototype.getScreenPosition = function () {\r\n return MathUtil.v2f(this.screenPos.x, this.screenPos.y);\r\n };\r\n\r\n InputHandler.prototype.setWriteMode = function (_true) {\r\n this.writeMode = _true;\r\n };\r\n\r\n InputHandler.prototype.isWriteMode = function () {\r\n return this.writeMode;\r\n };\r\n\r\n InputHandler.prototype.keyEvent = function (e) {\r\n if (!this.enabled) return false;\r\n if (e.type == 'keydown') {\r\n if (!this.keyPressed[e.keyCode]) {\r\n this.keyPress[e.keyCode] = true;\r\n this.keyPressed[e.keyCode] = true;\r\n }\r\n if (!this.writeMode) {\r\n e.preventDefault();\r\n } else {\r\n this.j2Ds.events.onEvent('writeMode:keyPress', '');\r\n }\r\n } else if (e.type == 'keyup') {\r\n if (this.keyPressed[e.keyCode]) {\r\n e.preventDefault();\r\n this.keyPress[e.keyCode] = false;\r\n this.keyPressed[e.keyCode] = false;\r\n this.keyUp[e.keyCode] = true;\r\n this.keyUped = true;\r\n }\r\n } else if (e.type == 'keypress' && (this.writeMode)) {\r\n var char = '';\r\n if (e.which != 0 && e.charCode != 0) {\r\n if (e.which >= 32) {\r\n char = String.fromCharCode(e.which);\r\n }\r\n }\r\n this.j2Ds.events.onEvent('writeMode:keyPress', char);\r\n }\r\n\r\n this.keyDown[e.keyCode] = (e.type == 'keydown') && (!this.canceled);\r\n this.anyKey = e.keyCode;\r\n return false;\r\n };\r\n\r\n InputHandler.prototype.cancel = function (id) {\r\n if (!id) {\r\n this.canceled = true;\r\n this.keyDown = [];\r\n this.mouseDown = [];\r\n }\r\n else {\r\n this.keyDown[this.jKey[id]] = false;\r\n }\r\n };\r\n\r\n InputHandler.prototype.onNode = function (id) {\r\n if (!id.layer.visible) return false;\r\n return (this.pos.x > id.pos.x && this.pos.x < id.pos.x + id.size.x) &&\r\n (this.pos.y > id.pos.y && this.pos.y < id.pos.y + id.size.y);\r\n };\r\n\r\n InputHandler.prototype.upd = function () {\r\n if (!this.enabled) return false;\r\n var dX = this.j2Ds.scene.offsetWidth / this.j2Ds.scene.width;\r\n var dY = this.j2Ds.scene.offsetHeight / this.j2Ds.scene.height;\r\n this.x = (this.screenPos.x / dX);\r\n this.y = (this.screenPos.y / dY);\r\n this.pos.x = this.j2Ds.scene.view.pos.x + this.x;\r\n this.pos.y = this.j2Ds.scene.view.pos.y + this.y;\r\n };\r\n\r\n InputHandler.prototype.onMove = function (e) {\r\n this.screenPos.x = -this.j2Ds.scene.offsetLeft + e.pageX;\r\n this.screenPos.y = -this.j2Ds.scene.offsetTop + e.pageY;\r\n };\r\n\r\n InputHandler.prototype.isMouseDown = function (code) {\r\n return this.mouseDown[this.mKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isMousePress = function (code) {\r\n return this.mousePress[this.mKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isMouseUp = function (code) {\r\n return this.mouseUp[this.mKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isMouseWheel = function (code) {\r\n return (code == 'UP' && this.mouseWheel > 0) ||\r\n (code == 'DOWN' && this.mouseWheel < 0)\r\n };\r\n\r\n InputHandler.prototype.onMouseWheel = function (e) {\r\n if (!this.enabled) return false;\r\n e.preventDefault();\r\n this.mouseWheel = ((e.wheelDelta) ? e.wheelDelta : -e.detail);\r\n return false;\r\n };\r\n\r\n InputHandler.prototype.onMouseEvent = function (e) {\r\n if (!this.enabled) return false;\r\n e.preventDefault();\r\n if (!e.which && e.button) {\r\n if (e.button & 1) e.which = 1;\r\n else if (e.button & 4) e.which = 2;\r\n else if (e.button & 2) e.which = 3;\r\n }\r\n\r\n if (e.type == 'mousedown') {\r\n if (!this.mousePressed[e.which]) {\r\n this.mousePress[e.which] = true;\r\n this.mousePressed[e.which] = true;\r\n }\r\n } else if (e.type == 'mouseup') {\r\n if (this.mousePressed[e.which]) {\r\n this.mousePress[e.which] = false;\r\n this.mousePressed[e.which] = false;\r\n this.mouseUp[e.which] = true;\r\n this.mouseUped = true;\r\n }\r\n }\r\n\r\n this.mouseDown[e.which] = (e.type == 'mousedown') && (!this.canceled);\r\n\r\n this.j2Ds.window.focus();\r\n return false;\r\n };\r\n\r\n InputHandler.prototype.setCursorImage = function (curImg) {\r\n this.j2Ds.dom.tag('body')[0].style.cursor = 'url(\"' + curImg + '\"), auto';\r\n };\r\n\r\n InputHandler.prototype.setVisible = function (_true) {\r\n this.visible = _true;\r\n if (!_true) {\r\n this.displayCursor = this.j2Ds.dom.tag('body')[0].style.cursor;\r\n this.j2Ds.dom.tag('body')[0].style.cursor = 'none';\r\n } else {\r\n this.j2Ds.dom.tag('body')[0].style.cursor = this.displayCursor;\r\n }\r\n };\r\n\r\n InputHandler.prototype.isVisible = function () {\r\n return this.visible;\r\n };\r\n\r\n InputHandler.prototype.init = function () {\r\n var input = this;\r\n input.enabled = true;\r\n\r\n input.j2Ds.events.addEvent('engine:before', function () {\r\n input.upd();\r\n });\r\n\r\n input.j2Ds.events.addEvent('engine:after', function () {\r\n input.reset();\r\n });\r\n\r\n\r\n input.j2Ds.events.addEvent('dom:loaded', function () {\r\n input.j2Ds.window.oncontextmenu = function () {\r\n return false;\r\n };\r\n input.j2Ds.window.onselectstart = input.j2Ds.window.oncontextmenu;\r\n input.j2Ds.window.ondragstart = input.j2Ds.window.oncontextmenu;\r\n input.j2Ds.window.onmousedown = input.onMouseEvent;\r\n input.j2Ds.window.onmouseup = function (e) {\r\n input.canceled = false;\r\n input.onMouseEvent(e);\r\n };\r\n input.j2Ds.window.onmousemove = function (e) {\r\n input.onMove(e);\r\n };\r\n input.j2Ds.window.onkeydown = function (e) {\r\n input.keyEvent(e);\r\n };\r\n input.j2Ds.window.onkeyup = function (e) {\r\n input.canceled = false;\r\n input.keyEvent(e);\r\n };\r\n input.j2Ds.window.onkeypress = function (e) {\r\n input.keyEvent(e);\r\n };\r\n input.j2Ds.window.onmousewheel = function (e) {\r\n input.onMouseWheel(e);\r\n };\r\n\r\n if (input.j2Ds.window.addEventListener) {\r\n input.j2Ds.window.addEventListener(\"DOMMouseScroll\", function (e) {\r\n input.onMouseWheel(e);\r\n }, false);\r\n }\r\n });\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.InputHandler = InputHandler;\r\n if (global.j2Ds !== undefined) global.modules.io.InputHandler = InputHandler;\r\n return InputHandler;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('io/TouchHandler', ['utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil) {\r\n \"use strict\";\r\n\r\n var TouchHandler = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n\r\n this.enabled = false;\r\n this.pos = {x: 0, y: 0};\r\n this.screenPos = {x: 0, y: 0};\r\n this.canceled = false;\r\n this.touchs = [];\r\n this.tapDown = false;\r\n this.tapPress = false;\r\n this.tapUp = false;\r\n this.body = false;\r\n };\r\n\r\n TouchHandler.prototype.getPosition = function () {\r\n return MathUtil.v2f(this.pos.x, this.pos.y);\r\n };\r\n\r\n TouchHandler.prototype.getScreenPosition = function () {\r\n return MathUtil.v2f(this.screenPos.x, this.screenPos.y);\r\n };\r\n\r\n TouchHandler.prototype.upd = function () {\r\n if (!this.enabled) return false;\r\n var dX = this.j2Ds.scene.offsetWidth / this.j2Ds.scene.width;\r\n var dY = this.j2Ds.scene.offsetHeight / this.j2Ds.scene.height;\r\n\r\n };\r\n\r\n TouchHandler.prototype.reset = function () {\r\n if (!this.enabled) return false;\r\n };\r\n\r\n TouchHandler.prototype.cancel = function () {\r\n if (!this.enabled) return false;\r\n };\r\n\r\n TouchHandler.prototype.isTapDown = function () {\r\n\r\n };\r\n\r\n TouchHandler.prototype.isTapPress = function () {\r\n\r\n };\r\n\r\n TouchHandler.prototype.isTapUp = function () {\r\n\r\n };\r\n\r\n TouchHandler.prototype.getTouch = function () {\r\n\r\n };\r\n\r\n TouchHandler.prototype.onTouchEvent = function () {\r\n if (!this.enabled) return false;\r\n\r\n };\r\n\r\n\r\n TouchHandler.prototype.init = function () {\r\n var touchHandler = this;\r\n touchHandler.enabled = true;\r\n\r\n touchHandler.j2Ds.events.addEvent('engine:before', function () {\r\n touchHandler.upd();\r\n });\r\n\r\n touchHandler.j2Ds.events.addEvent('engine:after', function () {\r\n touchHandler.reset();\r\n });\r\n\r\n\r\n touchHandler.j2Ds.events.addEvent('dom:loaded', function () {\r\n\r\n });\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TouchHandler = TouchHandler;\r\n if (global.j2Ds !== undefined) global.modules.io.TouchHandler = TouchHandler;\r\n return TouchHandler;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Layers', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var Layers = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.layersList = {};\r\n };\r\n\r\n Layers.prototype.layer = function (id) {\r\n return this.layersList[id];\r\n };\r\n\r\n Layers.prototype.add = function (id, index, notDOM) {\r\n if (!!this.layersList[id]) return false;\r\n\r\n var layer = {\r\n layerName: id\r\n };\r\n\r\n if (!notDOM) {\r\n layer.canvas = document.createElement('canvas');\r\n } else {\r\n layer.canvas = this.j2Ds.dom.id(id);\r\n }\r\n\r\n layer.canvas.style.position = this.j2Ds.scene.stylePosition;\r\n\r\n layer.canvas.id = id;\r\n\r\n layer.canvas.style.zIndex = 1000 + index;\r\n layer.canvas.style.left = this.j2Ds.scene.offsetLeft + 'px';\r\n layer.canvas.style.top = this.j2Ds.scene.offsetTop + 'px';\r\n\r\n layer.canvas.width = this.j2Ds.scene.width;\r\n layer.canvas.height = this.j2Ds.scene.height;\r\n layer.width = this.j2Ds.scene.width;\r\n layer.height = this.j2Ds.scene.height;\r\n layer.context = layer.canvas.getContext('2d');\r\n layer.context.shadowColor = 'rgba(0,0,0,0)';\r\n layer.alpha = 1;\r\n layer.angle = 0;\r\n layer.visible = 1;\r\n\r\n layer.onContext = function (callback) {\r\n callback(this.context);\r\n };\r\n\r\n layer.fill = function (color) {\r\n this.context.fillStyle = color;\r\n this.context.fillRect(0, 0, this.width, this.height);\r\n };\r\n\r\n layer.setAlpha = function (alpha) {\r\n this.canvas.style.opacity = alpha;\r\n this.alpha = alpha;\r\n };\r\n\r\n layer.getAlpha = function () {\r\n return this.alpha;\r\n };\r\n\r\n layer.setVisible = function (visible) {\r\n if (visible) {\r\n this.canvas.style.display = 'block';\r\n this.visible = true;\r\n } else {\r\n this.canvas.style.display = 'none';\r\n this.visible = false;\r\n }\r\n };\r\n\r\n layer.isVisible = function () {\r\n return this.visible;\r\n };\r\n\r\n layer.setIndex = function (index) {\r\n this.canvas.style.zIndex = 1000 + index;\r\n };\r\n\r\n layer.clear = function () {\r\n this.context.clearRect(0, 0, this.width, this.height);\r\n };\r\n\r\n layer.clearNode = function (node) {\r\n var layer = this;\r\n if (node.isLookScene()) {\r\n this.context.clearRect(\r\n node.pos.x - layer.j2Ds.scene.view.pos.x,\r\n node.pos.y - layer.j2Ds.scene.view.pos.y,\r\n node.size.x,\r\n node.size.y\r\n );\r\n }\r\n };\r\n\r\n layer.setContextSettings = function (settings) {\r\n for (var i in settings) {\r\n if (typeof this.context[i] !== 'undefined') {\r\n this.context[i] = settings[i];\r\n }\r\n }\r\n };\r\n\r\n layer.clearRect = function (pos, size) {\r\n var layer = this;\r\n this.context.clearRect(pos.x - layer.j2Ds.scene.view.pos.x, pos.y - layer.j2Ds.scene.view.pos.y, size.x, size.y);\r\n };\r\n\r\n this.layersList[id] = layer;\r\n\r\n if (!notDOM) {\r\n this.j2Ds.dom.attach(this.layersList[id].canvas);\r\n }\r\n\r\n return layer;\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Layers = Layers;\r\n if (global.j2Ds !== undefined) global.modules.core.Layers = Layers;\r\n return Layers;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Scene', [\r\n 'nodes/BaseNode',\r\n 'nodes/CircleNode',\r\n 'nodes/LineNode',\r\n 'nodes/RectNode',\r\n 'nodes/SpriteNode',\r\n 'nodes/TextNode',\r\n 'utils/TextureUtil'\r\n ], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(\r\n require('nodes/BaseNode'),\r\n require('nodes/CircleNode'),\r\n require('nodes/LineNode'),\r\n require('nodes/RectNode'),\r\n require('nodes/SpriteNode'),\r\n require('nodes/TextNode'),\r\n require('utils/TextureUtil')\r\n );\r\n } else {\r\n factory(\r\n root.modules.nodes.BaseNode,\r\n root.modules.nodes.CircleNode,\r\n root.modules.nodes.LineNode,\r\n root.modules.nodes.RectNode,\r\n root.modules.nodes.SpriteNode,\r\n root.modules.nodes.TextNode,\r\n root.modules.utils.TextureUtil\r\n );\r\n }\r\n}(typeof window !== 'undefined' ? window : global,\r\n function (BaseNode,\r\n CircleNode,\r\n LineNode,\r\n RectNode,\r\n SpriteNode,\r\n TextNode,\r\n TextureUtil) {\r\n \"use strict\";\r\n\r\n var Scene = function (j2Ds) {\r\n j2Ds = this.j2Ds = j2Ds;\r\n\r\n this.nodes = [];\r\n this.layerName = 'sceneNode';\r\n this.stylePosition = 'fixed';\r\n this.layers = j2Ds.layers;\r\n this.view = false;\r\n this.gameStateName = false;\r\n this.canFullScreen = true;\r\n\r\n this.texture = new TextureUtil(this.j2Ds);\r\n };\r\n\r\n /*функции*/\r\n\r\n Scene.prototype.setView = function (_id) {\r\n this.view = this.j2Ds.viewManager.views[_id];\r\n };\r\n\r\n Scene.prototype.getView = function () {\r\n return this.view;\r\n };\r\n\r\n Scene.prototype.setAutoDraw = function (toggle) {\r\n var scene = this;\r\n if (toggle) {\r\n scene.j2Ds.events.addEvent('engine:after', function () {\r\n scene.drawAllNodes();\r\n }, 'autoDraw');\r\n } else {\r\n scene.j2Ds.events.destroyEvent('engine:after', 'autoDraw');\r\n }\r\n };\r\n\r\n Scene.prototype.setAutoClear = function (toggle) {\r\n var scene = this;\r\n if (toggle) {\r\n scene.j2Ds.events.addEvent('engine:before', function () {\r\n scene.clear();\r\n }, 'autoClear');\r\n } else {\r\n scene.j2Ds.events.destroyEvent('engine:before', 'autoClear');\r\n }\r\n };\r\n\r\n Scene.prototype.setGameState = function (name) {\r\n if (this.j2Ds.gameStates.states[name].start) {\r\n this.j2Ds.gameStates.states[name].start();\r\n }\r\n if (this.j2Ds.gameStates.states[name].state) {\r\n this.j2Ds.setActiveEngine(this.j2Ds.gameStates.states[name].state);\r\n }\r\n this.gameStateName = name;\r\n this.j2Ds.events.onEvent('scene:changedGameState');\r\n };\r\n\r\n Scene.prototype.getGameState = function () {\r\n return this.gameStateName;\r\n };\r\n\r\n Scene.prototype.start = function (name, frameLimit) {\r\n this.j2Ds.events.onEvent('scene:beforeStart');\r\n if (this.j2Ds.gameStates.states[name].start) {\r\n this.j2Ds.gameStates.states[name].start();\r\n }\r\n if (this.j2Ds.gameStates.states[name]) {\r\n this.j2Ds.start(this.j2Ds.gameStates.states[name].state, frameLimit);\r\n }\r\n this.j2Ds.events.onEvent('scene:afterStart');\r\n };\r\n\r\n Scene.prototype.fullScreen = function (_true) {\r\n if (!this.canFullScreen) return;\r\n var layer;\r\n var tmpCanvas = document.createElement('canvas'); // Нужны для копирования содержимого\r\n var tmpContext = tmpCanvas.getContext('2d'); // При изменении размера\r\n if (_true) {\r\n this.origWidth = this.width;\r\n this.origHeight = this.height;\r\n this.width = this.j2Ds.getDeviceManager().width;\r\n this.height = this.j2Ds.getDeviceManager().height;\r\n for (var i in this.j2Ds.layers.list) {\r\n layer = this.j2Ds.layers.list[i];\r\n tmpCanvas.width = layer.width;\r\n tmpCanvas.height = layer.height;\r\n tmpContext.drawImage(layer.canvas, 0, 0);\r\n layer.canvas.width = this.width;\r\n layer.canvas.height = this.height;\r\n layer.width = this.width;\r\n layer.height = this.height;\r\n this.offsetWidth = this.width;\r\n this.offsetHeight = this.height;\r\n\r\n layer.context.drawImage(tmpCanvas, 0, 0, layer.width, layer.height);\r\n }\r\n } else {\r\n this.width = this.origWidth;\r\n this.height = this.origHeight;\r\n for (var i in this.j2Ds.layers.list) {\r\n layer = this.j2Ds.layers.list[i];\r\n layer.width = this.origWidth;\r\n layer.height = this.origHeight;\r\n layer.canvas.width = this.origWidth;\r\n layer.canvas.height = this.origHeight;\r\n this.offsetWidth = this.origWidth;\r\n this.offsetHeight = this.origHeight;\r\n\r\n }\r\n }\r\n };\r\n\r\n Scene.prototype.fullScale = function (_true) {\r\n if (!this.canFullScreen) return;\r\n var layer;\r\n if (_true) {\r\n for (var i in this.j2Ds.layers.list) {\r\n layer = this.j2Ds.layers.list[i].canvas;\r\n layer.style.width = this.j2Ds.getDeviceManager().width + 'px';\r\n layer.style.height = this.j2Ds.getDeviceManager().height + 'px';\r\n this.offsetWidth = this.j2Ds.getDeviceManager().width;\r\n this.offsetHeight = this.j2Ds.getDeviceManager().height;\r\n }\r\n } else {\r\n for (var i in this.j2Ds.layers.list) {\r\n layer = this.j2Ds.layers.list[i].canvas;\r\n layer.style.width = this.width + 'px';\r\n layer.style.height = this.height + 'px';\r\n this.offsetWidth = this.width;\r\n this.offsetHeight = this.height;\r\n }\r\n }\r\n };\r\n\r\n Scene.prototype.clear = function () {\r\n this.getLayer().clear();\r\n };\r\n\r\n Scene.prototype.getLayer = function () {\r\n return this.j2Ds.layers.layer(this.layerName);\r\n };\r\n\r\n Scene.prototype.drawAllNodes = function () {\r\n for (var i = 0, len = this.nodes.length; i < len; i += 1) {\r\n if (this.nodes[i].draw) {\r\n this.nodes[i].draw();\r\n }\r\n }\r\n };\r\n\r\n Scene.prototype.init = function (_w, _h, _canDeactivate) {\r\n var scene = this;\r\n\r\n scene.j2Ds.events.onEvent('scene:beforeInit');\r\n\r\n scene.width = _w;\r\n scene.height = _h;\r\n\r\n scene.origWidth = _w;\r\n scene.origHeight = _h;\r\n\r\n scene.offsetWidth = _w;\r\n scene.offsetHeight = _h;\r\n\r\n scene.offsetLeft = 0;\r\n scene.offsetTop = 0;\r\n\r\n\r\n scene.j2Ds.canDeactivate = _canDeactivate != false;\r\n\r\n scene.j2Ds.layers.add('sceneNode', 0);\r\n\r\n scene.context = scene.j2Ds.layers.layer(scene.layerName).context;\r\n scene.canvas = scene.j2Ds.layers.layer(scene.layerName).canvas;\r\n scene.visible = true;\r\n\r\n scene.cancelClear = false;\r\n\r\n /* Вид \"камеры\" */\r\n scene.view = scene.j2Ds.viewManager.add('sceneView');\r\n\r\n scene.j2Ds.events.onEvent('scene:afterInit');\r\n\r\n scene.j2Ds.window.onload = function () {\r\n\r\n scene.j2Ds.window.focus();\r\n\r\n scene.j2Ds.window.onblur = function () {\r\n if (scene.j2Ds.stopAll == 0) {\r\n scene.j2Ds.stopEngine();\r\n scene.j2Ds.events.onEvent('scene:deactivate');\r\n }\r\n };\r\n\r\n scene.j2Ds.window.onfocus = function () {\r\n if (scene.j2Ds.stopAll == 1) {\r\n\r\n scene.j2Ds.runEngine(scene.j2Ds);\r\n scene.j2Ds.events.onEvent('scene:activate');\r\n }\r\n };\r\n\r\n for (var i in scene.j2Ds.layers.list) {\r\n scene.j2Ds.dom.attach(scene.j2Ds.layers.layer(i).canvas);\r\n }\r\n\r\n scene.j2Ds.ready = true;\r\n\r\n scene.j2Ds.events.onEvent('dom:loaded');\r\n };\r\n };\r\n\r\n Scene.prototype.initCanvas = function (_id, _canDeactivate) {\r\n var scene = this;\r\n\r\n scene.canFullScreen = false;\r\n\r\n scene.layerName = _id;\r\n\r\n scene.j2Ds.events.onEvent('scene:beforeInit');\r\n\r\n scene.width = parseInt(scene.j2Ds.dom.id(_id).width);\r\n scene.height = parseInt(scene.j2Ds.dom.id(_id).height);\r\n\r\n scene.origWidth = scene.width;\r\n scene.origHeight = scene.height;\r\n\r\n scene.offsetWidth = parseInt(scene.j2Ds.dom.id(_id).offsetWidth);\r\n scene.offsetHeight = parseInt(scene.j2Ds.dom.id(_id).offsetHeight);\r\n\r\n scene.offsetLeft = parseInt(scene.j2Ds.dom.id(_id).offsetLeft);\r\n scene.offsetTop = parseInt(scene.j2Ds.dom.id(_id).offsetTop);\r\n\r\n scene.stylePosition = scene.j2Ds.dom.id(_id).style.position == 'fixed' ? 'fixed' : 'absolute';\r\n\r\n scene.j2Ds.canDeactivate = _canDeactivate != false;\r\n\r\n scene.j2Ds.layers.add(_id, 0, 1);\r\n\r\n scene.context = scene.j2Ds.layers.layer(_id).context;\r\n scene.canvas = scene.j2Ds.layers.layer(_id).canvas;\r\n scene.visible = true;\r\n\r\n scene.cancelClear = false;\r\n\r\n /* Вид \"камеры\" */\r\n scene.view = scene.j2Ds.viewManager.add('sceneView');\r\n\r\n scene.j2Ds.events.onEvent('scene:afterInit');\r\n\r\n scene.j2Ds.window.onload = function () {\r\n\r\n scene.j2Ds.window.focus();\r\n\r\n scene.j2Ds.window.onblur = function () {\r\n if (scene.j2Ds.stopAll == 0) {\r\n scene.j2Ds.stopEngine();\r\n scene.j2Ds.events.onEvent('scene:deactivate');\r\n }\r\n };\r\n\r\n scene.j2Ds.window.onfocus = function () {\r\n if (scene.j2Ds.stopAll == 1) {\r\n scene.j2Ds.runEngine(scene.j2Ds);\r\n scene.j2Ds.events.onEvent('scene:activate');\r\n }\r\n };\r\n\r\n for (var i in scene.j2Ds.layers.list) {\r\n scene.j2Ds.dom.attach(scene.j2Ds.layers.layer(i).canvas);\r\n }\r\n\r\n scene.j2Ds.ready = true;\r\n\r\n scene.j2Ds.events.onEvent('dom:loaded');\r\n };\r\n };\r\n\r\n /* Nodes */\r\n Scene.prototype.addBaseNode = function (pos, size) {\r\n return new BaseNode(this.j2Ds, pos, size);\r\n };\r\n\r\n Scene.prototype.addCircleNode = function (pos, radius, color) {\r\n return new CircleNode(this.j2Ds, pos, radius, color);\r\n };\r\n\r\n Scene.prototype.addLineNode = function (pos, points, scale, color, width, fill, cFill) {\r\n return new LineNode(this.j2Ds, pos, points, scale, color, width, fill, cFill);\r\n };\r\n\r\n Scene.prototype.addRectNode = function (pos, size, color) {\r\n return new RectNode(this.j2Ds, pos, size, color);\r\n };\r\n\r\n Scene.prototype.addSpriteNode = function (pos, size, animation) {\r\n return new SpriteNode(this.j2Ds, pos, size, animation);\r\n };\r\n\r\n Scene.prototype.addTextNode = function (pos, text, sizePx, color, family, width, colorL) {\r\n return new TextNode(this.j2Ds, pos, text, sizePx, color, family, width, colorL);\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Scene = Scene;\r\n if (global.j2Ds !== undefined) global.modules.core.Scene = Scene;\r\n return Scene;\r\n }));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('j2Ds', [\r\n 'core/Dom',\r\n 'core/Gui',\r\n 'core/Events',\r\n 'core/Layers',\r\n 'core/Scene',\r\n\r\n 'io/AudioHandler',\r\n 'io/InputHandler',\r\n 'io/TouchHandler',\r\n\r\n 'managers/DeviceManager',\r\n 'managers/ErrorManager',\r\n 'managers/FpsManager',\r\n 'managers/ResourceManager',\r\n 'managers/StorageManager',\r\n 'managers/TimeManager',\r\n 'managers/TriggerManager',\r\n 'managers/ViewManager',\r\n\r\n 'utils/MathUtil',\r\n 'utils/TextureUtil'\r\n ], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(\r\n require('core/Dom'),\r\n require('core/Gui'),\r\n require('core/Events'),\r\n require('core/Layers'),\r\n require('core/Scene'),\r\n\r\n require('io/AudioHandler'),\r\n require('io/InputHandler'),\r\n require('io/TouchHandler'),\r\n\r\n require('managers/DeviceManager'),\r\n require('managers/ErrorManager'),\r\n require('managers/FpsManager'),\r\n require('managers/ResourceManager'),\r\n require('managers/StorageManager'),\r\n require('managers/TimeManager'),\r\n require('managers/TriggerManager'),\r\n require('managers/ViewManager'),\r\n\r\n require('utils/MathUtil'),\r\n require('utils/TextureUtil')\r\n );\r\n } else {\r\n factory(\r\n root.modules.core.Dom,\r\n root.modules.core.Gui,\r\n root.modules.core.Events,\r\n root.modules.core.Layers,\r\n root.modules.core.Scene,\r\n\r\n root.modules.io.AudioHandler,\r\n root.modules.io.InputHandler,\r\n root.modules.io.TouchHandler,\r\n\r\n root.modules.managers.DeviceManager,\r\n root.modules.managers.ErrorManager,\r\n root.modules.managers.FpsManager,\r\n root.modules.managers.ResourceManager,\r\n root.modules.managers.StorageManager,\r\n root.modules.managers.TimeManager,\r\n root.modules.managers.TriggerManager,\r\n root.modules.managers.ViewManager,\r\n\r\n root.modules.utils.MathUtil,\r\n root.modules.utils.TextureUtil\r\n );\r\n }\r\n}(typeof window !== 'undefined' ? window : global,\r\n function (DOM,\r\n GUI,\r\n Events,\r\n Layers,\r\n Scene,\r\n AudioHandler,\r\n InputHandler,\r\n TouchHandler,\r\n DeviceManager,\r\n ErrorManager,\r\n FPSManager,\r\n ResourceManager,\r\n StorageManager,\r\n TimeManager,\r\n TriggerManager,\r\n ViewManager,\r\n MathUtil) {\r\n \"use strict\";\r\n\r\n var frameLimit = 60;\r\n\r\n /*------------------ 2D движок --------------------*/\r\n var j2DsEngine = function () {\r\n this.vector = {};\r\n this.math = {};\r\n this.dom = {};\r\n this.now = Date.now();\r\n this.dt = 0;\r\n this.stopAll = 0;\r\n this.frameLimit = 60;\r\n this.sceneStartTime = 0;\r\n this.sceneSkipTime = 0;\r\n this.engine = function () {\r\n this.errorManager.show('Не инициализировано ни одно игровое состояние', 'red');\r\n this.stopEngine();\r\n };\r\n this.ready = false;\r\n this.window = window;\r\n this.canDeactivate = true;\r\n\r\n /* Getters & Setters */\r\n\r\n this.getInfo = function () {\r\n return {\r\n 'name': 'j2DsEngine',\r\n 'version': '0.6.2',\r\n 'git': 'https://github.com/SkanerSoft/j2DsEngine',\r\n 'site': 'http://j2DsEngine.ru',\r\n 'description': 'HTML5 2D Game Engine',\r\n 'author': 'Skaner'\r\n };\r\n };\r\n\r\n this.getFPSManager = function () {\r\n this.fpsManager.init();\r\n return this.fpsManager;\r\n };\r\n\r\n this.getSceneManager = function () {\r\n return this.scene;\r\n };\r\n\r\n this.getLayerManager = function () {\r\n return this.layers;\r\n };\r\n\r\n this.getTextureManager = function () {\r\n return this.scene.texture;\r\n };\r\n\r\n this.getAudioManager = function () {\r\n this.audio.init();\r\n return this.audio;\r\n };\r\n\r\n this.getPaintManager = function () {\r\n return this.paint;\r\n };\r\n\r\n this.getIO = function () {\r\n this.input.init();\r\n return this.input;\r\n };\r\n\r\n this.getTouchIO = function () {\r\n this.touch.init();\r\n return this.touch;\r\n };\r\n\r\n this.getDOMManager = function () {\r\n return this.dom;\r\n };\r\n\r\n this.getTriggerManager = function () {\r\n this.trigger.init();\r\n return this.trigger;\r\n };\r\n\r\n this.getMathManager = function () {\r\n return MathUtil;\r\n };\r\n\r\n this.getGameStateManager = function () {\r\n return this.gameStates;\r\n };\r\n\r\n this.getViewManager = function () {\r\n return this.viewManager;\r\n };\r\n\r\n this.getDeviceManager = function () {\r\n return this.deviceManager;\r\n };\r\n\r\n this.getErrorManager = function () {\r\n this.errorManager.init();\r\n return this.errorManager;\r\n };\r\n\r\n this.getTimeManager = function () {\r\n return this.timeManager;\r\n };\r\n\r\n this.getResourceManager = function () {\r\n return this.resources;\r\n };\r\n\r\n this.setWindow = function (_window) {\r\n this.window = _window ? _window : window;\r\n };\r\n\r\n this.setFrameLimit = function (fps) {\r\n this.frameLimit = (fps > 0 && fps <= 60) ? fps : 60;\r\n frameLimit = this.frameLimit;\r\n };\r\n\r\n this.setActiveEngine = function (engine) {\r\n this.engine = typeof engine == 'function'\r\n ? engine\r\n : this.errorManager.show('Error in \"GameStateManager\"');\r\n };\r\n\r\n this.events = new Events(this);\r\n this.dom = new DOM(this);\r\n this.gui = new GUI(this);\r\n this.resources = new ResourceManager(this);\r\n this.timeManager = new TimeManager(this);\r\n this.deviceManager = DeviceManager();\r\n this.errorManager = new ErrorManager(this);\r\n this.fpsManager = new FPSManager(this);\r\n this.input = new InputHandler(this);\r\n this.layers = new Layers(this);\r\n this.viewManager = new ViewManager(this);\r\n this.scene = new Scene(this);\r\n\r\n this.createLocal = function (id) {\r\n new StorageManager(this, id);\r\n }\r\n };\r\n\r\n j2DsEngine.prototype.gameStates = {\r\n states: {},\r\n\r\n add: function (name, _state, start, end) {\r\n var state = {};\r\n state.state = _state;\r\n state.start = start || false;\r\n state.end = end || false;\r\n\r\n this.states[name] = state;\r\n }\r\n };\r\n\r\n j2DsEngine.prototype.start = function (engine, frameLimit) {\r\n this.setActiveEngine(engine);\r\n this.frameLimit = frameLimit || 60;\r\n this.sceneSkipTime = 1000.0 / this.frameLimit;\r\n this.lastTime = Date.now();\r\n this.dt = 0;\r\n this.sceneStartTime = this.lastTime;\r\n this.gameEngine(this);\r\n };\r\n\r\n j2DsEngine.prototype.gameEngine = function (j2Ds) {\r\n j2Ds.now = Date.now();\r\n setTimeout(function () {\r\n if (!j2Ds.stopAll) {\r\n j2Ds.dt = (j2Ds.now - j2Ds.lastTime) / 100.0;\r\n j2Ds.sceneStartTime = j2Ds.now;\r\n if (j2Ds.dt > j2Ds.sceneSkipTime / 2) j2Ds.dt = 0;\r\n\r\n j2Ds.events.onEvent('engine:before');\r\n\r\n try {\r\n j2Ds.engine();\r\n } catch (err) {\r\n j2Ds.errorManager.showError(err);\r\n }\r\n\r\n j2Ds.events.onEvent('engine:after');\r\n\r\n j2Ds.lastTime = j2Ds.now;\r\n\r\n requestAnimationFrame(function () {\r\n j2Ds.gameEngine(j2Ds);\r\n });\r\n }\r\n }, (j2Ds.frameLimit < 60 ? j2Ds.sceneSkipTime : 0));\r\n };\r\n\r\n var requestAnimationFrame = (function () {\r\n return window.requestAnimationFrame ||\r\n window.webkitRequestAnimationFrame ||\r\n window.mozRequestAnimationFrame ||\r\n window.oRequestAnimationFrame ||\r\n window.msRequestAnimationFrame ||\r\n function (callback) {\r\n window.setTimeout(callback, 1000 / frameLimit);\r\n };\r\n })();\r\n\r\n j2DsEngine.prototype.stopEngine = function () {\r\n if (!this.canDeactivate) return;\r\n this.stopAll = true;\r\n };\r\n\r\n j2DsEngine.prototype.runEngine = function (j2Ds) {\r\n j2Ds = j2Ds || this;\r\n if (!j2Ds.canDeactivate) return;\r\n if (!j2Ds.stopAll) return;\r\n j2Ds.stopAll = false;\r\n requestAnimationFrame(function () {\r\n j2Ds.gameEngine(j2Ds);\r\n });\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.j2Ds = j2DsEngine;\r\n if (global.j2Ds !== undefined) global.modules.core.j2Ds = j2DsEngine;\r\n if (global.j2Ds !== undefined) global.j2Ds = new j2DsEngine();\r\n return j2DsEngine;\r\n }\r\n));\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["j2ds.js","MathUtil.js","TextureUtil.js","Dom.js","Gui.js","Events.js","BaseNode.js","CircleNode.js","LineNode.js","RectNode.js","SpriteNode.js","TextNode.js","DeviceManager.js","ErrorManager.js","FpsManager.js","ResourceManager.js","StorageManager.js","TimeManager.js","TriggerManager.js","ViewManager.js","AudioHandler.js","InputHandler.js","TouchHandler.js","Layers.js","Scene.js","j2Ds.js"],"names":["root","factory","define","amd","module","exports","window","global","MathUtil","v2f","x","y","v2i","toInt","number","rndColor","min","max","opacity","random","omitZero","Math","floor","rad","num","PI","undefined","j2Ds","modules","utils","TextureUtil","this","prototype","createImageMap","width","height","callback","textureUtil","resources","add","image","img","loaded","document","createElement","context","getContext","getAnimation","sourceX","sourceY","sourceW","sourceH","frameCount","imageMap","ok","loadImageMap","path","crossOrigin","src","addEventListener","templates","ellipse","size","color","fillRect","fillStyle","strokeRect","lineWidth","strokeStyle","gradientL","colors","isHorizontal","gradient","createLinearGradient","step","length","i","j","addColorStop","gradientR","pos1","r1","pos2","r2","createRadialGradient","Dom","id","getElementById","name","getElementsByName","tag","parent","finder","getElementsByTagName","goURL","url","location","href","reloadURL","attach","dom","events","addEvent","appendChild","injectJavaScript","code","toString","replace","callJava","send","ajax","XMLHttpRequest","open","onreadystatechange","readyState","status","responseText","core","Gui","nodes","Events","scene:deactivate","scene:activate","scene:beforeInit","scene:afterInit","scene:beforeStart","scene:afterStart","engine:before","engine:after","scene:changedGameState","writeMode:keyPress","dom:loaded","eventType","push","now","ready","onEvent","destroyEvent","len","splice","args","err","errorManager","showError","require","BaseNode","_j2Ds","pos","visible","alpha","angle","layer","scene","box","offset","resizeBox","setLayer","layers","getLayer","setVisible","isVisible","setAlpha","getAlpha","moveTo","to","t","move","getPosition","setPosition","ceil","setSize","getSize","setParent","getDistance","sqrt","pow","getDistanceXY","abs","isIntersect","x1","x2","y1","y2","isCollision","result","isLookScene","view","turn","setRotation","getRotation","rotateTo","_to","_t","atan2","isOutScene","vector","all","moveDir","speed","cos","sin","drawBox","beginPath","rect","stroke","CircleNode","radius","call","Object","create","constructor","draw","tmpAlpha","globalAlpha","arc","fill","LineNode","points","scale","cFill","lineTo","RectNode","save","translate","rotate","restore","SpriteNode","animation","tmpSpeed","frame","flip","setFlip","drawFrame","show","drawImage","setAnimation","TextNode","text","sizePx","family","colorL","vAlign","hAlign","font","fullText","maxWidth","lines","split","measureText","drawSimpleText","textAlign","textBaseline","strokeText","fillText","getText","setText","DeviceManager","parseInt","documentElement","clientWidth","screen","clientHeight","managers","ErrorManager","mode","enabled","init","_true","runBtn","innerHTML","style","padding","align","position","zIndex","left","top","getDeviceManager","fontSize","backgroundColor","cursor","onmousedown","e","stopPropagation","onclick","runEngine","logListener","elems","pauseBtn","stopEngine","reloadBtn","onerror","string","console","log","setMode","debug","_func","stack","match","file","line","decodeURI","errMess","message","domId","count","execLine","lightSyntax","_code","_type","FpsManager","fps","frameLimit","tmp_of_fps","tmp_of_time","Date","fpsManager","update","getFPS","ResourceManager","added","failed","fail","isLoaded","getProgress","StorageManager","ls","localStorage","alert","saveNode","o","setItem","JSON","stringify","load","getItem","is","value","loadNode","parse","TimeManager","times","insert","get","TriggerManager","triggers","triggerManager","trigger","command","state","last","run","mSec","job","loop","reset","ViewManager","views","viewManager","viewport","focusNode","AudioHandler","audios","audioHandler","deactivate","activate","files","vol","audio","source","volume","sound","domEl","lock","onePlay","explicitOriginalTarget","currentSrc","setLock","play","unlock","currentTime","pause","stop","setVolume","getVolume","getState","getPlayPosition","snd","io","InputHandler","screenPos","keyDown","keyPress","keyPressed","keyUp","keyUped","mouseDown","mousePress","mousePressed","mouseUp","mouseUpped","mouseWheel","canceled","body","anyKey","anyMouse","writeMode","displayCursor","mKey","LEFT","MIDDLE","RIGHT","jKey","UP","DOWN","SPACE","CTRL","SHIFT","ALT","ESC","ENTER","MINUS","PLUS","CAPS_LOCK","BACKSPACE","TAB","Q","W","E","R","T","Y","U","I","O","P","A","S","D","F","G","H","J","K","L","Z","X","V","B","N","M","0","1","2","3","4","5","6","7","8","C","9","NUM_0","NUM_1","NUM_2","NUM_3","NUM_4","NUM_5","NUM_6","NUM_7","NUM_8","NUM_9","NUM_MINUS","NUM_PLUS","NUM_LOCK","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","keyList","isKeyDown","isKeyPress","isKeyUp","getScreenPosition","setWriteMode","isWriteMode","keyEvent","type","keyCode","preventDefault","char","which","charCode","String","fromCharCode","cancel","onNode","upd","dX","offsetWidth","dY","offsetHeight","onMove","offsetLeft","pageX","offsetTop","pageY","isMouseDown","isMousePress","isMouseUp","isMouseWheel","onMouseWheel","wheelDelta","detail","onMouseEvent","button","mouseUped","focus","setCursorImage","curImg","input","oncontextmenu","onselectstart","ondragstart","onmouseup","onmousemove","onkeydown","onkeyup","onkeypress","onmousewheel","TouchHandler","touchs","tapDown","tapPress","tapUp","isTapDown","isTapPress","isTapUp","getTouch","onTouchEvent","touchHandler","Layers","layersList","index","notDOM","layerName","canvas","stylePosition","shadowColor","onContext","display","setIndex","clear","clearRect","clearNode","node","setContextSettings","settings","Scene","gameStateName","canFullScreen","texture","setView","getView","setAutoDraw","toggle","drawAllNodes","setAutoClear","setGameState","gameStates","states","start","setActiveEngine","getGameState","fullScreen","tmpCanvas","tmpContext","origWidth","origHeight","fullScale","canDeactivate","cancelClear","onload","onblur","stopAll","onfocus","initCanvas","addBaseNode","addCircleNode","addLineNode","addRectNode","addSpriteNode","addTextNode","DOM","GUI","FPSManager","j2DsEngine","math","dt","sceneStartTime","sceneSkipTime","engine","getInfo","version","git","site","description","author","getFPSManager","getSceneManager","getLayerManager","getTextureManager","getAudioManager","getPaintManager","paint","getIO","getTouchIO","touch","getDOMManager","getTriggerManager","getMathManager","getGameStateManager","getViewManager","deviceManager","getErrorManager","getTimeManager","timeManager","getResourceManager","setWindow","_window","setFrameLimit","gui","createLocal","_state","end","lastTime","gameEngine","setTimeout","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CCbA,SAAAA,EAAAC,GACA,kBAAAC,SAAAA,OAAAC,IACAD,OAAA,oBAAAD,GACA,gBAAAG,SAAA,gBAAAA,QAAAC,QACAD,OAAAC,QAAAJ,IAEAA,KAEA,mBAAAK,QAAAA,OAAAC,OAAA,WACA,YAEA,IAAAC,GAAA,YAoCA,OAjCAA,GAAAC,IAAA,SAAAC,EAAAC,GACA,OAAAD,EAAAA,EAAAC,EAAAA,IAGAH,EAAAI,IAAA,SAAAF,EAAAC,GACA,OAAAD,EAAAA,GAAA,EAAAC,EAAAA,GAAA,IAGAH,EAAAK,MAAA,SAAAC,GACA,MAAAA,IAAA,GAGAN,EAAAO,SAAA,SAAAC,EAAAC,EAAAC,GACA,MAAA,QACAV,EAAAW,OAAAH,EAAAC,GAAA,KACAT,EAAAW,OAAAH,EAAAC,GAAA,KACAT,EAAAW,OAAAH,EAAAC,GAAA,KACAC,EAAA,KAGAV,EAAAW,OAAA,SAAAH,EAAAC,EAAAG,GACA,GAAAD,GAAAE,KAAAC,MAAAD,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A3G,EAAAymB,UAAA,IACAzmB,EAAAqkB,eAAArkB,EAAA2G,IACA3G,EAAAokB,GAAApkB,EAAAskB,cAAA,IAAAtkB,EAAAokB,GAAA,GAEApkB,EAAA0E,OAAAmC,QAAA,gBAEA,KACA7G,EAAAukB,SACA,MAAArd,GACAlH,EAAAmH,aAAAC,UAAAF,GAGAlH,EAAA0E,OAAAmC,QAAA,gBAEA7G,EAAAymB,SAAAzmB,EAAA2G,IAEAigB,EAAA,WACA5mB,EAAA0mB,WAAA1mB,OAGAA,EAAA8R,WAAA,GAAA9R,EAAAskB,cAAA,GAGA,IAAAsC,GAAA,WACA,MAAAjoB,QAAAioB,uBACAjoB,OAAAkoB,6BACAloB,OAAAmoB,0BACAnoB,OAAAooB,wBACApoB,OAAAqoB,yBACA,SAAAvmB,GACA9B,OAAAgoB,WAAAlmB,EAAA,IAAAqR,MAsBA,OAlBAoS,GAAA7jB,UAAAiQ,WAAA,WACAlQ,KAAA8iB,gBACA9iB,KAAAkjB,SAAA,IAGAY,EAAA7jB,UAAA6P,UAAA,SAAAlQ,GACAA,EAAAA,GAAAI,KACAJ,EAAAkjB,eACAljB,EAAAsjB,UACAtjB,EAAAsjB,SAAA,EACAsD,EAAA,WACA5mB,EAAA0mB,WAAA1mB,OAIA,gBAAAvB,SAAA,gBAAAA,QAAAC,UAAAD,OAAAC,QAAAsB,KAAAkkB,GACAnkB,SAAAnB,OAAAoB,OAAApB,OAAAqB,QAAAyF,KAAA1F,KAAAkkB,GACAnkB,SAAAnB,OAAAoB,OAAApB,OAAAoB,KAAA,GAAAkkB,IACAA","file":"j2ds.js","sourcesContent":[null,"/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('utils/MathUtil', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var MathUtil = function () {\r\n };\r\n\r\n MathUtil.v2f = function (x, y) {\r\n return {x: x, y: y};\r\n };\r\n\r\n MathUtil.v2i = function (x, y) {\r\n return {x: (x >> 0), y: (y >> 0)};\r\n };\r\n\r\n MathUtil.toInt = function (number) {\r\n return number >> 0;\r\n };\r\n\r\n MathUtil.rndColor = function (min, max, opacity) {\r\n return 'rgba('\r\n + MathUtil.random(min, max) + ', '\r\n + MathUtil.random(min, max) + ', '\r\n + MathUtil.random(min, max) + ', '\r\n + opacity + ')';\r\n };\r\n\r\n MathUtil.random = function (min, max, omitZero) {\r\n var random = (Math.floor(Math.random() * (max - min + 1) + min));\r\n return (omitZero && random == 0)\r\n ? MathUtil.random(min, max, omitZero)\r\n : random;\r\n };\r\n\r\n MathUtil.rad = function (num) {\r\n return num * (Math.PI / 180);\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.MathUtil = MathUtil;\r\n if (global.j2Ds !== undefined) global.modules.utils.MathUtil = MathUtil;\r\n return MathUtil;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.3\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('utils/TextureUtil', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var TextureUtil = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n };\r\n\r\n TextureUtil.prototype.createImageMap = function (width, height, callback) {\r\n var textureUtil = this;\r\n textureUtil.j2Ds.resources.add();\r\n var image = {\r\n img: null,\r\n loaded: false,\r\n width: width,\r\n height: height\r\n };\r\n\r\n image.img = document.createElement('canvas');\r\n image.context = image.img.getContext('2d');\r\n image.img.width = image.width;\r\n image.img.height = image.height;\r\n\r\n callback(image.context);\r\n image.loaded = true;\r\n\r\n /* Функции */\r\n image.getAnimation = function (sourceX, sourceY, sourceW, sourceH, frameCount) {\r\n return {\r\n imageMap: this,\r\n sourceX: sourceX,\r\n sourceY: sourceY,\r\n sourceW: sourceW,\r\n sourceH: sourceH,\r\n frameCount: frameCount - 1\r\n };\r\n };\r\n\r\n textureUtil.j2Ds.resources.ok('createImageMap_' + width + 'x' + height);\r\n\r\n return image;\r\n };\r\n\r\n TextureUtil.prototype.loadImageMap = function (path) {\r\n var textureUtil = this;\r\n textureUtil.j2Ds.resources.add();\r\n var image = {\r\n img: null,\r\n width: 0,\r\n height: 0,\r\n loaded: false\r\n };\r\n\r\n image.img = document.createElement('img');\r\n image.crossOrigin = 'anonymous';\r\n image.img.src = path;\r\n\r\n image.img.addEventListener('load', function () {\r\n image.width = image.img.width;\r\n image.height = image.img.height;\r\n image.loaded = true;\r\n textureUtil.j2Ds.resources.ok(path);\r\n });\r\n\r\n image.img.addEventListener('error', function () {\r\n image.width = 0;\r\n image.height = 0;\r\n image.loaded = false;\r\n //textureUtil.j2Ds.resources.fail(path);\r\n });\r\n /* Свойства */\r\n\r\n /* Функции */\r\n image.getAnimation = function (sourceX, sourceY, sourceW, sourceH, frameCount) {\r\n return {\r\n imageMap: this,\r\n sourceX: sourceX,\r\n sourceY: sourceY,\r\n sourceW: sourceW,\r\n sourceH: sourceH,\r\n frameCount: frameCount - 1\r\n };\r\n };\r\n\r\n return image;\r\n };\r\n\r\n /* -------------------- */\r\n\r\n TextureUtil.prototype.templates = {\r\n ellipse: function (context, size, color) { // TODO??\r\n },\r\n fillRect: function (context, size, color) {\r\n context.fillStyle = color;\r\n context.fillRect(0, 0, size.x, size.y);\r\n },\r\n strokeRect: function (context, size, color, lineWidth) {\r\n context.strokeStyle = color;\r\n context.lineWidth = lineWidth;\r\n context.strokeRect(0, 0, size.x, size.y);\r\n },\r\n gradientL: function (context, size, colors, isHorizontal) {\r\n var gradient = context.createLinearGradient(0, 0, size.x, 0);\r\n var step = 1 / colors.length;\r\n if (!isHorizontal) {\r\n gradient = context.createLinearGradient(0, 0, 0, size.y);\r\n }\r\n for (var i = step / 2, j = 0; j < colors.length; j += 1, i += step) {\r\n gradient.addColorStop(i, colors[j]);\r\n }\r\n context.fillStyle = gradient;\r\n context.fillRect(0, 0, size.x, size.y);\r\n },\r\n gradientR: function (context, size, pos1, r1, pos2, r2, colors) {\r\n var gradient = context.createRadialGradient(pos1.x, pos1.y, r1, pos2.x, pos2.y, r2);\r\n var step = 1 / colors.length;\r\n for (var i = step / 2, j = 0; j < colors.length; j += 1, i += step) {\r\n gradient.addColorStop(i, colors[j]);\r\n }\r\n context.fillStyle = gradient;\r\n context.fillRect(0, 0, size.x, size.y);\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TextureUtil = TextureUtil;\r\n if (global.j2Ds !== undefined) global.modules.utils.TextureUtil = TextureUtil;\r\n return TextureUtil;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Dom', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n /*----------- DOM ---------------*/\r\n var Dom = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n };\r\n\r\n Dom.prototype.id = function (id) {\r\n return document.getElementById(id);\r\n };\r\n\r\n Dom.prototype.name = function (id) {\r\n return document.getElementsByName(id)[0];\r\n };\r\n\r\n Dom.prototype.tag = function (id, parent) {\r\n var finder = parent || document;\r\n return finder.getElementsByTagName(id);\r\n };\r\n\r\n Dom.prototype.goURL = function (url) {\r\n document.location.href = url;\r\n };\r\n\r\n Dom.prototype.reloadURL = function () {\r\n document.location.href = document.location.href;\r\n };\r\n\r\n Dom.prototype.attach = function (id, parent) {\r\n var dom = this;\r\n this.j2Ds.events.addEvent('dom:loaded', function (parent) {\r\n if (!parent) {\r\n dom.tag('body')[0].appendChild(id);\r\n } else {\r\n dom.id(parent).appendChild(id);\r\n }\r\n });\r\n };\r\n\r\n Dom.prototype.injectJavaScript = function (code) {\r\n code = code.toString();\r\n code = code.replace(/[\\n\\r\\t]/g, ';');\r\n document.location.href = 'javascript: var injectFunction = (function() {setTimeout(' + code + ', 0);}); injectFunction();';\r\n };\r\n\r\n Dom.prototype.callJava = function (code) {\r\n document.location.href = 'javacall:' + code;\r\n };\r\n\r\n Dom.prototype.send = function (path, callback) {\r\n var ajax = new XMLHttpRequest();\r\n ajax.open('GET', path, true);\r\n ajax.onreadystatechange = function () {\r\n if (ajax.readyState == 4) {\r\n if (ajax.status == 200) {\r\n callback(ajax.responseText);\r\n }\r\n }\r\n };\r\n ajax.send(null);\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Dom = Dom;\r\n if (global.j2Ds !== undefined) global.modules.core.Dom = Dom;\r\n return Dom;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Gui', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n /*----------- GUI ---------------*/\r\n var Gui = function () {\r\n this.nodes = {};\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Gui = Gui;\r\n if (global.j2Ds !== undefined) global.modules.core.Gui = Gui;\r\n return Gui;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Events', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var Events = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.events = {\r\n 'scene:deactivate': [],\r\n 'scene:activate': [],\r\n\r\n 'scene:beforeInit': [],\r\n 'scene:afterInit': [],\r\n 'scene:beforeStart': [],\r\n 'scene:afterStart': [],\r\n\r\n 'engine:before': [],\r\n 'engine:after': [],\r\n\r\n 'scene:changedGameState': [],\r\n\r\n 'writeMode:keyPress': [],\r\n\r\n 'dom:loaded': []\r\n };\r\n };\r\n\r\n\r\n Events.prototype.addEvent = function (eventType, callback, id) {\r\n this.events[eventType].push({\r\n id: id || this.j2Ds.now,\r\n callback: callback\r\n });\r\n if (this.j2Ds.ready && eventType == 'dom:loaded') {\r\n this.onEvent('dom:loaded');\r\n return true;\r\n }\r\n };\r\n\r\n Events.prototype.destroyEvent = function (eventType, id) {\r\n var events = this;\r\n for (var i = 0, len = events.events[eventType].length; i < len; i += 1) {\r\n if (events.events[eventType][i]['id'] == id) {\r\n events.events[eventType].splice(i, 1);\r\n }\r\n }\r\n };\r\n\r\n Events.prototype.onEvent = function (eventType, args) {\r\n var events = this;\r\n for (var i = 0, len = events.events[eventType].length; i < len; i += 1) {\r\n if (events.events[eventType]) {\r\n try {\r\n events.events[eventType][i]['callback'](args || '');\r\n } catch (err) {\r\n events.j2Ds.errorManager.showError(err);\r\n }\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Events = Events;\r\n if (global.j2Ds !== undefined) global.modules.core.Events = Events;\r\n return Events;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.3\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/BaseNode', ['utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var BaseNode = function (_j2Ds, pos, size) {\r\n j2Ds = _j2Ds;\r\n this.visible = true;\r\n this.alpha = 1;\r\n this.pos = pos;\r\n this.size = size;\r\n this.parent = false;\r\n this.angle = 0;\r\n this.layer = j2Ds.scene;\r\n this.box = {\r\n offset: {\r\n x: 0,\r\n y: 0\r\n },\r\n size: {\r\n x: 0,\r\n y: 0\r\n }\r\n };\r\n j2Ds.scene.nodes.push(this);\r\n };\r\n\r\n BaseNode.prototype.resizeBox = function (offset, size) {\r\n this.box.offset = offset;\r\n this.box.size = size;\r\n };\r\n\r\n BaseNode.prototype.setLayer = function (layer) {\r\n this.layer = layer ? j2Ds.layers.layer(layer) : j2Ds.scene;\r\n };\r\n\r\n BaseNode.prototype.getLayer = function () {\r\n return this.layer;\r\n };\r\n\r\n BaseNode.prototype.setVisible = function (visible) {\r\n this.visible = !!visible;\r\n };\r\n\r\n BaseNode.prototype.isVisible = function () {\r\n return this.visible;\r\n };\r\n\r\n BaseNode.prototype.setAlpha = function (alpha) {\r\n if (alpha < 0) alpha = 0;\r\n if (alpha > 1) alpha = 1;\r\n this.alpha = alpha;\r\n };\r\n\r\n BaseNode.prototype.getAlpha = function () {\r\n return this.alpha;\r\n };\r\n\r\n BaseNode.prototype.moveTo = function (to, t) {\r\n t = t ? t : 1;\r\n this.move(MathUtil.v2f(\r\n ((to.x - this.getPosition().x) / t),\r\n ((to.y - this.getPosition().y) / t)\r\n ));\r\n };\r\n\r\n BaseNode.prototype.setPosition = function (pos) {\r\n if (pos) {\r\n this.pos = MathUtil.v2f(pos.x - Math.ceil(this.size.x / 2), pos.y - Math.ceil(this.size.y / 2));\r\n } else {\r\n return this.pos;\r\n }\r\n };\r\n\r\n BaseNode.prototype.move = function (pos) {\r\n this.pos.x += pos.x;\r\n this.pos.y += pos.y;\r\n };\r\n\r\n BaseNode.prototype.getPosition = function () {\r\n return MathUtil.v2f(this.pos.x + Math.ceil(this.size.x / 2), this.pos.y + Math.ceil(this.size.y / 2));\r\n };\r\n\r\n BaseNode.prototype.setSize = function (size) {\r\n if (size) {\r\n this.size = size;\r\n } else {\r\n return this.size;\r\n }\r\n };\r\n\r\n BaseNode.prototype.getSize = function () {\r\n return this.size;\r\n };\r\n\r\n BaseNode.prototype.setParent = function (id) {\r\n this.parent = id;\r\n };\r\n\r\n BaseNode.prototype.getDistance = function (id) {\r\n return Math.ceil(Math.sqrt(\r\n Math.pow(id.getPosition().x - this.getPosition().x, 2) +\r\n Math.pow(id.getPosition().y - this.getPosition().y, 2)\r\n )\r\n );\r\n };\r\n\r\n BaseNode.prototype.getDistanceXY = function (id) {\r\n return MathUtil.v2f(Math.abs(id.getPosition().x - this.getPosition().x), Math.abs(id.getPosition().y - this.getPosition().y));\r\n };\r\n\r\n BaseNode.prototype.isIntersect = function (id) {\r\n var pos = {\r\n x1: this.pos.x + this.box.offset.x,\r\n x2: id.pos.x + id.box.offset.x,\r\n y1: this.pos.y + this.box.offset.y,\r\n y2: id.pos.y + id.box.offset.y\r\n };\r\n\r\n var size = {\r\n x1: this.size.x + this.box.size.x,\r\n x2: id.size.x + id.box.size.x,\r\n y1: this.size.y + this.box.size.y,\r\n y2: id.size.y + id.box.size.y\r\n };\r\n\r\n return (\r\n (pos.y1 + size.y1 >= pos.y2) &&\r\n (pos.x1 + size.x1 >= pos.x2)\r\n ) && (\r\n (pos.x1 < pos.x2 + size.x2) &&\r\n (pos.y1 < pos.y2 + size.y2)\r\n );\r\n };\r\n\r\n BaseNode.prototype.isCollision = function (id) {\r\n var result = false;\r\n if (\r\n (this.getDistanceXY(id).x < (this.size.x / 2 + id.size.x / 2)) &&\r\n (this.getDistanceXY(id).y < (this.size.y / 2 + id.size.y / 2))\r\n ) {\r\n result = true;\r\n }\r\n return result;\r\n };\r\n\r\n BaseNode.prototype.isLookScene = function () {\r\n return !((this.pos.x > j2Ds.scene.view.pos.x + j2Ds.scene.width || this.pos.x + this.size.x < j2Ds.scene.view.pos.x)\r\n || (this.pos.y > j2Ds.scene.view.pos.y + j2Ds.scene.height || this.pos.y + this.size.y < j2Ds.scene.view.pos.y));\r\n };\r\n\r\n BaseNode.prototype.turn = function (angle) {\r\n this.angle = (this.angle % 360);\r\n this.angle += angle;\r\n };\r\n\r\n BaseNode.prototype.setRotation = function (angle) {\r\n this.angle = angle % 360;\r\n };\r\n\r\n BaseNode.prototype.getRotation = function () {\r\n return this.angle;\r\n };\r\n\r\n BaseNode.prototype.rotateTo = function (_to, _t) {\r\n _t = _t ? _t : 1;\r\n this.setRotation((Math.atan2(\r\n (_to.y - this.getPosition().y),\r\n (_to.x - this.getPosition().x)\r\n ) * (180 / Math.PI)) / _t);\r\n };\r\n\r\n BaseNode.prototype.isOutScene = function () {\r\n var vector = {};\r\n\r\n if (this.pos.x + this.size.x >= j2Ds.scene.view.pos.x + j2Ds.scene.width) {\r\n vector.x = 1;\r\n } else if (this.pos.x <= j2Ds.scene.view.pos.x) {\r\n vector.x = -1;\r\n } else {\r\n vector.x = 0;\r\n }\r\n\r\n if (this.pos.y + this.size.y >= j2Ds.scene.view.pos.y + j2Ds.scene.height) {\r\n vector.y = 1;\r\n } else if (this.pos.y <= j2Ds.scene.view.pos.y) {\r\n vector.y = -1;\r\n } else {\r\n vector.y = 0;\r\n }\r\n\r\n vector.all = (vector.x || vector.y);\r\n\r\n return vector;\r\n };\r\n\r\n BaseNode.prototype.moveDir = function (speed) {\r\n this.pos.x += speed * (Math.cos(MathUtil.rad(this.angle)));\r\n this.pos.y += speed * (Math.sin(MathUtil.rad(this.angle)));\r\n };\r\n\r\n BaseNode.prototype.drawBox = function () {\r\n var context = this.layer.context;\r\n context.lineWidth = 2;\r\n context.strokeStyle = 'black';\r\n\r\n context.beginPath();\r\n context.rect(\r\n this.pos.x - j2Ds.scene.view.pos.x,\r\n this.pos.y - j2Ds.scene.view.pos.y,\r\n this.size.x, this.size.y);\r\n context.stroke();\r\n\r\n context.strokeStyle = 'yellow';\r\n\r\n context.beginPath();\r\n context.rect(this.box.offset.x + this.pos.x - j2Ds.scene.view.pos.x, this.box.offset.y + this.pos.y - j2Ds.scene.view.pos.y,\r\n this.box.size.x + this.size.x, this.box.size.y + this.size.y);\r\n context.stroke();\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.BaseNode = BaseNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.BaseNode = BaseNode;\r\n return BaseNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/CircleNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var CircleNode = function (_j2Ds, pos, radius, color) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, MathUtil.v2f(radius * 2, radius * 2));\r\n\r\n /*Свойства*/\r\n this.color = color;\r\n this.radius = radius;\r\n };\r\n\r\n CircleNode.prototype = Object.create(BaseNode.prototype);\r\n CircleNode.prototype.constructor = CircleNode;\r\n\r\n CircleNode.prototype.draw = function () {\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n context.lineWidth = 0;\r\n context.fillStyle = this.color;\r\n\r\n context.beginPath();\r\n context.arc(this.pos.x - j2Ds.scene.view.pos.x + this.radius,\r\n this.pos.y - j2Ds.scene.view.pos.y + this.radius,\r\n this.radius, 0, 2 * Math.PI, true);\r\n context.stroke();\r\n context.fill();\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.CircleNode = CircleNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.CircleNode = CircleNode;\r\n return CircleNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/LineNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var LineNode = function (_j2Ds, pos, points, scale, color, width, fill, cFill) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, MathUtil.v2f(0, 0));\r\n\r\n /*Свойства*/\r\n this.color = color;\r\n this.points = points;\r\n this.fill = fill || false;\r\n this.scale = scale || 0;\r\n this.cFill = cFill;\r\n this.lineWidth = width;\r\n };\r\n\r\n LineNode.prototype = Object.create(BaseNode.prototype);\r\n LineNode.prototype.constructor = LineNode;\r\n\r\n LineNode.prototype.draw = function () {\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n context.strokeStyle = this.color;\r\n context.lineWidth = this.lineWidth;\r\n\r\n context.beginPath();\r\n context.moveTo(this.pos.x - j2Ds.scene.view.pos.x,\r\n this.pos.y - j2Ds.scene.view.pos.y);\r\n\r\n for (var i = 0, len = this.points.length; i < len; i += 1) {\r\n context.lineTo(\r\n this.pos.x + this.points[i][0] * this.scale - j2Ds.scene.view.pos.x,\r\n this.pos.y + this.points[i][1] * this.scale - j2Ds.scene.view.pos.y);\r\n }\r\n\r\n context.stroke();\r\n if (this.fill) {\r\n context.fillStyle = this.cFill;\r\n context.fill();\r\n }\r\n\r\n context.lineWidth = 0;\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.LineNode = LineNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.LineNode = LineNode;\r\n return LineNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/RectNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n /**\r\n * @param _j2Ds\r\n * @param pos\r\n * @param size\r\n * @param color\r\n * @constructor\r\n */\r\n var RectNode = function (_j2Ds, pos, size, color) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, size);\r\n\r\n this.color = color;\r\n };\r\n\r\n RectNode.prototype = Object.create(BaseNode.prototype);\r\n RectNode.prototype.constructor = RectNode;\r\n\r\n RectNode.prototype.draw = function () {\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n if (this.angle) {\r\n context.save();\r\n context.translate(this.getPosition().x - j2Ds.scene.view.pos.x, this.getPosition().y - j2Ds.scene.view.pos.y);\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.translate(-(this.getPosition().x - j2Ds.scene.view.pos.x), -(this.getPosition().y - j2Ds.scene.view.pos.y));\r\n }\r\n\r\n context.fillStyle = this.color;\r\n context.lineWidth = 0;\r\n\r\n context.fillRect(\r\n this.pos.x - j2Ds.scene.view.pos.x,\r\n this.pos.y - j2Ds.scene.view.pos.y,\r\n this.size.x, this.size.y);\r\n\r\n if (this.angle) {\r\n context.restore();\r\n }\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.RectNode = RectNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.RectNode = RectNode;\r\n return RectNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/SpriteNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var SpriteNode = function (_j2Ds, pos, size, animation) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, size);\r\n\r\n this.tmpSpeed = 0;\r\n this.frame = 0;\r\n this.animation = animation;\r\n this.flip = {x: false, y: false};\r\n };\r\n\r\n SpriteNode.prototype = Object.create(BaseNode.prototype);\r\n SpriteNode.prototype.constructor = SpriteNode;\r\n\r\n SpriteNode.prototype.setFlip = function (x, y) {\r\n this.flip = {x: x, y: y};\r\n };\r\n\r\n SpriteNode.prototype.draw = function (speed) {\r\n if (this.visible && this.isLookScene()) {\r\n speed = speed || 1;\r\n\r\n if (this.frame > this.animation.frameCount) {\r\n this.frame = 0;\r\n }\r\n this.drawFrame(this.frame + 1);\r\n\r\n if (this.tmpSpeed > speed) {\r\n this.frame += 1;\r\n this.tmpSpeed = 0;\r\n }\r\n else {\r\n this.tmpSpeed += 1;\r\n }\r\n }\r\n };\r\n\r\n // отрисовка одного кадра\r\n SpriteNode.prototype.drawFrame = function (frame) {\r\n if (!this.animation.imageMap.loaded) return (err.show('Invalid ImageMap', 'red'));\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n context.lineWidth = 0;\r\n\r\n if (this.angle || this.flip.x || this.flip.y) {\r\n context.save();\r\n context.translate(this.getPosition().x - j2Ds.scene.view.pos.x, this.getPosition().y - j2Ds.scene.view.pos.y);\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.scale(this.flip.x ? -1 : 1, this.flip.y ? -1 : 1);\r\n context.translate(-(this.getPosition().x - j2Ds.scene.view.pos.x), -(this.getPosition().y - j2Ds.scene.view.pos.y));\r\n }\r\n\r\n frame = frame ? (frame - 1) : 0;\r\n\r\n context.drawImage(\r\n this.animation.imageMap.img,\r\n (this.animation.sourceX + (this.animation.sourceW * frame)), this.animation.sourceY,\r\n this.animation.sourceW, this.animation.sourceH,\r\n this.pos.x - j2Ds.scene.view.pos.x, this.pos.y - j2Ds.scene.view.pos.y,\r\n this.size.x, this.size.y);\r\n\r\n if (this.angle || this.flip.x || this.flip.y) {\r\n context.restore();\r\n }\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n SpriteNode.prototype.setAnimation = function (id) {\r\n if (this.animation != id) {\r\n this.animation = id;\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.SpriteNode = SpriteNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.SpriteNode = SpriteNode;\r\n return SpriteNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('nodes/TextNode', ['nodes/BaseNode', 'utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('nodes/BaseNode'), require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.nodes.BaseNode, root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (BaseNode, MathUtil) {\r\n \"use strict\";\r\n\r\n var j2Ds;\r\n\r\n var TextNode = function (_j2Ds, pos, text, sizePx, color, family, width, colorL) {\r\n j2Ds = _j2Ds;\r\n BaseNode.call(this, _j2Ds, pos, MathUtil.v2f(0, 0));\r\n\r\n /*Свойства*/\r\n\r\n this.vAlign = 'top';\r\n this.hAlign = 'left';\r\n this.color = color ? color : 'black';\r\n\r\n this.family = family ? family : 'serif';\r\n this.sizePx = sizePx ? sizePx : 20;\r\n\r\n this.box.offset.y = MathUtil.toInt(this.sizePx * 0.26);\r\n this.box.size.y = -MathUtil.toInt(this.sizePx * 0.26);\r\n\r\n this.lineWidth = width ? width : 0;\r\n this.colorL = colorL ? colorL : 'black';\r\n\r\n this.font = this.sizePx + 'px ' + this.family;\r\n\r\n this.fullText = text;\r\n this.maxWidth = 0;\r\n this.lines = text.split(\"\\n\");\r\n\r\n j2Ds.scene.context.font = this.font;\r\n\r\n for (var i = 0, len = this.lines.length; i < len; i += 1) {\r\n this.maxWidth = (this.maxWidth < j2Ds.scene.context.measureText(this.lines[i]).width ?\r\n j2Ds.scene.context.measureText(this.lines[i]).width :\r\n this.maxWidth);\r\n }\r\n\r\n this.size.x = this.maxWidth;\r\n this.size.y = this.lines.length * this.sizePx;\r\n };\r\n\r\n TextNode.prototype = Object.create(BaseNode.prototype);\r\n TextNode.prototype.constructor = TextNode;\r\n\r\n TextNode.prototype.setSize = function (sizePx) {\r\n this.sizePx = sizePx;\r\n this.font = this.sizePx + 'px ' + this.family;\r\n j2Ds.scene.context.font = this.font;\r\n\r\n this.box.offset.y = MathUtil.toInt(this.sizePx * 0.26);\r\n this.box.size.y = -MathUtil.toInt(this.sizePx * 0.26);\r\n\r\n for (var i = 0, len = this.lines.length; i < len; i += 1) {\r\n this.maxWidth = (this.maxWidth < j2Ds.scene.context.measureText(this.lines[i]).width ?\r\n j2Ds.scene.context.measureText(this.lines[i]).width :\r\n this.maxWidth);\r\n }\r\n this.size.x = this.maxWidth;\r\n this.size.y = this.lines.length * this.sizePx;\r\n };\r\n\r\n TextNode.prototype.getSize = function () {\r\n return this.sizePx;\r\n };\r\n\r\n TextNode.prototype.drawSimpleText = function (text, pos, color, colorL) {\r\n var context = this.layer.context;\r\n context.fillStyle = color ? color : this.color;\r\n context.textAlign = this.hAlign;\r\n context.textBaseline = this.vAlign;\r\n context.font = this.font;\r\n context.lineWidth = this.lineWidth;\r\n context.strokeStyle = colorL ? colorL : this.colorL;\r\n\r\n var lines = text.split(\"\\n\");\r\n\r\n pos = pos ? pos : this.pos;\r\n\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n for (var i = 0, len = lines.length; i < len; i += 1) {\r\n if (this.lineWidth) {\r\n context.strokeText(lines[i], pos.x, pos.y + this.sizePx * i);\r\n }\r\n context.fillText(lines[i], pos.x, pos.y + this.sizePx * i);\r\n }\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n\r\n context.lineWidth = 0;\r\n context.strokeStyle = 'black';\r\n };\r\n\r\n TextNode.prototype.getText = function () {\r\n return this.fullText;\r\n };\r\n\r\n TextNode.prototype.setText = function (text) {\r\n this.fullText = text;\r\n this.maxWidth = 0;\r\n this.lines = text.split(\"\\n\");\r\n\r\n j2Ds.scene.context.font = this.font;\r\n\r\n this.box.offset.y = MathUtil.toInt(this.sizePx * 0.26);\r\n this.box.size.y = -MathUtil.toInt(this.sizePx * 0.26);\r\n\r\n for (var i = 0, len = this.lines.length; i < len; i += 1) {\r\n this.maxWidth = (this.maxWidth < j2Ds.scene.context.measureText(this.lines[i]).width ?\r\n j2Ds.scene.context.measureText(this.lines[i]).width :\r\n this.maxWidth);\r\n }\r\n this.size.x = this.maxWidth;\r\n this.size.y = this.lines.length * this.sizePx;\r\n };\r\n\r\n TextNode.prototype.draw = function () {\r\n var context = this.layer.context;\r\n if (this.visible && this.isLookScene()) {\r\n if (this.alpha != 1) {\r\n var tmpAlpha = context.globalAlpha;\r\n context.globalAlpha = this.alpha;\r\n }\r\n\r\n if (this.angle) {\r\n context.save();\r\n context.translate(this.getPosition().x - j2Ds.scene.view.pos.x, this.getPosition().y - j2Ds.scene.view.pos.y);\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.translate(-(this.getPosition().x - j2Ds.scene.view.pos.x), -(this.getPosition().y - j2Ds.scene.view.pos.y));\r\n }\r\n\r\n context.fillStyle = this.color;\r\n context.textAlign = this.hAlign;\r\n context.textBaseline = this.vAlign;\r\n context.font = this.font;\r\n context.lineWidth = this.lineWidth;\r\n context.strokeStyle = this.colorL;\r\n\r\n for (var i = 0, len = this.lines.length; i < len; i += 1) {\r\n if (this.lineWidth) {\r\n context.strokeText(this.lines[i], this.pos.x - j2Ds.scene.view.pos.x, this.pos.y + this.sizePx * i - j2Ds.scene.view.pos.y);\r\n }\r\n context.fillText(this.lines[i], this.pos.x - j2Ds.scene.view.pos.x, this.pos.y + this.sizePx * i - j2Ds.scene.view.pos.y);\r\n }\r\n\r\n context.lineWidth = 0;\r\n context.strokeStyle = 'black';\r\n\r\n if (this.angle) {\r\n context.restore();\r\n }\r\n\r\n if (this.alpha != 1) {\r\n context.globalAlpha = tmpAlpha;\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TextNode = TextNode;\r\n if (global.j2Ds !== undefined) global.modules.nodes.TextNode = TextNode;\r\n return TextNode;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/DeviceManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var DeviceManager = function () {\r\n return {\r\n width: (parseInt(document.documentElement.clientWidth) < parseInt(screen.width))\r\n ? parseInt(document.documentElement.clientWidth)\r\n : parseInt(screen.width),\r\n height: (parseInt(document.documentElement.clientHeight) < parseInt(screen.height))\r\n ? parseInt(document.documentElement.clientHeight)\r\n : parseInt(screen.height)\r\n };\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.DeviceManager = DeviceManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.DeviceManager = DeviceManager;\r\n return DeviceManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/ErrorManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var ErrorManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.mode = 'neverShow'; // values: onlyShow|stopAndShow|neverShow\r\n this.enabled = false;\r\n };\r\n\r\n ErrorManager.prototype.init = function (_true) {\r\n var errorManager = this;\r\n errorManager.enabled = _true || true;\r\n\r\n var runBtn = document.createElement('div');\r\n runBtn.innerHTML = 'RUN';\r\n runBtn.style.padding = '5px';\r\n runBtn.align = 'center';\r\n runBtn.style.position = 'fixed';\r\n runBtn.style.zIndex = 20000;\r\n runBtn.style.left = '0px';\r\n runBtn.style.top = -20 + errorManager.j2Ds.getDeviceManager().height + 'px';\r\n runBtn.style.fontSize = '8pt';\r\n runBtn.style.backgroundColor = '#B8FFB8';\r\n runBtn.style.height = '12px';\r\n runBtn.style.width = '50px';\r\n runBtn.style.cursor = 'pointer';\r\n\r\n runBtn.onmousedown = function (e) {\r\n e.stopPropagation();\r\n };\r\n\r\n runBtn.onclick = function (e) {\r\n e.stopPropagation();\r\n errorManager.show('Выполнение продолжено');\r\n errorManager.j2Ds.runEngine(errorManager.j2Ds);\r\n return false;\r\n };\r\n\r\n errorManager.j2Ds.dom.attach(runBtn);\r\n errorManager.logListener.elems.push(runBtn);\r\n\r\n\r\n var pauseBtn = document.createElement('div');\r\n pauseBtn.innerHTML = 'PAUSE';\r\n pauseBtn.style.padding = '5px';\r\n pauseBtn.align = 'center';\r\n pauseBtn.style.position = 'fixed';\r\n pauseBtn.style.zIndex = 20000;\r\n pauseBtn.style.left = '60px';\r\n pauseBtn.style.top = -20 + errorManager.j2Ds.getDeviceManager().height + 'px';\r\n pauseBtn.style.fontSize = '8pt';\r\n pauseBtn.style.backgroundColor = '#FFFFBD';\r\n pauseBtn.style.height = '12px';\r\n pauseBtn.style.width = '50px';\r\n pauseBtn.style.cursor = 'pointer';\r\n\r\n pauseBtn.onmousedown = function (e) {\r\n e.stopPropagation();\r\n };\r\n\r\n pauseBtn.onclick = function (e) {\r\n e.stopPropagation();\r\n errorManager.show('Выполнение приостановлено');\r\n errorManager.j2Ds.stopEngine();\r\n return false;\r\n };\r\n\r\n errorManager.j2Ds.dom.attach(pauseBtn);\r\n errorManager.logListener.elems.push(pauseBtn);\r\n\r\n var reloadBtn = document.createElement('div');\r\n reloadBtn.innerHTML = 'RELOAD';\r\n reloadBtn.style.padding = '5px';\r\n reloadBtn.align = 'center';\r\n reloadBtn.style.position = 'fixed';\r\n reloadBtn.style.zIndex = 20000;\r\n reloadBtn.style.left = '120px';\r\n reloadBtn.style.top = -20 + errorManager.j2Ds.getDeviceManager().height + 'px';\r\n reloadBtn.style.fontSize = '8pt';\r\n reloadBtn.style.backgroundColor = '#E2E2E2';\r\n reloadBtn.style.color = 'black';\r\n reloadBtn.style.height = '12px';\r\n reloadBtn.style.width = '50px';\r\n reloadBtn.style.cursor = 'pointer';\r\n\r\n reloadBtn.onmousedown = function (e) {\r\n e.stopPropagation();\r\n };\r\n\r\n reloadBtn.onclick = function (e) {\r\n e.stopPropagation();\r\n errorManager.j2Ds.dom.reloadURL();\r\n return false;\r\n };\r\n\r\n errorManager.j2Ds.dom.attach(reloadBtn);\r\n errorManager.logListener.elems.push(reloadBtn);\r\n\r\n errorManager.j2Ds.events.addEvent('dom:loaded', function () {\r\n errorManager.j2Ds.window.onerror = function (e) {\r\n errorManager.show(e);\r\n };\r\n });\r\n };\r\n\r\n ErrorManager.prototype.show = function (string) {\r\n console.log('[j2Ds]: ' + string);\r\n };\r\n\r\n ErrorManager.prototype.setMode = function (mode) {\r\n this.mode = mode;\r\n if (mode == 'neverShow') {\r\n this.enabled = false;\r\n }\r\n };\r\n\r\n ErrorManager.prototype.debug = function (string) {\r\n if (!this.enabled) return;\r\n this.j2Ds.stopEngine();\r\n if (this.mode != 'neverShow') {\r\n this.show(string || 'Точка останова достигнута');\r\n }\r\n };\r\n\r\n ErrorManager.prototype.showError = function (err, _func) {\r\n if (this.mode == 'neverShow') return;\r\n\r\n var stack = err.stack.toString();\r\n stack = stack.split(/\\n/);\r\n\r\n for (var i = 0, len = stack.length; i < len; i += 1) {\r\n if (stack[i].match(/\\:\\d/)) {\r\n stack = stack[i].split(/\\s/);\r\n break;\r\n }\r\n }\r\n\r\n stack = stack[stack.length - 1];\r\n stack = stack.replace(/([\\(\\)]|[\\w]+:\\/\\/)/g, '');\r\n var file = stack.split(':'),\r\n line = file[1],\r\n number = file[2];\r\n file = decodeURI(file[0]);\r\n\r\n if (file.match(/(|\\bj2Ds.js)/)) {\r\n file = '<Функция-аргумент или строка>';\r\n }\r\n\r\n var errMess = 'Тип ошибки: \"' + err.name + '\"' +\r\n '\\nСообщение: \"' + err.message + '\"' +\r\n '\\nФайл с ошибкой: \"' + file + '\"' +\r\n '\\nСтрока: ' + line +\r\n ', символ: ' + number;\r\n\r\n if (_func) {\r\n errMess += '\\nОшибка в теле функции: \\n' + _func.toString();\r\n }\r\n\r\n this.show(errMess);\r\n\r\n if (this.mode == 'stopAndShow') {\r\n this.j2Ds.stopEngine();\r\n this.show('Выполнение приостановлено');\r\n }\r\n\r\n };\r\n\r\n ErrorManager.prototype.logListener = {\r\n domId: '',\r\n count: 0,\r\n execLine: '',\r\n elems: []\r\n };\r\n\r\n ErrorManager.prototype.lightSyntax = function (_code, _type) {\r\n var code = ('' + _code).toString();\r\n\r\n if (_type == 'boolean') {\r\n code = code.replace(/true/gi, '$&')\r\n .replace(/false/gi, '$&');\r\n } else if (_type == 'code') {\r\n code = code.replace(/(this|var|typeof|new|return|if|else|for|in|while|break|do|continue|switch|case)([^a-z0-9\\$_])/gi,\r\n '$1$2')\r\n .replace(/(function|object)/gi,\r\n '$1')\r\n .replace(/(width|height|window|document|scene|j2Ds|value)/gi,\r\n '$1')\r\n .replace(/([a-z\\_\\$][a-z0-9_]*)\\(/gi, '$1(')\r\n .replace(/(\\{|\\}|\\]|\\[|\\|)/gi, '$1')\r\n .replace(/('.*?')/g, '$1')\r\n .replace(/(#[a-z0-9]{3,8};)/, '$1')\r\n .replace(/(\\t)/g, '  ');\r\n\r\n code = code.replace(/true/gi, '$&')\r\n .replace(/false/gi, '$&');\r\n }\r\n\r\n return code;\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.ErrorManager = ErrorManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.ErrorManager = ErrorManager;\r\n return ErrorManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/FpsManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var FpsManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n\r\n this.enabled = false;\r\n this.fps = this.j2Ds.frameLimit;\r\n this.tmp_of_fps = 1;\r\n this.tmp_of_time = Date.now();\r\n };\r\n\r\n FpsManager.prototype.init = function () {\r\n var fpsManager = this;\r\n fpsManager.enabled = true;\r\n\r\n this.j2Ds.events.addEvent('engine:after', function () {\r\n fpsManager.update();\r\n });\r\n\r\n };\r\n\r\n FpsManager.prototype.update = function () {\r\n if (!this.enabled) return;\r\n this.tmp_of_fps += 1;\r\n if (this.j2Ds.now - this.tmp_of_time >= 1000) {\r\n this.fps = this.tmp_of_fps;\r\n this.tmp_of_fps = 1;\r\n this.tmp_of_time = this.j2Ds.now;\r\n }\r\n };\r\n\r\n FpsManager.prototype.getFPS = function () {\r\n return this.fps <= this.j2Ds.frameLimit ? this.fps : this.j2Ds.frameLimit;\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.FpsManager = FpsManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.FpsManager = FpsManager;\r\n return FpsManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/ResourceManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var ResourceManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n\r\n this.added = 0;\r\n this.loaded = 0;\r\n this.failed = 0;\r\n\r\n this.add = function () {\r\n this.added += 1;\r\n };\r\n\r\n this.ok = function (file) {\r\n this.loaded += 1;\r\n this.j2Ds.errorManager.show('loaded: \"' + decodeURI(file));\r\n };\r\n\r\n this.fail = function (file) {\r\n this.failed += 1;\r\n this.j2Ds.errorManager.show('error load: \"' + decodeURI(file));\r\n };\r\n\r\n this.show = function () {\r\n return {'added': this.added, 'loaded': this.loaded, 'failed': this.failed};\r\n };\r\n\r\n this.isLoaded = function () {\r\n return this.added == this.loaded;\r\n };\r\n\r\n this.getProgress = function () {\r\n return Math.ceil(this.loaded / this.added * 100);\r\n };\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.ResourceManager = ResourceManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.ResourceManager = ResourceManager;\r\n return ResourceManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/StorageManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var StorageManager = function (j2Ds, id) {\r\n this.j2Ds = j2Ds;\r\n this.id = id;\r\n this.ls = this.j2Ds.window.localStorage ? this.j2Ds.window.localStorage : false;\r\n if (!this.ls) alert('j2Ds ERROR in \"createLocal(' + id + ')\" \\n' + 'Объект \"localStorage\" не поддерживается.');\r\n };\r\n\r\n StorageManager.prototype.saveNode = function (name, o) {\r\n if (!this.ls) return false;\r\n this.ls.setItem(this.id + name, JSON.stringify(o));\r\n };\r\n\r\n StorageManager.prototype.load = function (name) {\r\n if (!this.ls) {\r\n return false;\r\n }\r\n return this.ls.getItem(this.id + name);\r\n };\r\n\r\n StorageManager.prototype.is = function (name) {\r\n if (!this.ls) {\r\n return false;\r\n }\r\n return !!(this.ls.getItem(this.id + name));\r\n };\r\n\r\n StorageManager.prototype.save = function (name, value) {\r\n if (!this.ls) {\r\n return false;\r\n }\r\n this.ls.setItem(this.id + name, value);\r\n };\r\n\r\n StorageManager.prototype.loadNode = function (name) {\r\n if (!this.ls) {\r\n return false;\r\n }\r\n return JSON.parse(this.ls.getItem(this.id + name));\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.StorageManager = StorageManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.StorageManager = StorageManager;\r\n return StorageManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/TimeManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var TimeManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.times = {};\r\n\r\n this.insert = function (id) {\r\n if (!this.times[id]) {\r\n this.times[id] = this.j2Ds.now;\r\n }\r\n };\r\n\r\n this.get = function (id) {\r\n return this.times[id];\r\n };\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TimeManager = TimeManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.TimeManager = TimeManager;\r\n return TimeManager;\r\n}));\r\n\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/TriggerManager', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var TriggerManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.enabled = false;\r\n this.triggers = {};\r\n };\r\n\r\n TriggerManager.prototype.add = function (id, callback) {\r\n var triggerManager = this;\r\n var trigger = {\r\n command: callback,\r\n count: 0,\r\n state: 'stop',\r\n last: false\r\n };\r\n\r\n trigger.run = function (mSec) {\r\n if (this.state == 'job') {\r\n this.command();\r\n return;\r\n }\r\n if (triggerManager.j2Ds.now - this.last > mSec) {\r\n if (this.last) {\r\n this.state = 'job';\r\n this.count += 1;\r\n this.command();\r\n }\r\n this.last = triggerManager.j2Ds.now;\r\n }\r\n };\r\n\r\n trigger.job = function (mSec) {\r\n if (triggerManager.j2Ds.now - this.last > mSec && this.state != 'run') {\r\n if (this.last) {\r\n this.state = 'run';\r\n this.count += 1;\r\n this.command();\r\n }\r\n this.last = triggerManager.j2Ds.now;\r\n }\r\n };\r\n\r\n trigger.loop = function (mSec) {\r\n if (triggerManager.j2Ds.now - this.last > mSec) {\r\n if (this.last) {\r\n this.state = 'run';\r\n this.count += 1;\r\n this.command();\r\n }\r\n this.last = triggerManager.j2Ds.now;\r\n }\r\n };\r\n\r\n trigger.reset = function () {\r\n this.count = 0;\r\n this.state = 'stop';\r\n this.last = false;\r\n };\r\n\r\n this.triggers[id] = trigger;\r\n return trigger;\r\n };\r\n\r\n TriggerManager.prototype.get = function (id) {\r\n return this.triggers[id];\r\n };\r\n\r\n TriggerManager.prototype.init = function () {\r\n this.enabled = true;\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TriggerManager = TriggerManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.TriggerManager = TriggerManager;\r\n return TriggerManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('managers/ViewManager', ['utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil) {\r\n \"use strict\";\r\n\r\n var ViewManager = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.views = {};\r\n };\r\n\r\n ViewManager.prototype.add = function (id, pos) {\r\n var viewManager = this;\r\n var viewport = {\r\n focusNode: false\r\n };\r\n\r\n viewport.pos = pos ? MathUtil.v2f(pos.x, pos.y) : MathUtil.v2f(0, 0);\r\n\r\n viewport.setPosition = function (pos) {\r\n if (!pos) return this;\r\n this.pos = MathUtil.v2f(pos.x - viewManager.j2Ds.scene.width / 2, pos.y - viewManager.j2Ds.scene.height / 2);\r\n };\r\n\r\n viewport.getPosition = function () {\r\n return this.pos;\r\n };\r\n\r\n viewport.move = function (pos) {\r\n this.pos.x += pos.x;\r\n this.pos.y += pos.y;\r\n };\r\n\r\n viewManager.j2Ds.viewManager.views[id] = viewport;\r\n return viewport;\r\n };\r\n\r\n ViewManager.prototype.get = function (id) {\r\n return this.j2Ds.viewManager.views[id];\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.ViewManager = ViewManager;\r\n if (global.j2Ds !== undefined) global.modules.managers.ViewManager = ViewManager;\r\n return ViewManager;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('io/AudioHandler', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var AudioHandler = function () {\r\n this.audios = {};\r\n this.enabled = false\r\n };\r\n\r\n AudioHandler.prototype.init = function () {\r\n var audioHandler = this;\r\n this.enabled = true;\r\n\r\n audioHandler.j2Ds.events.addEvent('scene:deactivate', function () {\r\n audioHandler.deactivate();\r\n });\r\n\r\n audioHandler.j2Ds.events.addEvent('scene:activate', function () {\r\n audioHandler.activate();\r\n });\r\n\r\n };\r\n\r\n AudioHandler.prototype.load = function (id, files, vol) {\r\n var audioHandler = this;\r\n audioHandler.j2Ds.resources.add();\r\n var audio = document.createElement('audio');\r\n\r\n for (var i = 0, len = files.length; i < len; i += 1) {\r\n var source = document.createElement('source');\r\n source.src = files[i];\r\n audio.appendChild(source);\r\n }\r\n\r\n audio.id = 'audio_' + id;\r\n\r\n if (vol) {\r\n audio.volume = (vol <= 1 && vol >= 0) ? vol : 1;\r\n }\r\n\r\n var sound = {\r\n id: id,\r\n files: files,\r\n domEl: audio, // DOMElement\r\n ready: false,\r\n len: 0,\r\n state: 'stop',\r\n lock: false,\r\n volume: audio.volume,\r\n onePlay: false\r\n };\r\n\r\n sound.domEl.addEventListener('loadeddata', function (e) {\r\n sound.ready = true;\r\n var file = e.explicitOriginalTarget || e.path[0];\r\n audioHandler.j2Ds.resources.ok(file.currentSrc);\r\n });\r\n\r\n sound.domEl.addEventListener('error', function (e) {\r\n sound.setLock(true);\r\n //var file = e.srcElement || e.target;\r\n //audioHandler.j2Ds.resources.fail(file.src);\r\n });\r\n\r\n sound.domEl.addEventListener('ended', function () {\r\n sound.state = 'stop';\r\n });\r\n\r\n sound.play = function (unlock) {\r\n if (unlock) {\r\n this.setLock(false);\r\n }\r\n if (this.lock) return;\r\n if (this.state == 'play') {\r\n this.domEl.currentTime = 0;\r\n }\r\n this.domEl.play();\r\n this.state = 'play';\r\n };\r\n\r\n sound.loop = function () {\r\n if (this.lock) return;\r\n this.domEl.play();\r\n this.state = 'play';\r\n };\r\n\r\n sound.pause = function (lock) {\r\n if (this.state == 'play') {\r\n this.setLock(lock);\r\n this.domEl.pause();\r\n this.state = 'pause';\r\n }\r\n };\r\n\r\n sound.stop = function (lock) {\r\n this.domEl.pause();\r\n this.domEl.currentTime = 0;\r\n this.state = 'stop';\r\n if (lock) {\r\n this.setLock(lock);\r\n }\r\n };\r\n\r\n sound.setLock = function (lock) {\r\n this.lock = lock ? true : false;\r\n };\r\n\r\n sound.setVolume = function (vol) {\r\n this.domEl.volume = (vol <= 1 && vol >= 0) ? vol : 1;\r\n this.volume = this.domEl.volume;\r\n };\r\n\r\n sound.getVolume = function (id) {\r\n return this.volume;\r\n };\r\n\r\n sound.getState = function (id) {\r\n return this.state;\r\n };\r\n\r\n sound.getPlayPosition = function () {\r\n return this.domEl.currentTime;\r\n };\r\n\r\n sound.domEl.load();\r\n\r\n this.audios[id] = sound;\r\n return sound;\r\n };\r\n\r\n AudioHandler.prototype.get = function (id) {\r\n return this.audios[id];\r\n };\r\n\r\n AudioHandler.prototype.pause = function (lock) {\r\n for (var snd in this.audios) {\r\n this.audios[snd].pause(lock);\r\n }\r\n };\r\n\r\n AudioHandler.prototype.stop = function (lock) {\r\n for (var snd in this.audios) {\r\n this.audios[snd].stop(lock);\r\n }\r\n };\r\n\r\n AudioHandler.prototype.play = function (unlock) {\r\n for (var snd in this.audios) {\r\n this.audios[snd].play(unlock);\r\n }\r\n };\r\n\r\n AudioHandler.prototype.deactivate = function () {\r\n for (var snd in this.audios) {\r\n if (this.audios[snd].state == 'play') {\r\n this.audios[snd].pause();\r\n this.audios[snd].state = 'deactivated';\r\n }\r\n }\r\n };\r\n\r\n AudioHandler.prototype.activate = function () {\r\n for (var snd in this.audios) {\r\n if (this.audios[snd].state == 'deactivated') {\r\n this.audios[snd].play();\r\n }\r\n }\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.AudioHandler = AudioHandler;\r\n if (global.j2Ds !== undefined) global.modules.io.AudioHandler = AudioHandler;\r\n return AudioHandler;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('io/InputHandler', ['utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil) {\r\n \"use strict\";\r\n\r\n var InputHandler = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n\r\n this.pos = {x: 0, y: 0};\r\n this.x = 0;\r\n this.y = 0;\r\n this.screenPos = {x: 0, y: 0};\r\n this.keyDown = [];\r\n this.keyPress = [];\r\n this.keyPressed = [];\r\n this.keyUp = [];\r\n this.keyUped = false;\r\n this.mouseDown = [];\r\n this.mousePress = [];\r\n this.mousePressed = [];\r\n this.mouseUp = [];\r\n this.mouseUpped = false;\r\n this.mouseWheel = 0;\r\n this.canceled = false;\r\n this.body = false;\r\n this.anyKey = false;\r\n this.anyMouse = false;\r\n this.writeMode = false;\r\n this.displayCursor = '';\r\n this.visible = true;\r\n this.enabled = false;\r\n };\r\n\r\n InputHandler.prototype.mKey = {\r\n 'LEFT': 1,\r\n 'MIDDLE': 2,\r\n 'RIGHT': 3\r\n };\r\n\r\n InputHandler.prototype.jKey = {\r\n 'LEFT': 37,\r\n 'RIGHT': 39,\r\n 'UP': 38,\r\n 'DOWN': 40,\r\n 'SPACE': 32,\r\n 'CTRL': 17,\r\n 'SHIFT': 16,\r\n 'ALT': 18,\r\n 'ESC': 27,\r\n 'ENTER': 13,\r\n 'MINUS': 189,\r\n 'PLUS': 187,\r\n 'CAPS_LOCK': 20,\r\n 'BACKSPACE': 8,\r\n 'TAB': 9,\r\n 'Q': 81,\r\n 'W': 87,\r\n 'E': 69,\r\n 'R': 82,\r\n 'T': 84,\r\n 'Y': 89,\r\n 'U': 85,\r\n 'I': 73,\r\n 'O': 79,\r\n 'P': 80,\r\n 'A': 65,\r\n 'S': 83,\r\n 'D': 68,\r\n 'F': 70,\r\n 'G': 71,\r\n 'H': 72,\r\n 'J': 74,\r\n 'K': 75,\r\n 'L': 76,\r\n 'Z': 90,\r\n 'X': 88,\r\n 'V': 86,\r\n 'B': 66,\r\n 'N': 78,\r\n 'M': 77,\r\n '0': 48,\r\n '1': 49,\r\n '2': 50,\r\n '3': 51,\r\n '4': 52,\r\n '5': 53,\r\n '6': 54,\r\n '7': 55,\r\n '8': 56,\r\n 'C': 67,\r\n '9': 57,\r\n 'NUM_0': 45,\r\n 'NUM_1': 35,\r\n 'NUM_2': 40,\r\n 'NUM_3': 34,\r\n 'NUM_4': 37,\r\n 'NUM_5': 12,\r\n 'NUM_6': 39,\r\n 'NUM_7': 36,\r\n 'NUM_8': 38,\r\n 'NUM_9': 33,\r\n 'NUM_MINUS': 109,\r\n 'NUM_PLUS': 107,\r\n 'NUM_LOCK': 144,\r\n 'F1': 112,\r\n 'F2': 113,\r\n 'F3': 114,\r\n 'F4': 115,\r\n 'F5': 116,\r\n 'F6': 117,\r\n 'F7': 118,\r\n 'F8': 119,\r\n 'F9': 120,\r\n 'F10': 121,\r\n 'F11': 122,\r\n 'F12': 123\r\n };\r\n\r\n InputHandler.prototype.keyList = function () {\r\n var o = [];\r\n for (var i in this.jKey) {\r\n o.push(i);\r\n }\r\n return o;\r\n };\r\n\r\n InputHandler.prototype.reset = function () {\r\n if (!this.enabled) return false;\r\n this.keyPress = [];\r\n this.keyUp = [];\r\n this.mousePress = [];\r\n this.mouseUp = [];\r\n this.mouseWheel = 0;\r\n };\r\n\r\n InputHandler.prototype.isKeyDown = function (code) {\r\n return this.keyDown[this.jKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isKeyPress = function (code) {\r\n return this.keyPress[this.jKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isKeyUp = function (code) {\r\n return this.keyUp[this.jKey[code]];\r\n };\r\n\r\n InputHandler.prototype.getPosition = function () {\r\n return MathUtil.v2f(this.pos.x, this.pos.y);\r\n };\r\n\r\n InputHandler.prototype.getScreenPosition = function () {\r\n return MathUtil.v2f(this.screenPos.x, this.screenPos.y);\r\n };\r\n\r\n InputHandler.prototype.setWriteMode = function (_true) {\r\n this.writeMode = _true;\r\n };\r\n\r\n InputHandler.prototype.isWriteMode = function () {\r\n return this.writeMode;\r\n };\r\n\r\n InputHandler.prototype.keyEvent = function (e) {\r\n if (!this.enabled) return false;\r\n if (e.type == 'keydown') {\r\n if (!this.keyPressed[e.keyCode]) {\r\n this.keyPress[e.keyCode] = true;\r\n this.keyPressed[e.keyCode] = true;\r\n }\r\n if (!this.writeMode) {\r\n e.preventDefault();\r\n } else {\r\n this.j2Ds.events.onEvent('writeMode:keyPress', '');\r\n }\r\n } else if (e.type == 'keyup') {\r\n if (this.keyPressed[e.keyCode]) {\r\n e.preventDefault();\r\n this.keyPress[e.keyCode] = false;\r\n this.keyPressed[e.keyCode] = false;\r\n this.keyUp[e.keyCode] = true;\r\n this.keyUped = true;\r\n }\r\n } else if (e.type == 'keypress' && (this.writeMode)) {\r\n var char = '';\r\n if (e.which != 0 && e.charCode != 0) {\r\n if (e.which >= 32) {\r\n char = String.fromCharCode(e.which);\r\n }\r\n }\r\n this.j2Ds.events.onEvent('writeMode:keyPress', char);\r\n }\r\n\r\n this.keyDown[e.keyCode] = (e.type == 'keydown') && (!this.canceled);\r\n this.anyKey = e.keyCode;\r\n return false;\r\n };\r\n\r\n InputHandler.prototype.cancel = function (id) {\r\n if (!id) {\r\n this.canceled = true;\r\n this.keyDown = [];\r\n this.mouseDown = [];\r\n }\r\n else {\r\n this.keyDown[this.jKey[id]] = false;\r\n }\r\n };\r\n\r\n InputHandler.prototype.onNode = function (id) {\r\n if (!id.layer.visible) return false;\r\n return (this.pos.x > id.pos.x && this.pos.x < id.pos.x + id.size.x) &&\r\n (this.pos.y > id.pos.y && this.pos.y < id.pos.y + id.size.y);\r\n };\r\n\r\n InputHandler.prototype.upd = function () {\r\n if (!this.enabled) return false;\r\n var dX = this.j2Ds.scene.offsetWidth / this.j2Ds.scene.width;\r\n var dY = this.j2Ds.scene.offsetHeight / this.j2Ds.scene.height;\r\n this.x = (this.screenPos.x / dX);\r\n this.y = (this.screenPos.y / dY);\r\n this.pos.x = this.j2Ds.scene.view.pos.x + this.x;\r\n this.pos.y = this.j2Ds.scene.view.pos.y + this.y;\r\n };\r\n\r\n InputHandler.prototype.onMove = function (e) {\r\n this.screenPos.x = -this.j2Ds.scene.offsetLeft + e.pageX;\r\n this.screenPos.y = -this.j2Ds.scene.offsetTop + e.pageY;\r\n };\r\n\r\n InputHandler.prototype.isMouseDown = function (code) {\r\n return this.mouseDown[this.mKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isMousePress = function (code) {\r\n return this.mousePress[this.mKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isMouseUp = function (code) {\r\n return this.mouseUp[this.mKey[code]];\r\n };\r\n\r\n InputHandler.prototype.isMouseWheel = function (code) {\r\n return (code == 'UP' && this.mouseWheel > 0) ||\r\n (code == 'DOWN' && this.mouseWheel < 0)\r\n };\r\n\r\n InputHandler.prototype.onMouseWheel = function (e) {\r\n if (!this.enabled) return false;\r\n e.preventDefault();\r\n this.mouseWheel = ((e.wheelDelta) ? e.wheelDelta : -e.detail);\r\n return false;\r\n };\r\n\r\n InputHandler.prototype.onMouseEvent = function (e) {\r\n if (!this.enabled) return false;\r\n e.preventDefault();\r\n if (!e.which && e.button) {\r\n if (e.button & 1) e.which = 1;\r\n else if (e.button & 4) e.which = 2;\r\n else if (e.button & 2) e.which = 3;\r\n }\r\n\r\n if (e.type == 'mousedown') {\r\n if (!this.mousePressed[e.which]) {\r\n this.mousePress[e.which] = true;\r\n this.mousePressed[e.which] = true;\r\n }\r\n } else if (e.type == 'mouseup') {\r\n if (this.mousePressed[e.which]) {\r\n this.mousePress[e.which] = false;\r\n this.mousePressed[e.which] = false;\r\n this.mouseUp[e.which] = true;\r\n this.mouseUped = true;\r\n }\r\n }\r\n\r\n this.mouseDown[e.which] = (e.type == 'mousedown') && (!this.canceled);\r\n\r\n this.j2Ds.window.focus();\r\n return false;\r\n };\r\n\r\n InputHandler.prototype.setCursorImage = function (curImg) {\r\n this.j2Ds.dom.tag('body')[0].style.cursor = 'url(\"' + curImg + '\"), auto';\r\n };\r\n\r\n InputHandler.prototype.setVisible = function (_true) {\r\n this.visible = _true;\r\n if (!_true) {\r\n this.displayCursor = this.j2Ds.dom.tag('body')[0].style.cursor;\r\n this.j2Ds.dom.tag('body')[0].style.cursor = 'none';\r\n } else {\r\n this.j2Ds.dom.tag('body')[0].style.cursor = this.displayCursor;\r\n }\r\n };\r\n\r\n InputHandler.prototype.isVisible = function () {\r\n return this.visible;\r\n };\r\n\r\n InputHandler.prototype.init = function () {\r\n var input = this;\r\n input.enabled = true;\r\n\r\n input.j2Ds.events.addEvent('engine:before', function () {\r\n input.upd();\r\n });\r\n\r\n input.j2Ds.events.addEvent('engine:after', function () {\r\n input.reset();\r\n });\r\n\r\n\r\n input.j2Ds.events.addEvent('dom:loaded', function () {\r\n input.j2Ds.window.oncontextmenu = function () {\r\n return false;\r\n };\r\n input.j2Ds.window.onselectstart = input.j2Ds.window.oncontextmenu;\r\n input.j2Ds.window.ondragstart = input.j2Ds.window.oncontextmenu;\r\n input.j2Ds.window.onmousedown = input.onMouseEvent;\r\n input.j2Ds.window.onmouseup = function (e) {\r\n input.canceled = false;\r\n input.onMouseEvent(e);\r\n };\r\n input.j2Ds.window.onmousemove = function (e) {\r\n input.onMove(e);\r\n };\r\n input.j2Ds.window.onkeydown = function (e) {\r\n input.keyEvent(e);\r\n };\r\n input.j2Ds.window.onkeyup = function (e) {\r\n input.canceled = false;\r\n input.keyEvent(e);\r\n };\r\n input.j2Ds.window.onkeypress = function (e) {\r\n input.keyEvent(e);\r\n };\r\n input.j2Ds.window.onmousewheel = function (e) {\r\n input.onMouseWheel(e);\r\n };\r\n\r\n if (input.j2Ds.window.addEventListener) {\r\n input.j2Ds.window.addEventListener(\"DOMMouseScroll\", function (e) {\r\n input.onMouseWheel(e);\r\n }, false);\r\n }\r\n });\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.InputHandler = InputHandler;\r\n if (global.j2Ds !== undefined) global.modules.io.InputHandler = InputHandler;\r\n return InputHandler;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('io/TouchHandler', ['utils/MathUtil'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'));\r\n } else {\r\n factory(root.modules.utils.MathUtil);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil) {\r\n \"use strict\";\r\n\r\n var TouchHandler = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n\r\n this.enabled = false;\r\n this.pos = {x: 0, y: 0};\r\n this.screenPos = {x: 0, y: 0};\r\n this.canceled = false;\r\n this.touchs = [];\r\n this.tapDown = false;\r\n this.tapPress = false;\r\n this.tapUp = false;\r\n this.body = false;\r\n };\r\n\r\n TouchHandler.prototype.getPosition = function () {\r\n return MathUtil.v2f(this.pos.x, this.pos.y);\r\n };\r\n\r\n TouchHandler.prototype.getScreenPosition = function () {\r\n return MathUtil.v2f(this.screenPos.x, this.screenPos.y);\r\n };\r\n\r\n TouchHandler.prototype.upd = function () {\r\n if (!this.enabled) return false;\r\n var dX = this.j2Ds.scene.offsetWidth / this.j2Ds.scene.width;\r\n var dY = this.j2Ds.scene.offsetHeight / this.j2Ds.scene.height;\r\n\r\n };\r\n\r\n TouchHandler.prototype.reset = function () {\r\n if (!this.enabled) return false;\r\n };\r\n\r\n TouchHandler.prototype.cancel = function () {\r\n if (!this.enabled) return false;\r\n };\r\n\r\n TouchHandler.prototype.isTapDown = function () {\r\n\r\n };\r\n\r\n TouchHandler.prototype.isTapPress = function () {\r\n\r\n };\r\n\r\n TouchHandler.prototype.isTapUp = function () {\r\n\r\n };\r\n\r\n TouchHandler.prototype.getTouch = function () {\r\n\r\n };\r\n\r\n TouchHandler.prototype.onTouchEvent = function () {\r\n if (!this.enabled) return false;\r\n\r\n };\r\n\r\n\r\n TouchHandler.prototype.init = function () {\r\n var touchHandler = this;\r\n touchHandler.enabled = true;\r\n\r\n touchHandler.j2Ds.events.addEvent('engine:before', function () {\r\n touchHandler.upd();\r\n });\r\n\r\n touchHandler.j2Ds.events.addEvent('engine:after', function () {\r\n touchHandler.reset();\r\n });\r\n\r\n\r\n touchHandler.j2Ds.events.addEvent('dom:loaded', function () {\r\n\r\n });\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TouchHandler = TouchHandler;\r\n if (global.j2Ds !== undefined) global.modules.io.TouchHandler = TouchHandler;\r\n return TouchHandler;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Layers', [], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory();\r\n } else {\r\n factory();\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function () {\r\n \"use strict\";\r\n\r\n var Layers = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n this.layersList = {};\r\n };\r\n\r\n Layers.prototype.layer = function (id) {\r\n return this.layersList[id];\r\n };\r\n\r\n Layers.prototype.add = function (id, index, notDOM) {\r\n if (!!this.layersList[id]) return false;\r\n\r\n var layer = {\r\n layerName: id\r\n };\r\n\r\n if (!notDOM) {\r\n layer.canvas = document.createElement('canvas');\r\n } else {\r\n layer.canvas = this.j2Ds.dom.id(id);\r\n }\r\n\r\n layer.canvas.style.position = this.j2Ds.scene.stylePosition;\r\n\r\n layer.canvas.id = id;\r\n\r\n layer.canvas.style.zIndex = 1000 + index;\r\n layer.canvas.style.left = this.j2Ds.scene.offsetLeft + 'px';\r\n layer.canvas.style.top = this.j2Ds.scene.offsetTop + 'px';\r\n\r\n layer.canvas.width = this.j2Ds.scene.width;\r\n layer.canvas.height = this.j2Ds.scene.height;\r\n layer.width = this.j2Ds.scene.width;\r\n layer.height = this.j2Ds.scene.height;\r\n layer.context = layer.canvas.getContext('2d');\r\n layer.context.shadowColor = 'rgba(0,0,0,0)';\r\n layer.alpha = 1;\r\n layer.angle = 0;\r\n layer.visible = 1;\r\n\r\n layer.onContext = function (callback) {\r\n callback(this.context);\r\n };\r\n\r\n layer.fill = function (color) {\r\n this.context.fillStyle = color;\r\n this.context.fillRect(0, 0, this.width, this.height);\r\n };\r\n\r\n layer.setAlpha = function (alpha) {\r\n this.canvas.style.opacity = alpha;\r\n this.alpha = alpha;\r\n };\r\n\r\n layer.getAlpha = function () {\r\n return this.alpha;\r\n };\r\n\r\n layer.setVisible = function (visible) {\r\n if (visible) {\r\n this.canvas.style.display = 'block';\r\n this.visible = true;\r\n } else {\r\n this.canvas.style.display = 'none';\r\n this.visible = false;\r\n }\r\n };\r\n\r\n layer.isVisible = function () {\r\n return this.visible;\r\n };\r\n\r\n layer.setIndex = function (index) {\r\n this.canvas.style.zIndex = 1000 + index;\r\n };\r\n\r\n layer.clear = function () {\r\n this.context.clearRect(0, 0, this.width, this.height);\r\n };\r\n\r\n layer.clearNode = function (node) {\r\n var layer = this;\r\n if (node.isLookScene()) {\r\n this.context.clearRect(\r\n node.pos.x - layer.j2Ds.scene.view.pos.x,\r\n node.pos.y - layer.j2Ds.scene.view.pos.y,\r\n node.size.x,\r\n node.size.y\r\n );\r\n }\r\n };\r\n\r\n layer.setContextSettings = function (settings) {\r\n for (var i in settings) {\r\n if (typeof this.context[i] !== 'undefined') {\r\n this.context[i] = settings[i];\r\n }\r\n }\r\n };\r\n\r\n layer.clearRect = function (pos, size) {\r\n var layer = this;\r\n this.context.clearRect(pos.x - layer.j2Ds.scene.view.pos.x, pos.y - layer.j2Ds.scene.view.pos.y, size.x, size.y);\r\n };\r\n\r\n this.layersList[id] = layer;\r\n\r\n if (!notDOM) {\r\n this.j2Ds.dom.attach(this.layersList[id].canvas);\r\n }\r\n\r\n return layer;\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Layers = Layers;\r\n if (global.j2Ds !== undefined) global.modules.core.Layers = Layers;\r\n return Layers;\r\n}));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.2\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('core/Scene', [\r\n 'nodes/BaseNode',\r\n 'nodes/CircleNode',\r\n 'nodes/LineNode',\r\n 'nodes/RectNode',\r\n 'nodes/SpriteNode',\r\n 'nodes/TextNode',\r\n 'utils/TextureUtil'\r\n ], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(\r\n require('nodes/BaseNode'),\r\n require('nodes/CircleNode'),\r\n require('nodes/LineNode'),\r\n require('nodes/RectNode'),\r\n require('nodes/SpriteNode'),\r\n require('nodes/TextNode'),\r\n require('utils/TextureUtil')\r\n );\r\n } else {\r\n factory(\r\n root.modules.nodes.BaseNode,\r\n root.modules.nodes.CircleNode,\r\n root.modules.nodes.LineNode,\r\n root.modules.nodes.RectNode,\r\n root.modules.nodes.SpriteNode,\r\n root.modules.nodes.TextNode,\r\n root.modules.utils.TextureUtil\r\n );\r\n }\r\n}(typeof window !== 'undefined' ? window : global,\r\n function (BaseNode,\r\n CircleNode,\r\n LineNode,\r\n RectNode,\r\n SpriteNode,\r\n TextNode,\r\n TextureUtil) {\r\n \"use strict\";\r\n\r\n var Scene = function (j2Ds) {\r\n j2Ds = this.j2Ds = j2Ds;\r\n\r\n this.nodes = [];\r\n this.layerName = 'sceneNode';\r\n this.stylePosition = 'fixed';\r\n this.layers = j2Ds.layers;\r\n this.view = false;\r\n this.gameStateName = false;\r\n this.canFullScreen = true;\r\n\r\n this.texture = new TextureUtil(this.j2Ds);\r\n };\r\n\r\n /*функции*/\r\n\r\n Scene.prototype.setView = function (id) {\r\n this.view = this.j2Ds.viewManager.views[id];\r\n };\r\n\r\n Scene.prototype.getView = function () {\r\n return this.view;\r\n };\r\n\r\n Scene.prototype.setAutoDraw = function (toggle) {\r\n var scene = this;\r\n if (toggle) {\r\n scene.j2Ds.events.addEvent('engine:after', function () {\r\n scene.drawAllNodes();\r\n }, 'autoDraw');\r\n } else {\r\n scene.j2Ds.events.destroyEvent('engine:after', 'autoDraw');\r\n }\r\n };\r\n\r\n Scene.prototype.setAutoClear = function (toggle) {\r\n var scene = this;\r\n if (toggle) {\r\n scene.j2Ds.events.addEvent('engine:before', function () {\r\n scene.clear();\r\n }, 'autoClear');\r\n } else {\r\n scene.j2Ds.events.destroyEvent('engine:before', 'autoClear');\r\n }\r\n };\r\n\r\n Scene.prototype.setGameState = function (name) {\r\n if (this.j2Ds.gameStates.states[name].start) {\r\n this.j2Ds.gameStates.states[name].start();\r\n }\r\n if (this.j2Ds.gameStates.states[name].state) {\r\n this.j2Ds.setActiveEngine(this.j2Ds.gameStates.states[name].state);\r\n }\r\n this.gameStateName = name;\r\n this.j2Ds.events.onEvent('scene:changedGameState');\r\n };\r\n\r\n Scene.prototype.getGameState = function () {\r\n return this.gameStateName;\r\n };\r\n\r\n Scene.prototype.start = function (name, frameLimit) {\r\n this.j2Ds.events.onEvent('scene:beforeStart');\r\n if (this.j2Ds.gameStates.states[name].start) {\r\n this.j2Ds.gameStates.states[name].start();\r\n }\r\n if (this.j2Ds.gameStates.states[name]) {\r\n this.j2Ds.start(this.j2Ds.gameStates.states[name].state, frameLimit);\r\n }\r\n this.j2Ds.events.onEvent('scene:afterStart');\r\n };\r\n\r\n Scene.prototype.fullScreen = function (_true) {\r\n if (!this.canFullScreen) return;\r\n var layer;\r\n var tmpCanvas = document.createElement('canvas'); // Нужны для копирования содержимого\r\n var tmpContext = tmpCanvas.getContext('2d'); // При изменении размера\r\n if (_true) {\r\n this.origWidth = this.width;\r\n this.origHeight = this.height;\r\n this.width = this.j2Ds.getDeviceManager().width;\r\n this.height = this.j2Ds.getDeviceManager().height;\r\n for (var i in this.j2Ds.layers.layersList) {\r\n layer = this.j2Ds.layers.layersList[i];\r\n tmpCanvas.width = layer.width;\r\n tmpCanvas.height = layer.height;\r\n tmpContext.drawImage(layer.canvas, 0, 0);\r\n layer.canvas.width = this.width;\r\n layer.canvas.height = this.height;\r\n layer.width = this.width;\r\n layer.height = this.height;\r\n this.offsetWidth = this.width;\r\n this.offsetHeight = this.height;\r\n\r\n layer.context.drawImage(tmpCanvas, 0, 0, layer.width, layer.height);\r\n }\r\n } else {\r\n this.width = this.origWidth;\r\n this.height = this.origHeight;\r\n for (var i in this.j2Ds.layers.layersList) {\r\n layer = this.j2Ds.layers.layersList[i];\r\n layer.width = this.origWidth;\r\n layer.height = this.origHeight;\r\n layer.canvas.width = this.origWidth;\r\n layer.canvas.height = this.origHeight;\r\n this.offsetWidth = this.origWidth;\r\n this.offsetHeight = this.origHeight;\r\n\r\n }\r\n }\r\n };\r\n\r\n Scene.prototype.fullScale = function (_true) {\r\n if (!this.canFullScreen) return;\r\n var layer;\r\n if (_true) {\r\n for (var i in this.j2Ds.layers.layersList) {\r\n layer = this.j2Ds.layers.layersList[i].canvas;\r\n layer.style.width = this.j2Ds.getDeviceManager().width + 'px';\r\n layer.style.height = this.j2Ds.getDeviceManager().height + 'px';\r\n this.offsetWidth = this.j2Ds.getDeviceManager().width;\r\n this.offsetHeight = this.j2Ds.getDeviceManager().height;\r\n }\r\n } else {\r\n for (var i in this.j2Ds.layers.layersList) {\r\n layer = this.j2Ds.layers.layersList[i].canvas;\r\n layer.style.width = this.width + 'px';\r\n layer.style.height = this.height + 'px';\r\n this.offsetWidth = this.width;\r\n this.offsetHeight = this.height;\r\n }\r\n }\r\n };\r\n\r\n Scene.prototype.clear = function () {\r\n this.getLayer().clear();\r\n };\r\n\r\n Scene.prototype.getLayer = function () {\r\n return this.j2Ds.layers.layer(this.layerName);\r\n };\r\n\r\n Scene.prototype.drawAllNodes = function () {\r\n for (var i = 0, len = this.nodes.length; i < len; i += 1) {\r\n if (this.nodes[i].draw) {\r\n this.nodes[i].draw();\r\n }\r\n }\r\n };\r\n\r\n Scene.prototype.init = function (width, height, canDeactivate) {\r\n var scene = this;\r\n\r\n scene.j2Ds.events.onEvent('scene:beforeInit');\r\n\r\n scene.width = width;\r\n scene.height = height;\r\n\r\n scene.origWidth = width;\r\n scene.origHeight = height;\r\n\r\n scene.offsetWidth = width;\r\n scene.offsetHeight = height;\r\n\r\n scene.offsetLeft = 0;\r\n scene.offsetTop = 0;\r\n\r\n\r\n scene.j2Ds.canDeactivate = canDeactivate != false;\r\n\r\n scene.j2Ds.layers.add('sceneNode', 0);\r\n\r\n scene.context = scene.j2Ds.layers.layer(scene.layerName).context;\r\n scene.canvas = scene.j2Ds.layers.layer(scene.layerName).canvas;\r\n scene.visible = true;\r\n\r\n scene.cancelClear = false;\r\n\r\n /* Вид \"камеры\" */\r\n scene.view = scene.j2Ds.viewManager.add('sceneView');\r\n\r\n scene.j2Ds.events.onEvent('scene:afterInit');\r\n\r\n scene.j2Ds.window.onload = function () {\r\n\r\n scene.j2Ds.window.focus();\r\n\r\n scene.j2Ds.window.onblur = function () {\r\n if (scene.j2Ds.stopAll == 0) {\r\n scene.j2Ds.stopEngine();\r\n scene.j2Ds.events.onEvent('scene:deactivate');\r\n }\r\n };\r\n\r\n scene.j2Ds.window.onfocus = function () {\r\n if (scene.j2Ds.stopAll == 1) {\r\n\r\n scene.j2Ds.runEngine(scene.j2Ds);\r\n scene.j2Ds.events.onEvent('scene:activate');\r\n }\r\n };\r\n\r\n for (var i in scene.j2Ds.layers.layersList) {\r\n scene.j2Ds.dom.attach(scene.j2Ds.layers.layer(i).canvas);\r\n }\r\n\r\n scene.j2Ds.ready = true;\r\n\r\n scene.j2Ds.events.onEvent('dom:loaded');\r\n };\r\n };\r\n\r\n Scene.prototype.initCanvas = function (id, canDeactivate) {\r\n var scene = this;\r\n\r\n scene.canFullScreen = false;\r\n\r\n scene.layerName = id;\r\n\r\n scene.j2Ds.events.onEvent('scene:beforeInit');\r\n\r\n scene.width = parseInt(scene.j2Ds.dom.id(id).width);\r\n scene.height = parseInt(scene.j2Ds.dom.id(id).height);\r\n\r\n scene.origWidth = scene.width;\r\n scene.origHeight = scene.height;\r\n\r\n scene.offsetWidth = parseInt(scene.j2Ds.dom.id(id).offsetWidth);\r\n scene.offsetHeight = parseInt(scene.j2Ds.dom.id(id).offsetHeight);\r\n\r\n scene.offsetLeft = parseInt(scene.j2Ds.dom.id(id).offsetLeft);\r\n scene.offsetTop = parseInt(scene.j2Ds.dom.id(id).offsetTop);\r\n\r\n scene.stylePosition = scene.j2Ds.dom.id(id).style.position == 'fixed' ? 'fixed' : 'absolute';\r\n\r\n scene.j2Ds.canDeactivate = canDeactivate != false;\r\n\r\n scene.j2Ds.layers.add(id, 0, 1);\r\n\r\n scene.context = scene.j2Ds.layers.layer(id).context;\r\n scene.canvas = scene.j2Ds.layers.layer(id).canvas;\r\n scene.visible = true;\r\n\r\n scene.cancelClear = false;\r\n\r\n /* Вид \"камеры\" */\r\n scene.view = scene.j2Ds.viewManager.add('sceneView');\r\n\r\n scene.j2Ds.events.onEvent('scene:afterInit');\r\n\r\n scene.j2Ds.window.onload = function () {\r\n\r\n scene.j2Ds.window.focus();\r\n\r\n scene.j2Ds.window.onblur = function () {\r\n if (scene.j2Ds.stopAll == 0) {\r\n scene.j2Ds.stopEngine();\r\n scene.j2Ds.events.onEvent('scene:deactivate');\r\n }\r\n };\r\n\r\n scene.j2Ds.window.onfocus = function () {\r\n if (scene.j2Ds.stopAll == 1) {\r\n scene.j2Ds.runEngine(scene.j2Ds);\r\n scene.j2Ds.events.onEvent('scene:activate');\r\n }\r\n };\r\n\r\n for (var i in scene.j2Ds.layers.layersList) {\r\n scene.j2Ds.dom.attach(scene.j2Ds.layers.layer(i).canvas);\r\n }\r\n\r\n scene.j2Ds.ready = true;\r\n\r\n scene.j2Ds.events.onEvent('dom:loaded');\r\n };\r\n };\r\n\r\n /* Nodes */\r\n Scene.prototype.addBaseNode = function (pos, size) {\r\n return new BaseNode(this.j2Ds, pos, size);\r\n };\r\n\r\n Scene.prototype.addCircleNode = function (pos, radius, color) {\r\n return new CircleNode(this.j2Ds, pos, radius, color);\r\n };\r\n\r\n Scene.prototype.addLineNode = function (pos, points, scale, color, width, fill, cFill) {\r\n return new LineNode(this.j2Ds, pos, points, scale, color, width, fill, cFill);\r\n };\r\n\r\n Scene.prototype.addRectNode = function (pos, size, color) {\r\n return new RectNode(this.j2Ds, pos, size, color);\r\n };\r\n\r\n Scene.prototype.addSpriteNode = function (pos, size, animation) {\r\n return new SpriteNode(this.j2Ds, pos, size, animation);\r\n };\r\n\r\n Scene.prototype.addTextNode = function (pos, text, sizePx, color, family, width, colorL) {\r\n return new TextNode(this.j2Ds, pos, text, sizePx, color, family, width, colorL);\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.Scene = Scene;\r\n if (global.j2Ds !== undefined) global.modules.core.Scene = Scene;\r\n return Scene;\r\n }));\r\n","/**\r\n * j2Ds (HTML5 2D Game Engine)\r\n *\r\n * @authors Skaner, DeVinterX\r\n * @license zlib\r\n * @version 0.6.3\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('j2Ds', [\r\n 'core/Dom',\r\n 'core/Gui',\r\n 'core/Events',\r\n 'core/Layers',\r\n 'core/Scene',\r\n\r\n 'io/AudioHandler',\r\n 'io/InputHandler',\r\n 'io/TouchHandler',\r\n\r\n 'managers/DeviceManager',\r\n 'managers/ErrorManager',\r\n 'managers/FpsManager',\r\n 'managers/ResourceManager',\r\n 'managers/StorageManager',\r\n 'managers/TimeManager',\r\n 'managers/TriggerManager',\r\n 'managers/ViewManager',\r\n\r\n 'utils/MathUtil',\r\n 'utils/TextureUtil'\r\n ], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(\r\n require('core/Dom'),\r\n require('core/Gui'),\r\n require('core/Events'),\r\n require('core/Layers'),\r\n require('core/Scene'),\r\n\r\n require('io/AudioHandler'),\r\n require('io/InputHandler'),\r\n require('io/TouchHandler'),\r\n\r\n require('managers/DeviceManager'),\r\n require('managers/ErrorManager'),\r\n require('managers/FpsManager'),\r\n require('managers/ResourceManager'),\r\n require('managers/StorageManager'),\r\n require('managers/TimeManager'),\r\n require('managers/TriggerManager'),\r\n require('managers/ViewManager'),\r\n\r\n require('utils/MathUtil'),\r\n require('utils/TextureUtil')\r\n );\r\n } else {\r\n factory(\r\n root.modules.core.Dom,\r\n root.modules.core.Gui,\r\n root.modules.core.Events,\r\n root.modules.core.Layers,\r\n root.modules.core.Scene,\r\n\r\n root.modules.io.AudioHandler,\r\n root.modules.io.InputHandler,\r\n root.modules.io.TouchHandler,\r\n\r\n root.modules.managers.DeviceManager,\r\n root.modules.managers.ErrorManager,\r\n root.modules.managers.FpsManager,\r\n root.modules.managers.ResourceManager,\r\n root.modules.managers.StorageManager,\r\n root.modules.managers.TimeManager,\r\n root.modules.managers.TriggerManager,\r\n root.modules.managers.ViewManager,\r\n\r\n root.modules.utils.MathUtil,\r\n root.modules.utils.TextureUtil\r\n );\r\n }\r\n}(typeof window !== 'undefined' ? window : global,\r\n function (DOM,\r\n GUI,\r\n Events,\r\n Layers,\r\n Scene,\r\n AudioHandler,\r\n InputHandler,\r\n TouchHandler,\r\n DeviceManager,\r\n ErrorManager,\r\n FPSManager,\r\n ResourceManager,\r\n StorageManager,\r\n TimeManager,\r\n TriggerManager,\r\n ViewManager,\r\n MathUtil) {\r\n \"use strict\";\r\n\r\n var frameLimit = 60;\r\n\r\n /*------------------ 2D движок --------------------*/\r\n var j2DsEngine = function () {\r\n this.vector = {}; //TODO:: is need?\r\n this.math = {}; //TODO:: is need?\r\n this.dom = {};\r\n this.now = Date.now();\r\n this.dt = 0;\r\n this.stopAll = 0;\r\n this.frameLimit = 60;\r\n this.sceneStartTime = 0;\r\n this.sceneSkipTime = 0;\r\n this.engine = function () {\r\n this.errorManager.show('Не инициализировано ни одно игровое состояние', 'red');\r\n this.stopEngine();\r\n };\r\n this.ready = false;\r\n this.window = window;\r\n this.canDeactivate = true;\r\n\r\n /* Getters & Setters */\r\n\r\n this.getInfo = function () {\r\n return {\r\n 'name': 'j2Ds',\r\n 'version': '0.6.3',\r\n 'git': 'https://github.com/SkanerSoft/j2Ds',\r\n 'site': 'http://j2ds.ru',\r\n 'description': 'HTML5 2D Game Engine',\r\n 'author': 'Skaner'\r\n };\r\n };\r\n\r\n this.getFPSManager = function () {\r\n this.fpsManager.init();\r\n return this.fpsManager;\r\n };\r\n\r\n this.getSceneManager = function () {\r\n return this.scene;\r\n };\r\n\r\n this.getLayerManager = function () {\r\n return this.layers;\r\n };\r\n\r\n this.getTextureManager = function () {\r\n return this.scene.texture;\r\n };\r\n\r\n this.getAudioManager = function () {\r\n this.audio.init();\r\n return this.audio;\r\n };\r\n\r\n this.getPaintManager = function () {\r\n return this.paint;\r\n };\r\n\r\n this.getIO = function () {\r\n this.input.init();\r\n return this.input;\r\n };\r\n\r\n this.getTouchIO = function () {\r\n this.touch.init();\r\n return this.touch;\r\n };\r\n\r\n this.getDOMManager = function () {\r\n return this.dom;\r\n };\r\n\r\n this.getTriggerManager = function () {\r\n this.trigger.init();\r\n return this.trigger;\r\n };\r\n\r\n this.getMathManager = function () {\r\n return MathUtil;\r\n };\r\n\r\n this.getGameStateManager = function () {\r\n return this.gameStates;\r\n };\r\n\r\n this.getViewManager = function () {\r\n return this.viewManager;\r\n };\r\n\r\n this.getDeviceManager = function () {\r\n return this.deviceManager;\r\n };\r\n\r\n this.getErrorManager = function () {\r\n this.errorManager.init();\r\n return this.errorManager;\r\n };\r\n\r\n this.getTimeManager = function () {\r\n return this.timeManager;\r\n };\r\n\r\n this.getResourceManager = function () {\r\n return this.resources;\r\n };\r\n\r\n this.setWindow = function (_window) {\r\n this.window = _window ? _window : window;\r\n };\r\n\r\n this.setFrameLimit = function (fps) {\r\n this.frameLimit = (fps > 0 && fps <= 60) ? fps : 60;\r\n frameLimit = this.frameLimit;\r\n };\r\n\r\n this.setActiveEngine = function (engine) {\r\n this.engine = typeof engine == 'function'\r\n ? engine\r\n : this.errorManager.show('Error in \"GameStateManager\"');\r\n };\r\n\r\n this.events = new Events(this);\r\n this.dom = new DOM(this);\r\n this.gui = new GUI(this);\r\n this.resources = new ResourceManager(this);\r\n this.trigger = new TriggerManager(this);\r\n this.timeManager = new TimeManager(this);\r\n this.deviceManager = DeviceManager();\r\n this.errorManager = new ErrorManager(this);\r\n this.fpsManager = new FPSManager(this);\r\n this.input = new InputHandler(this);\r\n this.layers = new Layers(this);\r\n this.viewManager = new ViewManager(this);\r\n this.scene = new Scene(this);\r\n\r\n this.createLocal = function (id) {\r\n new StorageManager(this, id);\r\n }\r\n };\r\n\r\n j2DsEngine.prototype.gameStates = {\r\n states: {},\r\n\r\n add: function (name, _state, start, end) {\r\n var state = {};\r\n state.state = _state;\r\n state.start = start || false;\r\n state.end = end || false;\r\n\r\n this.states[name] = state;\r\n }\r\n };\r\n\r\n j2DsEngine.prototype.start = function (engine, frameLimit) {\r\n this.setActiveEngine(engine);\r\n this.frameLimit = frameLimit || 60;\r\n this.sceneSkipTime = 1000.0 / this.frameLimit;\r\n this.lastTime = Date.now();\r\n this.dt = 0;\r\n this.sceneStartTime = this.lastTime;\r\n this.gameEngine(this);\r\n };\r\n\r\n j2DsEngine.prototype.gameEngine = function (j2Ds) {\r\n j2Ds.now = Date.now();\r\n setTimeout(function () {\r\n if (!j2Ds.stopAll) {\r\n j2Ds.dt = (j2Ds.now - j2Ds.lastTime) / 100.0;\r\n j2Ds.sceneStartTime = j2Ds.now;\r\n if (j2Ds.dt > j2Ds.sceneSkipTime / 2) j2Ds.dt = 0;\r\n\r\n j2Ds.events.onEvent('engine:before');\r\n\r\n try {\r\n j2Ds.engine();\r\n } catch (err) {\r\n j2Ds.errorManager.showError(err);\r\n }\r\n\r\n j2Ds.events.onEvent('engine:after');\r\n\r\n j2Ds.lastTime = j2Ds.now;\r\n\r\n requestAnimationFrame(function () {\r\n j2Ds.gameEngine(j2Ds);\r\n });\r\n }\r\n }, (j2Ds.frameLimit < 60 ? j2Ds.sceneSkipTime : 0));\r\n };\r\n\r\n var requestAnimationFrame = (function () {\r\n return window.requestAnimationFrame ||\r\n window.webkitRequestAnimationFrame ||\r\n window.mozRequestAnimationFrame ||\r\n window.oRequestAnimationFrame ||\r\n window.msRequestAnimationFrame ||\r\n function (callback) {\r\n window.setTimeout(callback, 1000 / frameLimit);\r\n };\r\n })();\r\n\r\n j2DsEngine.prototype.stopEngine = function () {\r\n if (!this.canDeactivate) return;\r\n this.stopAll = true;\r\n };\r\n\r\n j2DsEngine.prototype.runEngine = function (j2Ds) {\r\n j2Ds = j2Ds || this;\r\n if (!j2Ds.canDeactivate) return;\r\n if (!j2Ds.stopAll) return;\r\n j2Ds.stopAll = false;\r\n requestAnimationFrame(function () {\r\n j2Ds.gameEngine(j2Ds);\r\n });\r\n };\r\n\r\n if (typeof module === 'object' && typeof module.exports === 'object') module.exports.j2Ds = j2DsEngine;\r\n if (global.j2Ds !== undefined) global.modules.core.j2Ds = j2DsEngine;\r\n if (global.j2Ds !== undefined) global.j2Ds = new j2DsEngine();\r\n return j2DsEngine;\r\n }\r\n));\r\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/src/header.js b/src/header.js index a98dde9..735de5c 100644 --- a/src/header.js +++ b/src/header.js @@ -3,7 +3,7 @@ * * @authors Skaner, DeVinterX * @license zlib - * @version 0.6.2 + * @version 0.6.3 */ if (global === undefined) { diff --git a/src/js/core/Dom.js b/src/js/core/Dom.js index 6619118..02bd907 100644 --- a/src/js/core/Dom.js +++ b/src/js/core/Dom.js @@ -22,55 +22,55 @@ this.j2Ds = j2Ds; }; - Dom.prototype.id = function (_id) { - return document.getElementById(_id); + Dom.prototype.id = function (id) { + return document.getElementById(id); }; - Dom.prototype.name = function (_id) { - return document.getElementsByName(_id)[0]; + Dom.prototype.name = function (id) { + return document.getElementsByName(id)[0]; }; - Dom.prototype.tag = function (_id, _parent) { - var finder = _parent || document; - return finder.getElementsByTagName(_id); + Dom.prototype.tag = function (id, parent) { + var finder = parent || document; + return finder.getElementsByTagName(id); }; - Dom.prototype.goURL = function (_url) { - document.location.href = _url; + Dom.prototype.goURL = function (url) { + document.location.href = url; }; Dom.prototype.reloadURL = function () { document.location.href = document.location.href; }; - Dom.prototype.attach = function (_id, _parent) { + Dom.prototype.attach = function (id, parent) { var dom = this; - this.j2Ds.events.addEvent('dom:loaded', function (_parent) { - if (!_parent) { - dom.tag('body')[0].appendChild(_id); + this.j2Ds.events.addEvent('dom:loaded', function (parent) { + if (!parent) { + dom.tag('body')[0].appendChild(id); } else { - dom.id(_parent).appendChild(_id); + dom.id(parent).appendChild(id); } }); }; - Dom.prototype.injectJavaScript = function (_code) { - var code = _code.toString(); + Dom.prototype.injectJavaScript = function (code) { + code = code.toString(); code = code.replace(/[\n\r\t]/g, ';'); document.location.href = 'javascript: var injectFunction = (function() {setTimeout(' + code + ', 0);}); injectFunction();'; }; - Dom.prototype.callJava = function (_code) { - document.location.href = 'javacall:' + _code; + Dom.prototype.callJava = function (code) { + document.location.href = 'javacall:' + code; }; - Dom.prototype.send = function (_path, _func) { + Dom.prototype.send = function (path, callback) { var ajax = new XMLHttpRequest(); - ajax.open('GET', _path, true); + ajax.open('GET', path, true); ajax.onreadystatechange = function () { if (ajax.readyState == 4) { if (ajax.status == 200) { - _func(ajax.responseText); + callback(ajax.responseText); } } }; diff --git a/src/js/core/Scene.js b/src/js/core/Scene.js index 550eaad..1cd0edd 100644 --- a/src/js/core/Scene.js +++ b/src/js/core/Scene.js @@ -64,8 +64,8 @@ /*функции*/ - Scene.prototype.setView = function (_id) { - this.view = this.j2Ds.viewManager.views[_id]; + Scene.prototype.setView = function (id) { + this.view = this.j2Ds.viewManager.views[id]; }; Scene.prototype.getView = function () { @@ -130,8 +130,8 @@ this.origHeight = this.height; this.width = this.j2Ds.getDeviceManager().width; this.height = this.j2Ds.getDeviceManager().height; - for (var i in this.j2Ds.layers.list) { - layer = this.j2Ds.layers.list[i]; + for (var i in this.j2Ds.layers.layersList) { + layer = this.j2Ds.layers.layersList[i]; tmpCanvas.width = layer.width; tmpCanvas.height = layer.height; tmpContext.drawImage(layer.canvas, 0, 0); @@ -147,8 +147,8 @@ } else { this.width = this.origWidth; this.height = this.origHeight; - for (var i in this.j2Ds.layers.list) { - layer = this.j2Ds.layers.list[i]; + for (var i in this.j2Ds.layers.layersList) { + layer = this.j2Ds.layers.layersList[i]; layer.width = this.origWidth; layer.height = this.origHeight; layer.canvas.width = this.origWidth; @@ -164,16 +164,16 @@ if (!this.canFullScreen) return; var layer; if (_true) { - for (var i in this.j2Ds.layers.list) { - layer = this.j2Ds.layers.list[i].canvas; + for (var i in this.j2Ds.layers.layersList) { + layer = this.j2Ds.layers.layersList[i].canvas; layer.style.width = this.j2Ds.getDeviceManager().width + 'px'; layer.style.height = this.j2Ds.getDeviceManager().height + 'px'; this.offsetWidth = this.j2Ds.getDeviceManager().width; this.offsetHeight = this.j2Ds.getDeviceManager().height; } } else { - for (var i in this.j2Ds.layers.list) { - layer = this.j2Ds.layers.list[i].canvas; + for (var i in this.j2Ds.layers.layersList) { + layer = this.j2Ds.layers.layersList[i].canvas; layer.style.width = this.width + 'px'; layer.style.height = this.height + 'px'; this.offsetWidth = this.width; @@ -198,25 +198,25 @@ } }; - Scene.prototype.init = function (_w, _h, _canDeactivate) { + Scene.prototype.init = function (width, height, canDeactivate) { var scene = this; scene.j2Ds.events.onEvent('scene:beforeInit'); - scene.width = _w; - scene.height = _h; + scene.width = width; + scene.height = height; - scene.origWidth = _w; - scene.origHeight = _h; + scene.origWidth = width; + scene.origHeight = height; - scene.offsetWidth = _w; - scene.offsetHeight = _h; + scene.offsetWidth = width; + scene.offsetHeight = height; scene.offsetLeft = 0; scene.offsetTop = 0; - scene.j2Ds.canDeactivate = _canDeactivate != false; + scene.j2Ds.canDeactivate = canDeactivate != false; scene.j2Ds.layers.add('sceneNode', 0); @@ -250,7 +250,7 @@ } }; - for (var i in scene.j2Ds.layers.list) { + for (var i in scene.j2Ds.layers.layersList) { scene.j2Ds.dom.attach(scene.j2Ds.layers.layer(i).canvas); } @@ -260,35 +260,35 @@ }; }; - Scene.prototype.initCanvas = function (_id, _canDeactivate) { + Scene.prototype.initCanvas = function (id, canDeactivate) { var scene = this; scene.canFullScreen = false; - scene.layerName = _id; + scene.layerName = id; scene.j2Ds.events.onEvent('scene:beforeInit'); - scene.width = parseInt(scene.j2Ds.dom.id(_id).width); - scene.height = parseInt(scene.j2Ds.dom.id(_id).height); + scene.width = parseInt(scene.j2Ds.dom.id(id).width); + scene.height = parseInt(scene.j2Ds.dom.id(id).height); scene.origWidth = scene.width; scene.origHeight = scene.height; - scene.offsetWidth = parseInt(scene.j2Ds.dom.id(_id).offsetWidth); - scene.offsetHeight = parseInt(scene.j2Ds.dom.id(_id).offsetHeight); + scene.offsetWidth = parseInt(scene.j2Ds.dom.id(id).offsetWidth); + scene.offsetHeight = parseInt(scene.j2Ds.dom.id(id).offsetHeight); - scene.offsetLeft = parseInt(scene.j2Ds.dom.id(_id).offsetLeft); - scene.offsetTop = parseInt(scene.j2Ds.dom.id(_id).offsetTop); + scene.offsetLeft = parseInt(scene.j2Ds.dom.id(id).offsetLeft); + scene.offsetTop = parseInt(scene.j2Ds.dom.id(id).offsetTop); - scene.stylePosition = scene.j2Ds.dom.id(_id).style.position == 'fixed' ? 'fixed' : 'absolute'; + scene.stylePosition = scene.j2Ds.dom.id(id).style.position == 'fixed' ? 'fixed' : 'absolute'; - scene.j2Ds.canDeactivate = _canDeactivate != false; + scene.j2Ds.canDeactivate = canDeactivate != false; - scene.j2Ds.layers.add(_id, 0, 1); + scene.j2Ds.layers.add(id, 0, 1); - scene.context = scene.j2Ds.layers.layer(_id).context; - scene.canvas = scene.j2Ds.layers.layer(_id).canvas; + scene.context = scene.j2Ds.layers.layer(id).context; + scene.canvas = scene.j2Ds.layers.layer(id).canvas; scene.visible = true; scene.cancelClear = false; @@ -316,7 +316,7 @@ } }; - for (var i in scene.j2Ds.layers.list) { + for (var i in scene.j2Ds.layers.layersList) { scene.j2Ds.dom.attach(scene.j2Ds.layers.layer(i).canvas); } diff --git a/src/js/j2Ds.js b/src/js/j2Ds.js index 0bd4cee..bd5bddf 100644 --- a/src/js/j2Ds.js +++ b/src/js/j2Ds.js @@ -3,7 +3,7 @@ * * @authors Skaner, DeVinterX * @license zlib - * @version 0.6.2 + * @version 0.6.3 */ (function (root, factory) { @@ -104,8 +104,8 @@ /*------------------ 2D движок --------------------*/ var j2DsEngine = function () { - this.vector = {}; - this.math = {}; + this.vector = {}; //TODO:: is need? + this.math = {}; //TODO:: is need? this.dom = {}; this.now = Date.now(); this.dt = 0; @@ -125,10 +125,10 @@ this.getInfo = function () { return { - 'name': 'j2DsEngine', - 'version': '0.6.2', - 'git': 'https://github.com/SkanerSoft/j2DsEngine', - 'site': 'http://j2DsEngine.ru', + 'name': 'j2Ds', + 'version': '0.6.3', + 'git': 'https://github.com/SkanerSoft/j2Ds', + 'site': 'http://j2ds.ru', 'description': 'HTML5 2D Game Engine', 'author': 'Skaner' }; @@ -227,6 +227,7 @@ this.dom = new DOM(this); this.gui = new GUI(this); this.resources = new ResourceManager(this); + this.trigger = new TriggerManager(this); this.timeManager = new TimeManager(this); this.deviceManager = DeviceManager(); this.errorManager = new ErrorManager(this); diff --git a/src/js/managers/ErrorManager.js b/src/js/managers/ErrorManager.js index bce9c7b..800c8ee 100644 --- a/src/js/managers/ErrorManager.js +++ b/src/js/managers/ErrorManager.js @@ -25,7 +25,7 @@ ErrorManager.prototype.init = function (_true) { var errorManager = this; - errorManager.enabled = true; + errorManager.enabled = _true || true; var runBtn = document.createElement('div'); runBtn.innerHTML = 'RUN'; diff --git a/src/js/nodes/BaseNode.js b/src/js/nodes/BaseNode.js index 4c487eb..d626e8c 100644 --- a/src/js/nodes/BaseNode.js +++ b/src/js/nodes/BaseNode.js @@ -3,7 +3,7 @@ * * @authors Skaner, DeVinterX * @license zlib - * @version 0.6.2 + * @version 0.6.3 */ (function (root, factory) { @@ -161,8 +161,8 @@ }; BaseNode.prototype.isLookScene = function () { - return (this.pos.x > j2Ds.scene.view.pos.x + j2Ds.scene.width || this.pos.x + this.size.x < j2Ds.scene.view.pos.x) - || (this.pos.y > j2Ds.scene.view.pos.y + j2Ds.scene.height || this.pos.y + this.size.y < j2Ds.scene.view.pos.y); + return !((this.pos.x > j2Ds.scene.view.pos.x + j2Ds.scene.width || this.pos.x + this.size.x < j2Ds.scene.view.pos.x) + || (this.pos.y > j2Ds.scene.view.pos.y + j2Ds.scene.height || this.pos.y + this.size.y < j2Ds.scene.view.pos.y)); }; BaseNode.prototype.turn = function (angle) { @@ -178,6 +178,14 @@ return this.angle; }; + BaseNode.prototype.rotateTo = function (_to, _t) { + _t = _t ? _t : 1; + this.setRotation((Math.atan2( + (_to.y - this.getPosition().y), + (_to.x - this.getPosition().x) + ) * (180 / Math.PI)) / _t); + }; + BaseNode.prototype.isOutScene = function () { var vector = {}; diff --git a/src/js/utils/TextureUtil.js b/src/js/utils/TextureUtil.js index 4584997..2b0ab27 100644 --- a/src/js/utils/TextureUtil.js +++ b/src/js/utils/TextureUtil.js @@ -3,7 +3,7 @@ * * @authors Skaner, DeVinterX * @license zlib - * @version 0.6.2 + * @version 0.6.3 */ (function (root, factory) { @@ -21,14 +21,14 @@ this.j2Ds = j2Ds; }; - TextureUtil.prototype.createImageMap = function (_w, _h, callback) { + TextureUtil.prototype.createImageMap = function (width, height, callback) { var textureUtil = this; textureUtil.j2Ds.resources.add(); var image = { img: null, loaded: false, - width: _w, - height: _h + width: width, + height: height }; image.img = document.createElement('canvas'); @@ -51,7 +51,7 @@ }; }; - textureUtil.j2Ds.resources.ok('createImageMap_' + w + 'x' + h); + textureUtil.j2Ds.resources.ok('createImageMap_' + width + 'x' + height); return image; }; @@ -71,8 +71,8 @@ image.img.src = path; image.img.addEventListener('load', function () { - image.width = o.img.width; - image.height = o.img.height; + image.width = image.img.width; + image.height = image.img.height; image.loaded = true; textureUtil.j2Ds.resources.ok(path); });