Hi!
I’m making a juggle game where there is a paddle that you move with the touch of your finger. Everything works fine, but now I have implemented some orientation code so that you can flip the device from landscapeLeft to landscapeRight and vice versa (in main.lua):
http://developer.anscamobile.com/code/proper-orientation-rotation-animation
My default is landscapeLeft, but when I flip it to landscapeRight the touch event inverts! So when I try to move the paddle to the left (by touching to the left) it moves to the right and vice versa.
How do I do to fix this?
My code to move paddle:
[code]
function movePaddle:touch(e)
if(e.phase == ‘began’) then
lastX = e.x - paddle.x
elseif(e.phase == ‘moved’) then
paddle.x = e.x - lastX
end
end
Best regards,
joelwe
[/code] [import]uid: 54640 topic_id: 22298 reply_id: 322298[/import]
