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
Veler
16
Years of Service
User Offline
Joined: 14th Jan 2008
Location: Boulogne Billancourt(92100)(France)
Posted: 20th Jan 2008 10:25
Good day to all,

I am beginning, I use the code of démo of Dark Physic to have a game FPS.
I would want there to add a code allowing jumping. But I have beautiful tried a lot of thing, it not anything that walks.

Can you help me?

Thank you for advances

To

VELER SOFTWARE = http://www.velersoftware.fr.nf

SOFTWARE CREATOR 2008 !!!
Tri Alliance
19
Years of Service
User Offline
Joined: 2nd Mar 2005
Location:
Posted: 17th Feb 2008 00:49
I don't think you need DarkPhysics for jumping, because that's mainly for dynamic animations, like the ragdolls, along with gravity. It's great that you have DarkPhysics, but I will try to help you in a way that only uses DarkBasicPro, which I'm guessing you might have.

Here is my code to make objects jump (Sorry I couldn't figure out how to rotate the camera so you could see the jumping from the side view)(Just copy and paste) - press the spacebar on your keyboard to make the cube jump:


Set window on:Set Window Size 800,600:Set window Layout 1,1,0
Set Window title "":Sync On:sync rate 30:Sync

Global ground as integer = 1
Global player as integer = 2
Global Jump_Height as float = 1.5

Make Object Plain ground,5,5
Rotate object ground,10,0,0

Make Object cube player,1

Position Camera 0,0,-10
Rotate Camera 0,0,0

Do
Position Object ground,0,-1,0
Color Object ground,RGB(0,255,0)

Color Object player,RGB(0,100,100)
Jump()
GoDown()
If Escapekey()=1
End
endIf
Sync
loop

function Jump()
If SpaceKey()=1
Point Object player,0,0,-1
Move Object player,Jump_Height
Set Global Collision On
Calculate automatic Collision
Sync
EndIf
EndFunction

Function GoDown()
If JumpHeight = 1.5
Point Object player,0,0,1
Move Object player,Jump_Height
EndIf
EndFunction
Veler
16
Years of Service
User Offline
Joined: 14th Jan 2008
Location: Boulogne Billancourt(92100)(France)
Posted: 17th Feb 2008 12:19
Hi,

I tried your code. It works well. But are that the mixture fact the physics of Dark Physic and the collisions of DBPro would bother the game? And also, good, I will modify your code for that the cube jump progressively (and not of a blows)

Thank you

VELER SOFTWARE = http://www.velersoftware.fr.nf
SOFTWARE CREATOR 2008 !!!
OS Info XP
Veler
16
Years of Service
User Offline
Joined: 14th Jan 2008
Location: Boulogne Billancourt(92100)(France)
Posted: 24th Feb 2008 10:55
up!

VELER SOFTWARE = http://www.velersoftware.fr.nf
SOFTWARE CREATOR 2008 !!!
OS Info XP
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Feb 2008 14:57
Many people combine the collision tools in Sparky's DLL with the DarkPhysics to have a "Mixed" mode if that is a good description - where creative coding and alot of triel and error allow you to get a result with the best of both worlds.

culmor30
16
Years of Service
User Offline
Joined: 16th Jun 2007
Location: In my head.
Posted: 27th Feb 2008 01:15
Yeah, using Sparky's is nice as it USUALLY does not conflict with the Physics engine. I mean, it might, but it never has for me. I handle my collisions with walls with sparky's, and use DP for the rest. Not the character controller though, hate that thing.
jeffhuys
17
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 27th Feb 2008 12:01
There is some heavy translator engine workin'!
But we understand!


You're the 'th to view this signature!
sindore
19
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 11th Mar 2008 02:14
Ok I know that this is not what you are torquing about but I fort I would post it anyway,

its a bit old, and I have not done anything to it for about 5 years,
but it should be ok, it doesn't have any dark physics in it, but dose have a primitive gravity, and floor force.



hope it is of some uses to some one.

From the dark and in to the light, twisted the body of madness, dark souls to only the one who would be called, Death lord of the dead, king of the forgotten, keep of lost souls.

Login to post a reply

Server time is: 2024-05-20 00:12:31
Your offset time is: 2024-05-20 00:12:31