How do I - Make an action last for a specific time?

Get help using Construct 2

Post » Wed Mar 18, 2015 5:05 pm

Hi Everyone - I am trying to figure out how to use a timer. I set a player's opacity to 50, disabling collisions for this condition, but I would only like it to last 5 seconds. I am trying to use the timer behavior, and set the timer accordingly, but I can't seem to figure it out. Is there a simpler way to make any given action last for a particular time?

Thanks!
B
5
Posts: 11
Reputation: 249

Post » Wed Mar 18, 2015 5:51 pm

When you set the opacity to 50, also set a timer for 5 seconds. create another condition to check for the timer going off. In this condition, reset the opacity.

Image
B
31
S
6
G
3
Posts: 22
Reputation: 4,766

Post » Wed Mar 18, 2015 9:26 pm

Sounds like you are trying to do something similar to what I did in my space shooter (in my signature area). When my player dies he is invulnerable during the respawn period for a few seconds.

I ended up using a variable for vulnerable (yes/no) and a set opacity 0 (I used set visibility but same thing really), respawn player (who is set invulnearble but invisible), Wait 3 seconds, set player to visible and then variable to vulnerable. In my damage event I simply check whether player is vulnerable before allowing damage.

You could do something similar just using opacity instead.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
68
S
17
G
8
Posts: 637
Reputation: 9,420


Return to How do I....?

Who is online

Users browsing this forum: Apollo14, komalrajsingh and 31 guests