Smooth Accelerometer Use?
I'm working on a game and I need the accelerometer to let the player smoothly move from left to right kind of like Doodle Jump. I'm having problems making the movement feel smooth.
Any tips?
Any tips?
Comments
for left movement :
When game.accelerometer.x < -0.01
Constrain : self.motion.linear.x to -(game.accelerometer.x*800)
For right movement, change the <-0.01 to >0.01
Depending on the orientation of your phone, you might need to swap around the > and < rules, and the minus around the constrain.
Also, the "800" is how fast it feels, so change that to get different effects, also, try setting a max speed in the actor that you are moving, so it never gets to silly speeds.