How do I Jump and Hold to Glide?

0 favourites
  • 4 posts
From the Asset Store
Includes 11min video guide. Hold an input button to "fill" up a text object and safely skip cutscenes without annoyances
  • Hi, I'm pretty new to Construct 2 and I am making a game where my character has wings and can glide. I need to be able to press the up button to jump, but if I hold it down the character glides for a few seconds until it lands on a platform/ground or collides with a trap and dies.

    How would I program the up button, preferably using the platform behavior (which is already implemented on my player), and what do I do to simulate a gliding motion? Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The platform behavior has a gravity setting. I would probably just do

    on up press, is falling: change animation to glide, set gravity to some lower value.

    On landed: set gavity to normal

  • Alright I have tried that but whenever I simply quickly press the up arrow button (which is supposed to make the player jump), the player simulates a glide instead, jumping higher than it is supposed to and gliding down.

    How do I make it so that the gravity change only occurs when I hold down the up arrow, not whenever I press it?

  • I suppose you could make an instance variable that increase while the up button is down. Change the gravity when the number is high enough. Then reset that value on key release.

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