Last active
April 16, 2020 22:45
-
-
Save thisisjofrank/e026bf204d497852cdd3857bc1d7fd94 to your computer and use it in GitHub Desktop.
startGame function
This file contains 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
async function startGame() { | |
dataSource = new AblyTrainArrivalsClient() | |
game = new Game(); | |
ui = new GameUi(game); | |
game.start({ | |
onGameStart: async () => await dataSource.listenForEvents("940GZZLUKSX", msg => game.registerEvent(game, msg)), | |
onGameEnd: () => dataSource.stopListening() | |
}); | |
ui.startRendering(game); | |
return game; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment