/**
   * Update the animation, sprites or whatever. If there is nothing to animate set the wait
   * attribute of the thread to true
   */
  private void updatePhysics() {
    // if nothing was updated :
    // this.wait = true;
    // this.wait = !mario.wasUpdated();
    // if(mSensor.isUpdated()) {
    float[] sensorData = mSensor.getAccel();
    mTheta = Math.toDegrees(Math.atan2(sensorData[1], sensorData[0]));

    if (mTheta < 89) {
      if (mario.getState() != Mario.states.JumpLeft && mario.getState() != Mario.states.JumpRight) {
        mario.setState(Mario.states.RunLeft);
      }
    } else if (mTheta > 91) {
      if (mario.getState() != Mario.states.JumpLeft && mario.getState() != Mario.states.JumpRight) {
        mario.setState(Mario.states.RunRight);
      }
    } else {
      if (mario.getState() == Mario.states.RunLeft) {
        mario.setState(Mario.states.StandLeft);
      } else if (mario.getState() == Mario.states.RunRight) {
        mario.setState(Mario.states.StandRight);
      }
    }
  }