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.

Author
Message
DB newbie
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 21st Feb 2006 03:32
ok fro my FPS i finally fund a code snippet for jumping in the code snippet section the problem is ther eis no limit on how high you can jump so if you keep pressing shift you go up,up,and away .

i want it so you only jump a little high. here is my code you can see were the jump thing is because it is marked with a rem. thank you



Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 21st Feb 2006 04:17 Edited at: 21st Feb 2006 04:18
try changing this

to something like


Pirates of Port Royale:
http://www.popr.gwgaming.net (Temporarily Disabled, We Apologize for the Inconvenience)
Live the life.
DB newbie
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 21st Feb 2006 04:33
what about gravity how do i mak eit so when i jump i come back down.

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 21st Feb 2006 05:01 Edited at: 21st Feb 2006 05:02
Take a look at http://www.RUCCUS.net/Tutorial.htm, click on Index and look up Jumping it has an example in there that might help you.

DB newbie
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 21st Feb 2006 05:09
is there a way to do it with the jumping code i have already?

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
DB newbie
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 22nd Feb 2006 03:19
can someone help me with this so i can put in gravity using the jumping code that i have.

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 22nd Feb 2006 03:34 Edited at: 22nd Feb 2006 03:34
Sorry, i don't really know how, you may have to restrict the height of the player by making it where if you jump to a certain height(like player height+x, so you could still go up on hills and mountains without being pushed down), it makes you go back down. One thing I don't get is where you got the "ch" variable in this

But I've seen some code snippets that deal with this, search the codebase, but I've never done anything with gravity myself.

Pirates of Port Royale:
http://www.popr.gwgaming.net (Temporarily Disabled, We Apologize for the Inconvenience)
Live the life.
DB newbie
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 22nd Feb 2006 03:51
ok

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 22nd Feb 2006 22:13
Everytime the user jumps, store their y position before there jump in a variable. Then, every loop that the user is in the air or jumping, do a check if their y position is equal to or greater than the previously stored variable + x, x being the maximum height you want the user to jump. If falso, keep jumping, if true, start moving down instead of up.

I might post an example in a few mins. might

DB newbie
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 23rd Feb 2006 02:11
ok i used ruccus code but my gun actually jumps because i am using a camera instead of a object.

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/

Login to post a reply

Server time is: 2024-09-24 17:42:11
Your offset time is: 2024-09-24 17:42:11