From 70e15540edd3d56e98768420f572996069f5363f Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sun, 28 Feb 2016 18:11:28 +0200 Subject: [PATCH] Run PGZeroGame directly to avoid issues with screen not being injected into the module we have access to (i.e. koperkapel.pgzapp). --- README | 2 +- app.py | 8 -------- koperkapel/__main__.py | 11 +++++++++++ 3 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 app.py create mode 100644 koperkapel/__main__.py 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() -- 2.34.1