How do I Move Object With Tilting?

Get help using Construct 2

Post » Wed Jul 23, 2014 4:03 pm

How to move an object by tilting the phone?

I use Cocoonjs and exported it to APK

Thanks
Last edited by ijoin on Wed Jul 23, 2014 5:10 pm, edited 2 times in total.
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Wed Jul 23, 2014 4:11 pm

ijoin wrote:How to move an object by tilting the phone?

I use Cocoonjs and exported it to APK

Thanks

Choose "Touch" > "Compare Orientation" > Select Orientation "beta" or "gamma" (beta - front to back tilt, gamma - left to right) and set the tilt angle, then just add sprite > move at angle that you need, or where you need to move it.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Wed Jul 23, 2014 4:17 pm

Sisyphus wrote:
ijoin wrote:How to move an object by tilting the phone?

I use Cocoonjs and exported it to APK

Thanks

Choose "Touch" > "Compare Orientation" > Select Orientation "beta" or "gamma" (beta - front to back tilt, gamma - left to right) and set the tilt angle, then just add sprite > move at angle that you need, or where you need to move it.


Btw, is there any way to test tilting on browser?
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Wed Jul 23, 2014 4:22 pm

Sorry my english is pretty weak.
example.capx

Here, i made a little example of that, try to tilt your device left and right, i just try that on cocoonjs 2.0.2.

ijoin wrote:Btw, is there any way to test tilting on browser?

Only if you had accelerometer in your device, i don't know any other way. Maybe someone else know how.
You do not have the required permissions to view the files attached to this post.
Last edited by Sisyphus on Wed Jul 23, 2014 4:25 pm, edited 1 time in total.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Wed Jul 23, 2014 4:25 pm

Sisyphus wrote:Sorry my english is pretty weak.
example.capx

Here, i made a little example of that, try to tilt your device left and right, i just try that on cocoonjs 2.0.2.


It's all right, gonna test your capx and report back soon :D
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Wed Jul 23, 2014 4:42 pm

@sisyphus I compiled it via Cocoonjs and it works very well!

Thank you very much bro, I owe you one :D
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Wed Jul 23, 2014 4:50 pm

ijoin wrote:@sisyphus I compiled it via Cocoonjs and it works very well!

Thank you very much bro, I owe you one :D

Glad to help :D
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Wed Jul 23, 2014 5:12 pm

I implemented the tilt function into my game, but it's not working correctly since my game orientation is landscape
The tilt detector thinks that my game is in portrait orientation

So how to pass the value as landscape mode?
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Wed Jul 23, 2014 6:23 pm

Bump!
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Wed Jul 23, 2014 6:30 pm

ijoin wrote:I implemented the tilt function into my game, but it's not working correctly since my game orientation is landscape
The tilt detector thinks that my game is in portrait orientation

So how to pass the value as landscape mode?

Try different angles on gamma or beta.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Next

Return to How do I....?

Who is online

Users browsing this forum: ditocruz, Google [Bot] and 19 guests