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
Users browsing this thread: 1 Guest(s)