How do I create a cooldown or wait time for my dash?

Get help using Construct 2

Post » Sat May 14, 2016 8:22 pm

Hi, I have attached a screenshot that contains a sort of dash ability that I am using in my current game. At the moment the dash ability is spammable and I have been unable to find a solution to this. I would like to have a 1-2 second cooldown or wait time in between dashes. Any help is appreciated.
Image
B
8
S
3
Posts: 21
Reputation: 751

Post » Sat May 14, 2016 8:49 pm

Ok here I made a capx. file for you its simple

http://www29.zippyshare.com/v/NJHVaJYy/file.html

Controls= press spacebar to dash forward. Then it takes 4 seconds before you can dash again. Any questions just ask.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Sat May 14, 2016 8:52 pm

Thanks so much. I am away from my PC at the moment but I will let you know one way or another when I get back.
B
8
S
3
Posts: 21
Reputation: 751

Post » Sat May 14, 2016 9:02 pm

Image

Thats the code its real simple, as simple as I could make it. Don't worry have fun making games !!
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Sat May 14, 2016 9:04 pm

When global variable dasher is 1 , then you can dash. When you press button dasher becomes 0 , then you can't dash. You can use this simple concept to solve a lot of problems too. The else statement cuts down coding by a lot.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Sat May 14, 2016 11:27 pm

Hey, thanks for the examples. The dash mechanic I am using is a little different. Was wondering if there was a way to have a cooldown for the way I have it set up here: http://www94.zippyshare.com/v/yFV8moKL/file.html

Update: I got it figured out now thanks for your help.
B
8
S
3
Posts: 21
Reputation: 751


Return to How do I....?

Who is online

Users browsing this forum: Laura_D, rayolf and 25 guests