Esempio n. 1
0
        //일반 포스쳐
        private void NuiSkeleton2DdataCoordReadyPosture(object sender, Skeleton2DdataCoordEventArgs a)
        {


            if (_video.Count > MinimumFrames)
            {

                string s = _dtw2.Recognize(_video);
                if (!s.Contains("__UNKNOWN"))
                {
                    _video = new ArrayList();
                }
                message = s.ToString();
                if (gestureFlag)
                {
                    if (!s.Contains("__UNKNOWN"))
                    {
                        postureCount++;
                        //message = "posture yes";
                        perfectBannerManager.AddBanners(collisionManager.perfectLocation,collisionManager.perfectBannerScale);
                       // scoreManager.Perfomance = scoreManager.Perfomance + 1;
                        scoreManager.PosturePerfect+=10;
                        scoreManager.Combo++;
                        scoreManager.ComboChanged = true;

                        collisionManager.AddComboNumber((int)scoreManager.Combo, 0);




                        scoreManager.Gage++;


                        //if (postureCount > 5)
                        //{
                            
                        //    gestureFlag = false;
                        //}
                    }

                    if (s.Contains("__UNKNOWN"))
                    {
                        //message = "posture no";
                    }
                }
            }

            if (_video.Count > BufferSize)
            {
                _video.RemoveAt(0);
            }

            if (!double.IsNaN(a.GetPoint(0).X))
            {

                _flipFlop = (_flipFlop + 1) % 2;
                if (_flipFlop == 0)
                {
                    _video.Add(a.GetCoords());
                }
            }
        }
Esempio n. 2
0
        //제스쳐
        private void NuiSkeleton2DdataCoordReadyGesture(object sender, Skeleton2DdataCoordEventArgs a)
        {
          
            if (_video.Count > MinimumFrames)
            {

                string s = _dtw3.Recognize(_video);
                double score = _dtw3.MinDist;//점수

                if (!s.Contains("__UNKNOWN"))
                {
                    _video = new ArrayList();
                }


                if (gestureFlag)
                {
                    if (!s.Contains("__UNKNOWN"))
                    {
                       scoreManager.Perfomance = scoreManager.Perfomance + 1;
                        if (score < 1.2 && score>=0.9)//굳
                        {
                           
                            goodBannerManager.AddBanners(collisionManager.goodLocation, collisionManager.goodBannerScale);
                            scoreManager.JestureGood ++ ;
                            scoreManager.Combo++;
                            scoreManager.ComboChanged = true;
                            collisionManager.AddComboNumber((int)scoreManager.Combo, 1);


                        }
                        else if (score < 0.9)//퍼펙트
                        {
                            perfectBannerManager.AddBanners(collisionManager.perfectLocation, collisionManager.perfectBannerScale);
                            scoreManager.JesturePerfect ++;
                            scoreManager.Combo++;
                            scoreManager.ComboChanged = true;
                            collisionManager.AddComboNumber((int)scoreManager.Combo, 0);


                        }

                        //message = "yes" + score.ToString();
                        gestureFlag = false;
                        postureCount++;
                    }

                    if (s.Contains("__UNKNOWN"))
                    {
                        //message = "no";
                    }
                }
            }

            if (_video.Count > BufferSize)
            {
                _video.RemoveAt(0);
            }

            if (!double.IsNaN(a.GetPoint(0).X))
            {

                _flipFlop = (_flipFlop + 1) % 2;
                if (_flipFlop == 0)
                {
                    _video.Add(a.GetCoords());
                }
            }
        }
Esempio n. 3
0
        //정지 포스쳐
        private void NuiSkeleton2DdataCoordReadyStop(object sender, Skeleton2DdataCoordEventArgs a)
        {
            if (_video.Count > MinimumFrames)
            {
                string s = _dtw1.Recognize(_video);

                if (!s.Contains("__UNKNOWN"))
                {
                    _video = new ArrayList();
                }
                //message = s.ToString();

                //////////////////////////////////////////
                if (!s.Contains("__UNKNOWN"))
                {
                    postureCount++;
                   // message = "stop yes";
                   // backJestureManager.ShowJestureMark = true;
                    if (postureCount > 2 && postureCount <= 7)
                    {
                        backJestureManager.ShowJestureMark = true;
                    }
                    if (postureCount > 7)
                    {
                        //여기에 정지했을 때 동작 넣기


                        if (gameState == GameStates.Playing)
                        {

                            file.SetEndFile(true);
                            resultManager.FailGame = true;
                        }
                        if (gameState == GameStates.TutorialScene || gameState == GameStates.ShopDoor )
                        {
                            gameState = GameStates.Menu;

                        }

                        if(gameState == GameStates.SettingBoard)
                        {
                            gameState = GameStates.Menu;
                          //  settingBoard.SaveCheckFile();
                        }

                        if (gameState == GameStates.BackgroundItemShop || gameState == GameStates.EffectItemShop || gameState == GameStates.LeftItemShop || gameState == GameStates.RightItemShop || gameState == GameStates.NoteItemShop)
                        {
                            gameState = GameStates.ShopDoor;
                        }

                        if (gameState == GameStates.RecordBoard)
                        {
                            gameState = GameStates.ShowPictures;
                        }

                        if (gameState == GameStates.SongMenu)
                        {
                            gameState = GameStates.Menu;
                            bool isPlay = false;
                            SoundFmod.sndChannel.isPlaying(ref isPlay);
                            if (isPlay)
                            {
                                SoundFmod.StopSound();
                            }
                        }

                        postureCount = 0;
                  

                        backJestureManager.ShowJestureMark = false;
                    }
                }

                if (s.Contains("__UNKNOWN"))
                {
                    postureCount = 0;
                 //   message = "stop no";
                    backJestureManager.ShowJestureMark = false;
                }


            }

            //////////////////////////////////////////



            if (_video.Count > BufferSize)
            {
                _video.RemoveAt(0);
            }

            if (!double.IsNaN(a.GetPoint(0).X))
            {

                _flipFlop = (_flipFlop + 1) % 2;
                if (_flipFlop == 0)
                {
                    _video.Add(a.GetCoords());
                }
            }


        }