aboutsummaryrefslogtreecommitdiff
path: root/CollisionChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CollisionChecker.cpp')
-rw-r--r--CollisionChecker.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/CollisionChecker.cpp b/CollisionChecker.cpp
new file mode 100644
index 0000000..b8bcbd5
--- /dev/null
+++ b/CollisionChecker.cpp
@@ -0,0 +1,14 @@
+#include "CollisionChecker.h"
+#include "Museum.h"
+
+CollisionChecker::CollisionChecker(Museum & m) : museum(m) { }
+
+void CollisionChecker::compare(Artist & a, Artist & b) {
+ if (a.data.x + 0.5 < b.data.x) return;
+ if (a.data.y + 0.5 < b.data.y) return;
+ if (a.data.x > b.data.x + 0.5) return;
+ if (a.data.y > b.data.y + 0.5) return;
+
+ a.colliding = b.colliding = true;
+}
+