Programming: how to make a countdown

Status
Not open for further replies.

GolRouge D

Estimable
Jul 26, 2015
2
0
4,510
0
so ive been doing some school related stuff , and in some parts i need a countdown timer in my game. I ve been coding in code blocks. . so how do or how can i code a countdown timer for my game
 

kanewolf

Splendid
Moderator
Usually the language you are using has a timer available. You set it up to asynchronously notifiy you when the timer expires. If something happens in your game that should reset the timer, you cancel it and start a new timer when needed. If you get the timer interrupt, then you take appropriate steps.
 

GolRouge D

Estimable
Jul 26, 2015
2
0
4,510
0


i dont meant to be annoying
but what I mean is. for example in my game. theres a question that need to be answer in 30 seconds. if you fail to answer in given time , the other player will have the chance to answer.
 

kanewolf

Splendid
Moderator


And that is EXACTLY what I answered. You will need to find a timer function in the language you are using. It should have the capability to send you an interrupt when the timer goes off (30 second). If you get that interrupt BEFORE you get an answer then you execute the code to switch the option to the other player. If you get a response you process that response.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
D Apps General Discussion 1
BlueMoon1890 Apps General Discussion 0
Neon The (Anthro) Umbreon Apps General Discussion 1
K Apps General Discussion 2
T Apps General Discussion 10
M Apps General Discussion 2
R Apps General Discussion 3
S Apps General Discussion 2
N Apps General Discussion 1
P Apps General Discussion 4
A Apps General Discussion 8
M Apps General Discussion 6
S Apps General Discussion 1
C Apps General Discussion 5
H Apps General Discussion 3
A Apps General Discussion 1
U Apps General Discussion 1
F Apps General Discussion 3
F Apps General Discussion 7
S Apps General Discussion 4

ASK THE COMMUNITY