Exemple #1
0
        public Menu()
        {
            InitializeComponent();

            s = new Sounds.Sounds();
            s.playOpeningSound();
        }
Exemple #2
0
        public TheGame(bool isRightHand)
        {
            this.isRightHand = isRightHand;

            s = new Sounds.Sounds();

            InitializeComponent();

            //Init GameFlow
            currentLevel = GameFlow.createGameFlow();

            Loaded += delegate
            {
                if (currentLevel.getLetter().ToString().Length > 1)
                {
                    getScreenSize(currentLevel.getLetter());
                }
            };

            this.speechEngine = SpeechRecognition.init();
            this.speechEngine.SpeechRecognized += this.SpeechRecognized;


            _sensor = KinectSensor.GetDefault();

            if (_sensor != null)
            {
                _sensor.Open();

                _width  = _sensor.ColorFrameSource.FrameDescription.Width;
                _height = _sensor.ColorFrameSource.FrameDescription.Height;

                _colorReader = _sensor.ColorFrameSource.OpenReader();
                _colorReader.FrameArrived += ColorReader_FrameArrived;

                _bodyReader = _sensor.BodyFrameSource.OpenReader();
                _bodyReader.FrameArrived += BodyReader_FrameArrived;

                _pixels = new byte[_width * _height * 4];
                _bitmap = new WriteableBitmap(_width, _height, 96.0, 96.0, PixelFormats.Bgra32, null);

                _bodies = new Body[_sensor.BodyFrameSource.BodyCount];

                camera.Source = _bitmap;

                changeLetter();
            }

            polylines = new List <Polyline>();
            addNewPolyline();
            isSecondClick = false;
        }