Xbox controller - angle

For questions about using Classic.

Post » Wed Dec 16, 2009 11:07 pm

Hi,
I'm struggling with something, keep trying but nothing works.
My problem is: How to make object (sprite) to rotate (or set it's angle) to angle of the xbox controller analogue stick.
If anyone have any ideas, please let me know.
Cheers
B
4
S
1
G
3
Posts: 85
Reputation: 1,234

Post » Wed Dec 16, 2009 11:36 pm

angle(0,0,Xbox360Controller.LeftThumbX(1),Xbox360Controller.LeftThumbY(1))
Spriter Dev
B
101
S
22
G
12
Posts: 3,274
Reputation: 17,079

Post » Wed Dec 16, 2009 11:48 pm

OMG
how did you figure it out? You are the best!!! Thanks, really appreciate it.
B
4
S
1
G
3
Posts: 85
Reputation: 1,234

Post » Thu Dec 17, 2009 5:28 am

[quote="Maciej":26dcwlq0]OMG
how did you figure it out?[/quote:26dcwlq0]

the sticks values return the x and y vectors of the stick and there respective magnitude.

atan2 converts vectors to an angle

angle(x,y,x,y) is atan2 pretty much.

:P when you get to know constructs in's and out's this stuff will come to you in no time
B
79
S
13
G
8
Posts: 1,977
Reputation: 9,947


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests