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 --- GameScreen.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'GameScreen.cpp') diff --git a/GameScreen.cpp b/GameScreen.cpp index 774956e..4315060 100644 --- a/GameScreen.cpp +++ b/GameScreen.cpp @@ -16,11 +16,7 @@ GameScreen::update(const float dt) m_player.update(dt); m_generator.update(dt); m_const.update(dt); - bool collided = false; - for (const auto& bullet : m_const.m_bullets) { - if (CheckCollisionCircles(m_player.m_position, 9, bullet.position, bullet.radius)) - collided = true; - } + bool collided = m_player.collide(m_const.m_bullets); (void) collided; } -- cgit v1.1