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 / fps movement code with jumping

Author
Message
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 17th Dec 2003 19:08
is there a really good example for this?
i havent seen any yet,and thats why i cant learn this dark basic.
guess there should be more tutorials around.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 17th Dec 2003 19:23
how come everyone else managed to learn it then?
jumping is basically going up and then going back down again its quite hard to do though and attempting a FPS while learning is quite a task, you'll find that as you learn more it'll seem obvious how to code an object to jump, so maybe continue to learn more basic things and come back to jumping later, otherwise checkout the code base, or search around the forums, there bound to be something


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 17th Dec 2003 19:50
well,that doesnt answer my question does it..
any examples?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Dec 2003 23:36
You go up, you come back down.

if spacekey()=1 and jump=0
jump = 1
force# = 10.0
endif

if jump=1
y #= y# + force#
force# = force# - 0.5
if force# = -10.0 then jump = 0
endif

position object 1, x#, y#, z#
Brandon Smith
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Urbana, Illinois (USA)
Posted: 18th Dec 2003 05:44
There's also some example code in the DarkBASIC help file. It's under sliding collisions I think. It gives code that incorporates jumping and gravity. But the jumping part is basically the same as what Phaelex wrote.

Brandon

Login to post a reply

Server time is: 2024-09-21 15:11:10
Your offset time is: 2024-09-21 15:11:10