diff options
Diffstat (limited to 'Player-inl.h')
-rw-r--r-- | Player-inl.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 <vector> + +#include <raylib.h> + + +template<typename T> +bool +Player::collide(const std::vector<T>& bullets) const +{ + for (const auto& bullet : bullets) { + if (CheckCollisionCircles(m_position, 9, bullet.position, bullet.radius)) + return true; + } + return false; +} |