Question
: Changing the sounds of Spacewar First of all, get sound working on your computer so that you can hear the Pop Framework sounds. (You
: Changing the sounds of Spacewar
First of all, get sound working on your computer so that you can hear the Pop Framework sounds. (You need to have a sound card with speakers, and the speakers need to be plugged in. If you double-click the little speaker icon on the upper right of your Windows taskbar, the Mute button needs to not be checked. Also don't forget to see if your speaker has a manual, physical control.) Now try removing the SND_ASYNC from the playSound calls in the gamespacewar.cpp. Rebuild the program and see how it sounds. See what happens if you OR in SND_LOOP
. Now find some other *.wav file and incorporate it into the program. Where to find a *.wav file? First you can use Start | Find to look for them on your hard disk. Second, it's pretty easy to search the web for sites that have *.wav files for download. When picking sounds for effects in a game, avoid long sounds. For instance, once a student wrote a game where every time you shot something the game said 'Hasta la vista, baby,' and although that was funny the first few dozen times, it then got really old.
So get the *.wav, put it in the res subdirectory and add it to the resources. Give it a name like, say, 'Newsound.'
Now change the code so that when you shoot an asteroid it will make the 'Newsound' sound if the radius is bigger than some value, and it will make a 'Ding' sound if the radius is smaller than some value. What value? Look for some value that separates the big from the small asteroids.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started