How do I do a charge jump?

Get help using Construct 2

Post » Wed Jan 25, 2017 1:15 am

Hey guys,
This will probably be difficult to answer without a capx file but Ill give it a try anyways.
I ve been trying to figure out the logic to do a character do a charge before doing a power jump.
I managed to change the total jump height and manage the different states so animations are different in between normal falling and falling after power jumping etc.

Now, the only missing part is the charge before jumping. whatever I try is just not working.

Is there a proper way to go with this?

Thanks in advance.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Wed Jan 25, 2017 2:16 am

What exactly is a charge jump?

Never mind now that I read Chris post below I know what a charge jump is referring to and looks like he covered it.
Last edited by lamar on Wed Jan 25, 2017 2:28 am, edited 1 time in total.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Wed Jan 25, 2017 2:21 am

I would use a variable that I incremented when the charging was triggered via whatever method/keypress and a condition that allowed the powered jump whenever the value was greater or equal to charged. Unless you want the charging to scale up and it's strength determined by its value.. in this case, I would increment the charge variable until the jump trigger (or button release) and set jump strength based on its current value on release. After either charge is reset to 0.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
65
S
17
G
8
Posts: 635
Reputation: 9,331

Post » Wed Jan 25, 2017 3:49 am

How about making the input for your charged jump Down + Jump ?
So you can change regular jump input to 'On Jump Pressed && Down not pressed'

EDIT:
More suggestions:

'On Jump Pressed && Down Pressed' | Player start timer 'ChargedJump'

'On Jump not Pressed or Down not Pressed' | Player stop timer 'ChargedJump'

On Timer 'ChargedJump' | Jump
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Wed Jan 25, 2017 11:56 pm

Thanks guys for your suggestions. The problem is at follows:

When I press the input to start charging, I need to play an animation. So technically after that animation is completed the jump would follow.
But is not working as intended.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Thu Jan 26, 2017 12:22 am

Actually I figured out a way to do it. But thanks guys for your suggestions ! :)
B
43
S
12
G
14
Posts: 488
Reputation: 10,570


Return to How do I....?

Who is online

Users browsing this forum: Rudi55 and 5 guests