fixed kill on border

This commit is contained in:
unknown 2015-07-10 03:33:44 -04:00
parent 74755460cc
commit 823b102139

View File

@ -172,8 +172,13 @@ function updateScore() {
function movement(x,y) {
if (playerTeam != "spectator") {
previousSquare = table.rows[playerCoordinate[0]].cells[playerCoordinate[1]];
nextSquare = table.rows[playerCoordinate[0] + y].cells[playerCoordinate[1] + x];
try {
previousSquare = table.rows[playerCoordinate[0]].cells[playerCoordinate[1]];
nextSquare = table.rows[playerCoordinate[0] + y].cells[playerCoordinate[1] + x];
} catch(err) {
//Hitting top/down
killPlayer(playerCoordinate, playerTeam);
}
}
timer =
@ -204,7 +209,7 @@ function movement(x,y) {
movement(x,y);
}
catch(err) {
// On hit wall
// Hitting left/right
killPlayer(playerCoordinate, playerTeam);
}
}, 100);