fixed kill on border
This commit is contained in:
parent
74755460cc
commit
823b102139
@ -172,8 +172,13 @@ function updateScore() {
|
|||||||
|
|
||||||
function movement(x,y) {
|
function movement(x,y) {
|
||||||
if (playerTeam != "spectator") {
|
if (playerTeam != "spectator") {
|
||||||
previousSquare = table.rows[playerCoordinate[0]].cells[playerCoordinate[1]];
|
try {
|
||||||
nextSquare = table.rows[playerCoordinate[0] + y].cells[playerCoordinate[1] + x];
|
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 =
|
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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user