How do I add the accelerometer in my game for Android ?

Get help using Construct 2

Post » Fri Apr 03, 2015 10:50 am

Hello , I wanted to ask how I can add the accelerometer to my project of a android game.
Among the various methods of input in construct 2 I found muouse keyboard , touch and other things, but not the accelerometer and other sensors .
Thanks a lot.
B
3
Posts: 3
Reputation: 181

Post » Fri Apr 03, 2015 11:01 am

Accelerometer can be found as expressions in the Touch plugin

You want to compare the values of AccelerationX, AccelerationY, AccelerationZ or AccelerationXWithG, AccelerationYWithG, AccelerationZWithG or still Alpha, Beta, Gamma to see in what axis the device is being rotated/turned/etc...

You likely should use the "Compare two values" system condition to do so.
Not all devices actually do allow browsers/HTML5 technology to take advantage of the accelerometer, so be sure to check on your device.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
253
S
87
G
42
Posts: 7,040
Reputation: 59,295

Post » Fri Apr 03, 2015 1:42 pm

Thanks to a friend very much.
I was able to add the accelerometer , but now I need to import as apk file to test on my smartphone .
Do you know if and how you can do?
Many thanks.
B
3
Posts: 3
Reputation: 181

Post » Sun Apr 05, 2015 2:27 pm

This blog article all the informations and links on how to currently export to mobile with Construct 2.
Note: You need to own a valid C2 license to follow those steps. Otherwise, just forget about mobile and focus on HTML5 development.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
253
S
87
G
42
Posts: 7,040
Reputation: 59,295


Return to How do I....?

Who is online

Users browsing this forum: annauva, SpyDaniel, Zebbi and 14 guests