Possible Jumping Solution

scitunesscitunes Member, Sous Chef Posts: 4,047
edited November -1 in Working with GS (Mac)
I have driven myself crazy trying to create a platform game with a player that jumps every time I press the spacebar but doesn't jump in mid air (in other words, doesn't fly). For some reason creating two rules with a accelerate up in the section under the rules doesn't work:

space bar down AND overlapping platform

This worked about 80% of the time and I have no clue why it failed the other 20%.

Here's what has been working 100% of the time so far:

1) Create a game boolean attribute (I called it jump) check that it is true
2) Create a rule that says when player collides with platform change jump attribute to true (1)
3) In your jump rule (make sure it is set to ALL):
-spacebar down (or whatever you are using for the jump key)
-game.jump = 1

-timer (longer the time higher the jump)
-accelerate (90degrees, experiment with speed to your liking)
-THIS IS KEY - change jump attribute to 0

This will make it so that when you leave the ground you cannot jump again until you collide with a platform. As soon as you leave the platform the boolean attribute is set to false (0) and you are then unable to jump again until you land (collide with ground).

So far this has been 100% consistent (I am probably jinxing myself right now!)

I know others have reported having jump issues. Hopefully this helps. I'll sleep better tonight!

Comments

Sign In or Register to comment.