From f0891205710c2d5c9b78a9d275de88a77c2ccda3 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 18 Apr 2022 10:59:32 +0200 Subject: Moved collision checks to player class --- Player-inl.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Player-inl.h (limited to 'Player-inl.h') diff --git a/Player-inl.h b/Player-inl.h new file mode 100644 index 0000000..10c43d1 --- /dev/null +++ b/Player-inl.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +#include + + +template +bool +Player::collide(const std::vector& bullets) const +{ + for (const auto& bullet : bullets) { + if (CheckCollisionCircles(m_position, 9, bullet.position, bullet.radius)) + return true; + } + return false; +} -- cgit v1.1