Example #1
0
        private async void home_Tapped(object sender, TappedRoutedEventArgs e)
        {
            TapAnimation.Stop();
            TapAnimation.SetValue(Storyboard.TargetNameProperty, "home");
            TapAnimation.Begin();
            await Task.Delay(TimeSpan.FromSeconds(0.1));

            this.Frame.Navigate(typeof(MainPage));
        }
Example #2
0
        private async void multiMode_Tapped(object sender, TappedRoutedEventArgs e)
        {
            TapAnimation.Stop();
            TapAnimation.SetValue(Storyboard.TargetNameProperty, "multiMode");
            TapAnimation.Begin();
            await Task.Delay(TimeSpan.FromSeconds(0.1));

            MainPage.GlobalVars.GameMode = "multi";
            this.Frame.Navigate(typeof(MultiPage));
        }
Example #3
0
        private async void singleMode_Tapped(object sender, TappedRoutedEventArgs e)
        {
            TapAnimation.Stop();
            TapAnimation.SetValue(Storyboard.TargetNameProperty, "singleMode");
            TapAnimation.Begin();
            await Task.Delay(TimeSpan.FromSeconds(0.1));

            MainPage.GlobalVars.GameMode = "single";
            this.Frame.Navigate(typeof(SinglePage));
            //this.Frame.Navigate(typeof(FileView), real.Text);
        }
        private async void cancel_Tapped(object sender, TappedRoutedEventArgs e)
        {
            TapAnimation.Stop();
            TapAnimation.SetValue(Storyboard.TargetNameProperty, "cancel");
            TapAnimation.Begin();
            await Task.Delay(TimeSpan.FromSeconds(0.1));

            Player1Name.Text = "Player";
            zero.Foreground  = new SolidColorBrush(Colors.Red);
            axe.Foreground   = new SolidColorBrush(Colors.Red);
        }
Example #5
0
        private async void done_Tapped(object sender, TappedRoutedEventArgs e)
        {
            TapAnimation.Stop();
            TapAnimation.SetValue(Storyboard.TargetNameProperty, "done");
            TapAnimation.Begin();
            await Task.Delay(TimeSpan.FromSeconds(0.1));

            MessageDialog err1 = new MessageDialog("Both the names can't be same", "Noughts And Crosses");
            MessageDialog err2 = new MessageDialog("Please choose a Avatar", "Noughts And Crosses");
            int           chk  = 1;

            MainPage.GlobalVars.Player1Name = Player1Name.Text;
            MainPage.GlobalVars.Player2Name = Player2Name.Text;
            if (Player1Name.Text == "")
            {
                MainPage.GlobalVars.Player1Name = "Player 1";
            }
            if (Player2Name.Text == "")
            {
                MainPage.GlobalVars.Player2Name = "Player 2";
            }
            if (Player1Name.Text == Player2Name.Text)
            {
                await err1.ShowAsync();

                chk = 0;
            }
            SolidColorBrush az = zero1.Foreground as SolidColorBrush;
            SolidColorBrush ax = axe1.Foreground as SolidColorBrush;

            if (az.Color == Windows.UI.Colors.Green && mode.IsOn == false)
            {
                MainPage.GlobalVars.Player1Avatar = "O";
                MainPage.GlobalVars.Player2Avatar = "X";
            }
            else if (ax.Color == Windows.UI.Colors.Green && mode.IsOn == false)
            {
                MainPage.GlobalVars.Player1Avatar = "X";
                MainPage.GlobalVars.Player2Avatar = "O";
            }
            else if (mode.IsOn == false)
            {
                await err2.ShowAsync();

                chk = 0;
            }
            else if (mode.IsOn == true)
            {
                MainPage.GlobalVars.Player1Avatar = "O";
                MainPage.GlobalVars.Player2Avatar = "X";
            }
            if (chk == 1)
            {
                if (mode.IsOn == true)
                {
                    MainPage.GlobalVars.amode = "auto";
                }
                else
                {
                    MainPage.GlobalVars.amode = "manual";
                }
                this.Frame.Navigate(typeof(GamePage));
            }
        }