Пример #1
0
        private void PlayTimeNow()
        {
            QuestionImage.IsVisible    = true;
            QuestionLabelBox.IsVisible = true;
            QuestionLabel.IsVisible    = true;
            CountingLabel.IsVisible    = false;
            //  QuestionImage.Opacity = 0;

            QuestionLabelBox.Opacity = 0;
            QuestionLabelBox.FadeTo(Global.LabelBox, 1000);
            var animateExpand = new Animation(d => QuestionLabelBox.HeightRequest = d, 0, 50, Easing.CubicIn);

            animateExpand.Commit(QuestionLabelBox, "box", 16, 800);

            //QuestionImage.FadeTo(Global.Questionopacity, 700);

            QuestionImage.Source = Global.ShuffledQuestion[i, 1];



            QuestionLabel.Text = Global.ShuffledQuestion[i, 0];


            CorrectButton.IsVisible = true;
            SkipButton.IsVisible    = true;
            VolumeButtonsActive();
            Timer();
        }
Пример #2
0
        private async void On_CorrectandSkip_button_clicked(bool CorS)
        {
            if (CorS)
            {//correct
                allSounds.Correctsound();
                Global.IsCorrect[i]    = 1;
                Global.IsGuessed[i]    = 1;
                Global.IsCorrectCount += 1;
                i++;

                if (i < Global.QuestionQuantity)
                {
                    CorrectButton.IsEnabled = false;
                    SkipButton.IsEnabled    = false;
                    VolumeButtonsDisabled();
                    //extension color in

                    QuestionLabelBox.ShiftColorTo
                    (
                        sourceColor: QuestionLabelBox.BackgroundColor,
                        targetColor: Color.FromRgb(80, 200, 120),
                        setter: color =>
                    {
                        QuestionLabelBox.BackgroundColor = color;
                    },
                        length: 500,
                        easing: Easing.CubicOut);
                    //
                    await CorrectFlash.FadeTo(0.2, 500, Easing.CubicOut);

                    QuestionLabel.Text = Global.ShuffledQuestion[i, 0];
                    CorrectFlash.FadeTo(0, 500, Easing.CubicOut);
                    //extension color out

                    QuestionLabelBox.ShiftColorTo
                    (
                        sourceColor: QuestionLabelBox.BackgroundColor,
                        targetColor: Color.FromRgb(47, 79, 79),
                        setter: color =>
                    {
                        QuestionLabelBox.BackgroundColor = color;
                    },
                        length: 500,
                        easing: Easing.CubicOut);
                    //

                    // await QuestionImage.FadeTo(0, 500);


                    QuestionImage.Source = Global.ShuffledQuestion[i, 1];



                    //  QuestionImage.FadeTo(Global.Questionopacity, 700);
                    CorrectButton.IsEnabled = true;
                    SkipButton.IsEnabled    = true;
                    VolumeButtonsActive();
                }


                else
                {
                    GameOver();
                }
            }
            else
            {//Skipping
                allSounds.Skipsound();
                Global.IsCorrect[i] = 0;
                Global.IsGuessed[i] = 1;
                i++;

                if (i < Global.QuestionQuantity)
                {
                    CorrectButton.IsEnabled = false;
                    SkipButton.IsEnabled    = false;
                    VolumeButtonsDisabled();
                    //extension color in

                    QuestionLabelBox.ShiftColorTo
                    (
                        sourceColor: QuestionLabelBox.BackgroundColor,
                        targetColor: Color.FromRgb(255, 0, 51),
                        setter: color =>
                    {
                        QuestionLabelBox.BackgroundColor = color;
                    },
                        length: 500,
                        easing: Easing.CubicOut);
                    //
                    await SkipFlash.FadeTo(0.2, 500, Easing.CubicOut);

                    QuestionLabel.Text = Global.ShuffledQuestion[i, 0];
                    SkipFlash.FadeTo(0, 500, Easing.CubicOut);
                    //extension color out

                    QuestionLabelBox.ShiftColorTo
                    (
                        sourceColor: QuestionLabelBox.BackgroundColor,
                        targetColor: Color.FromRgb(47, 79, 79),
                        setter: color =>
                    {
                        QuestionLabelBox.BackgroundColor = color;
                    },
                        length: 500,
                        easing: Easing.CubicOut);
                    //


                    //await QuestionImage.FadeTo(0, 500);
                    QuestionImage.Source = Global.ShuffledQuestion[i, 1];
                    //Global.ShuffledQuestion[i, 1];
                    // QuestionImage.FadeTo(Global.Questionopacity, 700);
                    CorrectButton.IsEnabled = true;
                    SkipButton.IsEnabled    = true;
                    VolumeButtonsActive();
                }
                else
                {
                    GameOver();
                }
            }
        }