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 / What is better(get ground height_ or (gravity code)

Author
Message
Neotech
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 11th Jul 2005 04:06
Which would be a better use Get ground height, or gravity or is it a must you use both ive look for a gravity physic formula cause i would like it to be somewhat more realistic so the the jumping would be more realistic.
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 11th Jul 2005 05:50
Neotech,

In what area does get ground height and gravity compare to eachother? If using a matrix in your level, you must implement both to have the effect of falling and of a solid ground beneath the player.

To make a character jump , you need two variables. One for height and the other for negative/positive acceleration. When the user taps the "jump" key, maybe the spacebar for instance, then the acceleration variable should be set to some larger positive value. By adding the acceleration variable to the characters current postition, the character will move at an upwards motion, at the rate you set.

When the character is in "jump mode", within the air after pressing the jump key, so to say, the acceleration of the jump needs to decrease by gravity, eventually forming into a negative value.


+NanoBrain+
Cyril Grey
19
Years of Service
User Offline
Joined: 28th Jan 2005
Location:
Posted: 11th Jul 2005 14:25
I'm no expert, but you can check out my post in Code Snipits called RPG/RTS game frame with animated media (or something very close to that). In that post, I have a jump sequence that uses two variables as nanobrain stated. You could fiddle with the values to get the falling/lift effect you want. Then create a neat looking jump animation in your character and I think it would look nice. I'm not into physics (not that smart, perhaps ), but with some trial and error, I think you can get what you're looking for.

Have fun.

Cyril

With math all things are possible
Neotech
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 12th Jul 2005 00:53
Thanks cyril, im more looking for fps way of doing it but ill fiddle mabey ill come up with a way like you said but for the camera\character
Neotech
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 12th Jul 2005 01:07
Also the reason i was aking this question is when my player were to fall of of a building or what ever i want the character to fall to the 0 point of gravity( i think i said that right) to where he cant fall anymore and i just thought using get ground height when player falls there wont be a fall it will be him on building then him od ground no in between. i may be very wrong that just seems to be what would happen since there is no in between Y position.
y position on building then get ground height then on ground . no fall... i hope i explained this half ass alright

Login to post a reply

Server time is: 2024-09-23 23:22:31
Your offset time is: 2024-09-23 23:22:31