I am working on a 2D side scroller game and came upon a sound issue. I would like to be able to play multiple sounds simultaneously but am unable to do so. Currently, I am using:
Mix_PlayChannel(-1,bat_sound,0);
to call sound effects. I have seen some talk about "threads," but I don't know anything about them at this point.
You should be able to play multiple sounds at the same time by calling Mix_PlayChannel multiple times. That should work for up to 8 sounds at the same time. If you need to be able to play more sounds at the same time you can use Mix_AllocateChannels to increase the number. http://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC26
Yes I did, and just tried it again. For example, my character shoots lances which makes a sound, and then I have enemies running around with sound being looped in the move function. After a compile and run, only the enemies sound is playing, while my shooting is not doing anything. It's a bit strange.