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.

Dark GDK / FPS jump code problem

Author
Message
Ninjateck
16
Years of Service
User Offline
Joined: 27th Feb 2008
Location:
Posted: 12th Mar 2008 19:37
In my game there is a problem with the jump code
its like this



then



everything works fine except as long as you are pressing space you stay in the air
how could i fix this ??
Kurt
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location:
Posted: 12th Mar 2008 21:43
if(dbSpaceKey() > 0)
{
if(dbObjectPositionY(1) != 4.5)
{

dbPositionObject(1,dbObjectPositionX(1),dbObjectPositionY(1)+jumph ,dbObjectPositionZ(1));
jumpng = 1;
jump = 1;


}
}
Ninjateck
16
Years of Service
User Offline
Joined: 27th Feb 2008
Location:
Posted: 13th Mar 2008 14:11
That dosent work

http://ninjagms.wetpaint.com/
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 13th Mar 2008 23:34
You need to make a Flag that you are JUMPING or NOT (Or have a variable that shows up force, while gravity (each loop you you bring force a little more negative.)

If guy on ground, then you MAY check for a JUMP Button, but if guy in Air, forget checking if user hit jump - they are already airborne.

In your loop, if your UPFORCE>0 (going Up) then move guy up a little.

Each loop, (gravity) Take some off UPFORCE UNLESS Player at groundheight already. You're using floats, so no testing for exact numbers.

IF (PlayerY<=groundheight) then
PlayerY=GroundHeight
else
UPFORCE = UPFORCE - 0.01;
endif

Remember - you're in a loop! Think like you're in a loop!

Also - your in a MMORPG - and this is the puzzle you need to conquer to advance to the next level toward fame, fortune and glory! NAME OF GAME: LIFE - Costs Nothing To Enter - Costs Everything to Leave!

Seriously - Give this a good think and good go of it.... Games are animated - you need to think in "One Frame at a time" until you start learning the logic that works versus why "broke stuff" has bad logic. Give this 4 hours before posting again... and then post the code you have - and I might ed-ja-ma-cate you

No Effort - No Helpy! I KNOW YOU can do this!!!!!

F0mka
16
Years of Service
User Offline
Joined: 14th Mar 2008
Location:
Posted: 14th Mar 2008 17:48
Hi all!
Guys, can i use dbBSPCollisionY to create a gravity function?
I use BSP map =)

i have some ideas, but i think that wrong


Object sometimes fast jump up and down. And have bad reaction on ladders...

Or i need to make a flag that i'm on a flor or not?

Login to post a reply

Server time is: 2024-09-29 15:26:49
Your offset time is: 2024-09-29 15:26:49