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 / Gravity Physics for DBC

Author
Message
Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 9th Oct 2006 01:20
I've never made a 3D game that needed gravity(I know, kinda noobish) but now I'm working on one that does need gravity, so what is the best way to apply it? I know it has something to do with velocity, but I'm not exactly sure how it works.

Cocacola and Pepsi aren't that differnt. Deal with it.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Oct 2006 02:25
I think it was Latch who made something in Code Snippets you could check out. But very basically, you do this:

g#=1.0
v#=v#-g#
y#=y#+v#
position object obj,x#,y#,z#

Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 9th Oct 2006 03:26
Thanks for the help, I just checked out Latch's snippet, It's pretty cool but it's too bad there isn't a more detailed explanation on how the whole thing works.

Cocacola and Pepsi aren't that differnt. Deal with it.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 9th Oct 2006 19:59 Edited at: 9th Oct 2006 20:00
Here's a long snippet I made. It demonstrates simple gravity and a bounce . There is a small section in the loop marked IMPORTANT STUFF. It should have everything that you need to know. The rest is... well... just there.



Ummm...
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Oct 2006 05:19
@Gamedesigner

I included an explanation of the snippet code. Take a look, I hope this helps.

http://forum.thegamecreators.com/?m=forum_view&t=90648&b=6

Enjoy your day.

Login to post a reply

Server time is: 2024-09-25 09:39:37
Your offset time is: 2024-09-25 09:39:37