Beispiel #1
0
 private void colorButton_Click(object sender, RoutedEventArgs e)
 {
     if (newPlayWindow == null)
     {
         newPlayWindow = new PlayWindow("color", sensor);
         newPlayWindow.Show();
     }
     this.Close();
 }
Beispiel #2
0
        private void CommandsParser(SpeechRecognizedEventArgs e)
        {
            string spokenCmd;

            System.Collections.ObjectModel.ReadOnlyCollection <RecognizedWordUnit> words = e.Result.Words;

            spokenCmd = words[0].Text;
            switch (spokenCmd)
            {
            case "shape":
                //go to shape game
                if (newPlayWindow == null)
                {
                    newPlayWindow = new PlayWindow("shape", sensor);
                    newPlayWindow.Show();
                }
                ;
                this.Close();
                return;

            case "color":
                // go to color game
                if (newPlayWindow == null)
                {
                    newPlayWindow = new PlayWindow("color", sensor);
                    newPlayWindow.Show();
                }
                ;
                this.Close();
                return;

            case "both":
                // go to Easter egg game
                if (newPlayWindow == null)
                {
                    newPlayWindow = new PlayWindow("both", sensor);
                    newPlayWindow.Show();
                }
                ;
                this.Close();
                return;

            case "quit":
                // exit the game
                stopKinect();
                Application.Current.Shutdown();
                return;

            default:
                return;
            }
        }