Re-based to follow thee new new base game

This commit is contained in:
2025-06-20 19:31:09 +01:00
parent 7429e8bff4
commit ac3702747c

View File

@ -1,39 +1,42 @@
from PIL import Imgae
import logging import logging
import pygame import pygame
#import NoPELib import gameUtils
#import PDOLib import NoPELib
class Game: class Game(gameUtils.Game):
def __init__(self, surface, size): def __init__(self, *args, **kwargs):
""" """
Ran when the game starts. Ran when the game starts.
Args: You have access to the following variables:
surface (pygame.Surface): The surface you draw to. self.surf (pygame.Surface): This is the surface you draw onto.
size (list[int, int]): The size of the surface. 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() # Don't remove this. It does important things. :3
self.surface = surface super().__init__(*args, **kwargs)
self.size = size
def onEvent(self, event): def onEvent(self, event):
""" """
Ran when an event is fired. Ran when an event is fired.
Args: Args:
event (pygame.Event): The event that was fired event (pygame.Event): The event that was fired.
""" """
pass 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 pass
def close(self): def close(self):
""" """
Ran when the game closes Ran when the game closes.
""" """
pass pass