Ejemplo n.º 1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (countdown)
            {
                if (timer == 0)
                {
                    timer = gameTime.TotalGameTime.TotalMilliseconds + 5000;
                    counterLabel.Visible     = true;
                    instructionLabel.Visible = true;
                    infoLabel.Visible        = false;
                }
                else if (timer > gameTime.TotalGameTime.TotalMilliseconds)
                {
                    // convert the difference to seconds
                    int displayCount = (((int)(timer - gameTime.TotalGameTime.TotalMilliseconds)) / 1000) + 1;
                    instructionLabel.Text = displayCount.ToString();
                }
                else
                {
                    countdown                = false;
                    counterLabel.Visible     = false;
                    instructionLabel.Visible = false;
                    infoLabel.Visible        = true;
                    _emgInput.Calibrate();
                }
            }
        }
        public override void OnCreate()
        {
            _emgInput.Calibrate();
            base.OnCreate();

            _emgInput.MuscleActivationChanged += _emgInput_MuscleActivationChanged;
        }