Client/JavaScript/game.js
// this method is used to update the icon and username of the other players
this method is used to update the icon and username of the other players
this method is used to update the icon and username of the other players
function updateOtherPlayers() {
	var i=game.you;
	$("#ownInfo").append("<div id='wrapper'><img src='../Resources/Icons/"+game.players[i].icon+".png' class='icons'/></div>");
	$("#ownInfo").append("<div id='username'>"+game.players[i].username+"</div>");
	if(game.players.length == 2) {
		var opponent = game.you == 0? 1:0;
		$("#player_3 div.userDivs").append("<div id='wrapper'><img src='../Resources/Icons/"+game.players[opponent].icon+".png' class='icons'/></div");
		$("#player_3 div.userDivs").append("<div id='username'>"+game.players[opponent].username+"</div>");
	}
	else {
		for(var j=2; j<=4; j++) {
			i=(i+1)%4;
			$("#player_"+j+" div.userDivs").append("<div id='wrapper'><img src='../Resources/Icons/"+game.players[i].icon+".png' class='icons'/></div>");
			$("#player_"+j+" div.userDivs").append("<div id='username'>"+game.players[i].username+"</div>");
		}
	}
}
function updateOtherPlayers ( ) { var i = game . you ; $ ( "#ownInfo" ) . append ( "<div id='wrapper'><img src='../Resources/Icons/" + game . players [ i ] . icon + ".png' class='icons'/></div>" ) ; $ ( "#ownInfo" ) . append ( "<div id='username'>" + game . players [ i ] . username + "</div>" ) ; if ( game . players . length == 2 ) { var opponent = game . you == 0 ? 1 : 0 ; $ ( "#player_3 div.userDivs" ) . append ( "<div id='wrapper'><img src='../Resources/Icons/" + game . players [ opponent ] . icon + ".png' class='icons'/></div" ) ; $ ( "#player_3 div.userDivs" ) . append ( "<div id='username'>" + game . players [ opponent ] . username + "</div>" ) ; } else { for ( var j = 2 ; j <= 4 ; j ++ ) { i = ( i + 1 ) % 4 ; $ ( "#player_" + j + " div.userDivs" ) . append ( "<div id='wrapper'><img src='../Resources/Icons/" + game . players [ i ] . icon + ".png' class='icons'/></div>" ) ; $ ( "#player_" + j + " div.userDivs" ) . append ( "<div id='username'>" + game . players [ i ] . username + "</div>" ) ; } } }
this method is used to update the icon and username of the other players
this method is used to update the icon and username of the other players