Jump to content

  • Log In with Google      Sign In   
  • Create Account

SDL2 Countdown Timer

  • You cannot reply to this topic
2 replies to this topic

#1   Members   

106
Like
1Likes
Like

Posted Today, 11:41 AM

Does anyone know how to create a countdown timer in SDL. I know that you can access the amount of time the program has been running with SDL_GetTicks(). Although I don't know how to use it in order to make a countdown timer.

 

Say, I am making a game where timing is important. You need to click the right button in time in order to proceed/win. 

 

I could't really find the answer anywhere, so I posted a topic here.



#2   Members   

7670
Like
0Likes
Like

Posted Today, 12:02 PM

Suppose you use that function now, and you store the value that it returns, let's say in variable A.

Suppose you use that function some time later, and you store the value it returns, let's say in variable B.

So, A is a point in time, and B is a point in time but some time later.

What is B - A then?


Edited by Alberth, Today, 12:03 PM.


#3   Members   

106
Like
0Likes
Like

Posted Today, 03:32 PM

Suppose you use that function now, and you store the value that it returns, let's say in variable A.

Suppose you use that function some time later, and you store the value it returns, let's say in variable B.

So, A is a point in time, and B is a point in time but some time later.

What is B - A then?

Haha lol, thanks anyways :D