Skip to content
Snippets Groups Projects
Commit 20d2b7a6 authored by ys678's avatar ys678
Browse files

Update WebSocketModel.js for energy

parent 7c534ab1
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,15 @@ class WebSocketModel { ...@@ -5,6 +5,15 @@ class WebSocketModel {
createInterval(game) { createInterval(game) {
setInterval(() => { setInterval(() => {
if (!this.games[game].started) return; if (!this.games[game].started) return;
let interval = 500;
this.games[game].players.forEach(player => {
if (speedBoostTimers[player.pid]) {
interval = 250; // Move faster if player has speed boost
}
});
let deadPlayers = []; let deadPlayers = [];
[this.games[game].gameBoard, deadPlayers] = gameModule.moveOneStep( [this.games[game].gameBoard, deadPlayers] = gameModule.moveOneStep(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment