예제 #1
0
        private void KinectTileButton_Click_1(object sender, RoutedEventArgs e)
        {
            LeaderBoard lb = new LeaderBoard(sensorChooser);

            this.sensorChooser.Stop();
            lb.Show();
            this.Close();
        }
예제 #2
0
        void timer_Tick(object sender, EventArgs e)
        {
            this.busapos    = Convert.ToInt64(busa.GetValue(Canvas.LeftProperty));
            this.busbpos    = Convert.ToInt64(busb.GetValue(Canvas.LeftProperty));
            this.buscpos    = Convert.ToInt64(busc.GetValue(Canvas.LeftProperty));
            this.carapos    = Convert.ToInt64(cara.GetValue(Canvas.LeftProperty));
            this.carbpos    = Convert.ToInt64(carb.GetValue(Canvas.LeftProperty));
            this.playerpos  = Convert.ToInt64(player.GetValue(Canvas.LeftProperty));
            this.carapost   = Convert.ToInt64(cara.GetValue(Canvas.TopProperty));
            this.playerpost = Convert.ToInt64(player.GetValue(Canvas.TopProperty));

            if (busapos >= 1024)
            {
                Canvas.SetLeft(busa, -6);
                Canvas.SetLeft(busb, -6);
                Canvas.SetLeft(busc, -6);
                Canvas.SetLeft(cara, -12);
                Canvas.SetLeft(carb, -12);
            }
            else
            {
                Canvas.SetLeft(busa, busapos - 5);
                Canvas.SetLeft(busb, busbpos - 5);
                Canvas.SetLeft(busc, buscpos - 5);
                Canvas.SetLeft(cara, carapos - 10);
                Canvas.SetLeft(carb, carbpos - 10);

                //MessageBox.Show("" + carapos);
                if (this.carapos.Equals(this.playerpos + 100) && this.carapost.Equals(this.playerpost))
                {
                    MessageBox.Show("Aww! Your score is " + score + "! Try Again!");
                    LeaderBoard lb = new LeaderBoard(sensorChooser);
                    this.sensorChooser.Stop();
                    lb.Show();
                    this.Close();
                }
            }
        }
예제 #3
0
        void timer_Tick(object sender, EventArgs e)
        {
            this.busapos = Convert.ToInt64(busa.GetValue(Canvas.LeftProperty));
            this.busbpos = Convert.ToInt64(busb.GetValue(Canvas.LeftProperty));
            this.buscpos = Convert.ToInt64(busc.GetValue(Canvas.LeftProperty));
            this.carapos = Convert.ToInt64(cara.GetValue(Canvas.LeftProperty));
            this.carbpos = Convert.ToInt64(carb.GetValue(Canvas.LeftProperty));
            this.playerpos = Convert.ToInt64(player.GetValue(Canvas.LeftProperty));
            this.carapost = Convert.ToInt64(cara.GetValue(Canvas.TopProperty));
            this.playerpost = Convert.ToInt64(player.GetValue(Canvas.TopProperty));
            
            if (busapos >= 1024)
            {
                Canvas.SetLeft(busa, -6);
                Canvas.SetLeft(busb, -6);
                Canvas.SetLeft(busc, -6);
                Canvas.SetLeft(cara, -12);
                Canvas.SetLeft(carb, -12);
            }
            else
            {
                Canvas.SetLeft(busa, busapos - 5);
                Canvas.SetLeft(busb, busbpos - 5);
                Canvas.SetLeft(busc, buscpos - 5);
                Canvas.SetLeft(cara, carapos - 10);
                Canvas.SetLeft(carb, carbpos - 10);

                //MessageBox.Show("" + carapos);
                if (this.carapos.Equals(this.playerpos + 100) && this.carapost.Equals(this.playerpost))
                {
                    MessageBox.Show("Aww! Your score is " + score +"! Try Again!");
                    LeaderBoard lb = new LeaderBoard(sensorChooser);
                    this.sensorChooser.Stop();
                    lb.Show();
                    this.Close();
                }
            }
        } 
예제 #4
0
 private void KinectTileButton_Click_1(object sender, RoutedEventArgs e)
 {
     LeaderBoard lb = new LeaderBoard(sensorChooser);
     this.sensorChooser.Stop();
     lb.Show();
     this.Close();
 }