c# - XNA sound effect -
i have little problem sound effect. doesn't function because when play played around 500000 times in 2 seconds. take look here:
soundeffect thunder; thunter=content.load<soundeffect>("thunder"); foreach (flash flash in flashes) if(flash.visible==true) if (time >1 && time <3) thunder.play(); //now sounds bad because played lot of times.. want played once! (the sound 5 sec long)
hmm. simple this:
foreach (var flash in flashes) if (flash.visible && time > 1 && time < 3) { thunder.play(); break; // play sound once }
Comments
Post a Comment