This repository has been archived on 2026-02-27. You can view files and clone it, but cannot push or open issues or pull requests.
Files
BaseGame/game.py
2025-06-20 18:05:25 +01:00

41 lines
1.1 KiB
Python

import logging
import pygame
import gameUtils
import NoPELib
class Game(gameUtils.Game):
def __init__(self, *args, **kwargs):
"""
Ran when the game starts.
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']
"""
# 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.
"""
pass
def update(self):
"""
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.
"""
pass