Hi
I am trying to make a simple collision detection class for a soccer game. Here is the code:
int Collision(int x1, int y1, int radius1, int x2, int y2, int radius2)
{
int dx = x2 - x1;
int dy = y2 - y1;
int radii = radius1 + radius2;
if ((dx*dy)+(dy*dy)< radii * radii)
{
return true;
}
else
{
return false;
}
}
The problem is with the code returning true or false. Visual Studio says it cannot implicitly convert bool to int, and I understand that, but how can I fix it? Thanks for any help.