Hello, im trying to implement pacman in p5.js.
But im facing the problem that when i loose a game I play a song, a mp3 file… and then when i restart the game it should play initial sound/song.
So im facing that the two sounds are overlapping.
Is there any way to play sound one song/sound when the other finish ?
myLooseGameSound.play();
myStartSound.play();
I tried:
myLooseGameSound.play();
while (myLooseGameSound.isplaying())
{
}
myStartSound.play();
But got stuck, and dont know why…
Thanks in advance.