# How do I use the accelerometer

Get help using Construct 2

### » Mon Mar 07, 2016 7:08 pm

Hello everyone,

I'm making a game where i need to use the accelerometer to fly a bird. I want to be able of moving the bird on all directions like "8 directions behavior".

Any help will be appreciate.
B
10
S
2
Posts: 21
Reputation: 594

### » Mon Mar 07, 2016 7:09 pm

@Ashley i have been viewing the forum and i saw you are one of the most familiar with the subject. Do you have any demo or something that can be helpful to me
B
10
S
2
Posts: 21
Reputation: 594

### » Mon Mar 07, 2016 7:44 pm

https://www.scirra.com/tutorials/202/to ... put-method
https://www.scirra.com/manual/119/touch

The Compare Orientation with Alpha Beta and Gamma in the touch object is what you are looking for.
B
58
S
28
G
115
Posts: 1,717
Reputation: 65,207

### » Mon Mar 07, 2016 7:59 pm

@oosyrag yes i know. I have an example .apk installed but what i want exactly is how can i use the values of Alpha Beta and Gamma to make the movements gradually like UP, Down, etc. I want detect when Gamma changes, apply the movement(UP, DOWN, etc) gradually and depending the value of Gamma, apply more or less acceleration.

If you make a fast movement the bird need to be more faster than if you make an lower one.

That's exactly the functionality i cant figure out how to do it.

Note: I'm not an expert in construct
B
10
S
2
Posts: 21
Reputation: 594

### » Mon Mar 07, 2016 9:12 pm

There is an action with the 8direction behavior - Set acceleration. You'll want to put an expression Touch.Gamma in here to get the Gamma, or your degrees tilt. Use math to adjust the final value to the speed you like.
B
58
S
28
G
115
Posts: 1,717
Reputation: 65,207

### Who is online

Users browsing this forum: mikewalton206 and 64 guests