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.

DarkBASIC Discussion / 3rd Person Jumping

Author
Message
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 4th Oct 2004 05:17
Hello. I am trying to do 3rd person jumping. Here is my code so far. Its has a crummy jumping system at the moment. Could any1 try and improve this?



I am currently working on : A Medievil style game
By the way I'm 13 years old!!
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 4th Oct 2004 11:38 Edited at: 4th Oct 2004 11:38
I normally use some form of a sin wave to control a 3rd person character while jumping. As the angle moves from 0 to 180 degrees the sin output goes from 0 to 1 to 0 and it's basically how the human jump pattern is like. You go from ground level into the air, you then slow down at the peak of your jump to a stop and then accelerate back down till you reach the ground again.

So if the player hits the jump button you can start incrementing a jump angle variable:

if spacekey() = 1 then start jump

if jump started
inc a#,speed#
if a# > 180.0 then a# = 0.0 and stop jumping
height# = sin(a#)*power#
position object x#,y#+height#,z#

speed# would determine how fast the jump is made and power# would determine how high the jump is made. If you understood all that then you should be able to implement it into your code.

Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 6th Oct 2004 02:54
Sorry i do not understand Sin,Cosine or your code.

I am currently working on : A Medievil style game
By the way I'm 13 years old!!

Login to post a reply

Server time is: 2025-05-24 17:04:33
Your offset time is: 2025-05-24 17:04:33