Double Tap Running?

Discussion and feedback on Construct 2

Post » Thu Nov 01, 2012 11:06 pm

Hi, I'm trying to have a character, where when you double tap the left arrow key, to change speeds and start to run. Can anyone help me out? I can't figure it out for the life of me.
B
3
Posts: 2
Reputation: 354

Post » Thu Nov 01, 2012 11:29 pm

You'll want to start a timer variable every time the left/right button is pressed. then, in the 'on key pressed' condition, compare that timer to some amount. If it's less, then increase the max speed until it's released, then reset the max speed and the timer variable.

You'll need a timer for each direction.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri Nov 02, 2012 12:28 pm

I posted this Example capx recently for a double tap jump.

It's similar to what sqiddster said, but it counted the number of taps in a time period rather than comparing time and had the unit jump instead of run.
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
27
S
7
G
4
Posts: 314
Reputation: 4,928

Post » Fri Nov 02, 2012 3:48 pm

This worked perfectly, thank you.
B
3
Posts: 2
Reputation: 354


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests