You can create another variable life for the current player.
With color variable you can assign a number to it, so if the color variable is different from the player's team color, then reduces size and -1 of life when life is less than or equal to zero destroys the player and end game.