Basically, I want to have a timer in the HUD which shows the current playtime for a particular stage in minutes (play Sonic and you'll know what I mean xD)
How do I go about this? Thanks!
textNumber=round((float)frame/1800);
int tmin,tsec;
sprintf(text,"%d:%d",tmin,tsec);
int tmin,tsec;
tmin=(float)frame/1800;//1800=30*60, 30 being the fps
tsec=(int)((float)frame/30)%60;//30 being the fps
sprintf(text, "%d:%02d",tmin,tsec);
int tmin,tsec;
tmin=(float)time/1800;//1800=30*60, 30 being the fps
tsec=(int)((float)time/30)%60;//30 being the fps
sprintf(text, "%d:%02d",tmin,tsec);
time++;//Increase the time manually
time=0;
long unsigned int time;
Users browsing this forum: No registered users and 1 guest