Esempio n. 1
0
        public async void BackTapped(object sender, EventArgs e)
        {
            TapCounter  = 0;
            TapCounter1 = 0;
            TapCounter2 = 0;
            BGMusics.Clicking_Sound().Play();
            if (Menus.IsVisible && DifficutyMenu.IsVisible == false && CategorySection.IsVisible == false && CategorySectionSelected.IsVisible == false)
            {
                var navPage = new NavigationPage(new MainPage());
                await Task.Delay(200);

                await navPage.FadeTo(0, 250);

                await Task.Delay(200);

                await navPage.FadeTo(1, 250);

                Application.Current.MainPage = navPage;
            }
            else
            {
                Menus.IsVisible                   = true;
                DifficutyMenu.IsVisible           = false;
                CategorySection.IsVisible         = false;
                CategorySectionSelected.IsVisible = false;
                Slots.IsVisible                   = false;
            }
        }
Esempio n. 2
0
        public async void L4Tapped(object sender, EventArgs e)
        {
            TapCounter1++;
            if (TapCounter1 == 1)
            {
                BGMusics.Clicking_Sound().Play();
                BGMusics.Menu_BGM().Stop();
                BGMusics.InGame_BGM().Play();
                Flow.StarSetter(4);
                Flow.IsGameInCategory(false);
                LoadingBit.IsVisible = true;
                Fetch.IsRunning      = true;
                BGMusics.Loading_Sound().Play();
                LocalSelection.ConvertQuotesAndSayings();
                LoadingBit.IsVisible = true;
                Fetch.IsRunning      = true;
                L4.IsEnabled         = false;
                var navPage = new NavigationPage(new Blank1());
                await Task.Delay(200);

                await navPage.FadeTo(0, 250);

                await Task.Delay(200);

                await navPage.FadeTo(1, 250);

                Application.Current.MainPage = navPage;
            }
        }
Esempio n. 3
0
        public static async void BactToGameType()
        {
            var navPage = new NavigationPage(new GameType());
            await Task.Delay(200);

            await navPage.FadeTo(0, 250);

            await Task.Delay(200);

            await navPage.FadeTo(1, 250);

            Application.Current.MainPage = navPage;
        }
Esempio n. 4
0
        public async void HomeTapped(object sender, EventArgs e)
        {
            BGMusics.Clicking_Sound().Play();
            var navPage = new NavigationPage(new MainPage());
            await Task.Delay(200);

            await navPage.FadeTo(0, 250);

            await Task.Delay(200);

            await navPage.FadeTo(1, 250);

            Application.Current.MainPage = navPage;
        }
Esempio n. 5
0
        public async void L4Tapped(object sender, EventArgs e)
        {
            Flow.StarSetter(4);
            var navPage = new NavigationPage(new Blank1());
            await Task.Delay(200);

            await navPage.FadeTo(0, 250);

            await Task.Delay(200);

            await navPage.FadeTo(1, 250);

            Application.Current.MainPage = navPage;
        }
Esempio n. 6
0
        private async void Button_Clicked(object sender, EventArgs e)
        {
            PointSystem.ResetScore();
            Flow.ResetRound();

            var navPage = new NavigationPage(new MainPage());
            await Task.Delay(200);

            await navPage.FadeTo(0, 250);

            await Task.Delay(200);

            await navPage.FadeTo(1, 250);

            Application.Current.MainPage = navPage;
        }
Esempio n. 7
0
        public async void Play_Clicked(object sender, EventArgs eventArgs)
        {
            TapCounter2++;
            if (TapCounter2 == 1)
            {
                BGMusics.Clicking_Sound().Play();
                BGMusics.Menu_BGM().Stop();
                BGMusics.InGame_BGM().Play();

                SaveOrLoad.ALoadedGame(false);
                CategoryLoad.SaveThisNow(CategoryName.Text);
                LoadingBit.IsVisible = true;
                Fetch.IsRunning      = true;
                BGMusics.Loading_Sound().Play();



                LoadingBit.IsVisible = true;
                Fetch.IsRunning      = true;

                var navPage = new NavigationPage(new Blank1());
                await Task.Delay(200);

                await navPage.FadeTo(0, 250);

                await Task.Delay(200);

                await navPage.FadeTo(1, 250);

                Application.Current.MainPage = navPage;

                /*
                 *
                 *     for (int k = 0; k < 5; k++)
                 * {
                 * await DisplayAlert("Result", CategoryLoad.LoadSelectedToks()[k].ToString(), "OK");
                 * }
                 * await DisplayAlert("Result", CategoryLoad.LoadSelectedToks()[0].ToString(), "OK");
                 * await DisplayAlert("Result", Selection.ThisIsThePhrase(), "OK");
                 *
                 *
                 *
                 */
            }
        }
Esempio n. 8
0
        public async void Play_Tapped(object sender, EventArgs e)
        {
            BGMusics.Clicking_Sound().Play();
            AccountCache();
            AutomaticLogIn();
            if (CrossConnectivity.Current.IsConnected && string.IsNullOrEmpty(Application.Current.Properties["UserEmail"].ToString()) && string.IsNullOrEmpty(Application.Current.Properties["UserPassword"].ToString()))
            {
                UserControl.IsVisible = true;
            }
            else
            {
                await Application.Current.MainPage.FadeTo(0, 300);

                var navPage = new NavigationPage(new GameType());
                Application.Current.MainPage = navPage;
                await Task.Delay(250);

                await navPage.FadeTo(0, 400);

                await navPage.FadeTo(1, 300);
            }
        }
Esempio n. 9
0
        void LoadGames()
        {
            int slotsAvailbale = 3;

            Image[]  SlotHolder = new Image[slotsAvailbale];
            Label[]  SlotName   = new Label[slotsAvailbale];
            string[] text       = new string[slotsAvailbale];
            string[] setting    = new string[slotsAvailbale];
            string[] theValues  = new string[slotsAvailbale];
            int[]    star       = new int[slotsAvailbale];
            TapGestureRecognizer[] recognizer = new TapGestureRecognizer[slotsAvailbale];
            for (int i = 0; i < slotsAvailbale; i++)
            {
                SaveSlots.RowDefinitions.Add(new RowDefinition {
                    Height = new GridLength(1, GridUnitType.Star)
                });
            }

            for (int i = 0; i < slotsAvailbale; i++)
            {
                SaveOrLoad.LoadGameInSelectedSlot("SD" + (i + 1));
                if (string.IsNullOrEmpty(SaveOrLoad.SetLoadedDataValues()))
                {
                    text[i] = "Saved Game " + (i + 1);
                }
                else
                {
                    if (SaveOrLoad.SetLoadedGameType() == "Variety")
                    {
                        switch (SaveOrLoad.SetLoadedSettings())
                        {
                        case "1": setting[i] = "Easy"; star[i] = 1; break;

                        case "2": setting[i] = "Moderate"; star[i] = 2; break;

                        case "3": setting[i] = "Challenging"; star[i] = 3; break;

                        case "4": setting[i] = "Difficult"; star[i] = 4; break;
                        }
                    }
                    else
                    {
                        setting[i] = SaveOrLoad.SetLoadedSettings();
                    }
                    theValues[i] = SaveOrLoad.SetLoadedDataValues();
                    text[i]      = SaveOrLoad.SetSaveName() + Environment.NewLine + SaveOrLoad.SetLoadedGameType() + Environment.NewLine + setting[i];
                }
                SlotHolder[i] = new Image {
                    Source          = ImageSource.FromResource("TokBlitzBeta.GameAssets.Button.BlackButton.png"),
                    BackgroundColor = Color.Transparent, Aspect = Aspect.AspectFit
                };
                SlotName[i] = new Label {
                    Text = text[i], FontFamily = "Face Off M54.ttf#Face Off M54", FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), TextColor = Color.White, BackgroundColor = Color.Transparent, VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center
                };
                int mark = i;
                recognizer[i]         = new TapGestureRecognizer();
                recognizer[i].Tapped += async(sender, args) =>
                {
                    BGMusics.Clicking_Sound().Play();
                    if (!string.IsNullOrEmpty(theValues[mark]))
                    {
                        if (!Flow.GameInCategory())
                        {
                            Flow.StarSetter(star[mark]);
                            Flow.IsGameInCategory(false);
                            LocalSelection.ConvertQuotesAndSayings();
                            SaveOrLoad.GetPhrases(theValues[mark].Split('-'));
                            var navPage = new NavigationPage(new Blank1());
                            await Task.Delay(200);

                            await navPage.FadeTo(0, 250);

                            await Task.Delay(200);

                            await navPage.FadeTo(1, 250);

                            Application.Current.MainPage = navPage;
                        }
                        else
                        {
                            Flow.IsGameInCategory(true);
                            LocalSelection.ConvertQuotesAndSayings();
                            SaveOrLoad.GetPhrases(theValues[mark].Split('-'));
                            var navPage = new NavigationPage(new Blank1());
                            await Task.Delay(200);

                            await navPage.FadeTo(0, 250);

                            await Task.Delay(200);

                            await navPage.FadeTo(1, 250);

                            Application.Current.MainPage = navPage;
                        }
                    }
                    else
                    {
                        await DisplayAlert("Warning!", "No Save Game Found", "OK");
                    }
                };
                SlotName[i].GestureRecognizers.Add(recognizer[i]);
                SaveSlots.Children.Add(SlotHolder[i], 0, i);
                SaveSlots.Children.Add(SlotName[i], 0, i);
            }
        }