Moved initalisation code to GameUtils
This commit is contained in:
14
__init__.py
14
__init__.py
@ -4,18 +4,18 @@ import gameUtils
|
|||||||
import NoPELib
|
import NoPELib
|
||||||
|
|
||||||
class Game(gameUtils.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):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user