Skip to content

Instantly share code, notes, and snippets.

@Srushtika
Created June 9, 2020 20:30
Show Gist options
  • Save Srushtika/ceb32fab4a5d86a29f3b9d070d9cb063 to your computer and use it in GitHub Desktop.
Save Srushtika/ceb32fab4a5d86a29f3b9d070d9cb063 to your computer and use it in GitHub Desktop.
Code snippet 18 - For multiplayer space invaders article
function resetServerState() {
peopleAccessingTheWebsite = 0;
gameOn = false;
gameTickerOn = false;
totalPlayers = 0;
alivePlayers = 0;
for (let item in playerChannels) {
playerChannels[item].unsubscribe();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment