Why is this code not working? It is supposed to allow me to control a ball I’ve got on my screen.
– Accelerometer
local motionx = 0
local motiony = 0
local function onAccelerate( event )
motionx = 35 * event.xGravity
motiony = 35 * event.yGravity
end
Runtime:addEventListener (“accelerometer”, onAccelerate)
local function moveball (event)
ball.x = ball.x + motionx
ball.y = ball.y - motiony
end
Runtime:addEventListener(“enterFrame”, moveball)
I’m using the Corona remote to try tilt the ball, but it wont tilt? [import]uid: 14018 topic_id: 5308 reply_id: 305308[/import]