Hello Anon, Login?
Notice: This is a mirrored post from /lua.

So tonight I added some much needed sound effects to the game which made it seem more "game-like". All of the sound effects are licensed as public domain from http://freesound.org/ and the theme music is from http://archive.org/.

I made a new file called beep.lua that contains all of the sound files and made sure to add references to the top of each file that will need sound effects (enemies.lua, ship.lua, bullets.lua and main_game.lua).

You can view my latest commit here - https://bitbucket.org/xixs/gamecakejam/commits/b60aed6cd5bddab52f47f53edfdeb08f8b8384cf

The new changes are as follows:

  • Added sfx for enemies death event.
  • Added two sfx for hero ship death event.
  • Added sfx for hero ship bullet shots.
  • Added sfx for new level event.
  • Added theme music.

The default setting for Gamecake is 4 sound effects channel and 2 streaming channels. You can change the number of channels by editing init.lua found one directory up and adding these settings: for example - sfmax=6 and strmax=6. However, there is no way of knowing if this works in certain hardware as some builds may require that number to be below a certain value (iPhone supports 32, windows Direct Sound supports 31, Ubuntu claims to support 255) but it's best to keep this number low with the safest limit at 8.

For the majority of the time, I was playing around with the sound effects and replacing them to make the game sound coherent as a combined whole. This is because you can't really tell if a sound will fit in with the other sounds or the theme music if that particular sound effect is heard in isolation. At times you might even have to replace entire sets of sound effects due to this dissonance.

Throughout this exercise, I was particularly unimpressed with my lack of basic mathematical understanding.