Accelerometer Controls

Get help using Construct 2

Post » Sat Jan 28, 2012 2:19 pm

Hey guys
i am making a plane game for mobile
can anyone tell me how to use axelerrometers for control ( tilt right and left up and down )
B
38
S
16
G
17
Posts: 2,230
Reputation: 17,220

Post » Sat Jan 28, 2012 10:24 pm

Use the Touch object to access the accelerometer. You'll have to experiment to get it right, but you could try something like this using 'Compare two values':

Touch.Gamma < -5: simulate control 'left'
Touch.Gamma > 5: simulate control 'right'
Scirra Founder
B
378
S
220
G
84
Posts: 23,867
Reputation: 188,027

Post » Tue May 29, 2012 12:32 am

and giroscope???
B
9
S
2
G
4
Posts: 3
Reputation: 2,895

Post » Tue May 29, 2012 7:06 am

[QUOTE=87santito] and giroscope???[/QUOTE]


I guess Touch.Alpha is used for giroscope
B
91
S
31
G
29
Posts: 3,129
Reputation: 27,789

Post » Thu May 02, 2013 12:38 pm

is there a example capx for this ?
B
30
S
6
G
4
Posts: 108
Reputation: 5,602

Post » Sun Aug 10, 2014 11:59 pm

guys how to test tilts?
B
5
Posts: 2
Reputation: 234

Post » Fri Oct 10, 2014 1:59 am

ajmaganito wrote:guys how to test tilts?

I think there is a way to test it in Intel XDK emulator.
ImageImageImageImage
B
48
S
15
G
71
Posts: 601
Reputation: 40,052

Post » Sat Feb 28, 2015 11:33 pm

For me, the accelerometer specifically Touch.Alpha works fine with Cocoonjs on an iPad 2 but it doesn't work properly as in it glitches when converted to an .apk file built from cordova in intel XDK and tested on a Samsung Galaxy tablet and Samsung S4. Does anyone know why this happens?
B
7
S
1
Posts: 17
Reputation: 495

Post » Sat Apr 11, 2015 4:18 pm

@Apex General, It would be appreciated if you started a new thread, rather than necro-ing another one
B
38
S
16
G
17
Posts: 2,230
Reputation: 17,220

Post » Sun Apr 12, 2015 3:36 am

how about using rex's tilt to arrow key plugin?
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
58
S
13
G
2
Posts: 283
Reputation: 6,330

Next

Return to How do I....?

Who is online

Users browsing this forum: DJKeefy, mekonbekon, Odin, SputnikCZ and 9 guests