initialize game loop while True: if current_room['name'] == 'Chamber of Secrets': if inventory == ['heart', 'nose', 'empathy', 'eyeballs', 'soul', 'hair']: print('\nCongratulations!') print('\nYou have reached the Chamber of Secrets and helped Harry Potter to defeat Lord Voldemort!') break else: print("You have encountered Lord Voldemort without all six potion ingredients!") print('Game Over!') breakThis is my winning and losing statements for a text based adventure I'm currently writing. The player has to move room-to-room gathering each inventory item before encountering the villain in his room. Even when I have all 6 items when I reach the villain's room, I'm still getting the loosing message. Not sure where I've messed up in my code. Any help is appreciated.
Winning/Losing Message Error in Text based Game
Messages In This Thread |
Winning/Losing Message Error in Text based Game - by kdr87 - Dec-13-2020, 11:35 PM
RE: Winning/Losing Message Error in Text based Game - by Larz60+ - Dec-13-2020, 11:59 PM
RE: Winning/Losing Message Error in Text based Game - by bowlofred - Dec-14-2020, 12:25 AM
|
Users browsing this thread: 1 Guest(s)