Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Implementing a standard Timer function

$
0
0

Hey guys, I'm wondering why the heck I'm unable to simply use one timer function in my game. Instead, I have to create copies of the exact same function over and over again in order for the time to sync or work at all.

 

I've created the function in a simple class(I made the class so that I didn't have to have 1000 timer functions):

 

asdf

class Timer
{
public:
bool WaitMilliSeconds(long int seconds) //Now THIS is how you do a fucking timer
{
 static unsigned long secondsPassed;
 static unsigned long startTime = GetTickCount();
 static …

Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>