Search the Community
Showing results for tags 'accelerometer'.
-
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 result isn't a smooth experience.
- 4 replies
-
- gyroscope
- accelerometer
-
(and 2 more)
Tagged with:
-
Hello, I appeal to you because I run out of time. I'm following a course and I need to create a game (simple) that makes use of device accelerometer, the course is done with Phonegap, created with HTML, CSS, JAVASCRIPT and use PHASER, preferably the physics engine. If you can help me. Thank you very much
- 3 replies
-
- javascript
- phaser
-
(and 1 more)
Tagged with:
-
Hello, I'm following a course with Phonegap and I have almost no time to study, if I do not do the project, I lose everything I invested. The problem is that I have to create a game (simple) created in javascript and make use of accelerometer, Phaser with its physics engine. If you can help me with a simple example. Thank you very much to all. a greeting
-
- javascript
- phaser
-
(and 1 more)
Tagged with:
-
Hi, Does phaser play nicely with gyro.js? Does it have a built in gyro support for ios input? I could not find anything in the documentation or example. Thanks!
- 2 replies
-
- Gyro
- accelerometer
-
(and 2 more)
Tagged with:
-
Hey guys, This is my first game for android made with p5js, cordova and angular js. https://play.google.com/store/apps/details?id=com.blissfullapps.blissgame Simple addictive accelerometer based game with a single mechanic. Subtle changes as you go make things interesting, keeps you on your toes, questions your ability, makes you think about how tiny changes increase the difficulty and how practice removes that difficulty very soon. Good soothing background music. The game play video is here One bug that I have in this game is, the background music keeps playing unless the game is exited or stopped in the background if the user exits by pressing home button. Any suggestion how to fix that issue? I have tried with javascript events and a bit of android native code changes but it didn't work. Designed and developed the whole thing myself. Any feedback will be appreciated and please share
-
Hi - I've just written my first android game using the accelerometer. But it does not work. To be precise the callbacks in the following statement never get executed: this.watchID = navigator.accelerometer.watchAcceleration(this.onSuccess, this.onFailure, options); I can trace the code into this statement and the statement executes without error, returning a valid watchID. However, the onSuccess and onFailure methods never get called. It's like my phone has no accelerometer or the accelerometer has been disabled. I am using the cordova command-line tools. I thought this was something to do with my code, so I created a new cordova project and used the example accelerometer code. What I found was that in the emulator the callback for onFailure was called. I presume this is correct as the emulator has no accelerometer. However, when I transferred the example app to my phone, no callback - success or failure - was ever called. So I don't think my code is at fault. Perhaps it is something to do with my phone. It is a Nexus 4 and has just been upgraded to the latest Android (lollipop). The API level of the game is 19. Do I have to do something to enable the accelerometer on my phone? There must be something major I'm missing since I get something from the emulator but nothing from the actual phone. Thanks in advance for any help. Ken
-
Hello guys, I want to move my sprite to left/right using the gyroscope/accelerometer. Is there something on panda to do this? Edit: Unfortunately the link here: http://www.html5gamedevs.com/topic/7064-how-to-use-accelerometer/?hl=accelerometer is offline.
- 6 replies
-
- accelerometer
- gyroscope
-
(and 1 more)
Tagged with:
-
I would like to know how to exactly use the accelerometer feature. I want to implement it on my game. Great work on this engine. I love it.
-
Hi, It's my first time using the Phaser.io and I must say it is great so far. I've ran into a problem, I want to create a webbased game that you can play on a mobile device using the accelerometer. What I want to do is change the angle of a sprite based on the x and y value of the accelerometer. Problem is, I don't know how to do this at all. I'm using the gyro.js library to get the tracking values. At the moment I'm using this code in my create() function to move the sprite on the screen (but it doesn't rotate accordingly): if(gyro.getFeatures().length > 0) { gyro.frequency = 10; gyro.startTracking(function(o) { player.body.velocity.x += o.x; player.body.velocity.y += o.y; });} Can anyone tell me how I could accomplish this?