acceleromoter = new FlxAccelerometer();
....
// update method below
#if ACCELERATOR
var deceleration:Float = 1;
var sensitivity:Float = 8.0;
var maxVelocity:Float = 50;
velocityX = acceleromoter.x;
velocityY = acceleromoter.y;
if (velocityX > maxVelocity) {
velocityX = maxVelocity;
} else if (velocityX < -maxVelocity) {
velocityX = -maxVelocity;
}
if (velocityY > maxVelocity) {
velocityY = maxVelocity;
} else if (velocityY < -maxVelocity) {
velocityY = -maxVelocity;
}
this.player.velocity.x = velocityX;
this.player.velocity.y = velocityY;
#end