I'm trying to collide my ball1 to greengreen drawable. how can I determine the collision?
public boolean CheckCollisionred(View ballr,View rr_1,View rg_3) {
Rect R1 = new Rect(ballr.getLeft(), ballr.getTop(), ballr.getRight(), ballr.getBottom());
Rect R2 = new Rect(rr_1.getLeft(), rr_1.getTop(), rr_1.getRight(), rr_1.getBottom());
Rect R3 = new Rect(rg_3.getLeft(), rg_3.getTop(), rg_3.getRight(), rg_3.getBottom());
return R1.setIntersect(R2, R3);
}
@Override
public void run() {startballanimation();
if (CheckCollisionred()) {
Score++;
}else
Score--;
}
UPDATE: this is showing me error "Checkcollisionred() in main activity cannot be applied to expected parameters, Actual arguments"
edit: the problem is I have an image button that displays the drawables that I want to collide .