How do I Do Something If WASD is held down for some time?

Get help using Construct 2

Post » Sat Mar 26, 2016 9:24 pm

I always ask an excessive amount of questions and I'm sorry for that, I've been on here a lot lately. 8-) ;)
I'm making a retro game. I'm making it so if the player hold down W, A, S, or D down for a randomized amount of seconds (say like from 15-30), they have to battle a new enemy that comes up to you. How would I make it so that they do this? I'm still trying to figure it out... help :oops: . Thanks :D
Alright, I've been thinking. When life gives you lemons, don't make lemonade! Take the lemons back! GET MAD! I DON'T WANT YOUR DANG LEMONS WHAT AM I SUPPOSED TO DO WITH THESE?! Demand to see life's manager!! Do you know who I am!?!?! I'M THE MAN WHOS GONNA BURN YOUR HOUSE DOWN... WITH THE LEMONS
B
17
S
9
Posts: 157
Reputation: 2,150

Post » Sat Mar 26, 2016 10:17 pm

You can use a counter variable. This can let you keep track of how long your key has been down for.

Then use that counter as a condition for an event.

Image

This is the quick way, but the problem is the random(15,30) will give you a new random number every tick, so basically you will never get to 30. If you want, you can use another variable to store the target time once, and have the condition compare the two variables to run your spawn action instead.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,697
Reputation: 64,442

Post » Sun Mar 27, 2016 3:06 am

Thanks, that's very helpful :-)
Alright, I've been thinking. When life gives you lemons, don't make lemonade! Take the lemons back! GET MAD! I DON'T WANT YOUR DANG LEMONS WHAT AM I SUPPOSED TO DO WITH THESE?! Demand to see life's manager!! Do you know who I am!?!?! I'M THE MAN WHOS GONNA BURN YOUR HOUSE DOWN... WITH THE LEMONS
B
17
S
9
Posts: 157
Reputation: 2,150


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 43 guests