Can anyone tell me why my hitTest doesn’t work?
Trying to make a knockout fighting game…
Any reference / Tutorial / assistance would be a HUGE help!
Thanks all!
This is the code i put together thus far…
Mouse.hide();
var clicked = false;
fists_mc.onMouseDown = function() {
//punches left on first mouse click
if (clicked == false) {
fists_mc.left.gotoAndPlay(2);
clicked = true;
}
//punches right on second mouse click
else if (clicked == true) {
fists_mc.right.gotoAndPlay(2);
clicked = false;
}
//THIS IS THE PART THAT IS NOT WORKING... Would like to have character "contact_mc" react to being hit... This aint doing it? trace('hit'); not working either. Any ideas here?
if ((fists_mc.left.hitLeft.hitTest(_root.contact_mc.h itMe_mc.hitFace_mc)==true) || (fists_mc.right.hitRight.hitTest(_root.contact_mc. hitMe_mc.hitFace_mc)==true)) {
_root.contact_mc.hitMe_mc.gotoAndPlay(2);
trace ('hit');
}
}
fists_mc.onEnterFrame = function() {
//stick the hands to the cursor
this._x = _root._xmouse;
this._y = _root._ymouse;
}