Skip to content
Snippets Groups Projects
Commit 1cac60f7 authored by Jake Dreher's avatar Jake Dreher
Browse files

Run prettier

parent e926584b
No related branches found
No related tags found
1 merge request!138 deadplayers
......@@ -329,7 +329,12 @@ module.exports = {
let x = head.x + j - Math.floor(width / 2);
let y = head.y + i - Math.floor(height / 2);
if (x < 0 || x >= updatedBoard[0].length || y < 0 || y >= updatedBoard.length) {
if (
x < 0 ||
x >= updatedBoard[0].length ||
y < 0 ||
y >= updatedBoard.length
) {
row.push(cellTypes.BORDER);
} else {
row.push(updatedBoard[y][x]);
......
......@@ -37,7 +37,10 @@ class WebSocketModel {
}
for (let conn of this.games[game].players) {
let playerView = gameModule.getPlayerView(this.games[game].gameBoard, conn.pid);
let playerView = gameModule.getPlayerView(
this.games[game].gameBoard,
conn.pid,
);
conn.connection.send(
JSON.stringify({
type: "gameBoard",
......@@ -149,13 +152,19 @@ class WebSocketModel {
let roomId = connection.protocol;
if (!this.games[roomId].started) {
this.games[roomId].players.push({connection, pid: this.games[roomId].players.length+1});
this.games[roomId].players.push({
connection,
pid: this.games[roomId].players.length + 1,
});
this.games[roomId].gameBoard = gameModule.addPlayer(
this.games[roomId].gameBoard,
this.games[roomId].players.length,
);
} else {
this.games[roomId].players.push({connection, pid: this.games[roomId].players.length+1});
this.games[roomId].players.push({
connection,
pid: this.games[roomId].players.length + 1,
});
}
connection.send(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment