Moved initalisation code to GameUtils
This commit is contained in:
16
__init__.py
16
__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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user