class documentation
Represents a game.
| Method | __init__ |
Initialize the game. |
| Method | __setattr__ |
Set a game attribute, routing to the matching setter. |
| Instance Variable | input |
Undocumented |
| Method | _update |
Update the game input and entity positions in a thread-safe manner. |
def __init__(self, name:
str, size, draw, input_manager, foreground_color: int = 65535, background_color: int = 0, camera_context=None, start=None, stop=None):
¶
Initialize the game.
| Parameters | |
name:str | Name of the game. |
size:Vector | Size of the game. |
draw:Draw | Draw context used to render the game. |
inputInputManager | Input manager used to handle input. |
foregroundint | Foreground color of the game. Defaults to 0xFFFF. |
backgroundint | Background color of the game. Defaults to 0x0000. |
cameraCamera or None | Camera context used to render the game. Defaults to None. |
start:callable | Function called when the game is started. Defaults to None. |
stop:callable | Function called when the game is stopped. Defaults to None. |