summaryrefslogtreecommitdiffstats
path: root/Lasers_und_stuff/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lasers_und_stuff/main.py')
-rw-r--r--Lasers_und_stuff/main.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Lasers_und_stuff/main.py b/Lasers_und_stuff/main.py
index 0b61c0d..4869d96 100644
--- a/Lasers_und_stuff/main.py
+++ b/Lasers_und_stuff/main.py
@@ -18,6 +18,10 @@ app = flask.Flask(__name__)
app.debug = True
pygame.init()
+@app.route("/")
+def root():
+ return "COCKS"
+
def main():
#create the screen
window = pygame.display.set_mode((800, 600))
@@ -40,12 +44,13 @@ def main():
gunpoint = Gunpoint((5, 4), (200, 4), (5, 210))
- while True:
+ keep_running = True
+ while keep_running:
screen.draw_surface(cannon)
for event in pygame.event.get():
if event.type == pygame.QUIT:
- sys.exit(0)
+ keep_running = False
elif event.type == KEYUP :
cannon.send_data()
if event.key == K_SPACE:
@@ -84,7 +89,8 @@ def main():
elif event.type == MOUSEBUTTONUP:
screen.change_color()
-
+ print "Pygame thread exited."
+ os.kill(os.getpid(), signal.SIGINT)