Created
June 9, 2020 14:38
-
-
Save Srushtika/fb63addd7b2b64ff26a2b114164c7264 to your computer and use it in GitHub Desktop.
Code snippet 12 - For multiplayer space invaders article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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