Extract collision detection into a ui module

This commit is contained in:
2024-01-15 22:35:31 +00:00
parent d114cfce99
commit c831fd23f7
2 changed files with 16 additions and 0 deletions

6
src/ui.c Normal file
View File

@@ -0,0 +1,6 @@
#include "ui.h"
bool aabb(const rect_t *rect, i32 x, i32 y) {
return x > rect->topleft.x && x <= rect->topleft.x + rect->w &&
y > rect->topleft.y && y <= rect->topleft.y + rect->h;
}