3bool isColliding(
const SDL_Rect* rect1,
const SDL_Rect* rect2)
5 int leftRect1, leftRect2,
7 rightRect1, rightRect2,
8 bottomRect1, bottomRect2;
14 rightRect1 = rect1->x + rect1->w;
15 rightRect2 = rect2->x + rect2->w;
16 bottomRect1 = rect1->y + rect1->h;
17 bottomRect2 = rect2->y + rect2->h;
19 if (leftRect1 >= rightRect2 ||
20 leftRect2 >= rightRect1 ||
21 topRect1 >= bottomRect2 ||
22 topRect2 >= bottomRect1)