How do I control diferent instance sprite with gamepad

Get help using Construct 2

Post » Sun Aug 09, 2015 3:21 am

As I can control 4 instances of the same sprite with 4 different gamepads?
I want gamepads automatically detect and assign each instance a gamepad.
The behavior they have is platform.

Thx a lot!
B
47
S
12
G
5
Posts: 124
Reputation: 6,851

Post » Sun Aug 09, 2015 4:08 am

gamepad compare axis (gamepad 0, "left analogue stick", value < 0 )
sub event Sprite.Name = "player1" -> (8 direction) simulate "Left" movement

gamepad compare axis (gamepad 1, "left analogue stick", value < 0 )
sub event Sprite.Name = "player2" -> (8 direction) simulate "Left" movement

etc etc...

So each gamepad has to get assigned its control inputs, then it applies them to each player

therefore gamepad 0 is all associated to sprite "player 1" , and gamepad 1 is all associated with player 2 etc etc


there's a fancier way of setting up reusable functions, but give that a go first.
B
91
S
44
G
17
Posts: 1,012
Reputation: 18,562

Post » Sun Aug 09, 2015 3:18 pm

Thank you very much for your answer. Now I is clearer. I will investigate how to do it functions.
And if I find solution I upload capx.
B
47
S
12
G
5
Posts: 124
Reputation: 6,851

Post » Sun Aug 09, 2015 5:46 pm

Hurra!
Here is the capx.
You can control x instances of a sprite with x gamepads!
I used a function to do this.

https://www.dropbox.com/s/m31c2p93edpyu3n/gamepadConnectDifferentInstances.capx?dl=0
B
47
S
12
G
5
Posts: 124
Reputation: 6,851

Post » Sun Aug 09, 2015 5:58 pm

Congratulations! That's a great way to solve the issue!
B
91
S
44
G
17
Posts: 1,012
Reputation: 18,562


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests