コード例 #1
0
ファイル: Clock.cpp プロジェクト: hirasawak1/kotonarinojikan
void Clock::Update()
{
	switch(state)
	{
	case TimeObj::SUCCESS:
		SuccessCnt--;
		if (SuccessCnt < 0)SuccessCnt = 0;
		if (!Gold_Effect){
			Update_Time();
			minuteAngle = 0;
			hourAngle = 0;
			break;
		}
		case TimeObj::MOVE:
			switch(behavior)
			{
				case Behavior::SMOOTH:
					Update_Smooth();
					break;
				case Behavior::STEPING:
					Update_Steping();
					break;
				default:
					break;
			}
			break;
		case TimeObj::STOP:
			timeCount = frameCount = 0;
			// 分単位の角度+秒単位の角度
			minuteAngle = (timeCount % MPH * ANGLE_1MINUTE) + (frameCount*(ANGLE_1MINUTE / (FPS / abs(speed))));
			// 時間単位+分単位+秒単位
			hourAngle = (timeCount / MPH * ANGLE_1HOUR) + (timeCount %MPH * (ANGLE_1HOUR / MPH)) + (frameCount*(ANGLE_1HOUR / MPH / (FPS / abs(speed))));
			break;
		case TimeObj::CHECK:
			Update_Check();
			break;
		default:
			break;
	}
}
コード例 #2
0
//	更新
void Candle::Update(void)
{
	switch (state)
	{
	case TimeObj::SUCCESS:
		SuccessCnt--;
		if (SuccessCnt < 0)SuccessCnt = 0;
		if (!Gold_Effect){
			Update_Time();
			fire_state = false;
			break;
		}
	case TimeObj::MOVE:
		fire_state = true;
		switch (behavior)
		{
		case Behavior::SMALL:
			Update_Melt_Small();
			break;
		case Behavior::BIG:
			Update_Melt_Big();
			break;
		default:

			break;
		}
		break;
	case TimeObj::STOP:
		timeCount = frameCount = 0;
		melt = 0.0f;
		break;
	case TimeObj::CHECK:
		Update_Check();
		break;
	default:
		break;
	}
}