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

Get help using Construct 2

Post » Mon Aug 31, 2015 10:15 am

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.
B
7
S
1
Posts: 29
Reputation: 514

Post » Mon Aug 31, 2015 12:45 pm

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 :D
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Mon Aug 31, 2015 12:59 pm

That makes sense. I'll try that when I get home. Thanks for the assist. It seems there is a nice helpful community here.
B
7
S
1
Posts: 29
Reputation: 514

Post » Mon Aug 31, 2015 1:06 pm

Another simple way would be

Image

This makes it work nicely when falling, and still only triggers if the jump is actually pulled off.
B
27
S
5
G
1
Posts: 62
Reputation: 2,367


Return to How do I....?

Who is online

Users browsing this forum: darkrealos, Rhindon and 26 guests