xbox360 Controller - Analog Thumb

For questions about using Classic.

Post » Wed Dec 29, 2010 11:09 am

Hello, first of all thank you for this wonderful program.
I'm a programmer (phyton, php and c) and I want to make a small game with construct just for fun. Since I'm a complete newby I wanted to make a geometry wars clone. Following the Ghost Shooter tutorial I was able to move and shoot with mouse and keyboard, I wanted to enable the 360 controller imput to aim and move, but with the analog sticks I only see a direction and a is down event. This means that I can't move and shoot like in geometry wars.

Basically (if you are not familiar with the game) I want to move the sprite with the left thumb and shoot with the analog, this means that if the analog thumb is down the ship will continuosly shoot bullets in the direction of the thumb.

Is this possible with construct?

Thanks
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Wed Dec 29, 2010 5:56 pm

Yes! you can get (left thumb x) and (left thumb y) and the same goes for the right analog stick and the triggers. you need to use them in an expression though, its the only way it really makes sense. the value scales from -1 to 0 to 1 based on how much its being "pushed", you multiply it to scale and add that to an objects current x,y velocities to get a geometry wars-ish movement. for the gun you make use of angle(x1,y1,x2,y2) and use x1=0 y1=0 x2=rightthumbx y2=rightthumby to get the current "direction" of the stick!

you should find them and figure it out if you select the xbox360controller plugin when you're writing an expression.

good luck :)
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests