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.

DarkBASIC Discussion / Calculating a curve of a falling object

Author
Message
Mucky Muck Ninja
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: im not entirely sure
Posted: 26th Nov 2003 01:27
Okay, i need help finding out how to make an object(like a ball) curve through the air like it really would. And since i don't want to double post, my next question would be how to make a good gravity rule. Thanks for your time.

Am I an Idiot...or is everyone else just really smart?
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 26th Nov 2003 03:04 Edited at: 26th Nov 2003 03:09
i have the code, but for some reason, nothing will copy to the 'clipboard' from DarkEDIT!!! i have a really nice code

hah, there we go. but that wasnt from DBEdit, weird...
cant remember who made that for me...guess i should so i could put him in my credits, due to the fact that im revolving my whole engine around that little snipit. although iv changed it a lot!

edit:
alrighty then--Phaelax made that for the post here: http://darkbasic.thegamecreators.com/?m=forum_view&t=20153&b=10

=<=Pudgie Wars=>=
Game engine: 20% = Models: 25% = Textures: 1% = Sounds/Music: 0%
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Nov 2003 05:27
For gravity...



That won't give you the full effect of increasing gravity, but it's a start...

Just make sure that you DO NOT have:
Position Object obj,x#,Get Ground Height(1,x#,z#),z#
In your main loop.

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Night Giant
21
Years of Service
User Offline
Joined: 26th Jul 2003
Location:
Posted: 26th Nov 2003 05:38
for the acceleration of gravity just set a gravity variable(g) and a verticle speed variable(vy) as well as a variable to hold the initial verticle speed(vi) (which if you are dropping it is zero), and vy=vi+g*t where t is time fallen (easily done with timer()). and just position object x,x,y-vy,z. remember, if gravity is pulling the object downward, it is a negative number, even if it is cause the speed to increase (because the velocity is still decreasing).
Mucky Muck Ninja
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: im not entirely sure
Posted: 26th Nov 2003 06:55
thanks guys!

Am I an Idiot...or is everyone else just really smart?
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 26th Nov 2003 07:12
dont thank me, thank Phaelax and JessT and NG im just the delivery boy

=<=Pudgie Wars=>=
Game engine: 20% = Models: 25% = Textures: 1% = Sounds/Music: 0%
Phaelax
DBPro Master
22
Years of Service
Recently Online
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Nov 2003 09:45
You could check the code database for "Throw object". Someone asked this question about a week ago and I threw up a snippet. Get it? threw up the snippet? hahahaha, awwww i'm a loser.
Phaelax
DBPro Master
22
Years of Service
Recently Online
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Nov 2003 09:45
Or I could read the previous posts and see this was already answered.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 27th Nov 2003 20:01
lmao, i was thinking, "is he drunk or just to lazy to read?" j/k. but that was kinda funny

=<=Pudgie Wars=>=
Game engine: 20% = Models: 25% = Textures: 1% = Sounds/Music: 0% = www.geocities.com/bigapple_entertainment

Login to post a reply

Server time is: 2025-05-21 16:25:00
Your offset time is: 2025-05-21 16:25:00