Run PGZeroGame directly to avoid issues with screen not being injected into the modul...
authorSimon Cross <hodgestar@gmail.com>
Sun, 28 Feb 2016 16:11:28 +0000 (18:11 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sun, 28 Feb 2016 16:11:28 +0000 (18:11 +0200)
README
app.py [deleted file]
koperkapel/__main__.py [new file with mode: 0644]

diff --git a/README b/README
index b7bc024bbe42187581c7c17555b74f4ce5882c0c..a21e2e2ae26fbd9383df36502269ab12842615a0 100644 (file)
--- 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 (file)
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 (file)
index 0000000..5479210
--- /dev/null
@@ -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()