void sceneFailed::Update() { if (!Pushed) { if (KEY_Get(KEY_SPACE) == 3) { Pushed = true; FadeManager::SetColor(Vector3(1, 1, 1)); FadeManager::FadeIn(1.5f); } } if (Pushed && FadeManager::IsFadeEnd()) { MainFrame->ChangeScene(new sceneTitle()); } }
void sceneTitle::Update() { if (!Pushed) { if (KEY_Get(KEY_SPACE) == 3) { obj_manager.PlacementAllObject(); Pushed = true; FadeManager::FadeIn(1.5f); } } if (Pushed && FadeManager::IsFadeEnd()) { MainFrame->ChangeScene(new sceneFind()); } }
/** * @brief 状态转换 */ void StateTrans(void) { SourceOn(); PumpOn(); DeviceDataInit(); GasDataInit(); // 获取存储的数据 SaveReadInit(); // 获取存储的设置 Lcd__LangSet(sDevice.pSave->Language); StateSelfCheck(); ChargeOn(); while (1) { // 获取信号量 20mS rt_sem_take(&sSemSystemTime, RT_WAITING_FOREVER); /* Reload IWDG counter */ IWDG_ReloadCounter(); KEY_Get(); DeviceDispCount(); DeviceTimeCount(); switch (sState) { case STATE_SELF_CHECK: StateLedBzVbrCheck(); SelfCheckJumpCheck(); break; case STATE_DETECT: StateDetect(&sGas, &sDevice); // DisRecSet(0, 0, 127, 63); break; case STATE_MENU: MenuKey(gKeyShort); MenuNoOperateCountdown(); // 闪烁 // MenuBlink(&sDevice); break; case STATE_INPUT: StateInputKey(gKeyShort); // 闪烁 if (sDevice.pTemp->Disp.Fresh == TURN_ON) { DisBlink(); } break; case STATE_COUNTDOWN: StateCountdownKey(gKeyShort); StateCountdownSecond(); break; case STATE_RESULT: StateResultKey(gKeyShort); break; case STATE_SHUTDOWN: StateShutdownKey(gKeyLong); StateShutdownSecond(); break; case STATE_POWER_OFF: break; case STATE_INFO: StateInfoKey(gKeyShort); StateInfoSecond(); break; case STATE_CHARGE: // PumpOff(); // sDevice.pTemp->Fan.State = TURN_OFF; break; default: break; } if (sState != STATE_SELF_CHECK) { if (gKeyTrg) { S_Buzzer lBz; lBz.Src = BUZZER_KEY; lBz.Time = BUZZER_KEY_TIME; BuzzerOn(&lBz); } } if (sState != STATE_POWER_OFF) { if (gKeyTrg || gKeyLong) { PowerSaveBglFresh(); } } if (gKeyTrg || gKeyLong) { MenuNoOperateFresh(); } // 设备倒计时 PowerSaveBglCountdown(); LedCountdown(); BuzzerCountdown(); VibrationCountdown(); StateBatCheck(); StateChargeCheck(); } }
void Player::Move() { static float MAX_SPEED = 1; static float MINI_SPEED = 0.01; static float ACCELATION = 0.05f; static float ブレーキ = 0.8f; //カメラの前方向 Vector3 c_front(matView._13,0,matView._33); c_front.Normalize(); //カメラの右方向 Vector3 c_right(matView._11, 0, matView._31); c_right.Normalize(); Vector3 temp = Vector3(0, 0, 0); bool is_move = false; if (KEY_Get(KEY_UP) && IsCanControl()) { SetMotion(1); temp += c_front; is_move = true; //if (velocity.Length() > MAX_SPEED) //{ // velocity.Normalize(); // velocity *= MAX_SPEED; //} } if (KEY_Get(KEY_DOWN) && IsCanControl()) { SetMotion(1); temp -= c_front; is_move = true; ////if (velocity.Length() > MAX_SPEED) ////{ //// velocity.Normalize(); //// velocity *= MAX_SPEED; ////} } if (KEY_Get(KEY_RIGHT) && IsCanControl()) { SetMotion(1); temp += c_right; is_move = true; //if (velocity.Length() > MAX_SPEED) //{ // velocity.Normalize(); // velocity *= MAX_SPEED; //} } if (KEY_Get(KEY_LEFT) && IsCanControl()) { is_move = true; SetMotion(1); temp -= c_right; if (velocity.Length() > MAX_SPEED) { velocity.Normalize(); velocity *= MAX_SPEED; } } temp.Normalize(); temp *= ACCELATION; velocity += temp; if (velocity.Length() > MAX_SPEED) { velocity.Normalize(); velocity *= MAX_SPEED; } if (!is_move) { velocity *= ブレーキ; if (velocity.Length() < MINI_SPEED) { velocity.Normalize(); velocity =Vector3(0,0,0); } SetMotion(0); }