Okay, I’ve searched as best I can these forums (searching is very broad here to say the least) and can’t find code that works.
Simple problem (not for noobs like me but…). Tilt based game based on old school wood labyrinth game.
Build settings are landscapeRight.
I found and used the code from the Shape/Tumbler demo and it works perfect, in portrait mode. Not in landscape.
[lua]local function onTilt( event )
physics.setGravity( 10 * event.xGravity, -10 * event.yGravity )
end
Runtime:addEventListener( “accelerometer”, onTilt )[/lua]
That works in portrait like the demo. I tried modifying positive and negative, changing x to y, etc… and I can get the up and down to work but still can’t get left to right working. At this point I’m out of ideas and looking for the correct code.
Thanks,
David [import]uid: 206478 topic_id: 35091 reply_id: 335091[/import]