Hello, I have a question, I have a small mobile Internet provider and I create a game in html and javascript that the user shaking the phone can receive letters that later can be exchanged over the Internet. I already know how to capture the movement of the mobile phone:
window.addEventListener("deviceorientation", handleOrientation, true);
function handleOrientation(event) {
var absolute = event.absolute;
var alpha = event.alpha;
var beta = event.beta;
var gamma = event.gamma;
}
But I do not know how to actually develop the algorithm that detects shaking up and down the device and ignores the rest of the moves! Can someone help me?