I'm making a simple game in AS3 for android/apple phones and I'm using the Accelerometer to move around a little guy through a tunnel thing. So I want to know how to make him look in the direction that he is moving in.
I have a movieclip called "ball" which is the guy. Then I use the "AccelerometerEvent.Update" eventlistener to a function called "accUpdate" where I've made two variables which are "accY" and "accY" which are being updated as you move the phone in different directions. Then in my main update function I have this snippet of code for the ball to move
if (!isNaN(accX)){
ball.x -= accX*15;
}
if(!isNaN(accY)){
ball.y += accY*15;
}
Please tell me if there is any more information you need to do this. Thanks in advance :D