Multiple Control Methods

Get help using Construct 2

Post » Tue Aug 14, 2012 10:47 am

My brain is breaking, this is quite hard to explain. Here's what I'm trying to do:

I have 4 players, I have keyboard inputs for two players and xbox controller inputs for the other two. Alternatively all 4 players can use 4 different xbox controllers.

All my player movements are done with variables; so "when left key is down" - "set 'turn left' to true" - "when left key is not down" - "set 'turn left' to false".


I am really struggling trying to cater for any combination of player control methods, so for example, player 1 can use the Keyboard and Player 2 can use the xbox controller.

If the players only have 1 xbox controller, that means that player 2 will need to use Controller index '0'. What I've done is say 'If player 1 control method = keys and player 2 = controller' - 'use controller 0' - I then write all the controls for this combination.

With 4 players though, say if player 1 and 2 use keyboard and player 3 and 4 use controllers, that means that players 3 and 4 need to use controller index 0 and 1. So that would mean I'd need to write out all that code for that eventuality too.

So what do I do? Do I write code for every possible combination or is there a more efficient way of doing it?



CrudeMik2012-08-14 10:48:35
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Tue Aug 14, 2012 7:57 pm

You could pre set 4 different inputs for controllers and 4 for keyboard (8 total) and then create a menu of some sort to choose which player will use keyboard or controller manually.

Just a quick idea.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Tue Aug 14, 2012 9:44 pm

You'll need to setup each controller inputs for a invisible player object, all the rest are sprite animations over it. Pick the nearest sprites of the player to change his animations...

I did a little game using this concept, with mouse and keyboard.
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 14 guests