A simple jumping problem.

0 favourites
  • 10 posts
From the Asset Store
Jump on candies, collect candies and earn score!!!
  • I'm creating a custom movement system for a platforming character.

    This is the Jumping.

    The problem is that when I hold down the space bar, the Player rises into the air, not falling until the spacebar is released.

    What I want to happen is for the player to do one jump per each press of the spacebar, no matter how long it is held down.

    I can't see why it doesn't do that with this piece of code...

    When the spacebar is pressed it sets Jumping to true, which should prevent the velocity from increasing until the spacebar is released and jumping is set to false again. But it doesn't do that. The player just keeps on rising into the air.

    Pls help.

    <img src="http://imgur.com/X0Mz62G.jpg" border="0" />

  • Use Space pressed instead of Space is down.

  • That was my thought too, but it doesn't make any difference. I can find no difference between the two functions.

  • Try putting your other conditions together with the condition on space key is pressed instead of using them as a sub condition.

  • Try putting your other conditions together with the condition on space key is pressed instead of using them as a sub condition.

    Thanks, but sadly this makes no difference to anything at all.

    <img src="http://i.imgur.com/gjLpT2D.jpg" border="0" />

  • You are over thinking your custom jumping. Your desired effect can be achieved in two or three events.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You are over thinking your custom jumping. Your desired effect can be achieved in two or three events.

    The reason I have set it up like this is so that the attributes of the jump can be modified as the player collects powerups.

    However if you've got an easier way, please, tell me more!

  • Try changing from (on key pressed) back to (space is down), but now add a (trigger once) condition together with them.

  • Try changing from (on key pressed) back to (space is down), but now add a (trigger once) condition together with them.

    Already tried that I'm afraid to say, it also makes no difference at all.

  • Make a boolean switch to activate the event only once.

    Setup a flag and add a check for it together with your Space is pressed/ Space is down event, then activate the flag inside this event. Then when your player touches the ground reactivate the flag.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)