Dźwięk wybuchu przy trafieniu w meteoryt

This commit is contained in:
2024-11-26 21:47:53 +03:00
parent 1e76a7ca95
commit 0e1b53fc9b
2 changed files with 2 additions and 0 deletions

BIN
assets/sounds/explosion.mp3 Normal file

Binary file not shown.

View File

@@ -31,6 +31,7 @@ int main()
audioManager.loadSoundEffect("shoot", "../assets/sounds/shoot.ogg");
audioManager.loadSoundEffect("shoot_alt", "../assets/sounds/shoot_alt.ogg");
audioManager.loadSoundEffect("fail", "../assets/sounds/fail.mp3");
audioManager.loadSoundEffect("explosion", "../assets/sounds/explosion.mp3");
// TODO: Przenieść tworzenie statku wewnątrz klasy Plansza
Player ship(mainWindow.getSize().x / 2, mainWindow.getSize().y - 100, "../assets/ship/Dreadnought-Base.png"); // tworzenie statku
@@ -145,6 +146,7 @@ int main()
bool meteorHit = false;
for (auto bulletIt = ship.getBullets().begin(); bulletIt != ship.getBullets().end(); ) {
if (meteorIt->getSprite().getGlobalBounds().intersects(bulletIt->getSprite().getGlobalBounds())) {
audioManager.playSoundEffect("explosion");
bulletIt = ship.getBullets().erase(bulletIt);
meteorIt = plansza.getMeteors().erase(meteorIt);
meteorHit = true;