a takie, dla kompletu
This commit is contained in:
BIN
assets/sounds/fail.mp3
Normal file
BIN
assets/sounds/fail.mp3
Normal file
Binary file not shown.
5
main.cpp
5
main.cpp
@@ -27,6 +27,7 @@ int main()
|
|||||||
|
|
||||||
audioManager.loadSoundEffect("shoot", "../assets/sounds/shoot.ogg");
|
audioManager.loadSoundEffect("shoot", "../assets/sounds/shoot.ogg");
|
||||||
audioManager.loadSoundEffect("shoot_alt", "../assets/sounds/shoot_alt.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
|
// 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
|
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.setFillColor(sf::Color::Red);
|
||||||
text.setPosition(50, 80);
|
text.setPosition(50, 80);
|
||||||
|
|
||||||
|
// zatrzymanie muzyki i odtworzenie dźwięku przegranej
|
||||||
|
audioManager.playSoundEffect("fail", 70.f);
|
||||||
|
audioManager.stopBackgroundMusic();
|
||||||
while (errorWindow.isOpen()) {
|
while (errorWindow.isOpen()) {
|
||||||
audioManager.stopBackgroundMusic();
|
|
||||||
sf::Event event;
|
sf::Event event;
|
||||||
while (errorWindow.pollEvent(event)) {
|
while (errorWindow.pollEvent(event)) {
|
||||||
if (event.type == sf::Event::Closed || sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) {
|
if (event.type == sf::Event::Closed || sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user