How to make a *Holding Button Trigger*.

Get help using Construct 2

Post » Tue Jul 01, 2014 3:35 pm

Hi there I am fairly new to construct 2 :), I have no background what so ever in coding or something similar. I am more an Animator/artist ;). This been said.

I am trying to Nail the CCC And I am still at the first C - Control.

I am making a Beat them up prototype. The movement, the attack are done, I put a combo achitechture as well.

What I would like to do is a other Button trigger in the equation.

exemple: Pressing X, Pressing X, Pressing X, holding X for 2 sec (onrelease) BOOM HIGH Punch something like that.

the thing I try to do is the; Holding * for * sec

I started with instance, if look at the picture above it obviously didnt work ._., I tryed other pattern without result.

In my head its king of clean, on X down every second you add 1, if on release you have 3 or more ONRELEASE is True. I just dont know how to go for it.

I tried to find as well a BusterGun mechanic(megaman) type in the tutorial without success. I found something on magicbar Ill try something from that.

PS. sorry for the bad english its not my mother tongue :).

Thank in advance for the help much appreciated.
You do not have the required permissions to view the files attached to this post.
Posts: 5
Reputation: 210

Post » Tue Jul 01, 2014 4:56 pm

Time = 2.0 seconds is not what you are looking for.

Create a new variable, called timePassed for example, while button X is down do
System > add to> timePassed > dt (dt is a system expression that means delta time, it holds the time passed between 2 frames)

then change the Time = 2.0 seconds to timePassed > 3 (if you want 3 seconds).

don't forget to reset timePassed.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
Posts: 272
Reputation: 1,643

Return to How do I....?

Who is online

Users browsing this forum: Sproadic and 6 guests