I'am building a game in Xna, and my soundeffects keep looping, it is quite obvious because, the sounds are playing from an update method.
The sounds are not really playing 1 at a time, but like when my car collides to a tile for example named: tile 1, it will play like a 1000+ times at once.
How can I prevent the sound from playing 1000+ times at once, and just make it play 1x at a time?
this is the code I use to play the sound effect:
if (map[x][y] == 1)
{
car.speed = 0;
crash.Play();
}
crash is the name of the soundEffect.
Thanks in Advance!
Quick example of how you could achieve this: