This commit is contained in:
tanglong 2026-03-30 15:41:11 +08:00
commit 183d463fba
3 changed files with 17 additions and 32 deletions

View File

@ -243,7 +243,6 @@ namespace Wpf_AiSportsMicrospace.Views
private async void StartCountdown(int start = 3)
{
_mainWin.ShowCountDownAnimation();
//_currentCountdown = start;
Utils.PlayBackgroundMusic("countdown_3.mp3", false);
@ -363,6 +362,7 @@ namespace Wpf_AiSportsMicrospace.Views
_groupJumpRopeContext.Sports.Add(sport);
}
}
//private void UpdateCircleCounts(List<Human> humans)
//{
// if (humans == null || humans.Count == 0)

View File

@ -201,18 +201,9 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope
switch (rightWaving)
{
case (int)WavingAction.FirstHand:
if (!_isCountdownStarted)
{
_currentGameState = GameState.Running;
StartCountdown(3);
}
break;
case (int)WavingAction.Raising:
//UpdateCountdown();
break;
case (int)WavingAction.RaiseHand:
//FinishCountdown();
//_currentGameState = GameState.Running;
_isCountdownStarted = true; // 倒计时开始,停止左手检测
break;
}
}

View File

@ -210,16 +210,10 @@ namespace Views.SquatFu
switch (rightWaving)
{
case (int)WavingAction.FirstHand:
_currentGameState = GameState.Running;
StartCountdown(3);
_isCountdownStarted = true; // 倒计时开始,停止左手检测
break;
//case (int)WavingAction.Raising:
// UpdateCountdown();
// break;
//case (int)WavingAction.RaiseHand:
// FinishCountdown();
// _currentGameState = GameState.Running; // 倒计时完成 → 游戏开始
// break;
}
}
break;
@ -227,19 +221,19 @@ namespace Views.SquatFu
case GameState.Running: // 游戏进行中
UpdateCircleCounts(humans);
break;
case GameState.Finished: // 游戏结束
int leftWave = sportOperate.VerifyLeftWavingAction(humans);
if (leftWave == 5)
{
_mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
_mainWin.WebcamClient.StopExtract();
//case GameState.Finished: // 游戏结束
// int leftWave = sportOperate.VerifyLeftWavingAction(humans);
// if (leftWave == 5)
// {
// _mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
// _mainWin.WebcamClient.StopExtract();
// 举左手逻辑,例如结束动画或退出
var newPage = new Home();
_mainWin?.SwitchPageWithMaskAnimation(newPage, true);
return; // 提前退出
}
break;
// // 举左手逻辑,例如结束动画或退出
// var newPage = new Home();
// _mainWin?.SwitchPageWithMaskAnimation(newPage, true);
// return; // 提前退出
// }
// break;
}
}
catch (Exception ex)