Compare commits
2 Commits
e5c2da4070
...
a6f6f56843
| Author | SHA1 | Date | |
|---|---|---|---|
| a6f6f56843 | |||
| ea7ed8be07 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -174,3 +174,6 @@ cython_debug/
|
|||||||
# PyPI configuration file
|
# PyPI configuration file
|
||||||
.pypirc
|
.pypirc
|
||||||
|
|
||||||
|
# ---> Other
|
||||||
|
/test.py
|
||||||
|
/.vscode/
|
||||||
40
game.py
Normal file
40
game.py
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
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
|
||||||
8
game.toml
Normal file
8
game.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# The ID used for logging
|
||||||
|
# TODO: Filter things like '\', '{}', '\n' etc.-
|
||||||
|
id = "changeMe"
|
||||||
|
# The name used for setting the windows
|
||||||
|
# title, and for displaying in the launcher
|
||||||
|
name = "Change me"
|
||||||
|
# The description displayed by the launcher
|
||||||
|
description = "Write something about this game.\nNew lines are supported."
|
||||||
4
requirements.txt
Normal file
4
requirements.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
../GameUtils/
|
||||||
|
../NoPELib/
|
||||||
|
../PDOLib/
|
||||||
|
pygame-ce
|
||||||
Reference in New Issue
Block a user