2019-03-21 01:25:19 +01:00
|
|
|
import sys
|
|
|
|
import getopt
|
2019-03-20 23:33:22 +01:00
|
|
|
from sprites.cell import CELL_SIZE
|
|
|
|
|
2019-03-21 01:25:19 +01:00
|
|
|
|
2019-03-20 23:33:22 +01:00
|
|
|
def set_home_amount():
|
2019-03-21 01:25:19 +01:00
|
|
|
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)
|
|
|
|
|
|
|
|
|
2019-03-20 23:33:22 +01:00
|
|
|
home_amount = set_home_amount()
|
|
|
|
|
2019-03-25 13:44:16 +01:00
|
|
|
PLAY_WIDTH = (home_amount+2)*CELL_SIZE
|
2019-03-21 01:25:19 +01:00
|
|
|
PLAY_HEIGHT = PLAY_WIDTH
|