SZI2019SmieciarzWmi/config.py

28 lines
762 B
Python
Raw Normal View History

import sys
import getopt
from sprites.cell import CELL_SIZE
def set_home_amount():
arguments = sys.argv[1:]
try:
optlist, args = getopt.getopt(arguments, '', ['home-count='])
for o, amount in optlist:
if o == '--home-count':
if int(amount) < 2:
print('Home count too low - must be higher than 2')
sys.exit(2)
return int(amount)
print('Missing argument: --home-count <amount>')
sys.exit(2)
except getopt.GetoptError as err:
print(err)
sys.exit(2)
home_amount = set_home_amount()
2019-03-25 16:00:01 +01:00
PLAY_WIDTH = (home_amount + 4)*CELL_SIZE
PLAY_HEIGHT = PLAY_WIDTH
2019-03-25 16:10:51 +01:00
HUD_HEIGHT = int(home_amount*CELL_SIZE/4)