render module
- class render.Gui(board: Board, colors_managed_by_gui=(0, 1), window_title='Chess Game', SCREEN_SIZE=(800, 800), FPS=60, verbose=1)
Bases:
objectClass for the pygame’s gui, it will enable you to display the game and human players to move pieces
- colors_managed
- Tuple containing the colors managed by human moves with the gui.The color(s) not in this tuple/list must be managed by AI with the parameter function function_for_AIs in method
run_pygame_loop()
- run_pygame_loop(function_for_AIs=None)
Run the Pygame gui loop to show and interact with the pygame window. The function_for_AIs must have one input: the board object We’ll call it when this is turn for a color that should not be managed by gui (an AI)
Obviously the move method called by your AI must be part of the given Board (Board.move_piece or a Piece.move)