diff --git a/dist/application.js b/dist/application.js index 80e9e6b..30cfc8b 100644 --- a/dist/application.js +++ b/dist/application.js @@ -20,6 +20,7 @@ scene.setAutoClear(true); lr.add('back', -1).fill('black'); var b = scene.addTextNode(v2f(5, 270), '', 30, 'white', '', 1, 'black'); +var b2 = scene.addTextNode(v2f(5, 240), '', 30, 'white', '', 1, 'black'); var f = scene.addTextNode(v2f(300, 270), '', 30, 'white', '', 1, 'black'); var r1 = scene.addRectNode(v2f(40, 40), v2f(50, 50), 'red'); var r2 = scene.addRectNode(v2f(100, 100), v2f(90, 90), 'green'); @@ -46,7 +47,9 @@ gm.add('myGame', function () { if (io.isKeyDown('S')) r1.move(v2f(0, 1)); if (io.isKeyDown('A')) r1.move(v2f(-1, 0)); if (io.isKeyDown('D')) r1.move(v2f(1, 0)); - if (io.isTouch()) console.log(io.getPosition()); + if (io.isTouch()) b2.drawSimpleText('IS TOUCH'); + if (io.isTouchTap()) console.log('touchTap', io.getPosition()); + if (io.isTouchHold()) console.log('touchHold', io.getPosition()); b.drawSimpleText(io.onNode([r1, r2, r3]) ? 'TRUE' : 'FALSE'); //b.drawSimpleText(r1.isIntersect([r2, r3]) ? 'TRUE' : 'FALSE'); diff --git a/dist/js/j2ds.min.js b/dist/js/j2ds.min.js index 51f0400..2679151 100644 --- a/dist/js/j2ds.min.js +++ b/dist/js/j2ds.min.js @@ -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(){};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)},e.is4VerticesIntersect=function(t,o){var i,s;for(i=0;i0&&1>r&&n>0&&1>n)},e.isPointInRect=function(t,o,i,s,n){return e.isPointInTriangle(n,t,o,i)||e.isPointInTriangle(n,i,s,t)};var t=function(e,t,o){return(e.x-o.x)*(t.y-o.y)-(t.x-o.x)*(e.y-o.y)};return e.isPointInTriangle=function(e,o,i,s){var n,r,a;return n=t(e,o,i)<0,r=t(e,i,s)<0,a=t(e,s,o)<0,n==r&&r==a},"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;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)},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.getBox=function(e){return{x1:e.pos.x+e.box.offset.x,x2:e.pos.x+e.box.offset.x+e.size.x+e.box.size.x,y1:e.pos.y+e.box.offset.y,y2:e.pos.y+e.box.offset.y+e.size.y+e.box.size.y}},o.prototype.getBoxVertices=function(o){void 0===o&&(o=this);var i=-e.rad(o.angle),s=o.box.offset.x+o.box.size.x/2+o.getPosition().x-t.scene.view.pos.x,n=o.box.offset.y+o.box.size.y/2+o.getPosition().y-t.scene.view.pos.y,r=this.getBox(o);return[{x:(s+(r.y1-n)*Math.sin(i)+(r.x2-s)*Math.cos(i)).toFixed(5),y:(n+(r.y1-n)*Math.cos(i)-(r.x2-s)*Math.sin(i)).toFixed(5)},{x:(s+(r.y2-n)*Math.sin(i)+(r.x2-s)*Math.cos(i)).toFixed(5),y:(n+(r.y2-n)*Math.cos(i)-(r.x2-s)*Math.sin(i)).toFixed(5)},{x:(s+(r.y2-n)*Math.sin(i)+(r.x1-s)*Math.cos(i)).toFixed(5),y:(n+(r.y2-n)*Math.cos(i)-(r.x1-s)*Math.sin(i)).toFixed(5)},{x:(s+(r.y1-n)*Math.sin(i)+(r.x1-s)*Math.cos(i)).toFixed(5),y:(n+(r.y1-n)*Math.cos(i)-(r.x1-s)*Math.sin(i)).toFixed(5)}]};var i=function(t,o){var i,s;return 0===t.angle&&0===o.angle?(i=t.getBox(t),s=t.getBox(o),!(i.y1>s.y2||i.y2s.x2)):(i=t.getBoxVertices(t),s=t.getBoxVertices(o),e.is4VerticesIntersect(i,s)?!0:t.isPointInsideBox(i,o.getPosition())||o.isPointInsideBox(s,t.getPosition()))};return o.prototype.isPointInsideBox=function(t,o){return e.isPointInRect(t[0],t[1],t[2],t[3],o)},o.prototype.isIntersect=function(e){var t=this;if(e instanceof o)return i(t,e);if(e instanceof Array&&e.length>0&&e[0]instanceof o){for(var s=0;st.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 o=this.layer.context;o.lineWidth=2,o.strokeStyle="black",this.angle&&(o.save(),o.translate(this.getPosition().x-t.scene.view.pos.x,this.getPosition().y-t.scene.view.pos.y),o.rotate(e.rad(this.angle)),o.translate(-(this.getPosition().x-t.scene.view.pos.x),-(this.getPosition().y-t.scene.view.pos.y))),o.beginPath(),o.rect(this.pos.x-t.scene.view.pos.x,this.pos.y-t.scene.view.pos.y,this.size.x,this.size.y),o.stroke(),this.angle&&(o.restore(),o.save(),o.translate(this.box.offset.x+this.box.size.x/2+this.getPosition().x-t.scene.view.pos.x,this.box.offset.y+this.box.size.y/2+this.getPosition().y-t.scene.view.pos.y),o.rotate(e.rad(this.angle)),o.translate(-(this.box.offset.x+this.box.size.x/2+this.getPosition().x-t.scene.view.pos.x),-(this.box.offset.y+this.box.size.y/2+this.getPosition().y-t.scene.view.pos.y))),o.strokeStyle="yellow",o.beginPath(),o.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),o.stroke(),this.angle&&o.restore()},"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;return 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},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;return 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},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;return i=function(t,i,s,n){o=t,e.call(this,t,i,s),this.color=n},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;return 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}},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;return 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 c=0,u=this.lines.length;u>c;c+=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","nodes/BaseNode"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil"),require("nodes/BaseNode")):t(e.modules.utils.MathUtil,e.modules.nodes.BaseNode)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o=function(e){this.j2Ds=e,this.pos={x:0,y:0},this.x=0,this.y=0,this.screenPos={x:0,y:0},this.touch=!1,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 o.prototype.mKey={LEFT:1,MIDDLE:2,RIGHT:3},o.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},o.prototype.keyList=function(){var e=[];for(var t in this.jKey)e.push(t);return e},o.prototype.reset=function(){return this.enabled?(this.keyPress=[],this.keyUp=[],this.mousePress=[],this.mouseUp=[],void(this.mouseWheel=0)):!1},o.prototype.isKeyDown=function(e){return this.keyDown[this.jKey[e]]},o.prototype.isKeyPress=function(e){return this.keyPress[this.jKey[e]]},o.prototype.isKeyUp=function(e){return this.keyUp[this.jKey[e]]},o.prototype.getPosition=function(){return e.v2f(this.pos.x,this.pos.y)},o.prototype.getScreenPosition=function(){return e.v2f(this.screenPos.x,this.screenPos.y)},o.prototype.setWriteMode=function(e){this.writeMode=e},o.prototype.isWriteMode=function(){return this.writeMode},o.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},o.prototype.cancel=function(e){e?this.keyDown[this.jKey[e]]=!1:(this.canceled=!0,this.keyDown=[],this.mouseDown=[])},o.prototype.onNode=function(e){if(e instanceof t)return e.layer.visible&&e.isLookScene()?e.isPointInsideBox(e.getBoxVertices(),this.pos):!1;if(e instanceof Array&&e.length>0&&e[0]instanceof t){for(var o=0;o0||"DOWN"==e&&this.mouseWheel<0},o.prototype.onMouseWheel=function(e){return this.enabled?(e.preventDefault(),this.mouseWheel=e.wheelDelta?e.wheelDelta:-e.detail,!1):!1},o.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},o.prototype.onTouchEvent=function(e){var t=this.j2Ds.input;return t.enabled?(e.preventDefault(),t.touch=!t.canceled,t.canceled||(t.mouseDown=[]),t.screenPos.x=-t.j2Ds.scene.offsetLeft+e.touches[0].pageX,t.screenPos.y=-t.j2Ds.scene.offsetTop+e.touches[0].pageY,t.j2Ds.window.focus(),!1):!1},o.prototype.setCursorImage=function(e){this.j2Ds.dom.tag("body")[0].style.cursor='url("'+e+'"), auto'},o.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")},o.prototype.isVisible=function(){return this.visible},o.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.focus(),e.j2Ds.window.addEventListener("touchstart",e.onTouchEvent),e.j2Ds.window.addEventListener("touchmove",e.onTouchEvent),e.j2Ds.window.addEventListener("touchend",function(){e.canceled=!1,e.touch=!1}),e.j2Ds.window.addEventListener("touchcancel",function(){e.canceled=!1,e.touch=!1}),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=e.onMove,e.j2Ds.window.onkeydown=e.keyEvent,e.j2Ds.window.onkeyup=function(t){e.canceled=!1,e.keyEvent(t)},e.j2Ds.window.onkeypress=e.keyEvent,e.j2Ds.window.onmousewheel=e.onMouseWheel,e.j2Ds.window.addEventListener&&e.j2Ds.window.addEventListener("DOMMouseScroll",e.onMouseWheel,!1)})},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.InputHandler=o),void 0!==global.j2Ds&&(global.modules.io.InputHandler=o),o}),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,c,u,p,f,y,g){"use strict";var m=60,v=function(){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.events=new o(this),this.dom=new e(this),this.gui=new t(this),this.resources=new c(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){return new u(this,e)}};v.prototype.getInfo=function(){return{name:"j2Ds",version:"0.6.4",git:"https://github.com/SkanerSoft/j2Ds",site:"http://j2ds.ru",description:"HTML5 2D Game Engine",author:"Skaner"}},v.prototype.getFPSManager=function(){return this.fpsManager.init(),this.fpsManager},v.prototype.getSceneManager=function(){return this.scene},v.prototype.getLayerManager=function(){return this.layers},v.prototype.getTextureManager=function(){return this.scene.texture},v.prototype.getAudioManager=function(){return this.audio.init(),this.audio},v.prototype.getPaintManager=function(){return this.paint},v.prototype.getIO=function(){return this.input.init(),this.input},v.prototype.getTouchIO=function(){return this.touch.init(),this.touch},v.prototype.getDOMManager=function(){return this.dom},v.prototype.getTriggerManager=function(){return this.trigger.init(),this.trigger},v.prototype.getMathManager=function(){return g},v.prototype.getGameStateManager=function(){return this.gameStates},v.prototype.getViewManager=function(){return this.viewManager},v.prototype.getDeviceManager=function(){return this.deviceManager},v.prototype.getErrorManager=function(){return this.errorManager.init(),this.errorManager},v.prototype.getTimeManager=function(){return this.timeManager},v.prototype.getResourceManager=function(){return this.resources},v.prototype.setWindow=function(e){this.window=e?e:window},v.prototype.setFrameLimit=function(e){this.frameLimit=e>0&&60>=e?e:60,m=this.frameLimit},v.prototype.setActiveEngine=function(e){this.engine="function"==typeof e?e:this.errorManager.show('Error in "GameStateManager"')},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,x(function(){e.gameEngine(e)})}},e.frameLimit<60?e.sceneSkipTime:0)};var x=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/m)}}();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,x(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(){};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)},e.is4VerticesIntersect=function(t,o){var i,s;for(i=0;i0&&1>r&&n>0&&1>n)},e.isPointInRect=function(t,o,i,s,n){return e.isPointInTriangle(n,t,o,i)||e.isPointInTriangle(n,i,s,t)};var t=function(e,t,o){return(e.x-o.x)*(t.y-o.y)-(t.x-o.x)*(e.y-o.y)};return e.isPointInTriangle=function(e,o,i,s){var n,r,a;return n=t(e,o,i)<0,r=t(e,i,s)<0,a=t(e,s,o)<0,n==r&&r==a},"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;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)},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.getBox=function(e){return{x1:e.pos.x+e.box.offset.x,x2:e.pos.x+e.box.offset.x+e.size.x+e.box.size.x,y1:e.pos.y+e.box.offset.y,y2:e.pos.y+e.box.offset.y+e.size.y+e.box.size.y}},o.prototype.getBoxVertices=function(o){void 0===o&&(o=this);var i=-e.rad(o.angle),s=o.box.offset.x+o.box.size.x/2+o.getPosition().x-t.scene.view.pos.x,n=o.box.offset.y+o.box.size.y/2+o.getPosition().y-t.scene.view.pos.y,r=this.getBox(o);return[{x:(s+(r.y1-n)*Math.sin(i)+(r.x2-s)*Math.cos(i)).toFixed(5),y:(n+(r.y1-n)*Math.cos(i)-(r.x2-s)*Math.sin(i)).toFixed(5)},{x:(s+(r.y2-n)*Math.sin(i)+(r.x2-s)*Math.cos(i)).toFixed(5),y:(n+(r.y2-n)*Math.cos(i)-(r.x2-s)*Math.sin(i)).toFixed(5)},{x:(s+(r.y2-n)*Math.sin(i)+(r.x1-s)*Math.cos(i)).toFixed(5),y:(n+(r.y2-n)*Math.cos(i)-(r.x1-s)*Math.sin(i)).toFixed(5)},{x:(s+(r.y1-n)*Math.sin(i)+(r.x1-s)*Math.cos(i)).toFixed(5),y:(n+(r.y1-n)*Math.cos(i)-(r.x1-s)*Math.sin(i)).toFixed(5)}]};var i=function(t,o){var i,s;return 0===t.angle&&0===o.angle?(i=t.getBox(t),s=t.getBox(o),!(i.y1>s.y2||i.y2s.x2)):(i=t.getBoxVertices(t),s=t.getBoxVertices(o),e.is4VerticesIntersect(i,s)?!0:t.isPointInsideBox(i,o.getPosition())||o.isPointInsideBox(s,t.getPosition()))};return o.prototype.isPointInsideBox=function(t,o){return e.isPointInRect(t[0],t[1],t[2],t[3],o)},o.prototype.isIntersect=function(e){var t=this;if(e instanceof o)return i(t,e);if(e instanceof Array&&e.length>0&&e[0]instanceof o){for(var s=0;st.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 o=this.layer.context;o.lineWidth=2,o.strokeStyle="black",this.angle&&(o.save(),o.translate(this.getPosition().x-t.scene.view.pos.x,this.getPosition().y-t.scene.view.pos.y),o.rotate(e.rad(this.angle)),o.translate(-(this.getPosition().x-t.scene.view.pos.x),-(this.getPosition().y-t.scene.view.pos.y))),o.beginPath(),o.rect(this.pos.x-t.scene.view.pos.x,this.pos.y-t.scene.view.pos.y,this.size.x,this.size.y),o.stroke(),this.angle&&(o.restore(),o.save(),o.translate(this.box.offset.x+this.box.size.x/2+this.getPosition().x-t.scene.view.pos.x,this.box.offset.y+this.box.size.y/2+this.getPosition().y-t.scene.view.pos.y),o.rotate(e.rad(this.angle)),o.translate(-(this.box.offset.x+this.box.size.x/2+this.getPosition().x-t.scene.view.pos.x),-(this.box.offset.y+this.box.size.y/2+this.getPosition().y-t.scene.view.pos.y))),o.strokeStyle="yellow",o.beginPath(),o.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),o.stroke(),this.angle&&o.restore()},"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;return 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},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;return 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},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;return i=function(t,i,s,n){o=t,e.call(this,t,i,s),this.color=n},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;return 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}},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;return 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","nodes/BaseNode"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("utils/MathUtil"),require("nodes/BaseNode")):t(e.modules.utils.MathUtil,e.modules.nodes.BaseNode)}("undefined"!=typeof window?window:global,function(e,t){"use strict";var o=function(e){this.j2Ds=e,this.pos={x:0,y:0},this.x=0,this.y=0,this.screenPos={x:0,y:0},this.touch=!1,this.touchTap=!1,this.touchHold=!1,this.touchAutoHold=!1,this.touchCount=0,this.touchDuration=60,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 o.prototype.mKey={LEFT:1,MIDDLE:2,RIGHT:3},o.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},o.prototype.keyList=function(){var e=[];for(var t in this.jKey)e.push(t);return e},o.prototype.reset=function(){return this.enabled?(this.keyPress=[],this.keyUp=[],this.mousePress=[],this.mouseUp=[],this.mouseWheel=0,this.touchHold=!1,void(this.touchTap=!1)):!1},o.prototype.isKeyDown=function(e){return this.keyDown[this.jKey[e]]},o.prototype.isKeyPress=function(e){return this.keyPress[this.jKey[e]]},o.prototype.isKeyUp=function(e){return this.keyUp[this.jKey[e]]},o.prototype.getPosition=function(){return e.v2f(this.pos.x,this.pos.y)},o.prototype.getScreenPosition=function(){return e.v2f(this.screenPos.x,this.screenPos.y)},o.prototype.setWriteMode=function(e){this.writeMode=e},o.prototype.isWriteMode=function(){return this.writeMode},o.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},o.prototype.cancel=function(e){e?this.keyDown[this.jKey[e]]=!1:(this.canceled=!0,this.keyDown=[],this.mouseDown=[],this.touchHold=!1,this.touchTap=!1,this.touch=!1,this.touchCount=0)},o.prototype.onNode=function(e){if(e instanceof t)return e.layer.visible&&e.isLookScene()?e.isPointInsideBox(e.getBoxVertices(),this.pos):!1;if(e instanceof Array&&e.length>0&&e[0]instanceof t){for(var o=0;o0&&this.touchCount=this.touchDuration&&this.touchAutoHold&&(this.touchHold=!0)},o.prototype.onMove=function(e){var t=this.j2Ds.input;t.touch||(t.screenPos.x=-t.j2Ds.scene.offsetLeft+e.pageX,t.screenPos.y=-t.j2Ds.scene.offsetTop+e.pageY)},o.prototype.isMouseDown=function(e){return this.mouseDown[this.mKey[e]]},o.prototype.isMousePress=function(e){return this.mousePress[this.mKey[e]]},o.prototype.isMouseUp=function(e){return this.mouseUp[this.mKey[e]]},o.prototype.isTouch=function(){return this.touch},o.prototype.isTouchTap=function(){return this.touchTap},o.prototype.isTouchHold=function(){return this.touchHold},o.prototype.setTouchDuration=function(e){return this.touchDuration=e>0?e:60},o.prototype.isMouseWheel=function(e){return"UP"==e&&this.mouseWheel>0||"DOWN"==e&&this.mouseWheel<0},o.prototype.onMouseWheel=function(e){return this.enabled?(e.preventDefault(),this.mouseWheel=e.wheelDelta?e.wheelDelta:-e.detail,!1):!1},o.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},o.prototype.onTouchEvent=function(e){var t=this.j2Ds.input;return t.enabled?(e.preventDefault(),0==t.touchCount&&t.touchCount++,t.canceled||(t.mouseDown=[],t.touch=!t.canceled),t.screenPos.x=-t.j2Ds.scene.offsetLeft+e.touches[0].pageX,t.screenPos.y=-t.j2Ds.scene.offsetTop+e.touches[0].pageY,t.j2Ds.window.focus(),!1):!1},o.prototype.setCursorImage=function(e){this.j2Ds.dom.tag("body")[0].style.cursor='url("'+e+'"), auto'},o.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")},o.prototype.isVisible=function(){return this.visible},o.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.focus(),e.j2Ds.window.addEventListener("touchstart",e.onTouchEvent),e.j2Ds.window.addEventListener("touchmove",e.onTouchEvent),e.j2Ds.window.addEventListener("touchend",function(){e.canceled=!1,e.touchCount>=e.touchDuration?(e.touchHold=!0,e.touchTap=!1,e.touchCount=0):e.touchCount>=0&&e.touchCounte;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","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("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.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){"use strict";var g=60,m=function(){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.events=new o(this),this.dom=new e(this),this.gui=new t(this),this.resources=new d(this),this.trigger=new p(this),this.timeManager=new c(this),this.deviceManager=a(),this.errorManager=new h(this),this.fpsManager=new l(this),this.input=new r(this),this.layers=new i(this),this.viewManager=new f(this),this.scene=new s(this),this.createLocal=function(e){return new u(this,e)}};m.prototype.getInfo=function(){return{name:"j2Ds",version:"0.6.4",git:"https://github.com/SkanerSoft/j2Ds",site:"http://j2ds.ru",description:"HTML5 2D Game Engine",author:"Skaner"}},m.prototype.getFPSManager=function(){return this.fpsManager.init(),this.fpsManager},m.prototype.getSceneManager=function(){return this.scene},m.prototype.getLayerManager=function(){return this.layers},m.prototype.getTextureManager=function(){return this.scene.texture},m.prototype.getAudioManager=function(){return this.audio.init(),this.audio},m.prototype.getPaintManager=function(){return this.paint},m.prototype.getIO=function(){return this.input.init(),this.input},m.prototype.getDOMManager=function(){return this.dom},m.prototype.getTriggerManager=function(){return this.trigger.init(),this.trigger},m.prototype.getMathManager=function(){return y},m.prototype.getGameStateManager=function(){return this.gameStates},m.prototype.getViewManager=function(){return this.viewManager},m.prototype.getDeviceManager=function(){return this.deviceManager},m.prototype.getErrorManager=function(){return this.errorManager.init(),this.errorManager},m.prototype.getTimeManager=function(){return this.timeManager},m.prototype.getResourceManager=function(){return this.resources},m.prototype.setWindow=function(e){this.window=e?e:window},m.prototype.setFrameLimit=function(e){this.frameLimit=e>0&&60>=e?e:60,g=this.frameLimit},m.prototype.setActiveEngine=function(e){this.engine="function"==typeof e?e:this.errorManager.show('Error in "GameStateManager"')},m.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}},m.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)},m.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,v(function(){e.gameEngine(e)})}},e.frameLimit<60?e.sceneSkipTime:0)};var v=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/g)}}();return m.prototype.stopEngine=function(){this.canDeactivate&&(this.stopAll=!0)},m.prototype.runEngine=function(e){e=e||this,e.canDeactivate&&e.stopAll&&(e.stopAll=!1,v(function(){e.gameEngine(e)}))},"object"==typeof module&&"object"==typeof module.exports&&(module.exports.j2Ds=m),void 0!==global.j2Ds&&(global.modules.core.j2Ds=m),void 0!==global.j2Ds&&(global.j2Ds=new m),m}); //# sourceMappingURL=j2ds.min.map diff --git a/dist/js/j2ds.min.map b/dist/js/j2ds.min.map index eba2539..05bb980 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","is4VerticesIntersect","a","b","m","n","length","isLineIntersect","c","d","dx","g","l","isPointInRect","p","isPointInTriangle","sign","p1","p2","p3","pt","b1","b2","b3","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","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","j2DsEngine","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","getBox","node","x1","x2","y1","y2","getBoxVertices","view","dy","sin","cos","toFixed","checkBoxIntersect","node1","node2","isPointInsideBox","vf","point","isIntersect","Array","isCollision","result","isLookScene","turn","setRotation","getRotation","rotateTo","atan2","isOutScene","vector","all","moveDir","speed","drawBox","save","translate","rotate","beginPath","rect","stroke","restore","CircleNode","radius","call","Object","create","constructor","draw","tmpAlpha","globalAlpha","arc","fill","LineNode","points","scale","cFill","lineTo","RectNode","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","touch","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","input","offsetLeft","pageX","offsetTop","pageY","isMouseDown","isMousePress","isMouseUp","isTouch","isMouseWheel","onMouseWheel","wheelDelta","detail","onMouseEvent","button","mouseUped","focus","onTouchEvent","touches","setCursorImage","curImg","oncontextmenu","onselectstart","ondragstart","onmouseup","onmousemove","onkeydown","onkeyup","onkeypress","onmousewheel","TouchHandler","touchs","tapDown","tapPress","tapUp","isTapDown","isTapPress","isTapUp","getTouch","touchHandler","Layers","layersList","index","notDOM","layerName","canvas","stylePosition","shadowColor","onContext","display","setIndex","clear","clearRect","clearNode","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","dt","sceneStartTime","sceneSkipTime","engine","gui","timeManager","deviceManager","createLocal","getInfo","version","git","site","description","author","getFPSManager","getSceneManager","getLayerManager","getTextureManager","getAudioManager","getPaintManager","paint","getIO","getTouchIO","getDOMManager","getTriggerManager","getMathManager","getGameStateManager","getViewManager","getErrorManager","getTimeManager","getResourceManager","setWindow","setFrameLimit","_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,YAUA,IAAAC,GAAA,YAUAA,GAAAC,IAAA,SAAAC,EAAAC,GACA,OAAAD,EAAAA,EAAAC,EAAAA,IAUAH,EAAAI,IAAA,SAAAF,EAAAC,GACA,OAAAD,EAAAA,GAAA,EAAAC,EAAAA,GAAA,IAUAH,EAAAK,MAAA,SAAAC,GACA,MAAAA,IAAA,GAWAN,EAAAO,SAAA,SAAAC,EAAAC,EAAAC,GACA,MAAA,QACAV,EAAAW,OAAAH,EAAAC,GAAA,KACAT,EAAAW,OAAAH,EAAAC,GAAA,KACAT,EAAAW,OAAAH,EAAAC,GAAA,KACAC,EAAA,KAWAV,EAAAW,OAAA,SAAAH,EAAAC,EAAAG,GACA,GAAAD,GAAAE,KAAAC,MAAAD,KAAAF,UAAAF,EAAAD,EAAA,GAAAA,EACA,OAAAI,IAAA,GAAAD,EACAX,EAAAW,OAAAH,EAAAC,EAAAG,GACAD,GASAX,EAAAe,IAAA,SAAAC,GACA,MAAAA,IAAAH,KAAAI,GAAA,MAUAjB,EAAAkB,qBAAA,SAAAC,EAAAC,GACA,GAAAC,GAAAC,CACA,KAAAD,EAAA,EAAAA,EAAAF,EAAAI,OAAAF,IACA,IAAAC,EAAA,EAAAA,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ACAvH,SAAA1C,OAAA2C,OAAA3C,OAAA4C,QAAAwF,KAAAzF,KAAAsH,GACAvH,SAAA1C,OAAA2C,OAAA3C,OAAA2C,KAAA,GAAAsH,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.4\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 /**\r\n * Вспомогательный класс содержащий статичные методы для облегчения расчетов.\r\n *\r\n * @class MathUtil\r\n * @exports module:utils/MathUtil\r\n *\r\n * @constructor\r\n */\r\n var MathUtil = function () {\r\n };\r\n\r\n /**\r\n * Вектор\r\n *\r\n * @param {number} x\r\n * @param {number} y\r\n * @returns {{x: number, y: number}}\r\n */\r\n MathUtil.v2f = function (x, y) {\r\n return {x: x, y: y};\r\n };\r\n\r\n /**\r\n * Целочисленный вектор\r\n *\r\n * @param {number} x\r\n * @param {number} y\r\n * @returns {{x: number, y: number}}\r\n */\r\n MathUtil.v2i = function (x, y) {\r\n return {x: (x >> 0), y: (y >> 0)};\r\n };\r\n\r\n /**\r\n * Приведение типа числа к целочисленному\r\n *\r\n * @alias parseInt()\r\n * @param number\r\n * @returns {number}\r\n */\r\n MathUtil.toInt = function (number) {\r\n return number >> 0;\r\n };\r\n\r\n /**\r\n * Случайный цвет\r\n *\r\n * @param {number} min 0..256\r\n * @param {number} max 0..256\r\n * @param {number} opacity 0.0 ~ 1.0\r\n * @returns {string} rgba(0..256, 0..256, 0..256, 0.0 ~ 1.0)\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 /**\r\n * Случайное число\r\n *\r\n * @param min Минимальное\r\n * @param max Максимальное\r\n * @param omitZero Включая нуль?\r\n * @returns {number}\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 /**\r\n * Приведение градусов в радианы\r\n *\r\n * @param {number} num 0..360\r\n * @returns {number}\r\n */\r\n MathUtil.rad = function (num) {\r\n return num * (Math.PI / 180);\r\n };\r\n\r\n /**\r\n * Проверка пересечения отрезков вершин двух фигур\r\n *\r\n * @param {Array.<{x: number, y: number}>} a\r\n * @param {Array.<{x: number, y: number}>} b\r\n * @returns {boolean}\r\n */\r\n MathUtil.is4VerticesIntersect = function (a, b) {\r\n var m, n;\r\n for (m = 0; m < a.length; m++) {\r\n for (n = 0; n < b.length; n++) {\r\n if (MathUtil.isLineIntersect(\r\n a[m],\r\n a[(m < a.length - 1) ? m + 1 : 0],\r\n b[n],\r\n b[(n < b.length - 1) ? n + 1 : 0])\r\n ) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n\r\n /**\r\n * Проверка пересечения отрезков\r\n *\r\n * @param {{x: number, y: number}} a Начальная точка первого отрезка\r\n * @param {{x: number, y: number}} b Конечная точка первого отрезка\r\n * @param {{x: number, y: number}} c Начальная точка второго отрезка\r\n * @param {{x: number, y: number}} d Конечная точка второго отрезка\r\n * @returns {boolean}\r\n */\r\n MathUtil.isLineIntersect = function (a, b, c, d) {\r\n var dx, g, l;\r\n dx = (b.x - a.x) * (d.y - c.y) - (d.x - c.x) * (b.y - a.y);\r\n if (dx === 0) {\r\n return false;\r\n } else {\r\n l = ((d.y - c.y) * (d.x - a.x) + (c.x - d.x) * (d.y - a.y)) / dx;\r\n g = ((a.y - b.y) * (d.x - a.x) + (b.x - a.x) * (d.y - a.y)) / dx;\r\n return (0 < l && l < 1) && (0 < g && g < 1);\r\n }\r\n };\r\n\r\n /**\r\n * Проверка принадлежности точки прямоугольнику\r\n *\r\n * @param {{x: number, y: number}} a 1-я вершина прямоугольника\r\n * @param {{x: number, y: number}} b 2-я вершина прямоугольника\r\n * @param {{x: number, y: number}} c 3-я вершина прямоугольника\r\n * @param {{x: number, y: number}} d 4-я вершина прямоугольника\r\n * @param {{x: number, y: number}} p Точка\r\n * @returns {boolean}\r\n */\r\n MathUtil.isPointInRect = function (a, b, c, d, p) {\r\n return MathUtil.isPointInTriangle(p, a, b, c) || MathUtil.isPointInTriangle(p, c, d, a);\r\n };\r\n\r\n /**\r\n * Служебная функция для проверки принадлежности точки треугольнику\r\n *\r\n * @param {{x: number, y: number}} p1\r\n * @param {{x: number, y: number}} p2\r\n * @param {{x: number, y: number}} p3\r\n * @returns {number}\r\n */\r\n var sign = function (p1, p2, p3) {\r\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\r\n };\r\n\r\n /**\r\n * Проверка принадлежности точки треугольнику\r\n *\r\n * @param {{x: number, y: number}} pt Точка\r\n * @param {{x: number, y: number}} a 1-я вершина прямоугольника\r\n * @param {{x: number, y: number}} b 2-я вершина прямоугольника\r\n * @param {{x: number, y: number}} c 3-я вершина прямоугольника\r\n * @returns {boolean}\r\n */\r\n MathUtil.isPointInTriangle = function (pt, a, b, c) {\r\n var b1, b2, b3;\r\n b1 = sign(pt, a, b) < 0;\r\n b2 = sign(pt, b, c) < 0;\r\n b3 = sign(pt, c, a) < 0;\r\n\r\n return ((b1 == b2) && (b2 == b3));\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 /**\r\n * Вспомогательный класс содержащий методы для генерации текстур.\r\n *\r\n * @class TextureUtil\r\n * @exports module:utils/TextureUtil\r\n *\r\n * @constructor\r\n */\r\n var TextureUtil = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n };\r\n\r\n /**\r\n * Создает карту текстур\r\n *\r\n * @param {number} width\r\n * @param {number} height\r\n * @param {function} callback\r\n * @returns {{img: null|Element, loaded: boolean, width: number, height: number}}\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 /** @type null|Element */\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 * Возвращает анимацию\r\n *\r\n * @param {number} sourceX\r\n * @param {number} sourceY\r\n * @param {number} sourceW\r\n * @param {number} sourceH\r\n * @param {number} frameCount\r\n * @returns {{imageMap: image, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}}\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 /**\r\n * Загружает из файла карту текстур\r\n *\r\n * @param {string} path\r\n * @returns {{img: null, width: number, height: number, loaded: boolean}}\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 /** @type null|Element */\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 * Возвращает анимацию\r\n *\r\n * @param {number} sourceX\r\n * @param {number} sourceY\r\n * @param {number} sourceW\r\n * @param {number} sourceH\r\n * @param {number} frameCount\r\n * @returns {{imageMap: image, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}}\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 /**\r\n * Шаблоны\r\n *\r\n * @type {{ellipse: TextureUtil.templates.ellipse, fillRect: TextureUtil.templates.fillRect, strokeRect: TextureUtil.templates.strokeRect, gradientL: TextureUtil.templates.gradientL, gradientR: TextureUtil.templates.gradientR}}\r\n */\r\n TextureUtil.prototype.templates = {\r\n /**\r\n * Рисует эллипс\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {number} size\r\n * @param {string} color\r\n */\r\n ellipse: function (context, size, color) { // TODO??\r\n },\r\n\r\n /**\r\n * Рисует прямоугольник закрашенный\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {number} size\r\n * @param {string} color\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\r\n /**\r\n * Рисует пустой прямоугольник\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {number} size\r\n * @param {string} color\r\n * @param {number} lineWidth\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\r\n /**\r\n * Рисует линейным градиентом\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {number} size\r\n * @param {Array.} colors\r\n * @param {boolean} isHorizontal\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\r\n /**\r\n * Рисует радиальным градиентом\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {{x: number, y: number}} size\r\n * @param {{x: number, y: number}} pos1\r\n * @param {number} r1\r\n * @param {{x: number, y: number}} pos2\r\n * @param {number} r2\r\n * @param {Array.} colors\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.4\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 /**\r\n * @exports module:nodes/BaseNode\r\n */\r\n var BaseNode;\r\n\r\n /**\r\n * Базовый класс о общими методами для всех узлов.\r\n *\r\n * @class BaseNode\r\n * @alias module:nodes/BaseNode\r\n *\r\n * @abstract\r\n * @constructor\r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {{x: number, y: number}} size\r\n *\r\n * @property {boolean} visible\r\n * @property {number} alpha\r\n * @property {{x: number, y: number}} pos\r\n * @property {{x: number, y: number}} size\r\n * @property {boolean} parent\r\n * @property {number} angle\r\n * @property {core/Scene} layer\r\n * @property {{offset: {x: number, y: number}, size: {x: number, y: number}}} box\r\n */\r\n BaseNode = function (j2DsEngine, pos, size) {\r\n j2Ds = j2DsEngine;\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 /**\r\n *\r\n * @param {{x: number, y: number}} offset\r\n * @param {{x: number, y: number}} size\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 /**\r\n *\r\n * @param layer\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 /**\r\n *\r\n * @returns {*}\r\n */\r\n BaseNode.prototype.getLayer = function () {\r\n return this.layer;\r\n };\r\n\r\n /**\r\n *\r\n * @param visible\r\n */\r\n BaseNode.prototype.setVisible = function (visible) {\r\n this.visible = !!visible;\r\n };\r\n\r\n /**\r\n *\r\n * @returns {boolean|*}\r\n */\r\n BaseNode.prototype.isVisible = function () {\r\n return this.visible;\r\n };\r\n\r\n /**\r\n *\r\n * @param alpha\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 /**\r\n *\r\n * @returns {*|number}\r\n */\r\n BaseNode.prototype.getAlpha = function () {\r\n return this.alpha;\r\n };\r\n\r\n /**\r\n *\r\n * @param to\r\n * @param t\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 /**\r\n *\r\n * @param pos\r\n * @returns {*}\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 /**\r\n *\r\n * @param pos\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 /**\r\n *\r\n * @returns {{x, y}|{x: number, y: number}}\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 /**\r\n *\r\n * @param size\r\n * @returns {*}\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 /**\r\n *\r\n * @returns {*}\r\n */\r\n BaseNode.prototype.getSize = function () {\r\n return this.size;\r\n };\r\n\r\n /**\r\n *\r\n * @param id\r\n */\r\n BaseNode.prototype.setParent = function (id) {\r\n this.parent = id;\r\n };\r\n\r\n /**\r\n *\r\n * @param id\r\n * @returns {number}\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 /**\r\n *\r\n * @param id\r\n * @returns {{x, y}|{x: number, y: number}}\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 /**\r\n *\r\n * @param node\r\n * @returns {{x1: *, x2: *, y1: *, y2: *}}\r\n */\r\n BaseNode.prototype.getBox = function (node) {\r\n return {\r\n x1: node.pos.x + node.box.offset.x,\r\n x2: node.pos.x + node.box.offset.x + node.size.x + node.box.size.x,\r\n y1: node.pos.y + node.box.offset.y,\r\n y2: node.pos.y + node.box.offset.y + node.size.y + node.box.size.y\r\n }\r\n };\r\n\r\n /**\r\n *\r\n * @param {BaseNode} node\r\n * @returns {Array.<{x: number, y: number}>}\r\n */\r\n BaseNode.prototype.getBoxVertices = function (node) {\r\n if (node === undefined) node = this;\r\n var angle = -MathUtil.rad(node.angle);\r\n\r\n var dx = node.box.offset.x + node.box.size.x / 2 + node.getPosition().x - j2Ds.scene.view.pos.x;\r\n var dy = node.box.offset.y + node.box.size.y / 2 + node.getPosition().y - j2Ds.scene.view.pos.y;\r\n\r\n var box = this.getBox(node);\r\n\r\n return [\r\n {\r\n x: (dx + (box.y1 - dy) * Math.sin(angle) + (box.x2 - dx) * Math.cos(angle)).toFixed(5),\r\n y: (dy + (box.y1 - dy) * Math.cos(angle) - (box.x2 - dx) * Math.sin(angle)).toFixed(5)\r\n },\r\n {\r\n x: (dx + (box.y2 - dy) * Math.sin(angle) + (box.x2 - dx) * Math.cos(angle)).toFixed(5),\r\n y: (dy + (box.y2 - dy) * Math.cos(angle) - (box.x2 - dx) * Math.sin(angle)).toFixed(5)\r\n },\r\n {\r\n x: (dx + (box.y2 - dy) * Math.sin(angle) + (box.x1 - dx) * Math.cos(angle)).toFixed(5),\r\n y: (dy + (box.y2 - dy) * Math.cos(angle) - (box.x1 - dx) * Math.sin(angle)).toFixed(5)\r\n },\r\n {\r\n x: (dx + (box.y1 - dy) * Math.sin(angle) + (box.x1 - dx) * Math.cos(angle)).toFixed(5),\r\n y: (dy + (box.y1 - dy) * Math.cos(angle) - (box.x1 - dx) * Math.sin(angle)).toFixed(5)\r\n }\r\n ]\r\n };\r\n\r\n /**\r\n *\r\n * @param node1\r\n * @param node2\r\n * @returns {*}\r\n */\r\n var checkBoxIntersect = function (node1, node2) {\r\n var a, b;\r\n if (node1.angle === 0 && node2.angle === 0) {\r\n a = node1.getBox(node1);\r\n b = node1.getBox(node2);\r\n\r\n return !(a.y1 > b.y2 || a.y2 < b.y1 || a.x2 < b.x1 || a.x1 > b.x2);\r\n } else {\r\n a = node1.getBoxVertices(node1);\r\n b = node1.getBoxVertices(node2);\r\n\r\n if (!MathUtil.is4VerticesIntersect(a, b)) {\r\n return node1.isPointInsideBox(a, node2.getPosition())\r\n || node2.isPointInsideBox(b, node1.getPosition());\r\n }\r\n return true;\r\n }\r\n };\r\n\r\n /**\r\n *\r\n * @param vf\r\n * @param point\r\n * @returns {boolean}\r\n */\r\n BaseNode.prototype.isPointInsideBox = function (vf, point) {\r\n return MathUtil.isPointInRect(vf[0], vf[1], vf[2], vf[3], point);\r\n };\r\n\r\n /**\r\n *\r\n * @param node2\r\n * @returns {*}\r\n */\r\n BaseNode.prototype.isIntersect = function (node2) {\r\n var node1 = this;\r\n\r\n if (node2 instanceof BaseNode) {\r\n return checkBoxIntersect(node1, node2);\r\n } else if (node2 instanceof Array && node2.length > 0 && node2[0] instanceof BaseNode) {\r\n for (var i = 0; i < node2.length; i++) {\r\n if (checkBoxIntersect(node1, node2[i])) return true;\r\n }\r\n return false;\r\n }\r\n };\r\n\r\n /**\r\n *\r\n * @param id\r\n * @returns {boolean}\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 /**\r\n *\r\n * @returns {boolean}\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 /**\r\n *\r\n * @param angle\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 /**\r\n *\r\n * @param angle\r\n */\r\n BaseNode.prototype.setRotation = function (angle) {\r\n this.angle = angle % 360;\r\n };\r\n\r\n /**\r\n *\r\n * @returns {number|*}\r\n */\r\n BaseNode.prototype.getRotation = function () {\r\n return this.angle;\r\n };\r\n\r\n /**\r\n *\r\n * @param to\r\n * @param t\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 /**\r\n *\r\n * @returns {{}}\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 /**\r\n *\r\n * @param speed\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 /**\r\n *\r\n */\r\n BaseNode.prototype.drawBox = function () {\r\n var context = this.layer.context;\r\n\r\n context.lineWidth = 2;\r\n context.strokeStyle = 'black';\r\n\r\n if (this.angle) {\r\n context.save();\r\n context.translate(\r\n this.getPosition().x - j2Ds.scene.view.pos.x,\r\n this.getPosition().y - j2Ds.scene.view.pos.y\r\n );\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.translate(\r\n -(this.getPosition().x - j2Ds.scene.view.pos.x),\r\n -(this.getPosition().y - j2Ds.scene.view.pos.y)\r\n );\r\n }\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 if (this.angle) {\r\n context.restore();\r\n context.save();\r\n context.translate(\r\n this.box.offset.x + this.box.size.x / 2 + this.getPosition().x - j2Ds.scene.view.pos.x,\r\n this.box.offset.y + this.box.size.y / 2 + this.getPosition().y - j2Ds.scene.view.pos.y\r\n );\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.translate(\r\n -(this.box.offset.x + this.box.size.x / 2 + this.getPosition().x - j2Ds.scene.view.pos.x),\r\n -(this.box.offset.y + this.box.size.y / 2 + this.getPosition().y - j2Ds.scene.view.pos.y)\r\n );\r\n }\r\n\r\n context.strokeStyle = 'yellow';\r\n\r\n context.beginPath();\r\n context.rect(\r\n this.box.offset.x + this.pos.x - j2Ds.scene.view.pos.x,\r\n this.box.offset.y + this.pos.y - j2Ds.scene.view.pos.y,\r\n this.box.size.x + this.size.x,\r\n this.box.size.y + this.size.y);\r\n context.stroke();\r\n\r\n if (this.angle) {\r\n context.restore();\r\n }\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 /**\r\n * @exports module:nodes/CircleNode\r\n */\r\n var CircleNode;\r\n\r\n /**\r\n * Примитивный узел для отрисовки круга.\r\n *\r\n * @class CircleNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {number} radius\r\n * @param {string} color\r\n *\r\n * @property {string} color\r\n * @property {number} radius\r\n */\r\n CircleNode = function (j2DsEngine, pos, radius, color) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * Метод для отрисовки узла\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 /**\r\n * @exports module:nodes/LineNode\r\n */\r\n var LineNode;\r\n\r\n /**\r\n * Примитивный узел для отрисовки линии.\r\n *\r\n * @class LineNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {Array.>} points\r\n * @param {number} scale\r\n * @param {string} color\r\n * @param {number} width\r\n * @param {boolean} fill\r\n * @param {string} cFill\r\n * \r\n * @property {string} color\r\n * @property {Array.>} points\r\n * @property {boolean} fill\r\n * @property {number} scale\r\n * @property {string} cFill\r\n * @property {number} lineWidth\r\n */\r\n LineNode = function (j2DsEngine, pos, points, scale, color, width, fill, cFill) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * Метод для отрисовки узла\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 * @exports module:nodes/RectNode\r\n */\r\n var RectNode;\r\n \r\n /**\r\n * Примитивный узел для отрисовки прямоугольника.\r\n *\r\n * @class RectNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n *\r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {{x: number, y: number}} size\r\n * @param {string} color\r\n *\r\n * @property {string} color\r\n */\r\n RectNode = function (j2DsEngine, pos, size, color) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * Метод для отрисовки узла\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 /**\r\n * @exports module:nodes/SpriteNode\r\n */\r\n var SpriteNode;\r\n \r\n /**\r\n * Примитивный узел для отрисовки спрайта.\r\n *\r\n * @class SpriteNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n * \r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {{x: number, y: number}} size\r\n * @param {{imageMap: {img: null|Element, loaded: boolean, width: number, height: number}, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}} animation\r\n * \r\n * @property {number} tmpSpeed\r\n * @property {number} frame\r\n * @property {{imageMap: {img: null|Element, loaded: boolean, width: number, height: number}, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}} animation\r\n * @property {{x: boolean|number, y: boolean|number}} flip\r\n */\r\n SpriteNode = function (j2DsEngine, pos, size, animation) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * //TODO Добавить описание этой херни\r\n *\r\n * @param {number} x\r\n * @param {number} y\r\n */\r\n SpriteNode.prototype.setFlip = function (x, y) {\r\n this.flip = {x: x, y: y};\r\n };\r\n\r\n /**\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 * Отрисовка одного кадра\r\n *\r\n * @param {number} frame\r\n * @returns {void|{added, loaded, failed}}\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 /**\r\n * Устанавливает анимацию\r\n *\r\n * @param {{imageMap: {img: null|Element, loaded: boolean, width: number, height: number}, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}} animation\r\n */\r\n SpriteNode.prototype.setAnimation = function (animation) {\r\n if (this.animation != animation) {\r\n this.animation = animation;\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 /**\r\n * @exports module:nodes/TextNode\r\n */\r\n var TextNode;\r\n \r\n /**\r\n * Примитивный узел для отрисовки текста.\r\n *\r\n * @class TextNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n * \r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {string} text\r\n * @param {number} sizePx\r\n * @param {string} color\r\n * @param {string} family\r\n * @param {number} width\r\n * @param {string} colorL\r\n *\r\n * @property {number} vAlign\r\n * @property {number} hAlign\r\n * @property {string} color\r\n * @property {string} family\r\n * @property {number} sizePx\r\n * @property {number} lineWidth\r\n * @property {string} colorL\r\n * @property {string} font\r\n * @property {string} fullText\r\n * @property {number} maxWidth\r\n * @property {Array.} lines\r\n */\r\n TextNode = function (j2DsEngine, pos, text, sizePx, color, family, width, colorL) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * Устанавливает размер текста\r\n *\r\n * @param {number} sizePx\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 /**\r\n * Возвращает текущий размер\r\n *\r\n * @returns {number}\r\n */\r\n TextNode.prototype.getSize = function () {\r\n return this.sizePx;\r\n };\r\n\r\n /**\r\n * Метод для быстрого изменения текста и его последующей отрисовки.\r\n *\r\n * @deprecated\r\n * @param {string} text\r\n * @param {{x: number, y: number}} pos\r\n * @param {string} color\r\n * @param {string} colorL\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 /**\r\n * Возвращает текст\r\n *\r\n * @returns {string}\r\n */\r\n TextNode.prototype.getText = function () {\r\n return this.fullText;\r\n };\r\n\r\n /**\r\n * Устанавливает текст\r\n *\r\n * @param {string} text\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 /**\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 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.4\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('io/InputHandler', ['utils/MathUtil', 'nodes/BaseNode'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'), require('nodes/BaseNode'));\r\n } else {\r\n factory(root.modules.utils.MathUtil, root.modules.nodes.BaseNode);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil, BaseNode) {\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.touch = false;\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 } else {\r\n this.keyDown[this.jKey[id]] = false;\r\n }\r\n };\r\n\r\n InputHandler.prototype.onNode = function (node) {\r\n if (node instanceof BaseNode) {\r\n if (!node.layer.visible || !node.isLookScene()) return false;\r\n return node.isPointInsideBox(node.getBoxVertices(), this.pos);\r\n } else if (node instanceof Array && node.length > 0 && node[0] instanceof BaseNode) {\r\n for (var i = 0; i < node.length; i++) {\r\n if (!node[i].layer.visible || !node[i].isLookScene()) continue;\r\n if (node[i].isPointInsideBox(node[i].getBoxVertices(), this.pos)) return true;\r\n }\r\n return false;\r\n }\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 var input = this.j2Ds.input;\r\n if (!input.touch) {\r\n input.screenPos.x = -input.j2Ds.scene.offsetLeft + e.pageX;\r\n input.screenPos.y = -input.j2Ds.scene.offsetTop + e.pageY;\r\n }\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.isTouch = function () {\r\n return this.touch;\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.onTouchEvent = function (e) {\r\n var input = this.j2Ds.input;\r\n if (!input.enabled) return false;\r\n e.preventDefault();\r\n input.touch = (!input.canceled);\r\n\r\n if (!input.canceled) {\r\n input.mouseDown = [];\r\n }\r\n\r\n input.screenPos.x = -input.j2Ds.scene.offsetLeft + e.touches[0].pageX;\r\n input.screenPos.y = -input.j2Ds.scene.offsetTop + e.touches[0].pageY;\r\n\r\n input.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.focus();\r\n input.j2Ds.window.addEventListener('touchstart', input.onTouchEvent);\r\n input.j2Ds.window.addEventListener('touchmove', input.onTouchEvent);\r\n input.j2Ds.window.addEventListener('touchend', function () {\r\n input.canceled = false;\r\n input.touch = false;\r\n });\r\n input.j2Ds.window.addEventListener('touchcancel', function () {\r\n input.canceled = false;\r\n input.touch = false;\r\n });\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 = input.onMove;\r\n input.j2Ds.window.onkeydown = input.keyEvent;\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 = input.keyEvent;\r\n input.j2Ds.window.onmousewheel = input.onMouseWheel;\r\n\r\n if (input.j2Ds.window.addEventListener) {\r\n input.j2Ds.window.addEventListener(\"DOMMouseScroll\", input.onMouseWheel, 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.4\r\n */\r\n\r\n/**\r\n * @module \"j2Ds\"\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 /**\r\n * @class j2DsEngine\r\n * @exports module:\"j2Ds\"\r\n * @alias module:\"j2Ds\"\r\n *\r\n * @constructor\r\n * @property {number} now\r\n * @property {number} dt\r\n * @property {number} stopAll\r\n * @property {number} frameLimit\r\n * @property {number} sceneStartTime\r\n * @property {number} sceneSkipTime\r\n * @property {function} engine\r\n * @property {boolean} ready\r\n * @property {Window} window\r\n * @property {boolean} canDeactivate\r\n */\r\n var j2DsEngine = function () {\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 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 /**\r\n * @method\r\n * @param {string} id\r\n * @returns {StorageManager}\r\n */\r\n this.createLocal = function (id) {\r\n return new StorageManager(this, id);\r\n }\r\n };\r\n\r\n /* Getters & Setters */\r\n /**\r\n * @returns {{name: string, version: string, git: string, site: string, description: string, author: string}}\r\n */\r\n j2DsEngine.prototype.getInfo = function () {\r\n return {\r\n 'name': 'j2Ds',\r\n 'version': '0.6.4',\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 /**\r\n * @returns {FpsManager}\r\n */\r\n j2DsEngine.prototype.getFPSManager = function () {\r\n this.fpsManager.init();\r\n return this.fpsManager;\r\n };\r\n\r\n /**\r\n * @returns {SceneManager}\r\n */\r\n j2DsEngine.prototype.getSceneManager = function () {\r\n return this.scene;\r\n };\r\n\r\n /**\r\n * @returns {Layers}\r\n */\r\n j2DsEngine.prototype.getLayerManager = function () {\r\n return this.layers;\r\n };\r\n\r\n /**\r\n * @returns {TextureUtil}\r\n */\r\n j2DsEngine.prototype.getTextureManager = function () {\r\n return this.scene.texture;\r\n };\r\n\r\n /**\r\n * @returns {AudioHandler}\r\n */\r\n j2DsEngine.prototype.getAudioManager = function () {\r\n this.audio.init();\r\n return this.audio;\r\n };\r\n\r\n /** @deprecated */\r\n j2DsEngine.prototype.getPaintManager = function () {\r\n return this.paint;\r\n };\r\n\r\n /**\r\n * @returns {InputHandler}\r\n */\r\n j2DsEngine.prototype.getIO = function () {\r\n this.input.init();\r\n return this.input;\r\n };\r\n\r\n /**\r\n * @returns {TouchHandler}\r\n */\r\n j2DsEngine.prototype.getTouchIO = function () {\r\n this.touch.init();\r\n return this.touch;\r\n };\r\n\r\n /**\r\n * @returns {Dom}\r\n */\r\n j2DsEngine.prototype.getDOMManager = function () {\r\n return this.dom;\r\n };\r\n\r\n /**\r\n * @returns {TriggerManager}\r\n */\r\n j2DsEngine.prototype.getTriggerManager = function () {\r\n this.trigger.init();\r\n return this.trigger;\r\n };\r\n\r\n /**\r\n * @returns {MathUtil}\r\n */\r\n j2DsEngine.prototype.getMathManager = function () {\r\n return MathUtil;\r\n };\r\n\r\n /**\r\n * @returns {{states: {}, add: j2DsEngine.gameStates.add}}\r\n */\r\n j2DsEngine.prototype.getGameStateManager = function () {\r\n return this.gameStates;\r\n };\r\n\r\n /**\r\n * @returns {ViewManager}\r\n */\r\n j2DsEngine.prototype.getViewManager = function () {\r\n return this.viewManager;\r\n };\r\n\r\n /**\r\n * @returns {DeviceManager}\r\n */\r\n j2DsEngine.prototype.getDeviceManager = function () {\r\n return this.deviceManager;\r\n };\r\n\r\n /**\r\n * @returns {ErrorManager}\r\n */\r\n j2DsEngine.prototype.getErrorManager = function () {\r\n this.errorManager.init();\r\n return this.errorManager;\r\n };\r\n\r\n /**\r\n * @returns {TimeManager}\r\n */\r\n j2DsEngine.prototype.getTimeManager = function () {\r\n return this.timeManager;\r\n };\r\n\r\n /**\r\n * @returns {ResourceManager}\r\n */\r\n j2DsEngine.prototype.getResourceManager = function () {\r\n return this.resources;\r\n };\r\n\r\n /**\r\n * @param {Window} global\r\n */\r\n j2DsEngine.prototype.setWindow = function (global) {\r\n this.window = global ? global : window;\r\n };\r\n\r\n /**\r\n * @param {number} fps\r\n */\r\n j2DsEngine.prototype.setFrameLimit = function (fps) {\r\n this.frameLimit = (fps > 0 && fps <= 60) ? fps : 60;\r\n frameLimit = this.frameLimit;\r\n };\r\n\r\n /**\r\n * @param {function} engine\r\n */\r\n j2DsEngine.prototype.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 /**\r\n * @type {{states: {}, add: j2DsEngine.gameStates.add}}\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 /**\r\n * @param {function} engine\r\n * @param {number} frameLimit\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 /**\r\n * @param {j2DsEngine} j2Ds\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 /**\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 /**\r\n * @param {j2DsEngine} j2Ds\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","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","is4VerticesIntersect","a","b","m","n","length","isLineIntersect","c","d","dx","g","l","isPointInRect","p","isPointInTriangle","sign","p1","p2","p3","pt","b1","b2","b3","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","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","j2DsEngine","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","getBox","node","x1","x2","y1","y2","getBoxVertices","view","dy","sin","cos","toFixed","checkBoxIntersect","node1","node2","isPointInsideBox","vf","point","isIntersect","Array","isCollision","result","isLookScene","turn","setRotation","getRotation","rotateTo","atan2","isOutScene","vector","all","moveDir","speed","drawBox","save","translate","rotate","beginPath","rect","stroke","restore","CircleNode","radius","call","Object","create","constructor","draw","tmpAlpha","globalAlpha","arc","fill","LineNode","points","scale","cFill","lineTo","RectNode","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","touch","touchTap","touchHold","touchAutoHold","touchCount","touchDuration","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","input","offsetLeft","pageX","offsetTop","pageY","isMouseDown","isMousePress","isMouseUp","isTouch","isTouchTap","isTouchHold","setTouchDuration","duration","isMouseWheel","onMouseWheel","wheelDelta","detail","onMouseEvent","button","mouseUped","focus","onTouchEvent","touches","setCursorImage","curImg","oncontextmenu","onselectstart","ondragstart","onmouseup","onmousemove","onkeydown","onkeyup","onkeypress","onmousewheel","Layers","layersList","index","notDOM","layerName","canvas","stylePosition","shadowColor","onContext","display","setIndex","clear","clearRect","clearNode","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","dt","sceneStartTime","sceneSkipTime","engine","gui","timeManager","deviceManager","createLocal","getInfo","version","git","site","description","author","getFPSManager","getSceneManager","getLayerManager","getTextureManager","getAudioManager","getPaintManager","paint","getIO","getDOMManager","getTriggerManager","getMathManager","getGameStateManager","getViewManager","getErrorManager","getTimeManager","getResourceManager","setWindow","setFrameLimit","_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,QAA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KAAA,GAAAsH,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.4\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 /**\r\n * Вспомогательный класс содержащий статичные методы для облегчения расчетов.\r\n *\r\n * @class MathUtil\r\n * @exports module:utils/MathUtil\r\n *\r\n * @constructor\r\n */\r\n var MathUtil = function () {\r\n };\r\n\r\n /**\r\n * Вектор\r\n *\r\n * @param {number} x\r\n * @param {number} y\r\n * @returns {{x: number, y: number}}\r\n */\r\n MathUtil.v2f = function (x, y) {\r\n return {x: x, y: y};\r\n };\r\n\r\n /**\r\n * Целочисленный вектор\r\n *\r\n * @param {number} x\r\n * @param {number} y\r\n * @returns {{x: number, y: number}}\r\n */\r\n MathUtil.v2i = function (x, y) {\r\n return {x: (x >> 0), y: (y >> 0)};\r\n };\r\n\r\n /**\r\n * Приведение типа числа к целочисленному\r\n *\r\n * @alias parseInt()\r\n * @param number\r\n * @returns {number}\r\n */\r\n MathUtil.toInt = function (number) {\r\n return number >> 0;\r\n };\r\n\r\n /**\r\n * Случайный цвет\r\n *\r\n * @param {number} min 0..256\r\n * @param {number} max 0..256\r\n * @param {number} opacity 0.0 ~ 1.0\r\n * @returns {string} rgba(0..256, 0..256, 0..256, 0.0 ~ 1.0)\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 /**\r\n * Случайное число\r\n *\r\n * @param min Минимальное\r\n * @param max Максимальное\r\n * @param omitZero Включая нуль?\r\n * @returns {number}\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 /**\r\n * Приведение градусов в радианы\r\n *\r\n * @param {number} num 0..360\r\n * @returns {number}\r\n */\r\n MathUtil.rad = function (num) {\r\n return num * (Math.PI / 180);\r\n };\r\n\r\n /**\r\n * Проверка пересечения отрезков вершин двух фигур\r\n *\r\n * @param {Array.<{x: number, y: number}>} a\r\n * @param {Array.<{x: number, y: number}>} b\r\n * @returns {boolean}\r\n */\r\n MathUtil.is4VerticesIntersect = function (a, b) {\r\n var m, n;\r\n for (m = 0; m < a.length; m++) {\r\n for (n = 0; n < b.length; n++) {\r\n if (MathUtil.isLineIntersect(\r\n a[m],\r\n a[(m < a.length - 1) ? m + 1 : 0],\r\n b[n],\r\n b[(n < b.length - 1) ? n + 1 : 0])\r\n ) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n\r\n /**\r\n * Проверка пересечения отрезков\r\n *\r\n * @param {{x: number, y: number}} a Начальная точка первого отрезка\r\n * @param {{x: number, y: number}} b Конечная точка первого отрезка\r\n * @param {{x: number, y: number}} c Начальная точка второго отрезка\r\n * @param {{x: number, y: number}} d Конечная точка второго отрезка\r\n * @returns {boolean}\r\n */\r\n MathUtil.isLineIntersect = function (a, b, c, d) {\r\n var dx, g, l;\r\n dx = (b.x - a.x) * (d.y - c.y) - (d.x - c.x) * (b.y - a.y);\r\n if (dx === 0) {\r\n return false;\r\n } else {\r\n l = ((d.y - c.y) * (d.x - a.x) + (c.x - d.x) * (d.y - a.y)) / dx;\r\n g = ((a.y - b.y) * (d.x - a.x) + (b.x - a.x) * (d.y - a.y)) / dx;\r\n return (0 < l && l < 1) && (0 < g && g < 1);\r\n }\r\n };\r\n\r\n /**\r\n * Проверка принадлежности точки прямоугольнику\r\n *\r\n * @param {{x: number, y: number}} a 1-я вершина прямоугольника\r\n * @param {{x: number, y: number}} b 2-я вершина прямоугольника\r\n * @param {{x: number, y: number}} c 3-я вершина прямоугольника\r\n * @param {{x: number, y: number}} d 4-я вершина прямоугольника\r\n * @param {{x: number, y: number}} p Точка\r\n * @returns {boolean}\r\n */\r\n MathUtil.isPointInRect = function (a, b, c, d, p) {\r\n return MathUtil.isPointInTriangle(p, a, b, c) || MathUtil.isPointInTriangle(p, c, d, a);\r\n };\r\n\r\n /**\r\n * Служебная функция для проверки принадлежности точки треугольнику\r\n *\r\n * @param {{x: number, y: number}} p1\r\n * @param {{x: number, y: number}} p2\r\n * @param {{x: number, y: number}} p3\r\n * @returns {number}\r\n */\r\n var sign = function (p1, p2, p3) {\r\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\r\n };\r\n\r\n /**\r\n * Проверка принадлежности точки треугольнику\r\n *\r\n * @param {{x: number, y: number}} pt Точка\r\n * @param {{x: number, y: number}} a 1-я вершина прямоугольника\r\n * @param {{x: number, y: number}} b 2-я вершина прямоугольника\r\n * @param {{x: number, y: number}} c 3-я вершина прямоугольника\r\n * @returns {boolean}\r\n */\r\n MathUtil.isPointInTriangle = function (pt, a, b, c) {\r\n var b1, b2, b3;\r\n b1 = sign(pt, a, b) < 0;\r\n b2 = sign(pt, b, c) < 0;\r\n b3 = sign(pt, c, a) < 0;\r\n\r\n return ((b1 == b2) && (b2 == b3));\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 /**\r\n * Вспомогательный класс содержащий методы для генерации текстур.\r\n *\r\n * @class TextureUtil\r\n * @exports module:utils/TextureUtil\r\n *\r\n * @constructor\r\n */\r\n var TextureUtil = function (j2Ds) {\r\n this.j2Ds = j2Ds;\r\n };\r\n\r\n /**\r\n * Создает карту текстур\r\n *\r\n * @param {number} width\r\n * @param {number} height\r\n * @param {function} callback\r\n * @returns {{img: null|Element, loaded: boolean, width: number, height: number}}\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 /** @type null|Element */\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 * Возвращает анимацию\r\n *\r\n * @param {number} sourceX\r\n * @param {number} sourceY\r\n * @param {number} sourceW\r\n * @param {number} sourceH\r\n * @param {number} frameCount\r\n * @returns {{imageMap: image, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}}\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 /**\r\n * Загружает из файла карту текстур\r\n *\r\n * @param {string} path\r\n * @returns {{img: null, width: number, height: number, loaded: boolean}}\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 /** @type null|Element */\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 * Возвращает анимацию\r\n *\r\n * @param {number} sourceX\r\n * @param {number} sourceY\r\n * @param {number} sourceW\r\n * @param {number} sourceH\r\n * @param {number} frameCount\r\n * @returns {{imageMap: image, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}}\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 /**\r\n * Шаблоны\r\n *\r\n * @type {{ellipse: TextureUtil.templates.ellipse, fillRect: TextureUtil.templates.fillRect, strokeRect: TextureUtil.templates.strokeRect, gradientL: TextureUtil.templates.gradientL, gradientR: TextureUtil.templates.gradientR}}\r\n */\r\n TextureUtil.prototype.templates = {\r\n /**\r\n * Рисует эллипс\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {number} size\r\n * @param {string} color\r\n */\r\n ellipse: function (context, size, color) { // TODO??\r\n },\r\n\r\n /**\r\n * Рисует прямоугольник закрашенный\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {number} size\r\n * @param {string} color\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\r\n /**\r\n * Рисует пустой прямоугольник\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {number} size\r\n * @param {string} color\r\n * @param {number} lineWidth\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\r\n /**\r\n * Рисует линейным градиентом\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {number} size\r\n * @param {Array.} colors\r\n * @param {boolean} isHorizontal\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\r\n /**\r\n * Рисует радиальным градиентом\r\n *\r\n * @param {CanvasRenderingContext2D} context\r\n * @param {{x: number, y: number}} size\r\n * @param {{x: number, y: number}} pos1\r\n * @param {number} r1\r\n * @param {{x: number, y: number}} pos2\r\n * @param {number} r2\r\n * @param {Array.} colors\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.4\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 /**\r\n * @exports module:nodes/BaseNode\r\n */\r\n var BaseNode;\r\n\r\n /**\r\n * Базовый класс о общими методами для всех узлов.\r\n *\r\n * @class BaseNode\r\n * @alias module:nodes/BaseNode\r\n *\r\n * @abstract\r\n * @constructor\r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {{x: number, y: number}} size\r\n *\r\n * @property {boolean} visible\r\n * @property {number} alpha\r\n * @property {{x: number, y: number}} pos\r\n * @property {{x: number, y: number}} size\r\n * @property {boolean} parent\r\n * @property {number} angle\r\n * @property {core/Scene} layer\r\n * @property {{offset: {x: number, y: number}, size: {x: number, y: number}}} box\r\n */\r\n BaseNode = function (j2DsEngine, pos, size) {\r\n j2Ds = j2DsEngine;\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 /**\r\n *\r\n * @param {{x: number, y: number}} offset\r\n * @param {{x: number, y: number}} size\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 /**\r\n *\r\n * @param layer\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 /**\r\n *\r\n * @returns {*}\r\n */\r\n BaseNode.prototype.getLayer = function () {\r\n return this.layer;\r\n };\r\n\r\n /**\r\n *\r\n * @param visible\r\n */\r\n BaseNode.prototype.setVisible = function (visible) {\r\n this.visible = !!visible;\r\n };\r\n\r\n /**\r\n *\r\n * @returns {boolean|*}\r\n */\r\n BaseNode.prototype.isVisible = function () {\r\n return this.visible;\r\n };\r\n\r\n /**\r\n *\r\n * @param alpha\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 /**\r\n *\r\n * @returns {*|number}\r\n */\r\n BaseNode.prototype.getAlpha = function () {\r\n return this.alpha;\r\n };\r\n\r\n /**\r\n *\r\n * @param to\r\n * @param t\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 /**\r\n *\r\n * @param pos\r\n * @returns {*}\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 /**\r\n *\r\n * @param pos\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 /**\r\n *\r\n * @returns {{x, y}|{x: number, y: number}}\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 /**\r\n *\r\n * @param size\r\n * @returns {*}\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 /**\r\n *\r\n * @returns {*}\r\n */\r\n BaseNode.prototype.getSize = function () {\r\n return this.size;\r\n };\r\n\r\n /**\r\n *\r\n * @param id\r\n */\r\n BaseNode.prototype.setParent = function (id) {\r\n this.parent = id;\r\n };\r\n\r\n /**\r\n *\r\n * @param id\r\n * @returns {number}\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 /**\r\n *\r\n * @param id\r\n * @returns {{x, y}|{x: number, y: number}}\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 /**\r\n *\r\n * @param node\r\n * @returns {{x1: *, x2: *, y1: *, y2: *}}\r\n */\r\n BaseNode.prototype.getBox = function (node) {\r\n return {\r\n x1: node.pos.x + node.box.offset.x,\r\n x2: node.pos.x + node.box.offset.x + node.size.x + node.box.size.x,\r\n y1: node.pos.y + node.box.offset.y,\r\n y2: node.pos.y + node.box.offset.y + node.size.y + node.box.size.y\r\n }\r\n };\r\n\r\n /**\r\n *\r\n * @param {BaseNode} node\r\n * @returns {Array.<{x: number, y: number}>}\r\n */\r\n BaseNode.prototype.getBoxVertices = function (node) {\r\n if (node === undefined) node = this;\r\n var angle = -MathUtil.rad(node.angle);\r\n\r\n var dx = node.box.offset.x + node.box.size.x / 2 + node.getPosition().x - j2Ds.scene.view.pos.x;\r\n var dy = node.box.offset.y + node.box.size.y / 2 + node.getPosition().y - j2Ds.scene.view.pos.y;\r\n\r\n var box = this.getBox(node);\r\n\r\n return [\r\n {\r\n x: (dx + (box.y1 - dy) * Math.sin(angle) + (box.x2 - dx) * Math.cos(angle)).toFixed(5),\r\n y: (dy + (box.y1 - dy) * Math.cos(angle) - (box.x2 - dx) * Math.sin(angle)).toFixed(5)\r\n },\r\n {\r\n x: (dx + (box.y2 - dy) * Math.sin(angle) + (box.x2 - dx) * Math.cos(angle)).toFixed(5),\r\n y: (dy + (box.y2 - dy) * Math.cos(angle) - (box.x2 - dx) * Math.sin(angle)).toFixed(5)\r\n },\r\n {\r\n x: (dx + (box.y2 - dy) * Math.sin(angle) + (box.x1 - dx) * Math.cos(angle)).toFixed(5),\r\n y: (dy + (box.y2 - dy) * Math.cos(angle) - (box.x1 - dx) * Math.sin(angle)).toFixed(5)\r\n },\r\n {\r\n x: (dx + (box.y1 - dy) * Math.sin(angle) + (box.x1 - dx) * Math.cos(angle)).toFixed(5),\r\n y: (dy + (box.y1 - dy) * Math.cos(angle) - (box.x1 - dx) * Math.sin(angle)).toFixed(5)\r\n }\r\n ]\r\n };\r\n\r\n /**\r\n *\r\n * @param node1\r\n * @param node2\r\n * @returns {*}\r\n */\r\n var checkBoxIntersect = function (node1, node2) {\r\n var a, b;\r\n if (node1.angle === 0 && node2.angle === 0) {\r\n a = node1.getBox(node1);\r\n b = node1.getBox(node2);\r\n\r\n return !(a.y1 > b.y2 || a.y2 < b.y1 || a.x2 < b.x1 || a.x1 > b.x2);\r\n } else {\r\n a = node1.getBoxVertices(node1);\r\n b = node1.getBoxVertices(node2);\r\n\r\n if (!MathUtil.is4VerticesIntersect(a, b)) {\r\n return node1.isPointInsideBox(a, node2.getPosition())\r\n || node2.isPointInsideBox(b, node1.getPosition());\r\n }\r\n return true;\r\n }\r\n };\r\n\r\n /**\r\n *\r\n * @param vf\r\n * @param point\r\n * @returns {boolean}\r\n */\r\n BaseNode.prototype.isPointInsideBox = function (vf, point) {\r\n return MathUtil.isPointInRect(vf[0], vf[1], vf[2], vf[3], point);\r\n };\r\n\r\n /**\r\n *\r\n * @param node2\r\n * @returns {*}\r\n */\r\n BaseNode.prototype.isIntersect = function (node2) {\r\n var node1 = this;\r\n\r\n if (node2 instanceof BaseNode) {\r\n return checkBoxIntersect(node1, node2);\r\n } else if (node2 instanceof Array && node2.length > 0 && node2[0] instanceof BaseNode) {\r\n for (var i = 0; i < node2.length; i++) {\r\n if (checkBoxIntersect(node1, node2[i])) return true;\r\n }\r\n return false;\r\n }\r\n };\r\n\r\n /**\r\n *\r\n * @param id\r\n * @returns {boolean}\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 /**\r\n *\r\n * @returns {boolean}\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 /**\r\n *\r\n * @param angle\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 /**\r\n *\r\n * @param angle\r\n */\r\n BaseNode.prototype.setRotation = function (angle) {\r\n this.angle = angle % 360;\r\n };\r\n\r\n /**\r\n *\r\n * @returns {number|*}\r\n */\r\n BaseNode.prototype.getRotation = function () {\r\n return this.angle;\r\n };\r\n\r\n /**\r\n *\r\n * @param to\r\n * @param t\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 /**\r\n *\r\n * @returns {{}}\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 /**\r\n *\r\n * @param speed\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 /**\r\n *\r\n */\r\n BaseNode.prototype.drawBox = function () {\r\n var context = this.layer.context;\r\n\r\n context.lineWidth = 2;\r\n context.strokeStyle = 'black';\r\n\r\n if (this.angle) {\r\n context.save();\r\n context.translate(\r\n this.getPosition().x - j2Ds.scene.view.pos.x,\r\n this.getPosition().y - j2Ds.scene.view.pos.y\r\n );\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.translate(\r\n -(this.getPosition().x - j2Ds.scene.view.pos.x),\r\n -(this.getPosition().y - j2Ds.scene.view.pos.y)\r\n );\r\n }\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 if (this.angle) {\r\n context.restore();\r\n context.save();\r\n context.translate(\r\n this.box.offset.x + this.box.size.x / 2 + this.getPosition().x - j2Ds.scene.view.pos.x,\r\n this.box.offset.y + this.box.size.y / 2 + this.getPosition().y - j2Ds.scene.view.pos.y\r\n );\r\n context.rotate(MathUtil.rad(this.angle));\r\n context.translate(\r\n -(this.box.offset.x + this.box.size.x / 2 + this.getPosition().x - j2Ds.scene.view.pos.x),\r\n -(this.box.offset.y + this.box.size.y / 2 + this.getPosition().y - j2Ds.scene.view.pos.y)\r\n );\r\n }\r\n\r\n context.strokeStyle = 'yellow';\r\n\r\n context.beginPath();\r\n context.rect(\r\n this.box.offset.x + this.pos.x - j2Ds.scene.view.pos.x,\r\n this.box.offset.y + this.pos.y - j2Ds.scene.view.pos.y,\r\n this.box.size.x + this.size.x,\r\n this.box.size.y + this.size.y);\r\n context.stroke();\r\n\r\n if (this.angle) {\r\n context.restore();\r\n }\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 /**\r\n * @exports module:nodes/CircleNode\r\n */\r\n var CircleNode;\r\n\r\n /**\r\n * Примитивный узел для отрисовки круга.\r\n *\r\n * @class CircleNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {number} radius\r\n * @param {string} color\r\n *\r\n * @property {string} color\r\n * @property {number} radius\r\n */\r\n CircleNode = function (j2DsEngine, pos, radius, color) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * Метод для отрисовки узла\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 /**\r\n * @exports module:nodes/LineNode\r\n */\r\n var LineNode;\r\n\r\n /**\r\n * Примитивный узел для отрисовки линии.\r\n *\r\n * @class LineNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {Array.>} points\r\n * @param {number} scale\r\n * @param {string} color\r\n * @param {number} width\r\n * @param {boolean} fill\r\n * @param {string} cFill\r\n * \r\n * @property {string} color\r\n * @property {Array.>} points\r\n * @property {boolean} fill\r\n * @property {number} scale\r\n * @property {string} cFill\r\n * @property {number} lineWidth\r\n */\r\n LineNode = function (j2DsEngine, pos, points, scale, color, width, fill, cFill) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * Метод для отрисовки узла\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 * @exports module:nodes/RectNode\r\n */\r\n var RectNode;\r\n \r\n /**\r\n * Примитивный узел для отрисовки прямоугольника.\r\n *\r\n * @class RectNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n *\r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {{x: number, y: number}} size\r\n * @param {string} color\r\n *\r\n * @property {string} color\r\n */\r\n RectNode = function (j2DsEngine, pos, size, color) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * Метод для отрисовки узла\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 /**\r\n * @exports module:nodes/SpriteNode\r\n */\r\n var SpriteNode;\r\n \r\n /**\r\n * Примитивный узел для отрисовки спрайта.\r\n *\r\n * @class SpriteNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n * \r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {{x: number, y: number}} size\r\n * @param {{imageMap: {img: null|Element, loaded: boolean, width: number, height: number}, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}} animation\r\n * \r\n * @property {number} tmpSpeed\r\n * @property {number} frame\r\n * @property {{imageMap: {img: null|Element, loaded: boolean, width: number, height: number}, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}} animation\r\n * @property {{x: boolean|number, y: boolean|number}} flip\r\n */\r\n SpriteNode = function (j2DsEngine, pos, size, animation) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * //TODO Добавить описание этой херни\r\n *\r\n * @param {number} x\r\n * @param {number} y\r\n */\r\n SpriteNode.prototype.setFlip = function (x, y) {\r\n this.flip = {x: x, y: y};\r\n };\r\n\r\n /**\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 * Отрисовка одного кадра\r\n *\r\n * @param {number} frame\r\n * @returns {void|{added, loaded, failed}}\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 /**\r\n * Устанавливает анимацию\r\n *\r\n * @param {{imageMap: {img: null|Element, loaded: boolean, width: number, height: number}, sourceX: number, sourceY: number, sourceW: number, sourceH: number, frameCount: number}} animation\r\n */\r\n SpriteNode.prototype.setAnimation = function (animation) {\r\n if (this.animation != animation) {\r\n this.animation = animation;\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 /**\r\n * @exports module:nodes/TextNode\r\n */\r\n var TextNode;\r\n \r\n /**\r\n * Примитивный узел для отрисовки текста.\r\n *\r\n * @class TextNode\r\n *\r\n * @constructor\r\n * @extends module:nodes/BaseNode\r\n * \r\n * @param {j2DsEngine} j2DsEngine\r\n * @param {{x: number, y: number}} pos\r\n * @param {string} text\r\n * @param {number} sizePx\r\n * @param {string} color\r\n * @param {string} family\r\n * @param {number} width\r\n * @param {string} colorL\r\n *\r\n * @property {number} vAlign\r\n * @property {number} hAlign\r\n * @property {string} color\r\n * @property {string} family\r\n * @property {number} sizePx\r\n * @property {number} lineWidth\r\n * @property {string} colorL\r\n * @property {string} font\r\n * @property {string} fullText\r\n * @property {number} maxWidth\r\n * @property {Array.} lines\r\n */\r\n TextNode = function (j2DsEngine, pos, text, sizePx, color, family, width, colorL) {\r\n j2Ds = j2DsEngine;\r\n BaseNode.call(this, j2DsEngine, 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 /**\r\n * Устанавливает размер текста\r\n *\r\n * @param {number} sizePx\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 /**\r\n * Возвращает текущий размер\r\n *\r\n * @returns {number}\r\n */\r\n TextNode.prototype.getSize = function () {\r\n return this.sizePx;\r\n };\r\n\r\n /**\r\n * Метод для быстрого изменения текста и его последующей отрисовки.\r\n *\r\n * @deprecated\r\n * @param {string} text\r\n * @param {{x: number, y: number}} pos\r\n * @param {string} color\r\n * @param {string} colorL\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 /**\r\n * Возвращает текст\r\n *\r\n * @returns {string}\r\n */\r\n TextNode.prototype.getText = function () {\r\n return this.fullText;\r\n };\r\n\r\n /**\r\n * Устанавливает текст\r\n *\r\n * @param {string} text\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 /**\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 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.4\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define('io/InputHandler', ['utils/MathUtil', 'nodes/BaseNode'], factory);\r\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\r\n module.exports = factory(require('utils/MathUtil'), require('nodes/BaseNode'));\r\n } else {\r\n factory(root.modules.utils.MathUtil, root.modules.nodes.BaseNode);\r\n }\r\n}(typeof window !== 'undefined' ? window : global, function (MathUtil, BaseNode) {\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.touch = false;\r\n this.touchTap = false;\r\n this.touchHold = false;\r\n this.touchAutoHold = false;\r\n this.touchCount = 0;\r\n this.touchDuration = 60;\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 this.touchHold = false;\r\n this.touchTap = false;\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 this.touchHold = false;\r\n this.touchTap = false;\r\n this.touch = false;\r\n this.touchCount = 0;\r\n } else {\r\n this.keyDown[this.jKey[id]] = false;\r\n }\r\n };\r\n\r\n InputHandler.prototype.onNode = function (node) {\r\n if (node instanceof BaseNode) {\r\n if (!node.layer.visible || !node.isLookScene()) return false;\r\n return node.isPointInsideBox(node.getBoxVertices(), this.pos);\r\n } else if (node instanceof Array && node.length > 0 && node[0] instanceof BaseNode) {\r\n for (var i = 0; i < node.length; i++) {\r\n if (!node[i].layer.visible || !node[i].isLookScene()) continue;\r\n if (node[i].isPointInsideBox(node[i].getBoxVertices(), this.pos)) return true;\r\n }\r\n return false;\r\n }\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 if (this.touchCount > 0 && this.touchCount < this.touchDuration) this.touchCount++;\r\n // Repeater TouchHold\r\n if (!this.touchHold && this.touchCount >= this.touchDuration) {\r\n if (this.touchAutoHold) this.touchHold = true;\r\n }\r\n };\r\n\r\n InputHandler.prototype.onMove = function (e) {\r\n var input = this.j2Ds.input;\r\n if (!input.touch) {\r\n input.screenPos.x = -input.j2Ds.scene.offsetLeft + e.pageX;\r\n input.screenPos.y = -input.j2Ds.scene.offsetTop + e.pageY;\r\n }\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.isTouch = function () {\r\n return this.touch;\r\n };\r\n\r\n InputHandler.prototype.isTouchTap = function () {\r\n return this.touchTap;\r\n };\r\n\r\n InputHandler.prototype.isTouchHold = function () {\r\n return this.touchHold;\r\n };\r\n\r\n InputHandler.prototype.setTouchDuration = function (duration) {\r\n return this.touchDuration = (duration > 0) ? duration : 60;\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.onTouchEvent = function (e) {\r\n var input = this.j2Ds.input;\r\n if (!input.enabled) return false;\r\n e.preventDefault();\r\n\r\n if (input.touchCount == 0) input.touchCount++;\r\n\r\n if (!input.canceled) {\r\n input.mouseDown = [];\r\n input.touch = !input.canceled;\r\n }\r\n\r\n input.screenPos.x = -input.j2Ds.scene.offsetLeft + e.touches[0].pageX;\r\n input.screenPos.y = -input.j2Ds.scene.offsetTop + e.touches[0].pageY;\r\n\r\n input.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.focus();\r\n input.j2Ds.window.addEventListener('touchstart', input.onTouchEvent);\r\n input.j2Ds.window.addEventListener('touchmove', input.onTouchEvent);\r\n input.j2Ds.window.addEventListener('touchend', function () {\r\n input.canceled = false;\r\n if (input.touchCount >= input.touchDuration) {\r\n input.touchHold = true;\r\n input.touchTap = false;\r\n input.touchCount = 0;\r\n } else if (input.touchCount >= 0 && input.touchCount < input.touchDuration) {\r\n input.touchTap = true;\r\n input.touchHold = false;\r\n input.touchCount = 0;\r\n }\r\n input.touch = false;\r\n });\r\n input.j2Ds.window.addEventListener('touchcancel', function () {\r\n input.canceled = false;\r\n });\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 = input.onMove;\r\n input.j2Ds.window.onkeydown = input.keyEvent;\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 = input.keyEvent;\r\n input.j2Ds.window.onmousewheel = input.onMouseWheel;\r\n\r\n if (input.j2Ds.window.addEventListener) {\r\n input.j2Ds.window.addEventListener(\"DOMMouseScroll\", input.onMouseWheel, 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('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.4\r\n */\r\n\r\n/**\r\n * @module \"j2Ds\"\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\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\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\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 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 /**\r\n * @class j2DsEngine\r\n * @exports module:\"j2Ds\"\r\n * @alias module:\"j2Ds\"\r\n *\r\n * @constructor\r\n * @property {number} now\r\n * @property {number} dt\r\n * @property {number} stopAll\r\n * @property {number} frameLimit\r\n * @property {number} sceneStartTime\r\n * @property {number} sceneSkipTime\r\n * @property {function} engine\r\n * @property {boolean} ready\r\n * @property {Window} window\r\n * @property {boolean} canDeactivate\r\n */\r\n var j2DsEngine = function () {\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 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 /**\r\n * @method\r\n * @param {string} id\r\n * @returns {StorageManager}\r\n */\r\n this.createLocal = function (id) {\r\n return new StorageManager(this, id);\r\n }\r\n };\r\n\r\n /* Getters & Setters */\r\n /**\r\n * @returns {{name: string, version: string, git: string, site: string, description: string, author: string}}\r\n */\r\n j2DsEngine.prototype.getInfo = function () {\r\n return {\r\n 'name': 'j2Ds',\r\n 'version': '0.6.4',\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 /**\r\n * @returns {FpsManager}\r\n */\r\n j2DsEngine.prototype.getFPSManager = function () {\r\n this.fpsManager.init();\r\n return this.fpsManager;\r\n };\r\n\r\n /**\r\n * @returns {SceneManager}\r\n */\r\n j2DsEngine.prototype.getSceneManager = function () {\r\n return this.scene;\r\n };\r\n\r\n /**\r\n * @returns {Layers}\r\n */\r\n j2DsEngine.prototype.getLayerManager = function () {\r\n return this.layers;\r\n };\r\n\r\n /**\r\n * @returns {TextureUtil}\r\n */\r\n j2DsEngine.prototype.getTextureManager = function () {\r\n return this.scene.texture;\r\n };\r\n\r\n /**\r\n * @returns {AudioHandler}\r\n */\r\n j2DsEngine.prototype.getAudioManager = function () {\r\n this.audio.init();\r\n return this.audio;\r\n };\r\n\r\n /** @deprecated */\r\n j2DsEngine.prototype.getPaintManager = function () {\r\n return this.paint;\r\n };\r\n\r\n /**\r\n * @returns {InputHandler}\r\n */\r\n j2DsEngine.prototype.getIO = function () {\r\n this.input.init();\r\n return this.input;\r\n };\r\n\r\n /**\r\n * @returns {Dom}\r\n */\r\n j2DsEngine.prototype.getDOMManager = function () {\r\n return this.dom;\r\n };\r\n\r\n /**\r\n * @returns {TriggerManager}\r\n */\r\n j2DsEngine.prototype.getTriggerManager = function () {\r\n this.trigger.init();\r\n return this.trigger;\r\n };\r\n\r\n /**\r\n * @returns {MathUtil}\r\n */\r\n j2DsEngine.prototype.getMathManager = function () {\r\n return MathUtil;\r\n };\r\n\r\n /**\r\n * @returns {{states: {}, add: j2DsEngine.gameStates.add}}\r\n */\r\n j2DsEngine.prototype.getGameStateManager = function () {\r\n return this.gameStates;\r\n };\r\n\r\n /**\r\n * @returns {ViewManager}\r\n */\r\n j2DsEngine.prototype.getViewManager = function () {\r\n return this.viewManager;\r\n };\r\n\r\n /**\r\n * @returns {DeviceManager}\r\n */\r\n j2DsEngine.prototype.getDeviceManager = function () {\r\n return this.deviceManager;\r\n };\r\n\r\n /**\r\n * @returns {ErrorManager}\r\n */\r\n j2DsEngine.prototype.getErrorManager = function () {\r\n this.errorManager.init();\r\n return this.errorManager;\r\n };\r\n\r\n /**\r\n * @returns {TimeManager}\r\n */\r\n j2DsEngine.prototype.getTimeManager = function () {\r\n return this.timeManager;\r\n };\r\n\r\n /**\r\n * @returns {ResourceManager}\r\n */\r\n j2DsEngine.prototype.getResourceManager = function () {\r\n return this.resources;\r\n };\r\n\r\n /**\r\n * @param {Window} global\r\n */\r\n j2DsEngine.prototype.setWindow = function (global) {\r\n this.window = global ? global : window;\r\n };\r\n\r\n /**\r\n * @param {number} fps\r\n */\r\n j2DsEngine.prototype.setFrameLimit = function (fps) {\r\n this.frameLimit = (fps > 0 && fps <= 60) ? fps : 60;\r\n frameLimit = this.frameLimit;\r\n };\r\n\r\n /**\r\n * @param {function} engine\r\n */\r\n j2DsEngine.prototype.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 /**\r\n * @type {{states: {}, add: j2DsEngine.gameStates.add}}\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 /**\r\n * @param {function} engine\r\n * @param {number} frameLimit\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 /**\r\n * @param {j2DsEngine} j2Ds\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 /**\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 /**\r\n * @param {j2DsEngine} j2Ds\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/gulpfile.js b/gulpfile.js index 09c82c7..c975c1f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -46,7 +46,6 @@ var paths = { 'src/js/io/AudioHandler.js', 'src/js/io/InputHandler.js', - 'src/js/io/TouchHandler.js', 'src/js/core/Layers.js', 'src/js/core/Scene.js', diff --git a/src/js/io/InputHandler.js b/src/js/io/InputHandler.js index 2973af9..a7e937e 100644 --- a/src/js/io/InputHandler.js +++ b/src/js/io/InputHandler.js @@ -25,6 +25,11 @@ this.y = 0; this.screenPos = {x: 0, y: 0}; this.touch = false; + this.touchTap = false; + this.touchHold = false; + this.touchAutoHold = false; + this.touchCount = 0; + this.touchDuration = 60; this.keyDown = []; this.keyPress = []; this.keyPressed = []; @@ -146,6 +151,8 @@ this.mousePress = []; this.mouseUp = []; this.mouseWheel = 0; + this.touchHold = false; + this.touchTap = false; }; InputHandler.prototype.isKeyDown = function (code) { @@ -216,6 +223,10 @@ this.canceled = true; this.keyDown = []; this.mouseDown = []; + this.touchHold = false; + this.touchTap = false; + this.touch = false; + this.touchCount = 0; } else { this.keyDown[this.jKey[id]] = false; } @@ -242,6 +253,12 @@ this.y = (this.screenPos.y / dY); this.pos.x = this.j2Ds.scene.view.pos.x + this.x; this.pos.y = this.j2Ds.scene.view.pos.y + this.y; + + if (this.touchCount > 0 && this.touchCount < this.touchDuration) this.touchCount++; + // Repeater TouchHold + if (!this.touchHold && this.touchCount >= this.touchDuration) { + if (this.touchAutoHold) this.touchHold = true; + } }; InputHandler.prototype.onMove = function (e) { @@ -268,6 +285,18 @@ return this.touch; }; + InputHandler.prototype.isTouchTap = function () { + return this.touchTap; + }; + + InputHandler.prototype.isTouchHold = function () { + return this.touchHold; + }; + + InputHandler.prototype.setTouchDuration = function (duration) { + return this.touchDuration = (duration > 0) ? duration : 60; + }; + InputHandler.prototype.isMouseWheel = function (code) { return (code == 'UP' && this.mouseWheel > 0) || (code == 'DOWN' && this.mouseWheel < 0) @@ -313,10 +342,12 @@ var input = this.j2Ds.input; if (!input.enabled) return false; e.preventDefault(); - input.touch = (!input.canceled); + + if (input.touchCount == 0) input.touchCount++; if (!input.canceled) { input.mouseDown = []; + input.touch = !input.canceled; } input.screenPos.x = -input.j2Ds.scene.offsetLeft + e.touches[0].pageX; @@ -363,11 +394,19 @@ input.j2Ds.window.addEventListener('touchmove', input.onTouchEvent); input.j2Ds.window.addEventListener('touchend', function () { input.canceled = false; + if (input.touchCount >= input.touchDuration) { + input.touchHold = true; + input.touchTap = false; + input.touchCount = 0; + } else if (input.touchCount >= 0 && input.touchCount < input.touchDuration) { + input.touchTap = true; + input.touchHold = false; + input.touchCount = 0; + } input.touch = false; }); input.j2Ds.window.addEventListener('touchcancel', function () { input.canceled = false; - input.touch = false; }); input.j2Ds.window.oncontextmenu = function () { return false; diff --git a/src/js/io/TouchHandler.js b/src/js/io/TouchHandler.js deleted file mode 100644 index 5d20a24..0000000 --- a/src/js/io/TouchHandler.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * j2Ds (HTML5 2D Game Engine) - * - * @authors Skaner, DeVinterX - * @license zlib - * @version 0.6.2 - */ - -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - define('io/TouchHandler', ['utils/MathUtil'], factory); - } else if (typeof module === 'object' && typeof module.exports === 'object') { - module.exports = factory(require('utils/MathUtil')); - } else { - factory(root.modules.utils.MathUtil); - } -}(typeof window !== 'undefined' ? window : global, function (MathUtil) { - "use strict"; - - var TouchHandler = function (j2Ds) { - this.j2Ds = j2Ds; - - this.enabled = false; - this.pos = {x: 0, y: 0}; - this.screenPos = {x: 0, y: 0}; - this.canceled = false; - this.touchs = []; - this.tapDown = false; - this.tapPress = false; - this.tapUp = false; - this.body = false; - }; - - TouchHandler.prototype.getPosition = function () { - return MathUtil.v2f(this.pos.x, this.pos.y); - }; - - TouchHandler.prototype.getScreenPosition = function () { - return MathUtil.v2f(this.screenPos.x, this.screenPos.y); - }; - - TouchHandler.prototype.upd = function () { - if (!this.enabled) return false; - var dX = this.j2Ds.scene.offsetWidth / this.j2Ds.scene.width; - var dY = this.j2Ds.scene.offsetHeight / this.j2Ds.scene.height; - - }; - - TouchHandler.prototype.reset = function () { - if (!this.enabled) return false; - }; - - TouchHandler.prototype.cancel = function () { - if (!this.enabled) return false; - }; - - TouchHandler.prototype.isTapDown = function () { - - }; - - TouchHandler.prototype.isTapPress = function () { - - }; - - TouchHandler.prototype.isTapUp = function () { - - }; - - TouchHandler.prototype.getTouch = function () { - - }; - - TouchHandler.prototype.onTouchEvent = function () { - if (!this.enabled) return false; - - }; - - - TouchHandler.prototype.init = function () { - var touchHandler = this; - touchHandler.enabled = true; - - touchHandler.j2Ds.events.addEvent('engine:before', function () { - touchHandler.upd(); - }); - - touchHandler.j2Ds.events.addEvent('engine:after', function () { - touchHandler.reset(); - }); - - - touchHandler.j2Ds.events.addEvent('dom:loaded', function () { - - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') module.exports.TouchHandler = TouchHandler; - if (global.j2Ds !== undefined) global.modules.io.TouchHandler = TouchHandler; - return TouchHandler; -})); diff --git a/src/js/j2Ds.js b/src/js/j2Ds.js index cd03487..f994d14 100644 --- a/src/js/j2Ds.js +++ b/src/js/j2Ds.js @@ -20,7 +20,6 @@ 'io/AudioHandler', 'io/InputHandler', - 'io/TouchHandler', 'managers/DeviceManager', 'managers/ErrorManager', @@ -44,7 +43,6 @@ require('io/AudioHandler'), require('io/InputHandler'), - require('io/TouchHandler'), require('managers/DeviceManager'), require('managers/ErrorManager'), @@ -68,7 +66,6 @@ root.modules.io.AudioHandler, root.modules.io.InputHandler, - root.modules.io.TouchHandler, root.modules.managers.DeviceManager, root.modules.managers.ErrorManager, @@ -91,7 +88,6 @@ Scene, AudioHandler, InputHandler, - TouchHandler, DeviceManager, ErrorManager, FPSManager, @@ -226,14 +222,6 @@ return this.input; }; - /** - * @returns {TouchHandler} - */ - j2DsEngine.prototype.getTouchIO = function () { - this.touch.init(); - return this.touch; - }; - /** * @returns {Dom} */ diff --git a/src/js/nodes/BaseNode.js b/src/js/nodes/BaseNode.js index fa26387..faa8a1b 100644 --- a/src/js/nodes/BaseNode.js +++ b/src/js/nodes/BaseNode.js @@ -69,8 +69,8 @@ /** * - * @param offset - * @param size + * @param {{x: number, y: number}} offset + * @param {{x: number, y: number}} size */ BaseNode.prototype.resizeBox = function (offset, size) { this.box.offset = offset; diff --git a/tests/2dist/application.js b/tests/2dist/application.js index 80e9e6b..30cfc8b 100644 --- a/tests/2dist/application.js +++ b/tests/2dist/application.js @@ -20,6 +20,7 @@ scene.setAutoClear(true); lr.add('back', -1).fill('black'); var b = scene.addTextNode(v2f(5, 270), '', 30, 'white', '', 1, 'black'); +var b2 = scene.addTextNode(v2f(5, 240), '', 30, 'white', '', 1, 'black'); var f = scene.addTextNode(v2f(300, 270), '', 30, 'white', '', 1, 'black'); var r1 = scene.addRectNode(v2f(40, 40), v2f(50, 50), 'red'); var r2 = scene.addRectNode(v2f(100, 100), v2f(90, 90), 'green'); @@ -46,7 +47,9 @@ gm.add('myGame', function () { if (io.isKeyDown('S')) r1.move(v2f(0, 1)); if (io.isKeyDown('A')) r1.move(v2f(-1, 0)); if (io.isKeyDown('D')) r1.move(v2f(1, 0)); - if (io.isTouch()) console.log(io.getPosition()); + if (io.isTouch()) b2.drawSimpleText('IS TOUCH'); + if (io.isTouchTap()) console.log('touchTap', io.getPosition()); + if (io.isTouchHold()) console.log('touchHold', io.getPosition()); b.drawSimpleText(io.onNode([r1, r2, r3]) ? 'TRUE' : 'FALSE'); //b.drawSimpleText(r1.isIntersect([r2, r3]) ? 'TRUE' : 'FALSE');