simplest way to detect collision with two bitmpas on android surface view

| | August 4, 2015

as title said. I have looked all over and havent found standard way to detect collision between two bitmaps on surface view. I tried intersect method with two rectangles, but didnt work.

`practiseA = new Rect(500, 500, 500, 500);
 practiseB = new Rect(500, 500, 500, 500);

public void isIntersecting() {
        Log.d("yeah", "hello");
        if (practiseA.intersect(practiseB)) {
            Log.d("collision", "yes");
        }
    }`

but problem is that it doesnt log. So can someone tell me what im doing wrong or give me a different method. I saw this complicating algorithm but didnt understand what to feed it:sqrt((ax-bx)^2+(ay-by)^2)<=aR+bR – whats ar and br?

im confused

Thanks!

Leave a Reply