Sorting the players into 2 teams? This should work.
PHP Code:
temp.teams = { "Team 1", "Team " };
for (temp.pl: players) { temp.team = temp.teams[temp.count % temp.teams.size()]; temp.count++;
if (temp.team == "Team 1") { temp.pl.x= 10; temp.pl.y = 10; } elseif(temp.team == "Team 2") { temp.pl.x = 20; temp.pl.y = 20; } }
|
|
and so on. It's a really nice solution btw emera.
|
the only thing i dont like about it: whenever you want to randomnize it with the same players, wouldnt it keep them in the same team? at least i think so, since the players array is sorted by the account, right?