Some code tweaks
This commit is contained in:
parent
6e9d3eb0f9
commit
08da91047e
5 changed files with 11 additions and 16 deletions
|
@ -397,8 +397,8 @@ bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec)
|
|||
int recCenterX = rec.x + rec.width/2;
|
||||
int recCenterY = rec.y + rec.height/2;
|
||||
|
||||
float dx = abs(center.x - recCenterX);
|
||||
float dy = abs(center.y - recCenterY);
|
||||
float dx = fabs(center.x - recCenterX);
|
||||
float dy = fabs(center.y - recCenterY);
|
||||
|
||||
if (dx > (rec.width/2 + radius)) { return false; }
|
||||
if (dy > (rec.height/2 + radius)) { return false; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue