/* DynAPI Distribution MotionX Class by Raymond Irving (http://dyntools.shorturl.com) The DynAPI Distribution is distributed under the terms of the GNU LGPL license. requires: Dynlayer */ MotionX = {}; // used by dynapi.library DynLayer.prototype.makeSolid=function(){ this.isHard=true; this._collideX=this.x; this._collideY=this.x; this.collideEvent ={ onlocationchange:function(e) { var me=e.getSource(); var dirX='',dirY=''; // get direction if (me._collideX!=me.x) { if (me._collideX=0) { if (distx>=0) angle = 90-(rad*180/Math.PI); else angle = 270+(180-(rad*180/Math.PI)); }else{ angle = 90+(rad*180/Math.PI); } this._collideAngle=Math.ceil(angle); }; DynLayer.prototype._checkForCollision=function(){ if (!this.parent.children.length>0) return false; var ch,chX,sX,sY,colX1,colX2,colY1,colY2,n1,n2; this.collideObject==null; for (var i in this.parent.children) { ch=this.parent.children[i]; if (ch!=this && ch.isHard==true) { chX=ch.x; chY=ch.y; sX=this.x; sY=this.y; colX1=(sX>=chX && sX<=chX+ch.w); colX2=(chX>=sX && chX<=sX+this.w); colY1=(sY>=chY && sY<=chY+ch.h); colY2=(chY>=sY && chY<=sY+this.h); if ((colX1 || colX2) && (colY1 || colY2)) { if (this._collideDirection=='NE') { n1=((chY+ch.h)-this.y);n2=((sX+this.w)-chX); if (n1