Skip to content

Commit

Permalink
feat: add new chapter small grammar and color change(#47)
Browse files Browse the repository at this point in the history
* New Chapter Added

* chore: small changes

* fix colour

---------

Co-authored-by: KendallDoesCoding <kendalldoescoding@gmail.com>
  • Loading branch information
Saksham093 and KendallDoesCoding authored Mar 14, 2023
1 parent 3c80e01 commit 7abb341
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def chapter_stranger():


def chapter_lake():
answer = input(Fore.GREEN + "You turned left and you come to a lake,"
answer = input(Fore.GREEN + "You come to a lake,"
"do you want to swim or go back? (swim/back) " +
Fore.LIGHTMAGENTA_EX).lower()
if answer == "swim":
Expand All @@ -160,7 +160,7 @@ def chapter_lake():

elif answer == "back":
answer = input(
Fore.GREEN + "You go back to the main road."
Fore.GREEN + "You go to the main road."
"Now you can decide to drive forward or turn left. (forward/left) "
+ Fore.LIGHTMAGENTA_EX).lower()
if answer == "forward":
Expand All @@ -171,6 +171,30 @@ def chapter_lake():
game_over(Fore.RED + "Not a valid answer. You die.")


def chapter_mountain():
answer = input(Fore.GREEN + "\nYou reached a mountain \U000026F0. \n"
"Do you want to climb or go back? (Type \"climb/c\" to proceed or "
"\"back/b\" to return) : " +
Fore.LIGHTMAGENTA_EX).lower()
if answer == "climb" or answer == 'c':
game_over(
Fore.RED +
"You climbed to the peak \nbut due to low temperature you frozen. \U0001F976 ")

elif answer == "back" or answer == 'b':
answer = input(
Fore.GREEN + "You return to the main road."
"Now you can choose to drive straight ahead or turn left. (Type \"forward/f\" to proceed or "
"\"left/l\" to return.) : "
+ Fore.LIGHTMAGENTA_EX).lower()
if answer == "forward" or answer == 'f':
chapter_tree()
elif answer == "left" or answer == 'l':
game_over(Fore.RED + "You died. \U0001F480")
else:
game_over(Fore.RED + "I'm sorry, I don't understand the input. You Died. \U0001F480")


def chapter_tree():
answer = input(
Fore.GREEN +
Expand All @@ -181,7 +205,7 @@ def chapter_tree():
Fore.RED +
"You ate the fruit but it was poisonous and you died. \U0001F480")
elif answer == "n":
answer = input(
answer = input(Fore.GREEN +
"You are nearly starving to death. Do you want to eat Pears instead of apples? (y/n) "
+ Fore.LIGHTMAGENTA_EX).lower()
if answer == "y":
Expand Down Expand Up @@ -230,4 +254,4 @@ def game_over(message: str = None, *, end_game=True, win=False):
exit()


my_list = [chapter_bridge, chapter_lake]
my_list = [chapter_bridge, chapter_lake, chapter_mountain]

0 comments on commit 7abb341

Please sign in to comment.