Advertisement

Wait type function.

Started by August 14, 2001 10:15 PM
1 comment, last by Ghost Face Killa 23 years, 6 months ago
Ok, I''m working on a 3d engine. I want to implement a jump button. So I figure I will need the GLtranslatef. My brain isn''t really working properly right now , so I have a problem. I need the translatef to go up when m is pressed. then go down like .5 seconds l8r. I''m not really sure how i''m going to do this timing. Could someone please help. Thanks. P.S. maybe even some other function would be better. -------------------------- |FuK| Ghost Face Killa You Got Fucked By Fuk! --------------------------
--------------------------|FuK| Ghost Face KillaYou Got Fucked By Fuk!--------------------------
i used a constant gravity. it moves player down if no collision
it will continue the next run though.(-0.5f)

Now, if you jump. add like 5 times the gravity drop(jumpup=2.5f).
then reduce the jumpup after the add(jumpup-=0.5f). continue the loop until jump is 0.0f then stop adding and let gravity pull down.

Later
Game Core
Advertisement
The best way (er rather, most realistic way) is to use kinematics and physics. Have a constant acceleration (-9.8 m/s^2), have an initial velocity, and then use the velocities up/downward to calculate your positions.

~ Dragonus

This topic is closed to new replies.

Advertisement