For my HND I've got to re-create Frogger, and everything was going swell until I tried adding some collision detection and sound. Whenever my player intersects a vehicle, the sound file just starts playing with every game update instead of just once.
Here is my code from the update method:
if (vehicles[count].bbox.Intersects(playerSprites[lives].bbox))
playerSprites[lives].isDead = true;
}
if (playerSprites[lives].isDead)
{
deathSound.Play();
}
The sound is declared as a SoundEffect, loaded as a SoundEffect, and the content processor is set to Sound Effect, and as far as I can tell, Sound Effects in XNA are only meant to be played once. What am I doing wrong??