generated from mwc/project_game
In this submission I wrapped up my game project!!
I fixed up some issues that I noticed I have been having such as my answers for the input being read as wrong even though it shouldn't be. I figured out that if I had pressed another key, my strip & upper won't get rid of those keystrokes so I added a buffer between the question input and the reaction time to game stopping so that the arrows wouldn't become part of the answers. I think overall I am proud of my progress. I learned and practiced many things such as the os clear screen, classes, methods, etc. One thing that I wish I knew how to do was changing the font of certain outputs. I saw that I can do this via VSC preferences but I would love to pick and choose which texts appears in which font. The answers on stackexchange etc. seemed a bit too complex for me at the moment. But if I ever revisit this game, I would love to improve its visual aspects. If I were to implement this project in my classroom, I definitely would take some extra time practicing if/elif/else statements that are more than 3+ lines. I found that critical for my game and I think it would be applicable to many other games. Additionally, I think this game is a great wrap-up project but I can't say that the scaffolding has been appropriate or 100% relevant leading up to this point. I did not utilize majority of the other lab aspects. That could just be me though but I felt a disconnect, which I guess is also inevitable because of our course being asynchronous. In a classroom setting this could easily be managed. Overall I loved developing this and I am happy with my results, though I would love to improve upon it in the future!
This commit is contained in:
Binary file not shown.
@@ -25,11 +25,11 @@ class Questioner:
|
|||||||
if score == 0 and self.speak:
|
if score == 0 and self.speak:
|
||||||
prompt = input("Questioner: Are you ready to start the game? [[Y/N]] \n")
|
prompt = input("Questioner: Are you ready to start the game? [[Y/N]] \n")
|
||||||
if prompt.strip().upper() == "Y":
|
if prompt.strip().upper() == "Y":
|
||||||
print("Questioner: Well then, the rules are as follows... \n 1. You have 3 lives. \n 2. For every 200 points you accumulate during Starfall, you receive a question. \n 3. Each wrong answer costs you a life. You must answer 3 questions to escape this terminal. \n")
|
print("Questioner: Well then, the rules are as follows... \n 1. You have 3 lives. \n 2. For every 200 points you accumulate during Starfall, you receive a question. \n 3. Each wrong answer costs you a life. You must answer 3 questions to escape this terminal. \n 4. You MUST enter NUMBERS ONLY.")
|
||||||
|
|
||||||
begin = input("Questioner: Shall we begin? [[Y/N]] \n" )
|
begin = input("Questioner: Shall we begin? [[Y/N]] \n" )
|
||||||
if begin.strip().upper() == "Y":
|
if begin.strip().upper() == "Y":
|
||||||
input("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! \n (PRESS ENTER TO CONTINUE) ")
|
input("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! \n (PRESS ANY KEY TO CONTINUE) ")
|
||||||
game.state["begin"] = True
|
game.state["begin"] = True
|
||||||
clear_screen()
|
clear_screen()
|
||||||
|
|
||||||
@@ -61,12 +61,12 @@ class Questioner:
|
|||||||
game.state["begin"] = False
|
game.state["begin"] = False
|
||||||
self.score_prompt += 200
|
self.score_prompt += 200
|
||||||
self.speak = True
|
self.speak = True
|
||||||
|
qbuffer = input("QUESTION INCOMING (PRESS ANY KEY TO CONTINUE) \n ")
|
||||||
question_1 = input("Very well, here is the first question: \n What is the square root of 64? \n" )
|
question_1 = input("Very well, here is the first question: \n What is the square root of 64? \n" )
|
||||||
if question_1.strip().lower() == "8":
|
if int(question_1) == 8:
|
||||||
input("You may proceed. See you again once you reach 400 points! \n (PRESS ENTER TO CONTINUE)")
|
print("You may proceed. See you again once you reach 400 points! \n ")
|
||||||
clear_screen()
|
|
||||||
else:
|
else:
|
||||||
print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.")
|
print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINING. \n ")
|
||||||
game.state['lives'] = 2
|
game.state['lives'] = 2
|
||||||
proceed_1 = input("Shall we continue? [[Y/N]]")
|
proceed_1 = input("Shall we continue? [[Y/N]]")
|
||||||
if proceed_1.strip().upper() == "Y":
|
if proceed_1.strip().upper() == "Y":
|
||||||
@@ -88,16 +88,17 @@ class Questioner:
|
|||||||
game.state["begin"] = False
|
game.state["begin"] = False
|
||||||
self.score_prompt += 200
|
self.score_prompt += 200
|
||||||
self.speak = True
|
self.speak = True
|
||||||
question_2 = input("What number is the element 'Argon'? \n" )
|
qbuffer = input("QUESTION INCOMING (PRESS ANY KEY TO CONTINUE) \n ")
|
||||||
if question_2.strip() == "18":
|
question_2 = input("What number is the element 'Argon'? \n")
|
||||||
input("You may proceed. See you again once you reach 600 points!")
|
if int(question_2) == 18:
|
||||||
clear_screen()
|
print("You may proceed. See you again once you reach 600 points! \n")
|
||||||
else:
|
else:
|
||||||
if life == 2:
|
if life == 2:
|
||||||
print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINING.")
|
print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINING.")
|
||||||
game.state['lives'] = 1
|
game.state['lives'] = 1
|
||||||
if life == 3:
|
if life == 3:
|
||||||
print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINING.")
|
print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINING.")
|
||||||
|
game.state['lives'] = 2
|
||||||
proceed_2 = input("Shall we continue? [[Y/N]]")
|
proceed_2 = input("Shall we continue? [[Y/N]]")
|
||||||
if proceed_2.strip().upper() == "Y":
|
if proceed_2.strip().upper() == "Y":
|
||||||
game.state["begin"] = True
|
game.state["begin"] = True
|
||||||
@@ -118,17 +119,25 @@ class Questioner:
|
|||||||
game.state["begin"] = False
|
game.state["begin"] = False
|
||||||
self.score_prompt += 200
|
self.score_prompt += 200
|
||||||
self.speak = True
|
self.speak = True
|
||||||
question_3 = input("How many states make up the USA? \n" )
|
qbuffer = input("QUESTION INCOMING (PRESS ANY KEY TO CONTINUE) \n ")
|
||||||
if question_3.strip() == "50":
|
clear_screen()
|
||||||
|
question_3 = input("How many states make up the USA? \n")
|
||||||
|
if int(question_3) == 50:
|
||||||
print("Correct!")
|
print("Correct!")
|
||||||
|
if life >= 1:
|
||||||
|
clear_screen()
|
||||||
|
print("CONGRATULATIONS! YOU MAY ESCAPE THE TERMINAL. \n")
|
||||||
else:
|
else:
|
||||||
if life == 1:
|
if life == 1:
|
||||||
|
clear_screen()
|
||||||
print("HAHAHAHA WRONG ANSWER! YOU ARE OUT OF LIVES! \n")
|
print("HAHAHAHA WRONG ANSWER! YOU ARE OUT OF LIVES! \n")
|
||||||
print("YOU LOST THE GAME!")
|
print("YOU LOST THE GAME!")
|
||||||
if life == 2:
|
if life == 2:
|
||||||
|
clear_screen()
|
||||||
print("HMPH! WRONG!! BUT YOU SURVIVE WITH ONE LIFE REMAINING.")
|
print("HMPH! WRONG!! BUT YOU SURVIVE WITH ONE LIFE REMAINING.")
|
||||||
game.state["lives"] = 1
|
game.state["lives"] = 1
|
||||||
if life ==3:
|
if life ==3:
|
||||||
|
clear_screen()
|
||||||
print("HMPH! WRONG!! BUT YOU SURVIVE WITH TWO LIVES REMAINING.")
|
print("HMPH! WRONG!! BUT YOU SURVIVE WITH TWO LIVES REMAINING.")
|
||||||
game.state['lives'] = 2
|
game.state['lives'] = 2
|
||||||
self.speak = False
|
self.speak = False
|
||||||
|
|||||||
Reference in New Issue
Block a user