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

0 favourites
  • 4 posts
From the Asset Store
Small pixel icons for the 3 most popular controller types.
  • 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,!

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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:

    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").

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)