Here's something you can reference off of to make it, this is just an example.
Code:
// global team kill count variables
private static int redTeamTotalKills = 0;
private static int blueTeamTotalKills = 0;
private static int greenTeamTotalKills = 0;
private static int purpleTeamTotalKills = 0;
private enum Team { NO_TEAM, RED_TEAM, BLUE_TEAM, GREEN_TEAM, PURPLE_TEAM }; // enums are constant int data types, represented with identifiers
private int currentTeam = assignTeam(); // sets the players team using the assignTeam() function
// you can assign a player a team like so
int assignTeam()
{
if (player.inRedStartArea())
return RED_TEAM;
else if (player.inBlueStartArea())
return BLUE_TEAM;
else if (player.inGreenStartArea())
return GREEN_TEAM;
else if (player.inPurpleStartArea())
return PURPLE_TEAM;
return NO_TEAM;
}
/**
*
* @return returns the players team
*
*/
int getTeam()
{
return currentTeam;
}
/**
*
* @void increases the specific teams kill count
* @param the players current team
*
*/
void increaseTeamKillCount(int team)
{
switch(team)
{
case RED_TEAM: redTeamTotalKills++; break;
case BLUE_TEAM: blueTeamTotalKills++; break;
case GREEN_TEAM: greenTeamTotalKills++; break;
case PURPLE_TEAM: purpleTeamTotalKills++; break;
default: break;
}
}