Co-authored-by: Paul Trowbridge <fleetside72@users.noreply.github.com>
This commit is contained in:
parent
b46f309396
commit
dbf1124ff9
@ -17,14 +17,24 @@ def save_player_data(player_name, character_name, data):
|
|||||||
file.write(line + '\n')
|
file.write(line + '\n')
|
||||||
|
|
||||||
def create_new_character(player_name):
|
def create_new_character(player_name):
|
||||||
|
#------------------------- game basics ----------------------------------
|
||||||
character_name = input("Enter character name: ")
|
character_name = input("Enter character name: ")
|
||||||
gamer_tag = input("Please enter your gamer tag: ")
|
gamer_tag = input("Please enter your gamer tag: ")
|
||||||
answer = input(f"So your gamer tag is {gamer_tag}? (yes/no) ")
|
answer = input(f"So your gamer tag is {gamer_tag}? (yes/no) ")
|
||||||
while answer.lower() not in ['yes', 'no']:
|
|
||||||
print("Sorry, I only accept 'yes' or 'no' as an answer.")
|
#-------------------- get feedback on gamer tag---------------------------
|
||||||
answer = input("Please enter 'yes' or 'no': ")
|
while True:
|
||||||
if answer.lower() == 'no':
|
|
||||||
gamer_tag = input("Please enter your gamer tag: ")
|
gamer_tag = input("Please enter your gamer tag: ")
|
||||||
|
answer = input(f"Is '{gamer_tag}' your gamer tag? (yes/no): ").lower()
|
||||||
|
if answer.startswith('y'):
|
||||||
|
print("Gamer tag verified.")
|
||||||
|
break
|
||||||
|
elif answer.startswith('n'):
|
||||||
|
print("Please re-enter your gamer tag.")
|
||||||
|
else:
|
||||||
|
print("Sorry, response must be yes or no.")
|
||||||
|
|
||||||
|
#---------------------- proceed with game ---------------------------------
|
||||||
print(f"Hello {gamer_tag}")
|
print(f"Hello {gamer_tag}")
|
||||||
player_race = input("Are you a human, dwarf, or elf? (human/dwarf/elf): ").lower()
|
player_race = input("Are you a human, dwarf, or elf? (human/dwarf/elf): ").lower()
|
||||||
player_category = input(f"Is your {player_race} a ranged {player_race} or a close combat {player_race}? (ranged/close combat): ").lower()
|
player_category = input(f"Is your {player_race} a ranged {player_race} or a close combat {player_race}? (ranged/close combat): ").lower()
|
||||||
@ -51,6 +61,7 @@ def main():
|
|||||||
save_player_data(player_name, f"character_{i + 1}", character_data)
|
save_player_data(player_name, f"character_{i + 1}", character_data)
|
||||||
# Continue with your story or additional code here
|
# Continue with your story or additional code here
|
||||||
print("You wake up on a shore not remebering anything")
|
print("You wake up on a shore not remebering anything")
|
||||||
|
player_option1 = input("You see a small hut with the smell of food making you start to feel hungery. Or their is a nearby cave that might have food. What do you do? (walk over/go to cave)")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user