Hello guys, I don't know if i can include and IrrIlang problem in an Irrlicht forum, but I reckon most of you use it anyway
So my problem is how do I time the sounds correctly so that they do not overlap. Some of the sounds like "steps" are fine because they are only the main sound. Others like the shooting sound include reverberations, echoes and other stuff recorded into the sound. These are the real problem. The way I'm checking whether to play a sound isn't working very well. As the button is held down the sound plays once, then pauses, plays several times, pauses again and so on. Also feel free for any other extra advice you can give me, as I need all I can get.
Here's the pastebin of my code http://pastebin.com/f3dd9a7f1
As I said if there is anything in the code that would work better some other way, tell me.
Cheers
Playing sounds correctly and other stuff
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Code: Select all
if(now%15 == 0)
{
sengine->play2D(shots);
once = 0;
}
Code: Select all
int timer = 0;
...
if (now >= timer) {
sengine->play2D(shots);
once = 0;
timer = now+15;
}