Statek miga

przy uderzeniu w meteoryt
This commit is contained in:
2024-12-06 15:16:57 +01:00
parent 2f9e0ba236
commit 71f8ebe285
4 changed files with 30 additions and 2 deletions

View File

@@ -105,13 +105,14 @@ void Plansza::update() {
update_hearts();
ship.updateBullets();
ship.update();
window->draw(ship.getSprite());
// trochę dziwny sposób ale jednak działa
for (auto &meteor: meteors) {
if (ship.getSprite().getGlobalBounds().intersects(meteor.getSprite().getGlobalBounds())) {
ship.dealDamage();
ship.onHit();
}
}