#include "collision.h" bool is_colliding(SDL_Rect* a, SDL_Rect* b) { bool collision_v, collision_h; collision_h = (a->x <= b->x && a->x + a->w - 1 >= b->x) || (b->x <= a->x && b->x + b->w - 1 >= a->x); collision_v = (a->y <= b->y && a->y + a->h - 1 >= b->y) || (b->y <= a->y && b->y + b->h - 1 >= a->y); return collision_v && collision_h; }