are there any special rules regarding hittesting?
im using this code here and its jus not working at all:
var speed:Number = 0;
var angle:Number = 0;
var angleFish:Number = 0;
fish_mc.onEnterFrame = function() {
radian = Math.PI/180angle;
this._x += (speedMath.cos(radian));
this._y += (speedMath.sin(radian));
this._rotation = angle;
if (pond_mc.hitTest(this._x, this._y, true)) {
speed = speed;
} else {
speed = 0;
speed -= 1;
}
if (Key.isDown(Key.RIGHT)) {
angleFish += 10;
} else if (Key.isDown(Key.LEFT)) {
angleFish -= 10;
}
if (Key.isDown(Key.UP)) {
speed += 1;
} else if (Key.isDown(Key.DOWN)) {
speed -= 1;
}
speed = speed0.95;
angle += angleFish;
angleFish = 0;
};
im starting to get quite irritated so any help would be much appreciated,
cheers
Note that that hitTest will only check if fish_mc’s registration point is colliding with pond_mc. If you wan’t to do a true shape-to-shape hitTest you’ll need to check against more points on fish_mc rather than just it’s registration point.
/Mirandir
at the moment the fish is sitting over the pond so i should hope it knows the registration point is there. how would i get it to check more points on the fish out of interest?