This code handles starting the game. Anything that is meant to be triggered when a game starts is stored here.
(self)
| 196 | self.turn_events[player_index].set() |
| 197 | |
| 198 | def start_game(self): |
| 199 | ''' |
| 200 | This code handles starting the game. Anything that is meant to be |
| 201 | triggered when a game starts is stored here. |
| 202 | ''' |
| 203 | |
| 204 | if self.terminal_viewer and sys.platform != 'win32': |
| 205 | # Clear the entire screen |
| 206 | sys.stdout.write("\033[2J") |
| 207 | |
| 208 | # Init the player who starts and then tell everyone we started |
| 209 | self.current_player_index = 0 |
| 210 | self.set_player_turn(self.current_player_index) |
| 211 | self.started = True |
| 212 | return |
| 213 | |
| 214 | |
| 215 |