mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 13:11:57 -04:00
Added support for older launchers.
This commit is contained in:
parent
3b221e4339
commit
08c12d3b4d
|
@ -5,16 +5,21 @@ WIN_TITLE = 'Punyverse'
|
|||
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(prog='punyverse', description='Python simulator of a puny universe.')
|
||||
parser.add_argument('-t', '--ticks', help='Ticks per second for game, more means more responsive, but '
|
||||
' may run slower, default is 20.', default=20, type=int)
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
import argparse
|
||||
except ImportError:
|
||||
args = False
|
||||
else:
|
||||
parser = argparse.ArgumentParser(prog='punyverse', description='Python simulator of a puny universe.')
|
||||
parser.add_argument('-t', '--ticks', help='Ticks per second for game, more means more responsive, but '
|
||||
' may run slower, default is 20.', default=20, type=int)
|
||||
args = parser.parse_args()
|
||||
|
||||
import pyglet
|
||||
from punyverse import game
|
||||
pyglet.options['shadow_window'] = False
|
||||
game.TICKS_PER_SECOND = args.ticks
|
||||
if args:
|
||||
game.TICKS_PER_SECOND = args.ticks
|
||||
|
||||
game.Applet(width=INITIAL_WIN_WIDTH, height=INITIAL_WIN_HEIGHT, caption=WIN_TITLE, resizable=True, vsync=0)
|
||||
pyglet.app.run()
|
||||
|
|
Loading…
Reference in a new issue