|

楼主 |
发表于 2011-8-11 10:19:00
|
显示全部楼层
Re:继上一个问题,如何实现自己的游戏时间系统?
这是我想设定的时间分段结构体:
struct CLightCycleDesc{
float RealDayLength; // real length of the day(seconds)
float NumHours; //number of game hours in a day
float NightTransitionStartHour; //start of night transition
float NightTransitionEndHour; //End of night transition
float DuskRatio; //ratio for dusk transition. e.g. when set to 0.5f, that means that the dusk colors are taken when the day->night transition is at its half
float DawnTransitionStartHour; //start of day transition
float DawnTransitionEndHour; //end of day transition
uint MaxNumColorSteps; //the max number of color steps
同时,我的状态划分为:enum TLightState{Day = 0, Night, DayToNight, NightToDay, StateUnknown};
我想设定的结构体参数分别为:300,24,19,21,5,7,128 也就是现实5分钟=游戏中一天。。我应该怎么来写这个时间系统呢?
|
|