How to get motion control values from iPad ?

Get help using Construct 2

Post » Fri Nov 25, 2011 11:10 am

I'm new in Construct 2 and try to make a motion control on iPad.
I Use some actions to get values on every tick, and show them as text on the screen.
As the test I can get the "Touch.AccelerationXWithG" value on my iPad.
but the "Touch.AccelerationY" and "Touch.Alpha" seems didn't work.
Do I got something wrong ? How can I get those montion values ?
B
24
S
4
G
6
Posts: 13
Reputation: 5,424

Post » Fri Nov 25, 2011 2:59 pm

Answer myself.
I make a test for 3 group of values.
1.Direction
2.Acceleration
3.Acceleration with gravity

On HTC HERO with android 2.1 got nothing.
On HTC Desire with android 2.2 got nothing ,too.
On iPad 1 (with iOS 4.3.1) got only the 3.
But on iPhone 4 (with iOS 5) all of them works well.

I think maybe I should upgrade my iPad and try again.:)
B
24
S
4
G
6
Posts: 13
Reputation: 5,424

Post » Fri Nov 25, 2011 4:38 pm

It depends on the browser and phone hardware - like you've done you just need to play with different devices and see which values work.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Nov 25, 2011 5:42 pm

On iPad 1 (with iOS 5.1) got only the 3.
Seems iPad 1 cant make direction control with Construct 2 r69 .

I just met Construct 2 two Days before and feel it's a great tool making thinkings into a game quickly and easily , thanks for doing the great job!
But
by now I think not to use it making games with motion control , maybe put a hope to the later version :)

B
24
S
4
G
6
Posts: 13
Reputation: 5,424

Post » Mon Jan 09, 2012 9:41 am

Hi Hayato,

Could you add a capx file of your findings?

I'm currently working on motion controls for the iPad 1st gen and am yet to be successful.
B
5
S
1
G
1
Posts: 111
Reputation: 1,122

Post » Mon Jan 09, 2012 1:41 pm

@all : remember that the iPad 1 has no gyroscope inside. So you can only get acceleration reading, no direction/heading...
With acceleration, you need to integrate (mathematically) that information two times to get position, and even that way, it's very innacurate.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Wed Jan 11, 2012 3:59 am

I cant upload my capx to dropbox by this PC now , but there is my test page :
http://dl.dropbox.com/u/12420207/M2/index.html

By using it we can define your device if it may support those values or not quickly.

In some case , device cannot get any value in offical web browser , but get values in 3rd-party web browsers, for example the SE Xperia Arc.
hayato2012-01-11 04:01:00
B
24
S
4
G
6
Posts: 13
Reputation: 5,424

Post » Fri Mar 02, 2012 8:23 pm

This test is preety usefull:
Actually I'm also interested on a capx file of the test you posted here(if at all possible when youre able). It shows some interesting values on my iphone 3gs and some nice movement that I'd like to take a more detained look at. I'm trying to make a shooter that should combine accelerometer valeues and swipe for certain movements.
Freefall Bird
B
37
S
8
G
5
Posts: 262
Reputation: 5,360

Post » Sat Mar 31, 2012 11:12 pm

Hi Hayato,
I'm also interested in seeing the capx. Or if you don't want to do that would you mind just typing down the commands you used? I can't seem to find any examples on the 'touch.acceleration' controls.
B
34
S
8
G
3
Posts: 328
Reputation: 7,692

Post » Tue Apr 17, 2012 9:16 pm

Sorry for reply late , I have forget to login here for a long time.
Now I have use the latest version (r87) of Construct 2 and make some upgrade for the sample :
http://dl.dropbox.com/u/12420207/C2/Motion2/index.html

or access by QR code


And you can get the capx here:
http://dl.dropbox.com/u/12420207/C2/Motion2/Motion2.capx

Hope those files are helpful for you :)hayato2012-04-17 21:56:17
B
24
S
4
G
6
Posts: 13
Reputation: 5,424

Next

Return to How do I....?

Who is online

Users browsing this forum: h1k3, LeFuji and 18 guests