Sample view.
parent
6f6dd4fe4c
commit
318fe0a909
|
@ -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)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue