How do I make a separate animation for a double jump?

0 favourites
  • 4 posts
From the Asset Store
Ninja char for your game! Make your own Shinobi game with this art.
  • Hi, I'm very new to this, in fact I'm now losing my posting virginity on this forum.

    Apologies if this has been asked before, but i couldn't find it. Anyway... what I'm aiming to do is have an attack activated on a double jump and use a separate animation from main jump.

    I'm assuming having an invisible box for damage to activate as needed, but I can't even get the animation to activate.

    Thanks in advance.

  • Hi friend. The idea of having a second animation for the double jump is really interesting.

    Unfortunately, even though the Platform behavior can enable a double jump without a sequence of events, there's no function to check with the player is on his second jump or at the first one.

    So what I suggest for you to try is this, create a variable to determine how many time the player have pressed the jump button and set its value to zero.

    Then create a Keyboard object at you game layout, and then back to the event sheet, create a event trigger "On key pressed" and select the key the player is using to jump, the default key is the up arrow.

    In this function set it to add 1 to the value of your variable. This means every time the player press the jump button the value of you variable will increase.

    Then set a condition using "system" and "compare two values", to check if the value of your value is equal or higher than 2. And as event to that set the player animation to the double jump one.

    Remember to set the value of your variable to 0 every time the player lands on the floor, and if you are using a "player is jumping" to trigger you animation, use a sub-event (press S). That would be a condition like this, if the player is jumping > goes to sub events. Variable = 1 > do jumping animation, Variable >= 2 double jump animation.

    I'm not quite sure if there's a better way to do it or if there are any plugins for that, but I would do it like this.

    Hope I could help

  • That makes sense. I'll try that when I get home. Thanks for the assist. It seems there is a nice helpful community here.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Another simple way would be

    This makes it work nicely when falling, and still only triggers if the jump is actually pulled off.

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