Created
June 1, 2020 03:11
-
-
Save jhcheung/9ce869eaaef2bc67f0f5236719cda654 to your computer and use it in GitHub Desktop.
bg.io local multiplayer
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
| // src/App.js | |
| import React from 'react'; | |
| import { Client } from 'boardgame.io/react'; | |
| import { Local } from 'boardgame.io/multiplayer'; | |
| import { TicTacToe } from './game'; | |
| import { TicTacToeBoard } from './board'; | |
| const TicTacToeClient = Client({ | |
| game: TicTacToe, | |
| board: TicTacToeBoard, | |
| multiplayer: Local(), | |
| }); | |
| const App = () => ( | |
| <div> | |
| <TicTacToeClient playerID="0" /> | |
| <TicTacToeClient playerID="1" /> | |
| </div> | |
| ); | |
| export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment