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 / Gravity Rule

Author
Message
Mucky Muck Ninja
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: im not entirely sure
Posted: 11th Nov 2003 17:19
Im having trouble getting my gravity rule to work. The problem, is not that I don't know how to do gravity, but my game is 2P and whichever player has the gravity rule after the other players code, he just falls through the ground. Hard to explain this.(this isn't my code its just and example, code is in source)
In this code, P2 would fall through the ground. If I put P2's code first, P1 would fall through the ground. How do I keep both of them on the ground without giving up on the gravity rule?

If fall=1 then P1Y#=P1Y#-5
If fall2=1 then P2Y#=P2Y#-5

Am I an Idiot...or is everyone else just really smart?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 12th Nov 2003 04:59
Put in:



Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Mucky Muck Ninja
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: im not entirely sure
Posted: 12th Nov 2003 06:57
still doesn't work. One player still always falls through the ground

Am I an Idiot...or is everyone else just really smart?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 12th Nov 2003 08:29
Change it to:


That should work, if not, there's somethign else wrong with your code somewhere else...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Mucky Muck Ninja
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: im not entirely sure
Posted: 13th Nov 2003 02:26
doesn't work

Am I an Idiot...or is everyone else just really smart?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 13th Nov 2003 08:34
Ok, if you don't mind, can i see the rest of your code to do with player positioning and jumping etc, so i can figure this out?

Thanks...

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 13th Nov 2003 10:58
Side note: Gravity doesn't move in 2 states (up & down) in the real world. It's parabolic:

psuedo-code:


Login to post a reply

Server time is: 2025-05-21 16:12:42
Your offset time is: 2025-05-21 16:12:42