How do I get 4 player multiplayer in a fighting game?

Get help using Construct 2

Post » Fri Oct 31, 2014 5:05 pm

What would be the best method of doing so? It can be LAN or network or same machine with different controllers(if possible)
B
7
S
1
Posts: 28
Reputation: 459

Post » Fri Oct 31, 2014 5:15 pm

Simply assign each player a different set of controls to use.

If you want to get fancy and setup one function to handle all controls you can as well.

Assign each player a "Player number" variable - 1, 2, 3, 4 etc.

On any key pressed - call function "player action" (keyboard.lastKeyCode") (Player.playernumber)

Function "player action" ("A", 1)

If function.param (0) = "A")
pick player object = function.param(1)
play animation "punch"

if function.param(0) = "left arrow"
pick player object function.param(1)
move player left

So basically you are creating a function that will update a players movement/animations
then telling it which player its effecting

then you can recycle this function to work with any number of active players and movements. so that you are only coding it once, and splitting its duties among all players inputs
B
83
S
40
G
15
Posts: 987
Reputation: 16,847

Post » Mon Nov 03, 2014 5:40 pm

Could you put this into a capx? I'm having trouble understanding it in plain text. That would be amazing!
B
7
S
1
Posts: 28
Reputation: 459


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests