Add accelerometer handling for control pointer
This commit is contained in:
parent
c299b2140e
commit
97f3dfc265
@ -49,6 +49,10 @@ public class Pointer {
|
||||
}
|
||||
|
||||
private void controlByAccelerometer() {
|
||||
float ax = Gdx.input.getAccelerometerX();
|
||||
float ay = Gdx.input.getAccelerometerY();
|
||||
|
||||
x += ax * screenWidth / 500f;
|
||||
y += ay * screenHeight / 500f;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user