Exemplo n.º 1
0
 public CLogic(MOptions option)
 {
     _SoundPlayer = new SoundPlayer();
     _CNote = new CNote(3);
     LeftShadow = new CShadow(250,150);
     RightShadow = new CShadow(450,150);
     _CMusicHit = new CMusicHit(option.MusicHitFilePath);
     _SoundPlayer.SoundLocation = @option.MusicMediaFilePath;
     //_SoundPlayer.SoundLocation = @"D:\Gangnam.wav";
     _SoundPlayer.LoadAsync();
     _CNote.Speed = _CMusicHit.Speed;
     _TotalTime = _CMusicHit.EndTime;
     Score = 0;
     Progress = 0;
     isStart = false;
 }
        void daShowShadow_Completed(object sender, EventArgs e)
        {
            (sender as AnimationClock).Completed -= daShowShadow_Completed;
            this._lShadow = new CShadow(450, 400);
            this._rShadow = new CShadow(600, 400);
            this.lVShadow.DataContext = this._lShadow;
            this.rVShadow.DataContext = this._rShadow;

            int elevationAngle = int.Parse(this.TxtElevationAngle.Text);
            this._cKinect = new CKinect();
            this._cKinect.start();
            this._cKinect.ElevationAngle = elevationAngle;

            TimeBeginPeriod(TimerResolution);
            this.myGameThread = new Thread(this.GameThread);
            myGameThread.SetApartmentState(ApartmentState.STA);
            myGameThread.Start();
        }