Please help with a little game logic

LearnTheGameLearnTheGame Member Posts: 7
edited November -1 in Working with GS (Mac)
Hey everyone

Ok, the problem only exists when my player actor falls from a ledge without jumping off it first.

I want to press a key down and activate jump when overlapping with a platform and then be forced to release the jump key before i'm allowed to press it again to activate a jump.

I have an issue where if my player actor is moving and falls off a ledge and then i press and hold the jump key in mid air, he will jump immediately when coming in contact with the floor instead of waiting for a release of the key first.

Can anyone help me with this? I'll explain further if you need more details. Thanks for the help.

Comments

  • rlehmrlehm Member Posts: 320
    Change the rule from press to release.

    But, you probably have the floor check in your rules.. if floor is true, and up is pressed, self.motion.linear velocity.Y to to 600 or whatever your number is?

    maybe.. maybe.. in your rules, when you push up, to change attributes, add something like.

    When up is pressed, change attribute jump to true
    timer, 0.1 change attribute jump to false.

    this way they must press again to reactivate jump?
  • LearnTheGameLearnTheGame Member Posts: 7
    Well, the problem is only if my actor drops off a "ledge" without jumping off it first. Just walking to the right and letting the actor drop down. If I just drop down without jumping but then press and hold the jump key while I'm falling down to the platform below me, my actor will automatically jump once when he hits the ground. That's the only time there's any problem with the jumping. It's strictly when dropping from a higher point without jumping first.

    Is there a way to program a sequence of events? Like for instance, game.jump is true only if "jump key" is first up while touching platform, and then if "jump key" is down?

    I hope I'm making sense. Its this last little error that's stopping me from moving forward. Everything else control wise is great and I just wish I could fix this little problem and move on with my project. Anyone familiar with this particular issue?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    put the jump rules in a rule when the player collides with ground,so he cant activate a jump in air
  • LearnTheGameLearnTheGame Member Posts: 7
    Unfortunately its not that simple. I already have a rule for that. The problem isn't that the player jumps while in the air. The problem is that if he's dropping back down to a lower platform without jumping off the higher platform, and the jump key is pressed while dropping, then when he hits the ground he'll automatically jump once.

    Its only a problem when you "walk" off a ledge not "jump" off a ledge and then hold down jump key during free-fall.
  • LearnTheGameLearnTheGame Member Posts: 7
    Please anyone?

    Its this one last little thing that's holding me back. Surely someone here can help?
Sign In or Register to comment.