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 / Walking effect

Author
Message
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 1st Jul 2003 17:35
I'm making an fps and i got a little prob with the camera, it doesn't looks like i'm walking it loks more like i'm sliding over the ground. how can I make the camera woble when i'm walking?
Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 10GB HD, Riva TNT2 Ultra 32mb
koolaid
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 1st Jul 2003 20:07
hmm good question my game will be fps to when it has to bounce up and down make it appear to be like a human also have sounds walking but im not sure exactly on the code!

KOOLAID
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 1st Jul 2003 23:40
Ok, to get the camera to bob up and down, you'll need to have a variable which says how far to offset the camera. Then, when the player is walking, just change the variable using a sine wave to get a nice bobbing motion.

moving=0
If upkey()=1 then moving=1 blah etc all your movement code here

if moving=1
camerabobangle=wrapvalue(camerabobangle+1)
endif

if moving=0
camerabobangle=curveangle(0,camerabobangle,10)
endif

camerabob=sin(camerabobangle)*10

position camera x,y+camerabob,z

That's basically the code you want, you'll have to fit that in around your existing code.

Once I was but the learner,
now, I am the Master.
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 1st Jul 2003 23:49 Edited at: 1st Jul 2003 23:50
I use DBpro so i can't play iced :-s .

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 10GB HD, Riva TNT2 Ultra 32mb
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 2nd Jul 2003 00:21
thnx mate

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 10GB HD, Riva TNT2 Ultra 32mb

Login to post a reply

Server time is: 2024-09-20 13:46:58
Your offset time is: 2024-09-20 13:46:58