Collision detection issues
I'm creating a space game where the main player unit is a stationary object that fires a laser.
I've added planets to the environment and want the lasr to 'break' on contact with the planets.
So far everything works, but the laser is breaking on a box surrounding each planet and not the planets themselves.
I think the issue is here on my checkCollisions function.
private function checkCollisions(testX:Number, testY:Number):Boolean
{
var i:int;
var len:int = _planets.length;
for (i = 0; i < len; i++)
{
if (MovieClip(_planets).hitTestPoint(testX, testY, true))
{
return true;
break;
}
}
return false;
}
