Smooth accelerometer movement

Hello,

I need a help. 

I set up a code for accelerometer-gravity based movement

local function moveZodo(event) zodo:setLinearVelocity(10\*event.xGravity,-10\*event.yGravity) end

Although it works but its not the way i want it to work.

I want the movement to be like in the game  Gravity Maze  by Geemzo.

Anyone please help me out.

:(  

Hi @playpunkgames,

I would suggest that you follow the method in our “ShapeTumbler” sample app. Instead of directly setting the linear velocity on the object (which will cause jerky motion), it simply resets the physical gravity of the simulation based on the accelerometer’s values.

https://github.com/coronalabs/samples-coronasdk/tree/master/Physics/ShapeTumbler

Take care,

Brent

Hi @playpunkgames,

I would suggest that you follow the method in our “ShapeTumbler” sample app. Instead of directly setting the linear velocity on the object (which will cause jerky motion), it simply resets the physical gravity of the simulation based on the accelerometer’s values.

https://github.com/coronalabs/samples-coronasdk/tree/master/Physics/ShapeTumbler

Take care,

Brent