Monday, October 3, 2011

Someone Set us Up the Bomb

Today I am adding a sound effect for a collision of the enemy ship and player ship. Should be fairly similar to adding the sound effect for the hit noise (except I will be replacing the explosion sound in one spot instead of adding the sound effect).

After a quick bit of searching I found a sound effect I could use, supposed to be a bazooka sound effect but it is basically an explosion and that is all I need.

Ran into a minor hiccup. After getting the wav file loaded and declared and initialized I realized that when the player collides with an enemy and the enemy is destroyed it doesn't say to play the explosion sound, it simply sets the enemy health to 0 which triggers the explosion sound in the update enemy method.

I could still just add a line to tell it to play the new sound, but then both the explosion and the new sound would play at the same time. On a lark I tried it and it sounds great actually, better then just the more flat sound I downloaded. I worried that one would play a split second after the other but they play at the same time and sound better together then by themselves. Guess I lucked out there, especially since it sounds even better.

Tomorrow I suppose I should try making a new enemy. That might be a 2 day event since it will involve a good deal of code and I have to get a decent looking animation.

No comments:

Post a Comment