summaryrefslogtreecommitdiffhomepage
path: root/src/wall.c
diff options
context:
space:
mode:
authorArnold <[email protected]>2023-05-28 12:56:19 -0400
committerGitHub <[email protected]>2023-05-28 12:56:19 -0400
commitad60e242e2d432b436de79ffeb76637e62b057d8 (patch)
treedb7e76c4e12c21c85de45e2e948419c5d2d8851c /src/wall.c
parentfed9c87269db74d70cd5262804873bc875543abe (diff)
downloadTOJam2023-ad60e242e2d432b436de79ffeb76637e62b057d8.tar.gz
TOJam2023-ad60e242e2d432b436de79ffeb76637e62b057d8.zip
implement random enemy spawning
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;
+}