So distance between to points is
(x2- x1)^2 + (y2-y1)^2
so if my max distance is 120 and the distance between the two points is 78.
78 < 120 = COLLISION!
No what about say...an image?
Well then you subtract the images width from the dist
distance is 150. max distance is 120
distance - imageWidth = 96 < 120 = COLLISION!
this assumes that the image has the same width and height.
How do you check for a collision with an image that has different height and width?
How do you check for a collision base on pixels?
Fast = better
currently this is what I use
public boolean collision( Vector3f other, float dist )
if(this.loc.dist(other) > (dist*dist) )
public float dist( Vector3f other )
float xd = other.x - this.x;
float yd = other.y - this.y;
return (xd * xd) + (yd * yd);