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