How to make text based adventure game in python gui with tkinter

Subscribers:
182
Published on ● Video Link: https://www.youtube.com/watch?v=FilakPL6YBU



Category:
Tutorial
Duration: 9:08
2,698 views
25


How to make text based adventure game in python gui with tkinter

Note : Recplace (greater than) and (less than) with their sign/symbol ( Because Youtube donot allow angle brackets in description ) OR You can get this code on github by using github link

Code github Link : https://github.com/ubaidahmadceh/python_tkinter_GUI_projects/blob/main/Text_Based_Adventure_Game_GUI.py

code :

from tkinter import *
from random import randint
root = Tk()
root.title("Number Guessing Game GUI")
root.geometry('600x600')

global health
health = 10

def age_function():
age_label = Label(root, text="Hi, "+name.get()+" What's your age?")
age_label.pack()
global age
age = Entry(root)
age.pack()
age_submit_button = Button(root, text="Submit", command=game_start_0_function)
age_submit_button.pack()

def game_start_0_function():
age_integer = int(age.get())
if age_integer (greater than)= 18:
welcome_label = Label(root, text="You are eligible to play the game")
welcome_label.pack()
play_game_button = Button(root, text="Play", command=game_start_1_function)
play_game_button.pack()

else:
cant_play_label = Label(root, text="Sorry you have to wait till you turn 18")
cant_play_label.pack()

def game_start_1_function():
game_line_1 = Label(root, text="Road is dividing into left and right")
game_line_1.pack()
game_line_2 = Label(root, text="Which path you will chose?")
game_line_2.pack()
game_line_3 = Label(root, text="left")
game_line_3.pack()
game_line_4 = Label(root, text="right")
game_line_4.pack()
global user_decision_1
user_decision_1 = Entry(root)
user_decision_1.pack()
decision_1_submit_button = Button(root, text="Submit", command=game_start_2_function)
decision_1_submit_button.pack()



def game_start_2_function():
if user_decision_1.get() == "left":
game_line_5 = Label(root, text="Now there is a house and a strange pond , So what will you chose? house or pond")
game_line_5.pack()
global user_decision_1_2
user_decision_1_2 = Entry(root)
user_decision_1_2.pack()
user_decision_1_2_submit = Button(root, text="Submit", command=game_start_3_function)
user_decision_1_2_submit.pack()


def game_start_3_function():
if user_decision_1_2.get() == "house":
game_line_6 = Label(root, text="you had a fight with them and you lose your health. Write health to find out your new health")
game_line_6.pack()
global new_health
new_health = health - 5
global find_out_health
find_out_health = Entry(root)
find_out_health.pack()
find_out_health_submit = Button(root, text="Submit", command=game_start_4_function)
find_out_health_submit.pack()

elif user_decision_1_2.get() == "pond":
game_line_7 = Label(root, text="you have a happy life now. you live by fishing Write thankyou to me for saving you")
game_line_7.pack()
global thnx
thnx = Entry(root)
thnx.pack()
thnx_submit=Button(root, text="Submit",command=game_start_5_function)
thnx_submit.pack()


def game_start_4_function():
if find_out_health.get() == "health":
find_out_health_label = Label(root, text=new_health)
find_out_health_label.pack()

def game_start_5_function():
if thnx.get() == "thankyou":
thnx_label_1 = Label(root, text="your welcome")
thnx_label_1.pack()

name_label = Label(root, text="Enter your Name")
name_label.pack()
name = Entry(root)
name.pack()
name_submit_button = Button(root, text="Submit", command=age_function)
name_submit_button.pack()

root.mainloop()











text-based game,beginner-friendly python project,simple python project,beginner-friendly programming project,python game,python tutorial,programming project,python project,comp sci central,python,time unraveled




Other Videos By UBprogrammer - Hindi


2020-12-17Dice Rolling Simulation Gui Project in Tkinter Python
2020-12-165. How to make button in tkinter and connect it to a function || python gui
2020-12-164. How to make dialogue box or popup in tkinter python gui
2020-12-163. How to set title in tkinter python gui
2020-12-162. How to set geometry or size in tkinter |
2020-12-161. first gui in tkinter python |
2020-12-16Corona Virus (covid-19) updater project in python | using api in tkinter
2020-12-15How to uninstall or remove pakage of libraries from python
2020-12-15How to install pip package or libraries in python
2020-12-15email sender project in python
2020-12-15How to make text based adventure game in python gui with tkinter
2020-12-15secret auction project in python
2020-12-10Number Guessing Game Python gui in Hindi with While loop | Python Computer Guess My Number | 2021
2020-12-10Github gui Tutorial |Github Desktop Clone Repository |Commit and Push Repo To Remote in vscode |Urdu
2020-12-10Number Guessing Game Python | Python Random Number Guessing Game with source code | Hindi/Urdu 2020
2020-12-10Install django on Windows10 | How to Install django in Visual Studio code |How to run django project
2020-12-09Python Installation in windows10 in Hindi | Python Path Setup Windows10 | Setup Python in VS code
2020-12-09Ceaser Cipher Text Project in Python | Urdu/Hindi
2020-12-08Screenshot Taker project in Python For Beginners
2020-12-08Screenshot Taker Project GUI in python tkinter
2020-12-08How to build Hangman Game in Python in Hindi | Word Guessing Game Python | Hangman Game Python 2021



Tags:
text-based game
beginner-friendly python project
simple python project
beginner-friendly programming project
python game
python tutorial
programming project
python project
comp sci central
python
time unraveled