public TetrisExecute(WriteableBitmap wbm, DispatcherTimer dt, Window CentralMonitor) { this.dt = dt; CentralMonitor.KeyDown += CentralMonitor_KeyDown; this.t = new Tetris(wbm); cm = CentralMonitor; hwnds = HwndSource.FromVisual(cm) as HwndSource; collison = new MediaPlayer(); lineClear = new MediaPlayer(); music = new MediaPlayer(); music.Open(new System.Uri("Sounds/Tetris.mp3", UriKind.Relative)); music.Play(); Bluetooth.Instance.CommandControlChange += new Bluetooth.PropertyChangeHandler(Event_Control_tetris); music.MediaEnded += music_MediaEnded; dt2 = new DispatcherTimer(); dt2.Interval = new TimeSpan(0, 0, 0, 0, 200); dt2.Tick += dt2_Tick; dt2.Start(); fastdown = false; }
public TetrisExecute(WriteableBitmap wbm,DispatcherTimer dt,Window CentralMonitor) { this.dt = dt; CentralMonitor.KeyDown+=CentralMonitor_KeyDown; this.t = new Tetris(wbm); cm = CentralMonitor; hwnds = HwndSource.FromVisual(cm) as HwndSource; collison = new MediaPlayer(); lineClear = new MediaPlayer(); music = new MediaPlayer(); music.Open(new System.Uri("Sounds/Tetris.mp3", UriKind.Relative)); music.Play(); Bluetooth.Instance.CommandControlChange += new Bluetooth.PropertyChangeHandler(Event_Control_tetris); music.MediaEnded += music_MediaEnded; dt2 = new DispatcherTimer(); dt2.Interval = new TimeSpan(0, 0, 0, 0, 200); dt2.Tick += dt2_Tick; dt2.Start(); fastdown = false; }