-
Simple hitest question
Hi there!
I have always used the "if(object.hitTest(object2)){};" hitTest BUT;
I am workin on a platform game and I want to use the one which tests the shape rather than bounding box. I have no idea how to use it. I have tried the following;
if(this.hitTest(_root.mov._x,_root.mov._y,true){};
if(_root.mov.hitTest(this._x,this._y,true){};
if(_root.mov.hitTest(x,y,true){};
none of these have worked for me
PLEASE HELP ME!!!
Thanks
-
if(this.hitTest(_root.mov._x,_root.mov._y,true){};
if(_root.mov.hitTest(this._x,this._y,true){};
if(_root.mov.hitTest(x,y,true){};
All of these are wrong, try one of these, depending on the desired effect:
if (this.hitTest(_root.mov._x, _root.mov._y, true)) {
trace('Collision detected!');
}
if (_root.mov.hitTest(this._x, this._y, true)) {
trace('Collision detected!');
}
-
The problem was just a single )