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

Skeleton code for camera changes

parent d9279417
No related branches found
No related tags found
1 merge request!138 deadplayers
...@@ -210,6 +210,12 @@ module.exports = { ...@@ -210,6 +210,12 @@ module.exports = {
return updatedBoard; return updatedBoard;
}, },
getPlayerView: (gameBoard, pid) => {
let updatedBoard = gameBoard.map((row) => row.map((cell) => ({ ...cell })));
// YANG: Find head with pid = pid
// return [x][y] around head
},
checkCollisions: (gameBoard) => { checkCollisions: (gameBoard) => {
// returns a list of players that have collided, // returns a list of players that have collided,
// and a new gameBoard with the players removed // and a new gameBoard with the players removed
......
...@@ -41,7 +41,7 @@ class WebSocketModel { ...@@ -41,7 +41,7 @@ class WebSocketModel {
conn.send( conn.send(
JSON.stringify({ JSON.stringify({
type: "gameBoard", type: "gameBoard",
data: this.games[game].gameBoard, data: this.games[game].gameBoard, // YANG: gameModule.getPlayerView()...
}), }),
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment