QUESTION about X-accelerometer range or limit ...

 QUESTION about X-accelerometer range or limit …

i want my x  accelerometer limit only  to 70 - 250 only…

i dont know how…

this is my code…


    local acc = {}

   local sensitivity = 4

    local centerX = display.contentWidth * 0.5

    function acc:accelerometer(e)

        green.x = centerX + (centerX * e.xGravity * sensitivity)

    end

        Runtime:addEventListener(“accelerometer”, acc)


if green.x < 70 then green.x = 70 end

if green.x > 250 then green.x = 250 end

Tnx very much uncle Rob … :slight_smile:

if green.x < 70 then green.x = 70 end

if green.x > 250 then green.x = 250 end

Tnx very much uncle Rob … :slight_smile: