Argh! Stop the double jump!

MattVolletMattVollet Member Posts: 86
edited November -1 in Working with GS (Mac)
Alright. This is frustrating and I can't think of how I would go about a solution:

I am working on a platform game, and the character must be on the actor "ground" in order to jump. The problem is happening when the player is jumping up, sometimes the platform above him also has "ground" on it, so it causes him to double jump if the jump button is still held down.

My question: is there a way to have my character be able to jump when on "ground" but only if he has been on ground for.. say.. .2 seconds?

thanks!

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    What about making a separate ceiling actor that keeps the jumper from hitting the floor above?
  • MattVolletMattVollet Member Posts: 86
    It's more from like.... a stair step situation where the second step has a floor also, so when you his the side of the stair you are able to jump...

    so since both of the horizontal platforms you are able to jump from, if you jump and touch the top steps left side, it allows you to double jump and sends you flying into the air.

    It's kind of hard to explain, but it is a pain.
  • MattVolletMattVollet Member Posts: 86
    Actually.. is it possible to disable the jump button after you push it for .2 seconds?
  • quantumsheepquantumsheep Member Posts: 8,188
    Yes - try putting the 'jump' rules in a timer.

    For .2 seconds

    'jump'

    Hope that helps,

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • EastboundEastbound Member, BASIC Posts: 1,074
    Well if you are using a boolean to control if the actor can jump, you could simply set canJump to true when the actor collides with the ground AND his y position is greater than the grounds.
  • RickyRicky Member Posts: 58
    Eastbound said:
    Well if you are using a boolean to control if the actor can jump, you could simply set canJump to true when the actor collides with the ground AND his y position is greater than the grounds.

    How do you have a test to see if another actor has a y position less than the player!?! I am DYING to know. I have overcome a few problems, but this one I cannot detain.
Sign In or Register to comment.