# Accelerometer to control handstans man?

In my game i have to control handstand man using accelerometer. i used this code:

``````function acc:accelerometer(e)
if(e.yGravity > 0.1 and e.yGravity < 0.2)then
boy:applyLinearImpulse(0.1, .5, boy.x, boy.y)

elseif(e.yGravity > 0.2 and e.yGravity < 0.3)then
boy:applyLinearImpulse(0.2, .5, boy.x, boy.y)

elseif(e.yGravity > 0.3 and e.yGravity < 0.4)then
boy:applyLinearImpulse(0.3, .5, boy.x, boy.y)

elseif(e.yGravity > 0.4 and e.yGravity < 0.5)then
boy:applyLinearImpulse(0.4, .5, boy.x, boy.y)

elseif(e.yGravity > 0.5 and e.yGravity < 0.9)then
boy:applyLinearImpulse(0.5, .5, boy.x, boy.y)

elseif(e.yGravity > -0.1 and e.yGravity < 0.1)then
boy:applyLinearImpulse(-0.1, .5, boy.x, boy.y)

elseif(e.yGravity > -0.2 and e.yGravity < -0.1)then
boy:applyLinearImpulse(-0.2, .5, boy.x, boy.y)

elseif(e.yGravity > -0.3 and e.yGravity < -0.2)then
boy:applyLinearImpulse(-0.3, .5, boy.x, boy.y)

elseif(e.yGravity > -0.4 and e.yGravity < -0.3)then
boy:applyLinearImpulse(-0.4, .5, boy.x, boy.y)

elseif(e.yGravity > -0.5 and e.yGravity < -0.4)then
boy:applyLinearImpulse(-0.5, .5, boy.x, boy.y)

elseif(e.yGravity > -0.9 and e.yGravity < -0.5)then
boy:applyLinearImpulse(-0.6, .5, boy.x, boy.y)
end
``````

-
Flagged as not a real question. Please try to tell us what you want to do http://translate.google.com/ – Byte56 Mar 13 '12 at 15:28

``````function acc:accelerometer(e)