RenderingEngine

This module provides a rendering engine for the PyRat game. It defines the base class for rendering engines, which can be used to render the game in different ways. The default implementation does nothing, but subclasses can override the render method to provide custom rendering logic.

class RenderingEngine.RenderingEngine(rendering_speed=1.0, render_simplified=False)[source]

A rendering engine is an object that can render a PyRat game. By default, this engine renders nothing, which is a valid rendering mode for a PyRat game. Inherit from this class to create a rendering engine that does something.

__init__(rendering_speed=1.0, render_simplified=False)[source]

Initializes a new instance of the class.

Parameters:
  • rendering_speed (float) – Speed at which the game should be rendered.

  • render_simplified (bool) – Whether to render the simplified version of the game.

end()[source]

This method does nothing. Redefine it in the child classes to do something when the game ends if needed.

Return type:

None

render(players, maze, game_state)[source]

This method does nothing. Redefine it in the child classes to render the game somehow.

Parameters:
  • players (list[Player]) – Players of the game.

  • maze (Maze) – Maze of the game.

  • game_state (GameState) – State of the game.

Return type:

None