How can i use the accelerometer to move a sprite

0 favourites
  • 3 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • How can i use the my phone's motion sensor (accelerometer) to move a sprite?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • thank you

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)