Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 16 additions & 47 deletions playScreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ def updateCategoryNames():
self.categories.append(game.questions[x][0])
self.categories = flattenList(self.categories)

def emptyQuestionText():
questionText.addText("")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")

# initialize game instance
game = MainDriver.Game(numPlayers, playerList)

Expand Down Expand Up @@ -278,23 +285,17 @@ def updateCategoryNames():

if game.current_round > 2:
# TODO: complete game and load final score board screen
emptyQuestionText()
questionText.addText(
"Game over! Press \"SEE RESULTS\" to view game results.")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")
spin_button.setClickable(False)
game_completed_button.setClickable(True)
quit_to_main_button.setClickable(False)
else:
self.extraSpinFunctions = True
emptyQuestionText()
questionText.addText(
"Round 1 over! Press \"SPIN\" to begin Round 2.")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")
spin_button.setClickable(True)

else:
Expand All @@ -315,16 +316,6 @@ def updateCategoryNames():
refresh_all_player_score()
refresh_current_player_indicator()

# jeopardy board category selection button handlers
# for x in range(6):
# if board.categorySelectionButtons[x].clicked and enterCategorySelection:
# print(str(x) + " CATEGORY BUTTON PRESSED SOMEHOW")
# enterCategorySelection = False
# self.categorySelected = True
# board.showButtons(False)
# spin_button.clicked = True
# spin_result = x

# jeopardy board category selection button handlers
for x in range(6):
if board.categorySelectionButtons[x].clicked and enterCategorySelection:
Expand All @@ -343,11 +334,8 @@ def updateCategoryNames():
answerButtonArray[x].setClickable(True)
else:
negative.play()
emptyQuestionText()
questionText.addText("Category empty, Spin again!")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")
spin_button.setClickable(True)
narration.setText(
"Press \"SPIN\" to spin the wheel.")
Expand Down Expand Up @@ -450,11 +438,7 @@ def updateCategoryNames():
q_intro.play()
pass

questionText.addText("")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")
emptyQuestionText()

# only run this block of code if the string result of the spin
# was neither opponent's choice nor player's choice
Expand All @@ -465,23 +449,17 @@ def updateCategoryNames():

if game.current_round > 2:
# TODO: complete game and load final score board screen
emptyQuestionText()
questionText.addText(
"Game over! Press \"SEE RESULTS\" to view game results.")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")
spin_button.setClickable(False)
game_completed_button.setClickable(True)
quit_to_main_button.setClickable(False)
else:
self.extraSpinFunctions = True
emptyQuestionText()
questionText.addText(
"Round 1 over! Press \"SPIN\" to begin Round 2.")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")
spin_button.setClickable(True)
narration.setText(
"Press \"SPIN\" to spin the wheel.")
Expand Down Expand Up @@ -513,34 +491,25 @@ def updateCategoryNames():

if game.current_round > 2:
# TODO: complete game and load final score board screen
emptyQuestionText()
questionText.addText(
"Game over! Press \"SEE RESULTS\" to view game results.")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")
spin_button.setClickable(False)
game_completed_button.setClickable(True)
quit_to_main_button.setClickable(False)
else:
self.extraSpinFunctions = True
emptyQuestionText()
questionText.addText(
"Round 1 over! Press \"SPIN\" to begin Round 2.")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")
spin_button.setClickable(True)
narration.setText(
"Press \"SPIN\" to spin the wheel.")
else:
negative.play()
emptyQuestionText()
questionText.addText(
"Category empty, Spin again!")
ansAText.setText("")
ansBText.setText("")
ansCText.setText("")
ansDText.setText("")
spin_button.setClickable(True)
narration.setText(
"Press \"SPIN\" to spin the wheel.")
Expand Down