📄 gametime.c
字号:
//*************************************************************************************************
//* *
//* ******************************游戏时间********************************** *
//* *
//*************************************************************************************************
#include "includes.h"
GAMETIME st_GameTime; //游戏时间全局变量。
//*************************************************************************************************
//* *
//* ******************************初始化时间显示****************************** *
//* *
//*************************************************************************************************
void vTimeInitialize()
{
st_GameTime.ucHour=0;
st_GameTime.ucMinute=0;
st_GameTime.ucSecond=0;
vShowGraph(TIMEPOS_ROW,TIMEPOS_LINE,40,2,uca_TIME);
vShowNumber(CAPS_TIME,TIMEPOS_ROW+1,TIMEPOS_LINE,st_GameTime.ucHour);
vShowCustomRow(TIMEPOS_ROW+2,TIMEPOS_LINE+10,3,uca_MAOHAO);
vShowNumber(CAPS_TIME,TIMEPOS_ROW+1,TIMEPOS_LINE+13,st_GameTime.ucMinute);
vShowCustomRow(TIMEPOS_ROW+2,TIMEPOS_LINE+23,3,uca_MAOHAO);
vShowNumber(CAPS_TIME,TIMEPOS_ROW+1,TIMEPOS_LINE+26,st_GameTime.ucSecond);
}
//*************************************************************************************************
//* *
//* ******************************游戏时间增加******************************** *
//* *
//*************************************************************************************************
void vTimeAdd()
{
if(st_GameTime.ucSecond<60)
st_GameTime.ucSecond++;
else
{
st_GameTime.ucSecond=0;
if(st_GameTime.ucMinute<60)
st_GameTime.ucMinute++;
else
{
st_GameTime.ucMinute=0;
st_GameTime.ucHour++;
}
}
vShowNumber(CAPS_TIME,TIMEPOS_ROW+1,TIMEPOS_LINE,st_GameTime.ucHour);
vShowNumber(CAPS_TIME,TIMEPOS_ROW+1,TIMEPOS_LINE+13,st_GameTime.ucMinute);
vShowNumber(CAPS_TIME,TIMEPOS_ROW+1,TIMEPOS_LINE+26,st_GameTime.ucSecond);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -