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.

Code Snippets / Gravity code..get your grav code here....

Author
Message
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 10th Jul 2003 17:18
I have made this gravity demo for DBPro, but u must ensure that the floor u have is an object-this is good since it lets u design ur floor the way u want it in the same prog u use to design ur objects. One prob though: notice that when u jump it isn't exactly smooth... maybe somebody will help to fix it...
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 10th Jul 2003 22:05
The jumping is fine, its smooth here

Well done.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
Redmotion
21
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 10th Jul 2003 22:30
Great - jumping is smooth on mine too.

Any chance of putting in like 5 moving plaforms to jump between?!



Dual athlon 2000 MP - 1GB ram
"It's the devils way now...There's no way out...You can scream and you can shout!
It is too late now..BECAUSE YOU HAVE NOT BEEN PLAYING ATTENTION.
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 11th Jul 2003 00:13 Edited at: 11th Jul 2003 01:00
No try holding down the space key and it seems that for a fraction of a second the cylinder goes a bit lower than the surface....doesn't this happen on your machines?

EVERYONE SEEMS EAGER TO DROP IN AND GET MY CODE BUT NOBODY CARES TO HELP ME SOLVE THE PROB! IT IS A PROB I TESTED IT ON OTHER PCs, SO WHETHER U REALISE IT OR NOT, THE CODE IS FAULTY!

Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 11th Jul 2003 00:30
it happens while the cylinder lands and touches the box...

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th Jul 2003 17:58
Quote: "EVERYONE SEEMS EAGER TO DROP IN AND GET MY CODE BUT NOBODY CARES TO HELP ME SOLVE THE PROB! IT IS A PROB I TESTED IT ON OTHER PCs, SO WHETHER U REALISE IT OR NOT, THE CODE IS FAULTY!"


I'm sorry but if we can't see the problem then we can't help you. Please don't get angry, it won't get you far on these forums. And no, we don't want to cash in on your code either.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 11th Jul 2003 18:19
It seems a little strange that you'd reset the gravity on every collision, why not try it without setting the gravity on the collision check, except when the Y collision check comes into play.

If you jumped at the side of a box, it'd stop in mid air for a second - maybe that's the problem. I don't have DB handy right now, so I can't check it properly for you.


Van-B

My cats breath smells of cat food.
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 12th Jul 2003 02:04
You need DBPro to see the prob...as the black thing hits the white 'ground', it seems for a fraction of a second that something weird happens-the black thing get repositioned, then goes back to where it is supposed to be...actually a guy who came to my house needed a few times to realise that what I said was actually happening...so u look at it carefully 2...remember it is DBPRO.

-john D.
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 12th Jul 2003 23:25
Van Bthanks for the idea though!

-john D.
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 12th Jul 2003 23:34
Van B is this what u meant:
if object collision(1,0)>0 and get object collision y()>0
dec posx#,get object collision x()
dec posy#,get object collision y()
dec posz#,get object collision z()
playergrav#=0.0

endif

because it doesn't work the cylinder falls...

-john D.
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 12th Jul 2003 23:35 Edited at: 12th Jul 2003 23:36
Woo-hoo! I tried this:
if object collision(1,0)>0 and get object collision y()<0
dec posx#,get object collision x()
dec posy#,get object collision y()
dec posz#,get object collision z()
playergrav#=0.0

endif
AND IT WORKED!!!!!!
still got the original prob though....

-john D.

Login to post a reply

Server time is: 2024-11-27 19:42:38
Your offset time is: 2024-11-27 19:42:38