Skip to content

Commit

Permalink
Fix bug and improve strings
Browse files Browse the repository at this point in the history
- Fix bug: After game completed you are taken back to game menu oppose
to intentional main menu.
- Fix some strings display across multiple lines incorretly in terminal.
  • Loading branch information
BobWritesCode committed Oct 8, 2022
1 parent 069b173 commit 76a61b5
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions game_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def choice(result, stats):
result, stats = run_day(stats)
if result:
end_game(stats)
daily_menu(stats)
else:
daily_menu(stats)
elif user_choice == '8':
help_menu(stats)
elif user_choice == '0':
Expand Down Expand Up @@ -82,6 +83,7 @@ def choice(result, stats):
continue

break

choice(user_choice, stats)


Expand Down Expand Up @@ -150,10 +152,10 @@ def purchase_location(stats):
print(f'{cyan("Purchase hotdog pitch locations")}')
print('------------------------------------')
print(f'Current balance {green(print_current_balance(stats))}\n')
print('Each location purchase means more customer to sell to.'
+ 'The better the location the more potential customers.\n')
print(f'{pink("TIP")}: Each location will need a cart and a staff'
+ 'member before they sell any hotdogs.\n')
print('Each location purchase means more customer to sell to. '
+ 'The better the location \nthe more potential customers.\n')
print(f'{pink("TIP")}: Each location will need a cart and a staff '
+ 'member before they sell any \nhotdogs.\n')

for count, key in enumerate(loc_name, start=1):
str_part_1 = f'{count}. {key}'
Expand Down Expand Up @@ -271,8 +273,8 @@ def choice(result):
print(f'Current balance {green(print_current_balance(stats))}\n')
print('Each upgrade on a cart will produce better quality hotdogs.'
+ f' So you will sell {constants.CART_SELLING_INCREASE}% more'
+ 'for each level on top the base selling price without an'
+ 'penelties at that location.')
+ ' for each level on top the base selling price without an'
+ 'penelties at that \nlocation.')
print(f'\n{pink("TIP")}: Each location will need a staff member'
+ 'before they sell any hotdogs.\n')

Expand Down Expand Up @@ -367,9 +369,9 @@ def choice(result):
print('------------------------------------')
print(f'Current balance {green(print_current_balance(stats))}\n')
print('Better trained staff encourage returning customers meaning more'
+ 'footfall.\n')
+ ' footfall.\n')
print(f'{pink("TIP")}: Each location will need a cart before they sell'
+ 'any hotdogs.\n')
+ ' any hotdogs.\n')

for count, key in enumerate(loc_name, start=1):
staff_level = stats['location'][str(count)]['staff_lvl']
Expand Down Expand Up @@ -453,9 +455,9 @@ def choice(result):

print_go_back()

print(f"\n{pink('TIP: ')}This will order the minimum amount of"
+ "ingredants to fullfill the amount of Hotdogs you want to have"
+ "in stock.")
print(f"\n{pink('TIP: ')}This will order the minimum amount of "
+ "ingredants to fullfill the amount of \nhotdogs you want to "
+ "have in stock.")

user_choice = input(f'\n{orange("Input amount (max 99999): ")}')

Expand Down Expand Up @@ -653,7 +655,7 @@ def set_selling_price(stats):
net_profit = round(curr_price - production_cost, 2)

if net_profit >= 0:
print(f'\n{green("Profit per serving is:")}£{net_profit}')
print(f'\n{green("Profit per serving is: ")}£{net_profit}')
else:
print(f'\n{red("Loss per serving is: ")}£{net_profit}')

Expand Down

0 comments on commit 76a61b5

Please sign in to comment.