Created
June 9, 2020 21:04
-
-
Save Srushtika/418952ac41bf19d17ab3ec37eb52399e to your computer and use it in GitHub Desktop.
Code snippet 24 - 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
const realtime = Ably.Realtime({ | |
authUrl: BASE_SERVER_URL + "/auth", | |
}); | |
realtime.connection.once("connected", () => { | |
myClientId = realtime.auth.clientId; | |
gameRoom = realtime.channels.get("game-room"); | |
deadPlayerCh = realtime.channels.get("dead-player"); | |
myChannel = realtime.channels.get("clientChannel-" + myClientId); | |
gameRoom.presence.enter(myNickname); | |
game = new Phaser.Game(config); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment