Remove --length option

If I add a leaderboard, changing the length could interfere with
statistics.
This commit is contained in:
Samuel Sloniker 2021-08-30 08:50:53 -07:00
parent 6885f0dc57
commit eef561d885

View File

@ -161,7 +161,6 @@ term = Terminal()
gamesave_path = os.path.join(os.getenv('HOME'), '.worm.py-gamesave') gamesave_path = os.path.join(os.getenv('HOME'), '.worm.py-gamesave')
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--length", '-l', help="initial worm length (default 7)", default=7, type=int)
parser.add_argument("--full-screen", '-f', help="use entire screen (disables game saving)", action='store_true') parser.add_argument("--full-screen", '-f', help="use entire screen (disables game saving)", action='store_true')
parser.add_argument("--delete-save", help="delete saved game and exit", action='store_true') parser.add_argument("--delete-save", help="delete saved game and exit", action='store_true')
args = parser.parse_args() args = parser.parse_args()
@ -196,7 +195,7 @@ try:
save = json.load(f) save = json.load(f)
worm_locations, worm_head, last_dir, score, size, bonus_location, bonus_points, do_automove, do_help = save worm_locations, worm_head, last_dir, score, size, bonus_location, bonus_points, do_automove, do_help = save
except FileNotFoundError: except FileNotFoundError:
size = args.length size = 7
worm_locations = [[i+10, worm_y] for i in range(size)] worm_locations = [[i+10, worm_y] for i in range(size)]
worm_head = [size+10, worm_y] worm_head = [size+10, worm_y]
last_dir = 'x' last_dir = 'x'