From 93b3e4004387047c25b2f5a190aced01c9091934 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 2 Feb 2021 19:34:48 -0500 Subject: Added collision with map tiles --- src/vector.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/vector.h') diff --git a/src/vector.h b/src/vector.h index 8019edf..9f6d54f 100644 --- a/src/vector.h +++ b/src/vector.h @@ -97,12 +97,16 @@ public: return vec2(x() * other.x(), y() * other.y()); } + vec2 operator/(const vec2& other) const { + return vec2(x() / other.x(), y() / other.y()); + } + bool operator==(const vec2& other) const { - return std::tie(x(), other.x()) == std::tie(y(), other.y()); + return (x() == other.x()) && (y() == other.y()); } bool operator!=(const vec2& other) const { - return std::tie(x(), other.x()) != std::tie(y(), other.y()); + return (x() != other.x()) || (y() != other.y()); } }; -- cgit 1.4.1