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 / jumping problem, what am I doing wrong?

Author
Message
Rico109
15
Years of Service
User Offline
Joined: 2nd Dec 2008
Location: none-of-your-beeswax!!!!! (lol)
Posted: 2nd Jan 2009 23:14
Ok, so I have the jumping, but when my guy jumps off the platform, he just stays in the air and moves like he normally would.

This is a sidescrolling game.

I know the problem (the jump code doesn't incorporate the platform object, just the y coordinates), I just don't know how to jix it without messing up my code!!!!!

here is my jump code:

the destroyer
15
Years of Service
User Offline
Joined: 24th Dec 2008
Location:
Posted: 3rd Jan 2009 21:17
I think you need to put a code e.g move object down
then you put that if the player is on the ground and presses the spacekey or whatever then he should jump and the move down command should move him down again ..
try it and tell me
the collision command is if object collision(1 object, 2object)=1
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 4th Jan 2009 00:04 Edited at: 4th Jan 2009 00:05
Quote: "I know the problem (the jump code doesn't incorporate the platform object, just the y coordinates), I just don't know how to jix it without messing up my code!!!!!"


I think what the destroyer said should work. Something like this:



Also, I'd like to point out that you are using float values for all your numbers, even the JUMP and JUMPING flags. This might be causing problems for you because float values often suffer accuracy errors (for example, if you store 1 in a float in might read 0.99997). I recommend that you make JUMP and JUMPING integers or booleans, this might fix your problem:



Login to post a reply

Server time is: 2024-09-28 00:28:53
Your offset time is: 2024-09-28 00:28:53