How can I create a timer?

Get help using Construct 2

Post » Sat Jan 12, 2013 4:13 am

Hi! The scenario is like this. If the player cannot finish the game in the given time and the timer ticks to 0:00 the game will then appear a pop-up window telling him/her that he/she lose. Is it possible? Thanks!
B
8
Posts: 11
Reputation: 799

Post » Sat Jan 12, 2013 5:25 am

A.
countdown = time + X

if time > countdown
GAME OVER


B.
on game start(however everything starts
sub event:
-> WAIT 60 seconds
-> whatever game over stuff you have


A will give you options to modify the countdown timer.
B will end the game after the period time no matter what.
Time scale will affect both of these time results.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sat Jan 12, 2013 8:24 am

Let's say the player has 60 seconds to complete the game.

Create a Number type Global Variable and name it 'Timer' and set it equal to 60

Create events
1. System - Every 1.0 Seconds
      System - Subtract 1 from Timer
2. System - Timer <= 0
       (insert end results here)
B
2
Posts: 3
Reputation: 256

Post » Mon Jan 14, 2013 8:56 am

Thanks for the replies! How about displaying the timer in the actual game?
B
8
Posts: 11
Reputation: 799

Post » Mon Jan 14, 2013 9:00 am

This you should already know if you had gone through the beginner's guide for C2.

Every tick: set a Text text to your timer value.
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


Return to How do I....?

Who is online

Users browsing this forum: nimos100, Yahoo [Bot] and 23 guests