public Buttons(GamePanel panel, Wiimote wm) : base(panel, wm) { timer = new Timer {Interval = 5000}; timer.Tick += TimerClock; starTimer = new Timer { Interval = 1000 }; starTimer.Tick += StartTimerClock; }
public QuestionPanel(GamePanel gamePanel) { this.gamePanel = gamePanel; Paint += PaintView; synthesizer = new SpeechSynthesizer(); timer = new Timer(); timer.Tick += TimerClock; timer.Interval = 1000; }
public ClickMe(GamePanel panel, Wiimote wm) : base(panel, wm) { Wm.SetRumble(false); timer = new Timer { Interval = 1000 }; timer.Tick += TimerClock; viewTimer = new Timer { Interval = 15 }; viewTimer.Tick += ViewTimerClock; }
public MarathonForm() { AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; Name = "Marathon des millions"; // Rajout des choix à la grammaire du prog var grammar = new GrammarBuilder(); grammar.Append(new Choices("1", "2", "3", "4", "Yes", "No")); recognizer = new SpeechRecognitionEngine(); recognizer.SetInputToDefaultAudioDevice(); recognizer.UnloadAllGrammars(); recognizer.LoadGrammar(new Grammar(grammar)); recognizer.SpeechRecognized += SpeechRecognized; recognizer.AudioLevelUpdated += AudioLevelUpdated; recognizer.RecognizeAsync(RecognizeMode.Multiple); // create a new instance of the Wiimote wm = new Wiimote(); scorePanel = new ScorePanel(); gamePanel = new GamePanel(wm); questionPanel = new QuestionPanel(gamePanel); // setup the event to handle state changes wm.WiimoteChanged += WiimoteChanged; // setup the event to handle insertion/removal of extensions wm.WiimoteExtensionChanged += WiimoteExtensionChanged; // connect to the Wiimote wm.Connect(); // set the report type to return the IR sensor and accelerometer data (buttons always come back) wm.SetReportType(InputReport.IRAccel, IRSensitivity.WiiLevel5, true); Layout += MarathonLayout; Controls.Add(questionPanel); Controls.Add(scorePanel); Controls.Add(gamePanel); questionPanel.Start(); }
protected MiniGame(GamePanel gamePanel, Wiimote wm) { GamePanel = gamePanel; Wm = wm; }
public Run(GamePanel panel, Wiimote wm) : base(panel, wm) { timer = new Timer { Interval = 100 }; timer.Tick += TimerClock; }