|
-
Funkalicious
Nevermind:
Method2
Enemy.prototype.HitTest = function(line) {
this.globalHit();
//
var m:Number = line[0];
var b:Number = line[1];
var k:Number = this.HitPos.x;
var h:Number = this.HitPos.y;
var r:Number = this.R
//
var b2 = h-(m*k)
//
var m3 = -1/m
var b3 = h-(m3*k)
//
var X2 = Intersect([m,b], [m3,b3])
var Y2 = m3*X2+b3
//
dX = X2-k
dY = Y2-h
//
var dist = Math.sqrt((dX*dX)+(dY*dY))
if (dist < r){
return (true)
}else{
return (false)
}
};
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|