I am planning out a game that I will be writing for android, and the accelerometer is something that I am not familiar with. Getting the tilt, and creating a vector for the player is a very important part of the game. I’ve read the documentation and various tutorials. Doing so was a little confusing b/c none of what I read relates to game programming. So I have a couple of questions:
How do I get a vector from a onSensorChange event?
How do I change this vector in a way that looks natural as the tilt lessens/advances?
There is many examples and tutorials will help u.
Link 1
Link 2
sample project
Link 3
i sure some of this u see it before, but hope it help u.
and these two i’m sure will help u to understand what onSensorChange exactly do:-
What happens when onSensorChanged() in called
Good Answer