Skip to content

Instantly share code, notes, and snippets.

@Srushtika
Created June 9, 2020 14:38
Code snippet 12 - For multiplayer space invaders article
deadPlayerCh.subscribe("dead-notif", (msg) => {
players[msg.data.deadPlayerId].isAlive = false;
killerBulletId = msg.data.killerBulletId;
alivePlayers--;
if (alivePlayers == 0) {
setTimeout(() => {
finishGame("");
}, 1000);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment