How To Code A Python Text-Based Adventure Game In 11 Minutes | Programming Tutorial For Beginners
Hey everyone,
In today's video, we talk about how to write a custom text adventure game in Python! This is probably the easiest game you can code and a great starter project to get your feet wet with python and game development. Have fun!
Thanks for watching! :)
This project is available on GitHub at
--------------------------------------------------------------------------------------
github.com/ShaunHalverson/Pyt...
Add Me On Discord!
--------------------------------------------------------------------------------------
Username: Shaun(Hashtag)5626
Want to see more?
--------------------------------------------------------------------------------------
/ @shaunhalverson
Legal Disclaimer
--------------------------------------------------------------------------------------
Assets in the thumbnail & video were provided by artists on
www.canva.com
The art used in this video is from Canva and is used solely for the purpose of enhancing or demonstrating these coding tutorials. I do not claim ownership or credit for any of the art shown in this video. I am a paid member of Canva Pro and have the rights to use the art in this video as outlined in my membership agreement. If you have any questions about the use of the art in this video, please contact me.
Video Tags
--------------------------------------------------------------------------------------
Software Engineering / Programming for beginners / variables types / computer science / compsci / coding for beginners / learn how to program / learn how to code / C# variables / python for beginners / coding tutorial / programming tutorial
#programming #tutorial #learntocode
Bro has Minecraft in his Hot Bar what a legend..
👏👏👏👏🗿🗿🗿🗿🗿🗿🗿🦸♂🦸♂🦸♂
no he’s not a legend because its bedrock edition
thanks! i was absolutely stuck on what to make for my first real project!
Good content as always! I love your vids
Thank you, Shuan. I was able to break off of your code really quickly, but I learned a lot. I even added an Easter egg for the shiny vase
That was very good keep it up! :D
Thank you so much is very helpful ❤
I was actualy searching about how to make a text based game, like a phone game. Not necessarily a mobile game but a game that's like a smartphone
Your tutorial is a lifesaver. Thank you!
this is great! ty
Tusen takk!
Very helpful Video for a beginner like me. I have one question. How can you make the if/else clause repeat, in case the user enters an invalid option, so he can choose again right away?
I would use a while loop. For example while choice != "yes" or choice != "no": choice = input("No such option, please enter yes or no: ")
@dolfinw4179 Absolute legend, tried figure it own on my own for days
@@dolfinw4179 ur goated for this
I got stuck on how to make the "carrot symbol" on my keyboard. I am from norway so couldn't find it. Had to copy it from some text
caret. He said caret (^) but did "greater than" > shift-dot, between comma and slash. A caret is shift-6.
What about continuing this game with another episode, you could have a drawing of location layouts of the mansion (not ingame but as an example of designing our map on paper) and how you add a navigate around the game world, where the player can navigate with n or e as traditionally with interactive fiction games. Or you could do a new setting where the player is walking through a forest where there are several paths to follow. This would be a great addition to learning how to make basic gameworld maps. I guess the very simple method would be giving several direction choices at the end of the location desc.." To the west is a swamp." And I guess, match input keyword of west or w to the current location the player is at. You could do a simple method for one half of the video and a more advanced version which might involve functions that handle the map system, on the other half of the video using the same adventure game setting.
It is a ‘text’ adventure
Many text adventure games provide graphic clues. Maybe not in early 80s but later.
How can I get the player back to first set of options after choosing a particular choice route?
While loop
Do you have a pastebin?
can we made this using tkinter and how??
how to set the game asking like " Do you wanna play again ?" yes or no, Y/N
@@summerlovinxx thank you my friend.
Throw in a continue after the catch statement so they can redo the input without having to start over :)
What is the code on how to do this, I’ve been trying to find out how for a while?
@dontmindme3740 Make sure that the try section is inside a loop or else it won't work. try: Code except: Error message continue
@@dontmindme3740Id like to know too
the fan part killed me lmao
that was so helpful I would like to ask you a question.
Good content as always. But why is he stealing from his own house???
Good question!
Can you make it with less nesting?
No
Yo can someone tell me why; roomChoice = ("> ") if(roomChoice == "blue"): Doesn’t work?
Are they on the same part, for example hideChoice = input("> ") if(hideChoice == "yes"): print("You hide and you see the horrifying demons rush past you") print("Before you know it your running out the door") print("You win") elif(hideChoice == "no"): print("The demons catch up with you and your eaten") print("You Lose")
meme break? how mature of you.
Hi my friend, can you help me. it says that pitbull is not defined can you fix it for me? print("Welcome to the hounted mansion!") print("You are a distant family member of a rich millionaire who has been passed away living this / mansion to you ") print("as a new found owner, you decide to pay a visit to the mansion") print("the hause isdated, creaky, and a falling appart. you walk in the front door.") print("do you want to enter the living room or dinning room?") roomChoice = input ("> ") if(roomChoice == "living room"): print("you enter the living room") print("as you walk in you see a sleeping pitbull guarding some gold jewerly") print(" do you want to steal the jeverly from the pitbul?") pitBullchoice = input (" > ") if(pitBullChoice == "yes"): print("you attempt to stela jewelry, but it wakes up and rips you shreds") print("you are now dead") elif(pitBullChoice == "No"): Print("You decide to not to steal dog's jewerly") print("you decide to turn and leave the house safely") else: print("invalid choice. Please enter yes or no") elif(roomChoice == "dinning room"): print("you chose to go into the dinning room") print("as you walk in, you see a shiny vase on the table") print("do you want to open the vase") vasechoice = input ("> ") if (vasechoice == "yes"): print("you open the vase and find a pile of bones") elif(vasechoice == "no"): print("you decide not to open the shiny vase") print("as you turn to leave,you heare a ckacking sound comming from the corner") print("a dark figure with glowind red eyes launches at you, knockin you unconcious") print("you wake up in your bad.it was all a dream") else: print("invalid choice.please enter yes or no.") else: print("invalid choice. please enter living room or dinning room")
Probably a spelling error, you first typed pitBullchoice with small c and then if(pitBullChoice) with capitalized c. Not sure tho just a thought.