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.

Dark Physics & Dark A.I. & Dark Dynamix / good FPS controls (Gravity Need Help!)

Author
Message
sindore
20
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 23rd Jun 2008 18:14
I got a good working player control. except that the gravity is way off, can any one help me?

would like it if the player could fall at 9.8g, which is the speed at which ever object falls at.

here is the code


soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
sindore
20
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 26th Jun 2008 01:38
ok I just tryed a simpler character control, but I`m still having problems.

how can I make the player jump / fall?

here is the code


dose any one know how to sort out character controls? it is starting to get on my nerves.

I`m thinking that making the physic my self would be easyer.

I need help with this, if any one could help with ever of the posts on this thread please do so.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
cazub
16
Years of Service
User Offline
Joined: 29th Jul 2008
Location: here
Posted: 29th Jul 2008 14:17
Hey guys, its 4am so i only THINK i'm answering you. Um what i do is add a velocity to the objects y coordinate. If ya do this usually something simple like
//------------------------------------------
objectCoord( x , y , z);
velocity_Y = 0;

//in yur gameLoop
//onkeypress() for Jump
velocity_Y = 10;

//set the new coordinate for y
objectCoord( x , y + velocity_Y, z);

//adjust velocity for gravity
velocity_Y = velocity_Y - .8;

//END gameLoop
//-----------------------------------------

then i'd usually check to see if i have hit the ground or whatever (maybe collision detection with a plane?) , then i can choose to bounce or stop my velocity all together. The -.8 , will give ya a smooth jump up and down again.

hey doods

Login to post a reply

Server time is: 2024-11-24 23:45:50
Your offset time is: 2024-11-24 23:45:50