Moved initalisation code to GameUtils

This commit is contained in:
2025-06-20 14:46:58 +01:00
parent 856e0b46a9
commit 43768f4fed

View File

@ -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):
"""