summaryrefslogtreecommitdiffhomepage
path: root/Player-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'Player-inl.h')
-rw-r--r--Player-inl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Player-inl.h b/Player-inl.h
index 140bfad..32f6117 100644
--- a/Player-inl.h
+++ b/Player-inl.h
@@ -7,11 +7,15 @@
template<typename T>
bool
-Player::collide(const std::vector<T>& bullets) const
+Player::collide(const std::vector<T>& bullets)
{
+ if (m_invulnerability > 0)
+ return false;
for (const auto& bullet : bullets) {
- if (CheckCollisionCircles(m_position, 4, bullet.position, bullet.radius))
+ if (CheckCollisionCircles(m_position, 4, bullet.position, bullet.radius)) {
+ hit();
return true;
+ }
}
return false;
}