コード例 #1
0
 private void Play_Click(object sender, RoutedEventArgs e)
 {
     gameSettings = new GameSettings((int)TimeSlider.Value, (int)TeamsCountSlider.Value, (int)PointsSlider.Value);
     int[] teamPoints = new int[gameSettings.getTeamsNumber()];
     int actualTeam = 0;
     PhoneApplicationService.Current.State["ActualTeam"] =  actualTeam;
    //PhoneApplicationService.Current.State["GameSettings"] = game;
     PhoneApplicationService.Current.State["TeamPoints"] = teamPoints;
     NavigationService.Navigate(new Uri("/TeamChange.xaml?", UriKind.Relative));
   
 }
コード例 #2
0
        public GamePage()
        {
            InitializeComponent();
            allTaboos = MainPage.allTaboos;
            BackKeyPress += OnBackKeyPressed;
            actualTeam = (int)PhoneApplicationService.Current.State["ActualTeam"];
            teamPoints = (int[])PhoneApplicationService.Current.State["TeamPoints"];
            teamPointsTextLabel.Text = "" + teamPoints[actualTeam].ToString();
            gameSettings = MainPage.gameSettings;
            actualTime = gameSettings.getTime();
            //allTaboos = new Taboos();
            Debugger.Log(1, "Warning", "ZAŁADOWAŁEM TABOOS \n ");
            changeTaboo();
            accelSensor = new Accelerometer();

            // Add the accelerometer event handler to the accelerometer sensor.
            accelSensor.ReadingChanged +=
                new EventHandler<AccelerometerReadingEventArgs>(AccelerometerReadingChanged);


            // Start the accelerometer
            try
            {
                accelSensor.Start();
                
            }
            catch (AccelerometerFailedException e)
            {
                // the accelerometer couldn't be started.  No fun!
                
            }

            timer.Interval = new TimeSpan(0, 0, 0, 1);
            timer.Tick += new EventHandler(timer_Tick);
            timer.Start();
        }