From 7a88780bf8ef555e6c8d9d29fb9f741af10453c6 Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Mon, 30 Mar 2026 15:40:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BE=E5=B7=A6=E6=89=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/JumpRope/GroupJumpRope.xaml.cs | 2 +- .../Views/JumpRope/MusicJumpRope.xaml.cs | 15 ++------- .../Views/SquatFu/WhackAMole.xaml.cs | 32 ++++++++----------- 3 files changed, 17 insertions(+), 32 deletions(-) diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs index 68a904b..4437563 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs @@ -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 humans) //{ // if (humans == null || humans.Count == 0) diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs index 5741ed4..6368c40 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs @@ -201,18 +201,9 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope switch (rightWaving) { case (int)WavingAction.FirstHand: - if (!_isCountdownStarted) - { - StartCountdown(3); - } - - break; - case (int)WavingAction.Raising: - //UpdateCountdown(); - break; - case (int)WavingAction.RaiseHand: - //FinishCountdown(); - //_currentGameState = GameState.Running; + _currentGameState = GameState.Running; + StartCountdown(3); + _isCountdownStarted = true; // 倒计时开始,停止左手检测 break; } } diff --git a/Wpf_AiSportsMicrospace/Views/SquatFu/WhackAMole.xaml.cs b/Wpf_AiSportsMicrospace/Views/SquatFu/WhackAMole.xaml.cs index b17adb6..394b4ba 100644 --- a/Wpf_AiSportsMicrospace/Views/SquatFu/WhackAMole.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/SquatFu/WhackAMole.xaml.cs @@ -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)