summaryrefslogtreecommitdiffhomepage
path: root/src/wall.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wall.c')
-rw-r--r--src/wall.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wall.c b/src/wall.c
index d2b1319..5a2d6df 100644
--- a/src/wall.c
+++ b/src/wall.c
@@ -38,3 +38,18 @@ new_wall(
.height = height
});
}
+
+bool
+coords_inside_wall(
+ float x,
+ float y
+)
+{
+ c_foreach(i, cvec_collision_2d_world_item, collision_wall_world) {
+ if (x >= i.ref->x && x <= i.ref->x + i.ref->width &&
+ y >= i.ref->y && y <= i.ref->y + i.ref->height) {
+ return true;
+ }
+ }
+ return false;
+}