Ok. I have read through the forums, checked the touch object in the manual, I have downloaded capx to see what other people have done and have experimented for lots of days (I did print out the values returned) but I still can not find a way to implement Tilt controls consistently on different mobile devices.
The target:
I am making a game where I want to make a penguin move left when the player tilts his phone left and right when he tilts it right in portrait mode. I used the following methods.
-The first one used the Touch.Gamma expression.
-The second one used the Touch.Beta expression.
-The third used the Touch.AccelerationXWithG expression.
The problem:
Each method works on some mobiles but not on others!! I tested on the following mobiles and have noted what controls work and what not:
Samsung Galaxy Wonder (android 4.2.2): Acceleration Yes, Gamma Yes, Beta No.
Samsung Galaxy Tab 2 10.1 (android 4.2.2): Acceleration No, Gamma No, Beta Yes.
----Also, if the player has deactivated AutoRotation on their phone, Touch.AccelerationXWithG returns 0 which, as you can understand, breaks the controls.
Samsung Galaxy Fame (android 4.1.2): Acceleration No, Gamma Yes (inverted), Beta No.
Sony Experia Acro S (android 4.1.2): Acceleration Yes, Gamma Yes, Beta No.
Request:
Can anyone help me figure this out? Other people have made games with tilt controls that work on multiple devices, so I am probably not doing something correctly (or I am plain dumb). I am willing to give a consulting fee of $10 to the person that can help me solve this issue. Below I include a link to the capx that I used to test things and an apk, so you can see the code I used and test it on your phones.
https://dl.dropboxusercontent.com/u/1342998/OrientationTest_Multi.capx - capx
https://dl.dropboxusercontent.com/u/1342998/OrientationTest.android.apk - apk for phone iXDK export