You are going to write a Python game where the user walks within the different rooms of a haunted house.
In each room, something will happen. You will decide what happens when the user enters a room. You can use some of the following ideas:
- Maybe a ghost will appear (ASCII Art using the print command) when the user enters the bedroom,
- You could have three magic potions on the kitchen table and your program could ask the user to choose one of them. It would then display a different message based on the potion chosen by the user,
- There could be a secret passage in the library to lead to the dining room,
- There could be a random math question to solve in the living room, and if the user does not give the correct answer they lose.
Designing the game
Open and print the following floor plan. Write in each room what you would like your program to do when the user enters the room.
Let’s get coding
We have started the game for you with some (but not all) the options for the user to walk from one room to the other.
Complete this game, one room at a time:
Note: If this code does not work in Internet Explorer, try to use Google Chrome instead.