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 / DBPro Jumping Error

Author
Message
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 21st Jul 2011 21:56
Hey guys,

I have some code here that I can't get the jumping factor to work.
Here is the part that deals with jumping:









I know that there is something wrong with:

Quote: "Global P1X# As String
Global P1Y# As String
Global P1Z# As String
Global A1X As String
Global A1Y As String
Global A1Z As String
Global P2X# As String
Global P2Y# As String
Global P2Z# As String "


But I'm not sure what. Is it the String?
Thanks for any help.


Cheers.

God help me, Please.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 22nd Jul 2011 00:28 Edited at: 22nd Jul 2011 00:29
Surely all those need to be floats, not strings?

>Edit<

To clarify...

float#=3.141
string$="Hello world"

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 22nd Jul 2011 01:26
Yes, I changed it after posting and tested it out but still nothing. I press space and nothing. Then I noticed that I never put position object X, P1X#, P1Y#, P1Z# and still nothing.

Here is the updated version:









Any ides why this isn't working?


Cheers.

God help me, Please.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Jul 2011 12:15 Edited at: 22nd Jul 2011 12:16
It confuses me why you have multiple code snippets which contain code that isn't in a function or a subroutine. So here is the version I'll be looking at all together in one nice big code snippet:



Now basically, jumping code works like this:



So I'm going to go ahead and modify your code to fit that jump example above:



I hope that helps, it's all untested, so there may be some minor errors.

TheComet

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 23rd Jul 2011 01:00
Well, here is what I now have:



This should work, but why isn't it?

When I press the space key, it goes up like a millimeter and then the controls are locked up.


Cheers.

God help me, Please.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Jul 2011 09:20
This should work. You will have to change the line player_is_colliding_with_the_ground=1 to something that actually does check if the player is colliding with the ground.



TheComet

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 24th Jul 2011 02:19
Thanks Comet.

How would I move while in the air since it constantly positions the player at it's position? I know that I could make the arrow keys change P1X# and stuff but, how do I know which way is forward, left, right, and back?


Cheers.

God help me, Please.
Webber
13
Years of Service
User Offline
Joined: 27th May 2011
Location:
Posted: 25th Jul 2011 07:32
This code works, I added some third person controls, a cube for the player, and a floor with some basic collision.
I might have changed to much, but its not a bad example of moving a character around, in third person.
And the player moves just fine in the air.
You might want to change the controls, depending on what kind of game your making.
Hope this helps.



I like games, and stuff.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Jul 2011 12:24
Nice Webber!

Lol, "makes the floor follow the player"... THERE IS NO ESCAPE!!

TheComet

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 29th Jul 2011 21:24
Thanks guys!


Cheers.

God help me, Please.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Aug 2011 17:02
Just to throw this in here as well, check out this here : http://forum.thegamecreators.com/?m=forum_view&t=187644&b=6

TheComet

Login to post a reply

Server time is: 2024-11-24 03:02:08
Your offset time is: 2024-11-24 03:02:08