more server handling

This commit is contained in:
yamanq 2015-07-08 00:51:25 -04:00
parent 3db891a641
commit a08e0de4a4

View File

@ -79,6 +79,8 @@ function serverTransfer(coordinate,team,turn,username) {
console.log(data[user][turn]); console.log(data[user][turn]);
var theMove = data[user][turn]; var theMove = data[user][turn];
tableUpdate(theMove[1], theMove[2]); tableUpdate(theMove[1], theMove[2]);
var oldMove = data[user][turn - 1];
oldTableUpdate(oldMove[1], oldMove[2]);
} }
} }
}, },
@ -113,9 +115,13 @@ function tableUpdate (coordinate, team) {
current = table.rows[coordinate[0]].cells[coordinate[1]]; current = table.rows[coordinate[0]].cells[coordinate[1]];
current.className = "player "; current.className = "player ";
current.className += team; current.className += team;
current.style.backgroundColor = playerColors[team] current.style.backgroundColor = playerColors[team];
} }
function oldTableUpdate(coordinate, team) {
current.className = current.className.replace("player ", "");
current.style.backgroundColor = claimedColors[team];
}
// Creation of Player // Creation of Player