Python Forum
Simple Game - Choice Based
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Game - Choice Based
#1
I am very very new to python and trying to make a simple game where you type a choice and something happens depending on the choice but I'm not quite sure how to start as I dont really understand how to do it at all.
Im not even sure if im using the forum correctly- bear with me please
Reply
#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
#3
You might also want to check out my text adventure tutorial.
XavierPlatinum likes this post
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#4
Hey
I am new like u..
I choosed Renpy
u might check
more python
Reply
#5
Hello! I fully understand the difficulty of being a Python beginner and trying to create a game with user input and different outputs. It might be hard at first, but don't worry, you'll get the hang of it with practice and persistence.
I was in a similar situation when I first started learning game development. It seemed overwhelming, but I found that breaking the problem down into smaller steps and learning from different resources helped a lot. On this resource Link Removed a wide selection of games that can be studied and learned. .
When it comes to creating a text-based game in Python, the key is to understand how to take user input, use conditional statements (such as if-else statements) to validate the input, and then execute different blocks of code based on the user input. . choice. It may seem confusing at first, but with a little guidance and practice, it will become clearer.
Gribouillis write May-22-2024, 02:32 PM:
Clickbait link removed. Please read What to NOT include in a post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple game help jarettday 1 4,002 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,006 Dec-17-2019, 03:40 AM
Last Post: detkitten
  Trying to make a simple pong game. kevindadmun 1 3,970 Aug-05-2019, 06:39 AM
Last Post: kevindadmun
  simple pygame game kinglarry0327 0 10,704 Jan-06-2019, 06:18 PM
Last Post: kinglarry0327
  Text Based Game DuaneJack 3 3,611 Aug-15-2018, 12:02 PM
Last Post: ichabod801
  Simple Digimon Game - Suggestions Welcome prog92 2 4,416 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