Condition trigger time

Get help using Construct 2

Post » Tue Jun 27, 2017 3:00 pm

I want to add a feature to my game where you have to hold the escape button for a while to exit the game. Kind of just like in Undertale. But i don't know how to make the action (close the game) only happen when i pressed the button for a certain time.
Can i get some help on this?
Posts: 2
Reputation: 179

Post » Tue Jun 27, 2017 3:16 pm

You can increment a variable every 0.2 sec by 1, and lets say when it gets to 10 close the game.
You will need 2 events

on key being held down esc,every 0.2 sec, add 1 to timer
timer == 10 -> close game or what you plan to do

This will exit the game after 2 sec holding the button, also if lets say player stops holding the button before it gets to 10 you have to reset it to 0, you can do this by inverting the event and changing the action to set timer 0.
Like my work? Fallow me on social media, and see my games on the arcade.
Posts: 298
Reputation: 5,377

Post » Tue Jun 27, 2017 3:46 pm

Thx it worked!!!
Posts: 2
Reputation: 179

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests