示例#1
0
        protected override void OnSquareTapped(Square obj)
        {
            if (IsGameOver)
            {
                return;
            }

            obj.FadeIn();
            OnPausePressed(true);
            if (!IsTapCorrect(obj))
            {
                Failed();
            }
            else
            {
                Sucksess();
            }

            if (HasActiveSquares())
            {
                return;
            }

            //BeginMoveRandomSignals(() => StartOnce());

            StartOnce();


            //if (_score >= _levelTwoPoints)
            //{
            //    //SetAllSignalsInactive();

            //    if (_score >= _levelThreePoints)
            //        ChangeSquaresPosition(5, 9);

            //    ChangeSquaresPosition(1, 5, () =>
            //    {

            //        StartOnce();
            //        SchduleTime();
            //    });

            //}
            //else
            //{
            //    StartOnce();
            //    SchduleTime();
            //}
        }
示例#2
0
        protected override void OnSquareTapped(Square obj)
        {
            obj.FadeIn();
            _pauseButton.SetPauseVisible(true);
            if (IsGameOver)
            {
                return;
            }

            if (!IsTapCorrect(obj))
            {
                UnscheduleAll();
                StopProgressLine();

                //if there is no lives - GAME OVER
                Failed();
                PauseListeners(this, true);
                animator.BeginLiveTakenAnimation(_lives, () =>
                {
                    //livesSquares[(LevelLivePosition)_lives + 1].Visible = false;//fix this
                    animator.HideLostLives(_lives);
                    if (IsGameOver)
                    {
                        GameOver();
                        return;
                    }


                    animator.BeginSquareMovementByLevel(_currentLevel, _timeForChangingPositions, () =>
                    {
                        ResumeListeners(this, true);
                        StartOnce();
                        SchduleTime();
                    });
                });
            }
            else
            {
                Sucksess(obj);
                if (HasActiveSquares())
                {
                    return;
                }

                UnscheduleAll();
                StopProgressLine();
                PauseListeners(this, true);
                if (IsLevelNeedToChange())
                {
                    PlayEffect(Sounds.LevelRise);
                    animator.BeginLevelChangeAnimation(_currentLevel, () =>
                    {
                        ResumeListeners(this, true);

                        StartOnce();
                        SchduleTime();
                    });
                }
                else
                {
                    animator.BeginSquareMovementByLevel(_currentLevel, _timeForChangingPositions, () =>
                    {
                        ResumeListeners(this, true);

                        StartOnce();
                        SchduleTime();
                    });
                }
            }
        }