Python Forum
Simple Game - Choice Based
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Game - Choice Based
#2
If your question is unrelated to a current thread, it's best to start a new thread. I've split your question off into it's own thread for you :)

Your question isn't really specific, but what you're explaining can be handled through user input (https://docs.python.org/3/library/functions.html#input), and branching based on the result of that input (https://docs.python.org/3/tutorial/contr...statements)

As a simple example, take a look at this:
print("The tunnel splits here.  Do you want to go left (1), or right (2)?")
choice = None
while choice not in ("1", "2"):
    choice = input("1|2: ")

if "1" == choice:
    print("You go left.  You find a fountain granting eternal life.")
elif "2" == choice:
    print("Being bold, you head right.  There's a bowl of candy!")
Reply


Messages In This Thread
Simple Game - Choice Based - by theor - Apr-13-2019, 01:30 PM
RE: Simple Game - Choice Based - by nilamo - Apr-13-2019, 05:02 PM
RE: Simple Game - Choice Based - by ichabod801 - Apr-13-2019, 05:28 PM
RE: Simple Game - Choice Based - by beLIEve - May-10-2019, 08:41 AM
RE: Simple Game - Choice Based - by alanbriggs - May-22-2024, 01:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple game help jarettday 1 4,072 Sep-07-2020, 10:45 PM
Last Post: bowlofred
  Adding an inventory and a combat system to a text based adventure game detkitten 2 7,159 Dec-17-2019, 03:40 AM
Last Post: detkitten
  Trying to make a simple pong game. kevindadmun 1 4,073 Aug-05-2019, 06:39 AM
Last Post: kevindadmun
  simple pygame game kinglarry0327 0 12,445 Jan-06-2019, 06:18 PM
Last Post: kinglarry0327
  Text Based Game DuaneJack 3 3,696 Aug-15-2018, 12:02 PM
Last Post: ichabod801
  Simple Digimon Game - Suggestions Welcome prog92 2 4,513 Jun-01-2017, 09:53 PM
Last Post: prog92

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020