Step 1: The Front Door ๐ช
Ever read a book where you choose what happens next? You're about to build one. ๐ฐ
An adventure game is really just two things you already know: prints to tell the story, and input + if to let the player steer.
print("You are standing in a dark forest.")
print("Two paths split in front of you.")
choice = input("Do you go NORTH or SOUTH? ").lower().strip()
if choice == "north":
print("๐บ A wolf blocks your path!")
elif choice == "south":
print("๐ You find a sparkling river.")
else:
print("๐คท You wander in circles. THE END.")
Notice .lower().strip() right on the end of input() โ that cleans
up the answer immediately so NORTH, north and North all work.
The else at the bottom catches anything weird they type. Always
include one, or your game just... stops. ๐ถ
Your mission
- Print at least 2 lines to set the spooky scene ๐ฏ๏ธ
- Ask the player to choose the left door or the right door
- Use
if/elseso each door leads somewhere different
Make it creepy. Make it silly. It's your mansion. ๐ฆ
Your code
Press โถ Run to see what your code does!