for (i = 0; i < theTileNum; i++)
{
var thisTile = gTargetList[i];
//left
if ( this.MovieClip._x > _root.bricks[thisTile]._x - _root.bricks[thisTile]._width/2-7
&& this.MovieClip._x < _root.bricks[thisTile]._x - _root.bricks[thisTile]._width/2
&& this.MovieClip._y > _root.bricks[thisTile]._y-7 - _root.bricks[thisTile]._height/2-1
&& this.MovieClip._y < _root.bricks[thisTile]._y+7 + _root.bricks[thisTile]._height/2-1)
{
//trace("left");
if (this.deltaX>0){ this.flipX();}
destroy(i,thisTile);
}
//right
if ( this.MovieClip._x > _root.bricks[thisTile]._x + _root.bricks[thisTile]._width/2
&& this.MovieClip._x < _root.bricks[thisTile]._x + _root.bricks[thisTile]._width/2+7
&& this.MovieClip._y > _root.bricks[thisTile]._y-7 - _root.bricks[thisTile]._height/2
&& this.MovieClip._y < _root.bricks[thisTile]._y+7 + _root.bricks[thisTile]._height/2)
{
//trace("right");
if (this.deltaX<0){this.flipX();}
destroy(i,thisTile);
}
//up
if (( this.MovieClip._x > (_root.bricks[thisTile]._x-7 - _root.bricks[thisTile]._width/2))
&& (this.MovieClip._x < (_root.bricks[thisTile]._x+7 + _root.bricks[thisTile]._width/2))
&& (this.MovieClip._y > (_root.bricks[thisTile]._y - _root.bricks[thisTile]._height/2-7))
&& (this.MovieClip._y < (_root.bricks[thisTile]._y - _root.bricks[thisTile]._height/2)))
{
//trace("up");
if (this.deltaY>0){this.flipY();}
destroy(i,thisTile);
}
//down
if (
this.MovieClip._x > _root.bricks[thisTile]._x - _root.bricks[thisTile]._width/2-7
&& this.MovieClip._x < _root.bricks[thisTile]._x + _root.bricks[thisTile]._width/2+7
&& this.MovieClip._y > _root.bricks[thisTile]._y + _root.bricks[thisTile]._height/2
&& this.MovieClip._y < _root.bricks[thisTile]._y + _root.bricks[thisTile]._height/2+7)
{
//trace("down");
if (this.deltaY<0){this.flipY();}
destroy(i,thisTile);
}
}
это что нибудь вам скажет господа?