How To Code A Python Text-Based Adventure Game In 11 Minutes | Programming Tutorial For Beginners

2022 ж. 29 Жел.
46 402 Рет қаралды

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..

    @damelon9783@damelon978311 ай бұрын
    • 👏👏👏👏🗿🗿🗿🗿🗿🗿🗿🦸‍♂🦸‍♂🦸‍♂

      @BharatSchoolOfEnglish@BharatSchoolOfEnglish10 ай бұрын
    • no he’s not a legend because its bedrock edition

      @edgarplayz1021@edgarplayz10212 ай бұрын
  • thanks! i was absolutely stuck on what to make for my first real project!

    @catthatisarat@catthatisarat6 ай бұрын
  • Good content as always! I love your vids

    @likezoinks2739@likezoinks2739 Жыл бұрын
  • 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

    @Bjorofficial@Bjorofficial Жыл бұрын
  • That was very good keep it up! :D

    @hedgehogsmarbleruns3705@hedgehogsmarbleruns370510 ай бұрын
  • Thank you so much is very helpful ❤

    @7archaslayer763@7archaslayer763 Жыл бұрын
  • 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

    @swart.385@swart.3858 ай бұрын
  • Your tutorial is a lifesaver. Thank you!

    @Centiaa@Centiaa10 күн бұрын
  • this is great! ty

    @gameu2sleep@gameu2sleep11 ай бұрын
  • Tusen takk!

    @FindusFiskekaker@FindusFiskekaker11 күн бұрын
  • 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?

    @spanailos@spanailos8 ай бұрын
    • 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@dolfinw41795 ай бұрын
    • @dolfinw4179 Absolute legend, tried figure it own on my own for days

      @nervnichtmitalias@nervnichtmitalias2 ай бұрын
    • @@dolfinw4179 ur goated for this

      @Jynsol@JynsolАй бұрын
  • 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

    @StonyComet@StonyComet8 ай бұрын
    • caret. He said caret (^) but did "greater than" > shift-dot, between comma and slash. A caret is shift-6.

      @daryllee7471@daryllee74716 ай бұрын
  • 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.

    @Daz30@Daz3011 ай бұрын
    • It is a ‘text’ adventure

      @thevalkyrie8@thevalkyrie87 ай бұрын
    • Many text adventure games provide graphic clues. Maybe not in early 80s but later.

      @KKolbet@KKolbet5 ай бұрын
  • How can I get the player back to first set of options after choosing a particular choice route?

    @AlexandersVideoCorner@AlexandersVideoCorner6 ай бұрын
    • While loop

      @PAFBEAST@PAFBEAST26 күн бұрын
  • Do you have a pastebin?

    @dylansachdev1559@dylansachdev1559 Жыл бұрын
  • can we made this using tkinter and how??

    @ompathak3384@ompathak33843 ай бұрын
  • how to set the game asking like " Do you wanna play again ?" yes or no, Y/N

    @elvisdavidfenny8446@elvisdavidfenny8446 Жыл бұрын
    • @@summerlovinxx thank you my friend.

      @elvisdavidfenny8446@elvisdavidfenny8446 Жыл бұрын
  • Throw in a continue after the catch statement so they can redo the input without having to start over :)

    @aaronjenkins223@aaronjenkins2237 ай бұрын
    • What is the code on how to do this, I’ve been trying to find out how for a while?

      @dontmindme3740@dontmindme37406 ай бұрын
    • @dontmindme3740 Make sure that the try section is inside a loop or else it won't work. try: Code except: Error message continue

      @aaronjenkins223@aaronjenkins2236 ай бұрын
    • @@dontmindme3740Id like to know too

      @griswoldthegoblin9420@griswoldthegoblin94206 ай бұрын
  • the fan part killed me lmao

    @user-lo1wq8xk8i@user-lo1wq8xk8i2 ай бұрын
  • that was so helpful I would like to ask you a question.

    @marcossalcedo5498@marcossalcedo5498 Жыл бұрын
  • Good content as always. But why is he stealing from his own house???

    @mqasim.chandio1@mqasim.chandio111 ай бұрын
    • Good question!

      @Teach-at-HomeDad@Teach-at-HomeDad3 ай бұрын
  • Can you make it with less nesting?

    @midnightgamer217@midnightgamer217Ай бұрын
    • No

      @PAFBEAST@PAFBEAST26 күн бұрын
  • Yo can someone tell me why; roomChoice = ("> ") if(roomChoice == "blue"): Doesn’t work?

    @farming4521@farming4521 Жыл бұрын
    • 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")

      @Bjorofficial@Bjorofficial Жыл бұрын
  • meme break? how mature of you.

    @Qu0thTheRaven@Qu0thTheRaven Жыл бұрын
  • 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")

    @grigoldvali4124@grigoldvali4124 Жыл бұрын
    • Probably a spelling error, you first typed pitBullchoice with small c and then if(pitBullChoice) with capitalized c. Not sure tho just a thought.

      @griswoldthegoblin9420@griswoldthegoblin94206 ай бұрын
KZhead