0
Hello, I have a question, I have a small Mobile Internet provider and I create create a game in html and javascript that the user to shake the phone can receive letters that later can exchange for Internet. I already know how to capture cell phone movement:
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 don’t know how to really develop the algorithm that detects the shake up and down of the device and ignore the rest of the moves! Can someone help me?