What’s wrong with this code? When I test my app on my device the controls are messed up. I’m using landscape mode and when I tilt the phone north the ball moves to the right…
[code]
– Accelerometer
local motionx = 0
local motiony = 0
local function onAccelerate(event)
motionx = 15 * event.xGravity
motiony = 15 * 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)
[/code] [import]uid: 14018 topic_id: 5545 reply_id: 305545[/import]
