Permalink
Browse files

add scale to lr

  • Loading branch information...
BorisKolganov committed Sep 5, 2018
1 parent a7987c8 commit 67b7df8d0d0ddacb7b213a534442f10b3cee2f66
Showing with 15 additions and 10 deletions.
  1. +15 −10 madcars/Runners/localrunner.py
@@ -9,9 +9,11 @@
from mechanic.game import Game
from mechanic.strategy import KeyboardClient, FileClient
window = pyglet.window.Window(1200, 800, vsync=False)
draw_options = pymunk.pyglet_util.DrawOptions()
_ = pyglet.clock.ClockDisplay(interval=0.016)
maps = ['PillMap', 'PillHubbleMap', 'PillHillMap', 'PillCarcassMap', 'IslandMap', 'IslandHoleMap']
cars = ['Buggy', 'Bus', 'SquareWheelsBuggy']
games = [','.join(t) for t in product(maps, cars)]
parser = argparse.ArgumentParser(description='LocalRunner for MadCars')
@@ -24,16 +26,20 @@
help='Path to executable with strategy for second player', default='keyboard')
parser.add_argument('--spl', type=str, nargs='?', help='Path to log for second player')
parser.add_argument('-m', '--matches', nargs='+', help='List of pairs(map, car) for games', default=games)
maps = ['PillMap', 'PillHubbleMap', 'PillHillMap', 'PillCarcassMap', 'IslandMap', 'IslandHoleMap']
cars = ['Buggy', 'Bus', 'SquareWheelsBuggy']
games = [','.join(t) for t in product(maps, cars)]
parser.add_argument('-S', '--scale', type=float, help='Window scale', default=1)
parser.add_argument('-m', '--matches', nargs='+', help='List of pairs(map, car) for games', default=games)
args = parser.parse_args()
scale = args.scale
window = pyglet.window.Window(1200 * scale, 800 * scale, vsync=False)
draw_options = pymunk.pyglet_util.DrawOptions()
_ = pyglet.clock.ClockDisplay(interval=0.016)
pyglet.gl.glScalef(scale, scale, scale)
first_player = args.fp
second_player = args.sp
@@ -55,10 +61,9 @@
@window.event
def on_draw():
pyglet.gl.glClearColor(255,255,255,255)
pyglet.gl.glClearColor(255, 255, 255, 255)
window.clear()
game.draw(draw_options)
game.tick()
if not game.game_complete:
future_message = loop.run_until_complete(game.tick())
else:

0 comments on commit 67b7df8

Please sign in to comment.