title: Cocos2d-x Accelerometer x y interchanged in iPhone6 and iPhoneX
body: <p>Works perfect in iPhoneX. In iPhone6 when I tilt in landscape mode then accelerometer value comes even in Portrait game. How to get accelerometer value in portrait tilt ? Game is in Portrait. But accelerometer treat it as landscape..</p>
  
  <p>Here is Code:</p>
  
  <pre><code>    Device::setAccelerometerEnabled(true);
  
      mAccelerometerListener = EventListenerAcceleration::create(CC_CALLBACK_2( GBGameScene::onAcceleration, this));
      _eventDispatcher-&gt;addEventListenerWithSceneGraphPriority(mAccelerometerListener, this);
  </code></pre>
  
  <p>Accelerometer Code:</p>
  
  <pre><code>void GBGameScene::onAcceleration(Acceleration* acc, Event* event)
  {
      //  Processing logic here
  
      float deceleration = 1.0f;
      float maxVelocity = 100;
  
      playerVelocity.x = playerVelocity.x * deceleration + acc-&gt;x;
      playerVelocity.y = playerVelocity.y * deceleration + acc-&gt;y;
  
      if (playerVelocity.x &gt; maxVelocity)
      {
          playerVelocity.x = maxVelocity;
      }
      else if (playerVelocity.x &lt; -maxVelocity)
      {
          playerVelocity.x = -maxVelocity;
      }
  
  
      if (playerVelocity.y &gt; maxVelocity)
      {
          playerVelocity.y = maxVelocity;
      }
      else if (playerVelocity.y &lt; -maxVelocity)
      {
          playerVelocity.y = -maxVelocity;
      }
  
  //    Point pos = mGravityBall-&gt;getPosition();
  //    pos.x += playerVelocity.x;
  //    mGravityBall-&gt;setPosition(pos);
  
  }
  </code></pre>
  
  <p>I think nothing wrong with code as its working perfect in iphoneX. Why not its tilted in iPhone6 ?</p>