How do I change the animation in double jump

Get help using Construct 2

Post » Mon Jul 13, 2015 8:12 pm

Hello in my game my player can double jump
in the first jump i have an animation
but when get the double jump how i can change the animation??
B
7
Posts: 21
Reputation: 311

Post » Mon Jul 13, 2015 8:21 pm

via a STATE which can be represented as a variable,

Player press jump key statevar jumped = true

if jumped = true
player press jump key statevar doublejumped = true
if double jumped and animation = jumpedone
do doublejump animation change
B
4
Posts: 33
Reputation: 266

Post » Tue Jul 14, 2015 2:12 pm

is there another form?
B
7
Posts: 21
Reputation: 311

Post » Tue Jul 14, 2015 2:46 pm

minotauro31 wrote:is there another form?


Ofcourse there is, but all of them are similar to the solution above..
Construct 2 doesn't have a condition "is double-jumping" so you would have to create a way to check for it yourself..
This is done by using (instance) variables, setting them at the right time and checking them in a condition to verify the player "is double-jumping"
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 14, 2015 8:42 pm

minotauro31 wrote:is there another form?


Well, None that I can see. As you now know, variables are the only way to hold any kind of state you want in your game/application. So regardless of how you do it, you're going to need to push a value to some kind of variable (whether a local, or object variable) and then retrieve it. I mean you could try to use an array and have states tied to a spot in an array and cycle through them when you press the key twice within a certain amount of time or from a certain time and spot in your array but to pass the array value your going to need, yet again, another variable. This way was most direct that I can think of. Perhaps you can make it simple.
B
4
Posts: 33
Reputation: 266

Post » Tue Jul 14, 2015 8:56 pm

You might actually pull it of with:

keyboard on pressed up arrow
player is not on floor
> set animation to doublejump
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: MadSpy and 3 guests