Add accelerometer handling for control pointer

This commit is contained in:
Victor 2014-01-14 23:05:37 +02:00
parent c299b2140e
commit 97f3dfc265

View File

@ -49,6 +49,10 @@ public class Pointer {
} }
private void controlByAccelerometer() { private void controlByAccelerometer() {
float ax = Gdx.input.getAccelerometerX();
float ay = Gdx.input.getAccelerometerY();
x += ax * screenWidth / 500f;
y += ay * screenHeight / 500f;
} }
} }