How do I attach Controller 1 to Player 1 Controller 2 to...

Get help using Construct 2

Post » Thu Apr 28, 2016 1:13 am

Hello, I am currently working on making a 2D fighting game in Construct and have come up to the issue of having two controllers control two different sprites. I am using mostly platformer behavior and state machines to control attacks. I currently have invisible sprites under Player 1 family and Player 2 family. I have all the different character sprites repeated in two different families (Character 1 and Character 2).

I thought it would work using the Gamepad index numbers, having P1 set as 0 and P2 set as 1, and have alittle bit of repetitive programming listing out commands for each player. It has malfunctioned in different ways depending on what I tweak around, but I feel like I'm missing something.

Is there something with the Gamepad that makes this easy(easier)?
Thanks,!
B
14
S
2
Posts: 5
Reputation: 712

Post » Thu Apr 28, 2016 5:57 am

On the surface, what you have written out seems to be valid, but I believe this is likely related to how you design your event sheet.

Can you show us how do you design your event sheet?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459

Post » Thu Apr 28, 2016 6:26 am

Going by what you said it really should be working. Are the invisible sprites you're using the same sprite for both players, or a different sprite for each one? This could be your problem. You should pick the right sprite you want to control using "pick" events.

If you don't want to use repetitive events when making controls, you can try a For loop. I'm pretty sure it won't help you solve the problem you're currently facing but it's a good way to have less events.

I do it like this:

Image

Keep in mind that in this example I have the same sprite for both players though - I differentiate them in other events , using the object IID to set their animations (player 1 should always be playing "run"&player.iid for instance, so the animation name is "run0", while player 2 would be "run1").
B
122
S
42
G
40
Posts: 846
Reputation: 27,994

Post » Thu Apr 28, 2016 11:04 pm

Thanks for the replies! I went and combed every bit of my event sheet and found it was some mixed up events that were stirring the pot. Cleaned them up and solved those problems.

keroberos- I almost have everything working at a basic level and plan on posting what I have soon.
Andreyin- I haven't messed with loops yet, I will definitely give them a try soon.
B
14
S
2
Posts: 5
Reputation: 712


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests