How do I Player Roll on Double Tap Key

Get help using Construct 2

Post » Fri May 06, 2016 6:11 pm

Ok, so this is what i have.

It is working as intended. However, i cannot find a good way to make a realistic looking roll. When setting the player_box.X+150 it looks more like a teleport, as it moves instantly to the location.

I tried playing around with setting the platform X Vector, but the doubletap variable does not stay long enough for anything to happen. Attempts to make the variable stay 1 or 2 for longer affect the normal left/ right controls.

Ive been messing with it for a while and feel a bit braindead atm. Any advice or pointers would be appreciated, thanks.
Posts: 104
Reputation: 1,033

Post » Fri May 06, 2016 7:09 pm

Maybe give the player object an instance boolean variable called Roll and use that to control the rolling? Like:

if Roll is true & every 0.1 seconds (not sure on the timing, try different things): set player_box.X to player_box.X + 1 (or however many pixels)
if doubletap = 1: set Roll to true, wait 1 second, set Roll to false

Then you may just need to adjust the normal left/right controls so they don't apply while Roll is true.

Coming soon on Steam!
Posts: 209
Reputation: 3,476

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests