Using the accelerometer in android?

Get help using Construct 2

Post » Sun Aug 11, 2013 3:32 pm

Using the accelerometer in android? I tried several tutorials but I get, I want to move a ship right or left, would appreciate any help

Sorry for my English
B
9
S
2
G
2
Posts: 6
Reputation: 1,369

Post » Sun Aug 11, 2013 4:47 pm

You need to use the Touch.Alpha/Beta/Gamma properties to set the position (or bullet angle, or whatever you're using) and angle of your object.

Here's a little example capx [r140] that shows all three values in action.

And here is a slightly more advanced example.GeometriX2013-08-11 17:12:12
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Sun Aug 11, 2013 5:22 pm

Thanks!!!!
B
9
S
2
G
2
Posts: 6
Reputation: 1,369

Post » Sun Jan 18, 2015 1:42 pm

Hey @GeometriX, we're having a hard time understanding the orientation readouts over here

Can you tell me if your example is meant to work as a compass, or at least did it use to work as a compass in a previous C2 version at that time?

In my case it's turning "faster" at some point than the tablet, and I'm still trying to figure out whether to report it as a bug or not
B
22
S
6
G
8
Posts: 328
Reputation: 6,651


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, cb130felix, jorgmaquoi, Kermad, Lancifer, piddlyPoo and 4 guests