Search the Community
Showing results for tags 'devicemotion'.
-
How do you guys do motion detection (if any) in your apps? Motion detection is when you detect when the user shakes their phone (for example). I just tried the following in Android Chrome to no avail: devicemotion event API. Supposedly it works on Chrome but it had no effect on my phones. See https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent. Interestingly, it did work on Firefox Focus this code snippet for cross-browser compatibility. Again, it did not work on Android Chrome. See https://stackoverflow.com/a/4378439/555493 the Gyroscope API. See https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope Curious to see what people do to handle device motion. Currently, the best approach seems to be to use something like Flutter to shove device motion events into state, render the app into a Web view, and then query the motion state from the Web view as needed.
- 3 replies
-
- motion sensor
- gyroscope
-
(and 2 more)
Tagged with:
-
Topheman Playground - use your phone as a remote !
topheman posted a topic in Coding and Game Design
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 like a Wiimote to your desktop screen. This is more an experiment that could lead to a game than a game itself. All the sources are on github under MIT license, so feel free to fork it, give some feedback/ideas. Tophe PS : The demo is hosted on a heroku instance that doesn't support Websocket (so it fallbacks on xhr-polling), this is why you may have a little latency and the ball may take sometime to disconnect. You can install it on your computer if you have node, it's a simple npm install, everything's explained in the readme. -
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 ...
-
- devicemotion
- deviceorientation
-
(and 1 more)
Tagged with: