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 / Adding jumping and Gravity...

Author
Message
Jaydon52
17
Years of Service
User Offline
Joined: 4th Dec 2008
Location:
Posted: 27th May 2009 04:21
Hi Everyone,

I am having some trouble adding jumping and gravity to the game i am making. I am using RUCCUS's sliding collision script(with sparky's dll), I have a cube and a map (.x)

Collisions work okay but i need gravity and jumping. I have tried some ideas given on other posts but none of them seem to work with what I have.

I have attached the map and here what i have so far:


If someone has any ideas on a way to add jumping and/or gravity that would be a big help.

Also, I had to make the cube quite small because when i try to make the map larger using the scale object command, collisions stop working. Any ideas on that would be much appreciated.
Erk
18
Years of Service
User Offline
Joined: 26th Feb 2008
Location:
Posted: 27th May 2009 06:41 Edited at: 27th May 2009 07:06
From my various Java games, I have one implementation.



Conceptually, that'll work perfectly without any overbearing physics libraries.
Tweak as needed. Ask if you need help!
bobbel
17
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 27th May 2009 08:33
thats a good example, but one tip: if the user is falling really fast and you jump, he's not gonna jump up. so you might want (if you want the ability to jump in mid-air) to change this
Momentum = Momentum + JUMP_STRENGTH
to this
MOMENTUM = JUMP_STRENGTH

Jaydon52
17
Years of Service
User Offline
Joined: 4th Dec 2008
Location:
Posted: 27th May 2009 11:02
Erk, I need HELP!

I've got no idea how to add this in.
I tried, but failed hopelessly. Any more info on how to add this in would be great.

Thanks also to bobbel for your input!
Jaydon52
17
Years of Service
User Offline
Joined: 4th Dec 2008
Location:
Posted: 29th May 2009 03:14
Anyone else have any ideas???
the destroyer
17
Years of Service
User Offline
Joined: 24th Dec 2008
Location:
Posted: 31st May 2009 01:18
yes, place this in the main loop


hope it helps

Login to post a reply

Server time is: 2026-07-23 07:33:38
Your offset time is: 2026-07-23 07:33:38