How can i use the accelerometer to move a sprite

Get help using Construct 2

Post » Fri Nov 18, 2016 6:05 am

How can i use the my phone's motion sensor (accelerometer) to move a sprite?
B
22
S
4
G
2
Posts: 55
Reputation: 2,220

Post » Fri Nov 18, 2016 2:49 pm

Swivels wrote:How can i use the my phone's motion sensor (accelerometer) to move a sprite?


Compare orientation
Compare the device's current orientation, if the device has a supported inclinometer. Alpha is the compass direction in degrees. Beta is the device front-to-back tilt in degrees (i.e. tilting forwards away from you if holding in front of you). A positive value indicates front tilt and a negative value indicates back tilt. Gamma is the device left-to-right tilt in degrees (i.e. twisting if holding in front of you). A positive value indicates right tilt and a negative value indicates left tilt.

Touch > Gamma Orientation greater/equal "start with -8" - Sprite > Simulate pressing left
Touch > Gamma Orientation greater/equal "start with 8" - Sprite > Simulate pressing right
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Fri Nov 18, 2016 6:11 pm

thank you
B
22
S
4
G
2
Posts: 55
Reputation: 2,220


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests