From 43768f4fedd72f9817cd1d7805a05cf540e7dc6a Mon Sep 17 00:00:00 2001 From: Brosef Date: Fri, 20 Jun 2025 14:46:58 +0100 Subject: [PATCH] Moved initalisation code to GameUtils --- __init__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/__init__.py b/__init__.py index d1d29e7..1c23c5e 100644 --- a/__init__.py +++ b/__init__.py @@ -4,18 +4,18 @@ import gameUtils import NoPELib class Game(gameUtils.Game): - def __init__(self, surface, size): + def __init__(self, *args, **kwargs): """ Ran when the game starts. - Args: - surface (pygame.Surface): The surface you draw to. - size (list[int, int]): The size of the surface. + You have access to the following variables: + self.surf (pygame.Surface): This is the surface you draw onto. + self.pm (NoPELib.PlayerManager): This is where your players are stored. + self.cfg (dict): Everything from the `game.toml` file. You can access it like this: self.details['title'] """ - - pygame.init() - self.surface = surface - self.size = size + + # Don't remove this. It does important things. :3 + super().__init__(*args, **kwargs) def onEvent(self, event): """