Touch. Shake device

Get help using Construct 2

Post » Mon Sep 03, 2012 1:50 pm

Hi

i'm building a small game and i wish to enable (shake device) to invoke a particular action.

i've been struggling with touch.accelerometer with no success.

in the game i want the player to be able to shake their phone to use a power up.

any help appreciated
B
6
Posts: 3
Reputation: 745

Post » Mon Sep 03, 2012 1:51 pm

sorry i meant touch.acceleration
B
6
Posts: 3
Reputation: 745

Post » Tue Sep 04, 2012 4:38 am

i was curious to know how to do it as well but seems nobody knows ?
B
11
G
1
Posts: 41
Reputation: 1,107

Post » Tue Sep 04, 2012 10:46 am

@shiprat @odesign : do you known in advance what kind of gesture you want the user to do ? If it's a shake, do you know how much shake you want to have, and on which axis ?
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Tue Sep 04, 2012 11:15 am

I think z axis movement not sure on speed. Just a quick up/down movement.
B
6
Posts: 3
Reputation: 745

Post » Tue Sep 04, 2012 8:10 pm

same answer here, same way as you shake a bottle so it could be even y axis
B
11
G
1
Posts: 41
Reputation: 1,107

Post » Sat Sep 15, 2012 10:44 pm

anyone have news about this topic ?
B
11
G
1
Posts: 41
Reputation: 1,107

Post » Mon Sep 16, 2013 3:31 am

I know this is an old thread, but did anyone ever figure this out?

I'd love to add an action when you shake the phone in an app I'm working on.

B
10
S
4
G
5
Posts: 136
Reputation: 2,977

Post » Mon Sep 16, 2013 8:31 am

I agree

http://televizyonizletr.blogspot.com/
B
2
Posts: 3
Reputation: 156

Post » Mon Sep 16, 2013 7:35 pm

Ironically I was going to ask a similar question.

I experimented with a layout that shows X Y and Z output from the touch.accelerometerx, y , and z (without gravity - not sure of the difference) in three text fields, but the resulting data does into several decimal points. I suppose I ought to use an integer of the output?

FYI: X is left and right movement, Y is up and down movement, and Z is towards and away from you.

I see my users performing a left-right shake gesture, which will fill a progress bar and ultimately trigger returning to the original layout.

What I would like is any suggestions regards measuring the rate of change - from the X axis data. 4.0x seems to be a comfortable point, (and I don't want users to inadvertently fling their phones across the room). So - thoughts on measuring this accumulated 'shake' data?

Any input is welcome and appreciated!

- Scott
B
9
S
3
G
1
Posts: 12
Reputation: 760

Next

Return to How do I....?

Who is online

Users browsing this forum: Zebbi and 21 guests