How do I use the accelerometer

Get help using Construct 2

Post » 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

Post » 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

Post » 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.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » 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 :D
B
10
S
2
Posts: 21
Reputation: 594

Post » 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.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, David181 and 13 guests