From fcbb0aeb2c710d8e77e7db8cb128071b4da4fc7d Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 15 Jan 2014 20:10:36 +0200 Subject: [PATCH] Fix accelerometer processing --- src/com/annimon/influencexxii/Pointer.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/com/annimon/influencexxii/Pointer.java b/src/com/annimon/influencexxii/Pointer.java index 2428cc0..30e4623 100644 --- a/src/com/annimon/influencexxii/Pointer.java +++ b/src/com/annimon/influencexxii/Pointer.java @@ -3,6 +3,7 @@ package com.annimon.influencexxii; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.Input.Peripheral; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; /** @@ -74,15 +75,8 @@ public class Pointer { } private void controlByAccelerometer() { - int orientation = Gdx.input.getRotation(); - float ax = Gdx.input.getAccelerometerX(); - float ay = Gdx.input.getAccelerometerY(); - - if (orientation == 90) { - float temp = ax; - ax = ay; - ay = -temp; - } + float ax = Gdx.input.getAccelerometerY(); + float ay = -Gdx.input.getAccelerometerX(); x += ax * screenWidth / 500f; y += ay * screenHeight / 500f;