From ac3702747cb31e5cb665bc69dfbbbc6802da573b Mon Sep 17 00:00:00 2001 From: Brosef Date: Fri, 20 Jun 2025 19:31:09 +0100 Subject: [PATCH] Re-based to follow thee new new base game --- __init__.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/__init__.py b/__init__.py index 7cbf5cb..14278f9 100644 --- a/__init__.py +++ b/__init__.py @@ -1,39 +1,42 @@ +from PIL import Imgae import logging import pygame -#import NoPELib -#import PDOLib +import gameUtils +import NoPELib -class Game: - def __init__(self, surface, size): +class Game(gameUtils.Game): + 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): """ Ran when an event is fired. Args: - event (pygame.Event): The event that was fired + event (pygame.Event): The event that was fired. """ pass - def draw(self): + def update(self): """ - Ran once per frame, put your drawing code in here + Ran once per frame, put your drawing code and any + game logic that should be ran once per frame in here. """ pass def close(self): """ - Ran when the game closes + Ran when the game closes. """ pass +