From: Simon Cross Date: Sun, 28 Feb 2016 16:11:28 +0000 (+0200) Subject: Run PGZeroGame directly to avoid issues with screen not being injected into the modul... X-Git-Url: https://git.ctpug.org.za/?p=koperkapel.git;a=commitdiff_plain;h=70e15540edd3d56e98768420f572996069f5363f Run PGZeroGame directly to avoid issues with screen not being injected into the module we have access to (i.e. koperkapel.pgzapp). --- diff --git a/README b/README index b7bc024..a21e2e2 100644 --- a/README +++ b/README @@ -12,4 +12,4 @@ Running the game Run the game using: -$ pgzrun app.py +$ python -m koperkapel diff --git a/app.py b/app.py deleted file mode 100644 index cfe3902..0000000 --- a/app.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env pgzrun - -import os -import sys - -sys.path.append(os.path.curdir) - -from koperkapel.pgzapp import * diff --git a/koperkapel/__main__.py b/koperkapel/__main__.py new file mode 100644 index 0000000..5479210 --- /dev/null +++ b/koperkapel/__main__.py @@ -0,0 +1,11 @@ +import pygame +pygame.init() + +from pgzero.game import PGZeroGame, DISPLAY_FLAGS +pygame.display.set_mode((100, 100), DISPLAY_FLAGS) + +from pgzero import loaders +loaders.set_root(__file__) + +from . import pgzapp +PGZeroGame(pgzapp).run()