- 'showTime()' Function
void showTime(void)
{
int newTime = time(NULL);
int diff = newTime - curTime;
point curPos;
if (sec < diff)
{
curPos = GetCurrentCursorPos();
sec = diff;
if (sec == 30 && !timeBlocking)
{
gameLevelUp();
timeBlocking = 1;
}
else if (sec == 60 && !timeBlocking)
{
curTime = time(NULL);
min++;
sec = 0;
gameLevelUp();
timeBlocking = 1;
}
else if(sec==31 || sec == 0)
timeBlocking = 0;
SetCurrentCursorPos(32, 10);
printf(" %02d : %02d ", min, sec);
SetCurrentCursorPos(curPos.x, curPos.y);
}
}
---------------------------------------------------------------------------------
- add 'time.h' header file
- Whenever Time is flowing, Game Progress quicken once every 30s
Source Download (Github Repository)
댓글 없음:
댓글 쓰기