Countdown example

Show us your completed creations made in Construct 2

Post » Sun Nov 13, 2011 2:05 pm

Per request, this is an example capx showing how you can do countdowns with text (the 3... 2... 1.. GO! thing).

countdown_example.capx

Of course there are many possible ways to achieve this, this is just a quick example using a private variable as a timer.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Dec 20, 2011 2:31 pm

there more simple way to create timer, only in two lines of events

timer
B
3
G
1
Posts: 7
Reputation: 669

Post » Wed Dec 21, 2011 6:38 pm

thank you guys 4 sharing !! time will come that i`ll give something back to this fantastic community !
B
17
S
3
G
5
Posts: 71
Reputation: 4,401

Post » Fri Dec 23, 2011 10:13 am

this is nice, it should be on the FAQ of the How Do I to help others :)
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Post » Fri Dec 23, 2011 11:15 am

It is already since it was posted.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Wed May 16, 2012 8:56 pm

Hello!

Is there a way to make a realtime countdown? like, I want my game to last 2:00 minutes and make it countdown 1:59, 1:58 . . .

Thanks!!
B
4
S
1
Posts: 22
Reputation: 671

Post » Thu May 17, 2012 7:28 am

Sure, that'd be 120 seconds to substract 1 from every second. You can even make the countdown flash, turn red or whatever by comparing remaining seconds (such as countdown < 30). And when it hits zero, the game events are stopped (countdown is < 0). In fact, you can make it so game events are only run when countdown is above 0 seconds (make it the first condition).Mipey2012-05-17 07:29:07
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu May 17, 2012 4:27 pm

Yes, I understand. I was referring to the countdown format, let's say I want my game to last 10 minutes (10:00) then I want it to be displayed as 10:00 not a 600 seconds countdown. Is better explained now jeje?
B
4
S
1
Posts: 22
Reputation: 671

Post » Fri May 18, 2012 6:10 am

Use math expressions, such as % (which is modulo):

text.Text = 'Mission time: ' & floor(variable/60) & ':' & variable%60

I haven't checked, but this should display minutes and seconds.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue May 22, 2012 11:49 pm

I havent tried yet, but thank you very much for the answer :)

[EDIT]: I tried now and it works perfect!!! THANKS :D!!Ga2Z2012-05-23 01:01:11
B
4
S
1
Posts: 22
Reputation: 671

Next

Return to Completed Creations

Who is online

Users browsing this forum: Swivels and 4 guests