PygameRenderingEngine¶
This module provides a rendering engine using the pygame library.
It will create a window and display the game in it.
- class PygameRenderingEngine.PygameRenderingEngine(fullscreen=False, trace_length=0, *args, **kwargs)[source]¶
(This class inherits from
RenderingEngine).This rendering engine uses the
pygamelibrary to render the game. It will create a window and display the game in it. The window will run in a different process than the one running the game.- __init__(fullscreen=False, trace_length=0, *args, **kwargs)[source]¶
Initializes a new instance of the class.
- Parameters:
fullscreen (
bool) – Indicates if the GUI should be fullscreen.trace_length (
int) – Length of the trace to display.*args (
object) – Arguments to pass to the parent constructor.**kwargs (
object) – Keyword arguments to pass to the parent constructor.
- end()[source]¶
(This method redefines the method of the parent class with the same name).
It waits for the window to be closed before exiting.
- Return type:
None
- render(players, maze, game_state)[source]¶
(This method redefines the method of the parent class with the same name).
This function renders the game to a
pygamewindow. The window is created in a different process than the one running the game.- Parameters:
players (
list[Player]) – Players of the game.maze (
Maze) – Maze of the game.game_state (
GameState) – State of the game.
- Return type:
None