Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        public QuestionPanel(GamePanel gamePanel)
        {
            this.gamePanel = gamePanel;
            Paint += PaintView;

            synthesizer = new SpeechSynthesizer();

            timer = new Timer();
            timer.Tick += TimerClock;
            timer.Interval = 1000;
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
 protected MiniGame(GamePanel gamePanel, Wiimote wm)
 {
     GamePanel = gamePanel;
     Wm = wm;
 }
Ejemplo n.º 6
0
 public Run(GamePanel panel, Wiimote wm)
     : base(panel, wm)
 {
     timer = new Timer { Interval = 100 };
     timer.Tick += TimerClock;
 }
Ejemplo n.º 7
0
 protected MiniGame(GamePanel gamePanel, Wiimote wm)
 {
     GamePanel = gamePanel;
     Wm        = wm;
 }