How do I make a timer in the HUD of my game?

Get help using Construct 2

Post » Sun Jun 29, 2014 8:27 pm

Hi, I'm very new to using construct 2 and I can't seem to figure out how to have a timer running in the HUD of my game which, on the player being destroyed, stops and shows the survival time of the player. If anyone could help me it would be much appreciated. I will upload what I have done if anyone wants to see it. Thanks.
B
3
Posts: 2
Reputation: 183

Post » Sun Jun 29, 2014 8:50 pm

You use 2 variables, one for minutes and one for seconds.
Every second you will add 1 to the second variable and when the second variable is 60 you will change it back to 0 and add 1 to the minute variable.

You will then put those variables in a text object using "Set Text" to variable_minutes & ":" & variable_seconds.

Everything I just mentioned will only work with a condition like "player is alive", so it stops working when the player has died.

Hopefully this helps you a bit in the right direction
B
6
S
1
Posts: 73
Reputation: 571

Post » Sun Jun 29, 2014 8:58 pm

Global variable = Timer
Text object

System - Every tic = Text - Set text to "Time:" & Global variable timer

System - Every 1 second - System - Add 1 to Timer global variable
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155


Return to How do I....?

Who is online

Users browsing this forum: AllanR, Artcadev and 15 guests