April 2018
Beginner
340 pages
7h 54m
English
As the rounds go on, the amount of money needed to satisfy the minimum bet will grow. This means that if the player loses enough rounds, they will be unable to continue playing.
When this happens, the GameScreen will call the on_game_over method within our GameWindow so that it can adjust the GUI elements accordingly:
def on_game_over(self): self.hit_button.pack_forget() self.stick_button.pack_forget() self.new_game_button.pack(side=tk.LEFT, padx=(100, 200)) self.quit_button.pack(side=tk.LEFT)
The hit and stick buttons are replaced with a new game button as well as our familiar quit button. The new game button will call a method named new_game on our GameWindow:
def new_game(self): self.remove_all_buttons() self.game_screen.refresh() ...