KevinnFtw Posted April 15, 2014 Share Posted April 15, 2014 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? Link to comment Share on other sites More sharing options...
KevinnFtw Posted April 15, 2014 Author Share Posted April 15, 2014 Never mind, seemed to be a caching issue. It is working now.. Link to comment Share on other sites More sharing options...
rich Posted April 15, 2014 Share Posted April 15, 2014 Would be interested to know how you get on with this. Link to comment Share on other sites More sharing options...
KevinnFtw Posted April 15, 2014 Author Share Posted April 15, 2014 Would be interested to know how you get on with this.I'd love to keep you updated. The game is just in the beginning stage, but still got 10 weeks to develop 'something' which will hopefully be a fully working game. Link to comment Share on other sites More sharing options...
Recommended Posts