Physics/Acceleromerter question

Hi all…

I am trying to understand how the accelerator and physics work, so I create a small program that moves a ball around the screen when you tilt the device.

I do not understand whyit only works if I have an enterFrame listener defined, even if the listener is empty:

[lua]local physics = require “physics”
physics.start(true)
physics.setGravity(0,0)
physics.setScale(60)
system.setAccelerometerInterval( 100 )
function onNewFrame(event)
– empty!
end

function onTilt(event)
physics.setGravity( 10*event.xGravity, -10 * event.yGravity )
end

imgBall=display.newImage(groupMain, “ball.png”)
imgBall.x=100
imgBall.y=100
imgBall.name=“ball”
physics.addBody(imgBall, “dynamic”,
{bounce = 0.1, friction = 0.5, density = 5.0, radius = imgBall.width/2})

Runtime:addEventListener( “accelerometer”, onTilt )
Runtime:addEventListener( “enterFrame”, onNewFrame )[/lua]

If I comment out the enterFrame listener, the ball just sits there. Can someone explain why this is happening?

thanks [import]uid: 114363 topic_id: 24139 reply_id: 324139[/import]

Sorry for the bump, but can anyone help out? Not sure if this is normal of if I am doing something wrong.

thanks [import]uid: 114363 topic_id: 24139 reply_id: 98044[/import]