a takie, dla kompletu

This commit is contained in:
2024-11-23 19:18:46 +01:00
parent dd3a4a464e
commit 61544365b2
2 changed files with 4 additions and 1 deletions

BIN
assets/sounds/fail.mp3 Normal file

Binary file not shown.

View File

@@ -27,6 +27,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");
// 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
@@ -118,8 +119,10 @@ int main()
text.setFillColor(sf::Color::Red);
text.setPosition(50, 80);
// zatrzymanie muzyki i odtworzenie dźwięku przegranej
audioManager.playSoundEffect("fail", 70.f);
audioManager.stopBackgroundMusic();
while (errorWindow.isOpen()) {
audioManager.stopBackgroundMusic();
sf::Event event;
while (errorWindow.pollEvent(event)) {
if (event.type == sf::Event::Closed || sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) {