Commit 4349d3e3 authored by Aurel Wildfellner's avatar Aurel Wildfellner

start window in fullscreen and fps config parameter

parent 6e6af69a
......@@ -32,6 +32,10 @@ class PongConfig:
barcodes = {"ball" : "123", "playerleft" : "101", "playerright" : "102"}
# keep in mind that high refresh rates like 60fps
# may disturb scanning of the barcode.
refreshRate = 25 # fps
"""
# game parameters
playerLifes = 3
......
......@@ -285,7 +285,7 @@ def main():
def gameLoop(foo):
pg.gameLoop()
pyglet.clock.schedule_interval(gameLoop, 1/25.)
pyglet.clock.schedule_interval(gameLoop, 1/PongConfig.refreshRate)
pyglet.app.run()
#TODO catch exceptions and stop barcode reader threads
......
......@@ -161,7 +161,7 @@ class Heart():
class PygletCanvas(pyglet.window.Window):
def __init__(self, ball, gamefield, leftPlayer, rightPlayer):
self.size = PongConfig.screensize
super(PygletCanvas, self).__init__(*(self.size))
super(PygletCanvas, self).__init__(*(self.size), fullscreen=True)
# white background
pyglet.gl.glClearColor(1.0, 1.0, 1.0, 0.0)
self.clear()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment