Search the Community
Showing results for tags 'deviceorientation'.
I'm using the `deviceorientation` event to get phone rotation data. And I'm noticing that at least on my device the rotation data is very "jumpy". That is it can look something like this: 0 -10 0 1 2 4 40 20 Have not had a change to try the Gyroscope API but I imagine it has the same limitation. My question is, does any one know of a technique to smooth of the rotation data. So in the above example, it would be `0, 0, 1, 2, 4, 20`. The use case is that when a user rotates the phone to the left/right, the app would apply a force vector. But with jumpy data like the above, the
Try it here : http://topheman-playground.herokuapp.com/ I developped a little experiment that could lead to a game. Basically, it's using : NodeJS with socket.io for the real time (plugged on expressjs for the server part/session management) Ball.js (client side) : a little library I wrote that handles the physics of the balls as well as their rendering on the canvas. Once you're connected to the main page with a desktop or a laptop, snap the QR-Code with a mobile device (phone/tablet), you will be able to control your ball by tilting your phone like on a labyrinth game, using your phone lik
Topheman Bombs takes advantage of the accelerometer (devicemotion/deviceorientation events) on your device.It's using Ball.js, a game engine I made that handles physics interactions between balls as well as rendering. You can play offline, or on your desktop browser via the accelerometer emulator !Tilt your device to manage the blue dotTap the screen to drop bombs on the enemies (red dots)Grab the green dots to get more bombsTest Topheman Bombs here + video demo ...