Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Walk/Run sound in FPS game?

Author
Message
B++
14
Years of Service
User Offline
Joined: 6th Dec 2009
Location: India
Posted: 27th Mar 2011 14:01
Hi,
I just want to know how do u add walk/run sound in ur FPS game? I just tryed and found that it is not that simple. Could u kindly give me some idea about this?

Thanks
Regards


Your Signature Here;
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 27th Mar 2011 14:09 Edited at: 27th Mar 2011 14:10
Use a timer to determine when the next "step" is to be played, so if the character is still walking and the next step sound timer is reached, play another step sound and reset the timer.

If your character is running, then use a shorter delay between steps and maybe a different sound file?

Hope that helps

>Edit<

Or a 2nd idea, is only play the step sample when the animation frame of your characters feet reaches a specified frame.

B++
14
Years of Service
User Offline
Joined: 6th Dec 2009
Location: India
Posted: 27th Mar 2011 15:39
Thanks prof. The only problem i am having right now is changing the sound from walk to run or vice versa. If i do it with variables it does not work bcos of keypress.

Regards


Your Signature Here;
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 27th Mar 2011 15:46
How do you distinguish between running and walking?

Assuming your using "shift" or another button to make your guy run (i.e. Holding down shift run=true, else run=false)

Then just add this check to your sound playing bit.

if timer()-footStepTimer>footStepDelay
if run=true
play sound runStep
else
play sound walkStep
endif
footStepTimer=timer()
endif

B++
14
Years of Service
User Offline
Joined: 6th Dec 2009
Location: India
Posted: 27th Mar 2011 16:32
Thanks PRoF. I will try this.

Regards


Your Signature Here;

Login to post a reply

Server time is: 2024-09-29 02:33:02
Your offset time is: 2024-09-29 02:33:02