How do I implement tilt controls consistently across mobile

Get help using Construct 2

Post » Sun Apr 13, 2014 8:53 am

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
Last edited by shirogr on Mon Apr 14, 2014 12:23 pm, edited 1 time in total.
B
5
Posts: 20
Reputation: 370

Post » Mon Apr 14, 2014 12:23 pm

Anyone? Any ideas?
B
5
Posts: 20
Reputation: 370

Post » Thu Jun 26, 2014 7:23 pm

Did you ever get an answer because i'm stuck too!
B
7
S
1
Posts: 74
Reputation: 1,368

Post » Thu Jul 17, 2014 2:56 pm

Nope, I never got a reply from anyone and I also posted on Reddit-no luck there either. I have abandoned the project now and will NEVER touch tilt controls in Construct 2 again.
B
5
Posts: 20
Reputation: 370

Post » Wed Oct 08, 2014 6:55 pm

I'm having same issue.

Tilt works perfect when I run on an ipad (using gamma / beta) . But same tilt program does not work on Galaxy.

Anyone have a guess as to why?
B
11
S
2
Posts: 19
Reputation: 889

Post » Thu Oct 09, 2014 1:39 am

I wrote about this in my blog for Firefox OS using HTML5. You can read it here if you want to see the underlying native HTML5 code. http://firefoxosgaming.blogspot.com/2013/12/device-orientation-game-programming.html.

The technical term is device orientation.

Unfortunately, the sad answer is:

1. Not all device manufacturers support this.

2. Not all browsers support this.

I wanted to go further with this but there isn't enough support yet. Sorry!
Proud Construct 3 subscriber.
B
20
S
5
G
5
Posts: 205
Reputation: 4,614


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], troxx, TwistedSaviour and 1 guest