Hello, I want to play music when my player dies, I have this in Int main
int main()
{
Music death;
death.openFromFile("music/death.ogg");
and I want to put death.play(); here
while (window.isOpen())
{
float time = clock.getElapsedTime().asMicroseconds();
if (p.life == true) gameTime = gameTimeClock.getElapsedTime().asSeconds();
else {
p.sprite.setColor(Color(235, 65, 7));
view.zoom(0.999f);
view.move(0, 0.03);
view.move(0.03, 0);
}
but
if (p.life == true) gameTime = gameTimeClock.getElapsedTime().asSeconds();
else {
death.play();
wouldn't work... Can you please tell me what to do in details, because I'm just starting to learn programming.
Some details: Visual studio 2013, win 10, and I have class Player in my code.