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.

Code Snippets / HeadBob Code

Author
Message
Gazzaden
20
Years of Service
User Offline
Joined: 21st May 2004
Location:
Posted: 16th Jun 2004 07:02
I am a newbie, I got DBP about 4 days ago. I have a very simple bit of code for a headbob in FPS mode. Should I post it? I didn't see any head bob code anywhere. I tried out the Grunt game and it didn't have any head bobbing.

Gazzaden
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 18th Jun 2004 20:58
it's just called bobing , there are some snippits of it out there but don't mind posting yours to.



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
Gazzaden
20
Years of Service
User Offline
Joined: 21st May 2004
Location:
Posted: 19th Jun 2004 23:42
Ok, so I had a bit of trouble, when I ugraded DBPro it deleted all my tutorial files. Anyway, here is the new _control_player subroutine from the FPS tutorial that ships with DBPro, with the added code for a HeadBob. As you can see, it is a very simple headbob implementation. I am playing around with stuff for now, so I might embellish the headbob for different gaits etc. Please feel free to comment on my code. I changed the control setup to WASD, I don't like using arrow keys for FPS.

Gazzaden
Gazzaden
20
Years of Service
User Offline
Joined: 21st May 2004
Location:
Posted: 20th Jun 2004 02:42
I have elaborate the code a bit so it works better, and added a function so that a sound is played at the bottome of every bob for footsteps. Grab a short sound of any kind to test it out, I just recorder myself saying "Step", make it about 0.5 second long. There is a slight issue in that if you stop walking in the middle of a sound, the next step when you resume walking does not play a sound. I'm going to explore this, but if anyone has any ideas, I'm all ears.

Gazzaden

Login to post a reply

Server time is: 2024-11-23 21:39:54
Your offset time is: 2024-11-23 21:39:54