I am using Andengine and using SenorEvents to make a sprite move with the accelerometer.
But for some reason with this code, on tablet if i am in landscape mode which the game is made in, it acts as if it is in portrait mode.
Am i doing anything wrong? On a regular cell phone device, it works correctly
Here is what i have.
sensorManager = (SensorManager) this.getSystemService(Arcade_MainGame.SENSOR_SERVICE);
sensorManager.registerListener(this, sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_GAME);
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
// TODO Auto-generated method stub
}
@Override
public void onSensorChanged(SensorEvent event) {
synchronized (this) {
switch (event.sensor.getType()) {
case Sensor.TYPE_ACCELEROMETER:
accellerometerSpeedX = (int)event.values[1];
accellerometerSpeedY = (int)event.values[0];
break;
}
}
}