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

Поделиться
HTML-код
  • Опубликовано: 24 окт 2024

Комментарии • 60

  • @Bjorofficial
    @Bjorofficial Год назад +24

    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

  • @Kayne-zk4xi
    @Kayne-zk4xi 10 часов назад

    Thanks so much you helped me complete the school work

  • @catthatisarat
    @catthatisarat 11 месяцев назад +5

    thanks! i was absolutely stuck on what to make for my first real project!

  • @karenbourgeois7957
    @karenbourgeois7957 11 дней назад

    I have so many ideas. RPGs are my favorite! Thanks a bunch 😊

  • @damelon9783
    @damelon9783 Год назад +54

    Bro has Minecraft in his Hot Bar what a legend..

    • @Aaryanaustralia
      @Aaryanaustralia Год назад +2

      👏👏👏👏🗿🗿🗿🗿🗿🗿🗿🦸‍♂🦸‍♂🦸‍♂

    • @edgarplayz1021
      @edgarplayz1021 7 месяцев назад +2

      no he’s not a legend because its bedrock edition

    • @jbomb11
      @jbomb11 2 месяца назад

      @@edgarplayz1021it doesn’t matter

    • @edgarplayz1021
      @edgarplayz1021 2 месяца назад

      @@jbomb11 It does 💀

    • @edgarplayz1021
      @edgarplayz1021 2 месяца назад

      Bro really called it a hotbar its a taskbar

  • @ChimpanzéDo38
    @ChimpanzéDo38 Год назад +4

    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

  • @spanailos
    @spanailos Год назад +10

    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?

    • @dolfinw4179
      @dolfinw4179 11 месяцев назад +12

      I would use a while loop. For example
      while choice != "yes" or choice != "no":
      choice = input("No such option, please enter yes or no: ")

    • @nervnichtmitalias
      @nervnichtmitalias 8 месяцев назад +1

      @dolfinw4179
      Absolute legend, tried figure it own on my own for days

    • @Johzenji
      @Johzenji 6 месяцев назад +1

      @@dolfinw4179 ur goated for this

  • @magicwordxyzzy
    @magicwordxyzzy Месяц назад

    I feel like using lower() to make the input not case sensitive would be an easy addition to improve this...but then, if we did every little thing to improve on the idea of a text adventure in Python, the video would be considerably longer, lol. I just wish that Python had some sort of getch command built in so every input didn't need to end with the press of the enter key.

  • @scarloss474
    @scarloss474 4 месяца назад +1

    If anyone sees this please answer;
    What code do I use to return it back to the input/question I ask the player if put in an invalid choice? Or perhaps revert the game back to the beginning if they die without starting the game over themselves?

  • @Centiaa
    @Centiaa 5 месяцев назад

    Your tutorial is a lifesaver.
    Thank you!

  • @likezoinks2739
    @likezoinks2739 Год назад +6

    Good content as always! I love your vids

  • @aaronjenkins223
    @aaronjenkins223 Год назад +3

    Throw in a continue after the catch statement so they can redo the input without having to start over :)

    • @dontmindme3740
      @dontmindme3740 11 месяцев назад +2

      What is the code on how to do this, I’ve been trying to find out how for a while?

    • @aaronjenkins223
      @aaronjenkins223 11 месяцев назад

      @dontmindme3740
      Make sure that the try section is inside a loop or else it won't work.
      try:
      Code
      except:
      Error message
      continue

    • @griswoldthegoblin9420
      @griswoldthegoblin9420 11 месяцев назад

      @@dontmindme3740Id like to know too

  • @StonyComet
    @StonyComet Год назад +4

    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

    • @daryllee7471
      @daryllee7471 11 месяцев назад +5

      caret. He said caret (^) but did "greater than" > shift-dot, between comma and slash. A caret is shift-6.

  • @hedgehogsmarbleruns3705
    @hedgehogsmarbleruns3705 Год назад +1

    That was very good keep it up!
    :D

  • @AlexandersVideoCorner
    @AlexandersVideoCorner 11 месяцев назад +2

    How can I get the player back to first set of options after choosing a particular choice route?

    • @PAFBEAST
      @PAFBEAST 6 месяцев назад

      While loop

  • @MetalHeadRed954
    @MetalHeadRed954 4 месяца назад

    I really like this one very informative

  • @elvisdavidfenny8446
    @elvisdavidfenny8446 Год назад +7

    how to set the game asking like " Do you wanna play again ?"
    yes or no, Y/N

  • @Daz30
    @Daz30 Год назад

    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.

  • @FindusFiskekaker
    @FindusFiskekaker 5 месяцев назад

    Tusen takk!

  • @7archaslayer763
    @7archaslayer763 Год назад +1

    Thank you so much is very helpful ❤

  • @megazoned3973
    @megazoned3973 Месяц назад

    If you make an invalid choice, how to you make it prompt you to answer the last question again instead of having to re run the game from the start?

    • @QuizMaster-w6c
      @QuizMaster-w6c Месяц назад

      that is one way to solve this problem, hope it helps
      ### choice
      print("do you want to enter the room?")
      choicebool = True
      while choicebool == True:
      choice = input("> ")
      if choice == "yes":
      print("you entered the room")
      choicebool = False
      elif choice == "no":
      print("you did not enter the room")
      choicebool = False
      else:
      print("invalid input, please enter yes or no.")
      print("end")

  • @mqasim.chandio1
    @mqasim.chandio1 Год назад +2

    Good content as always. But why is he stealing from his own house???

  • @Poolnoodlez
    @Poolnoodlez 4 дня назад

    I edged it to this video thank you 😊

  • @gameu2sleep
    @gameu2sleep Год назад

    this is great! ty

  • @ompathak3384
    @ompathak3384 8 месяцев назад

    can we made this using tkinter and how??

  • @jamaalHailey
    @jamaalHailey 7 месяцев назад

    the fan part killed me lmao

  • @marcossalcedo5498
    @marcossalcedo5498 Год назад

    that was so helpful I would like to ask you a question.

  • @GeekRedux
    @GeekRedux 3 месяца назад

    caret: ^ greater than sign: >

  • @midnightgamer217
    @midnightgamer217 7 месяцев назад

    Can you make it with less nesting?

    • @PAFBEAST
      @PAFBEAST 6 месяцев назад

      No

    • @magicwordxyzzy
      @magicwordxyzzy Месяц назад

      Maybe? I've started thinking about doing a project like this, and I'm considering using a variable to set the current location, and based on the location call a function for that location. I'm also thinking about how I would implement an inventory system, which would need to include character inventory as well as inventory for each location, with the ability to move things between the current location and the character inventory.

  • @dylansachdev1559
    @dylansachdev1559 Год назад

    Do you have a pastebin?

  • @farming4521
    @farming4521 Год назад +1

    Yo can someone tell me why;
    roomChoice = ("> ")
    if(roomChoice == "blue"):
    Doesn’t work?

    • @Bjorofficial
      @Bjorofficial Год назад +2

      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")

  • @Lonewander
    @Lonewander 19 дней назад

    if i see a pitbull im gonna pet da baby bc teddy bear dog

  • @Qu0thTheRaven
    @Qu0thTheRaven Год назад

    meme break? how mature of you.

  • @grigoldvali4124
    @grigoldvali4124 Год назад +1

    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")

    • @griswoldthegoblin9420
      @griswoldthegoblin9420 11 месяцев назад +2

      Probably a spelling error, you first typed pitBullchoice with small c and then if(pitBullChoice) with capitalized c. Not sure tho just a thought.