Python Text RPG (Part 2) - Making a Title Screen!

preview_player
Показать описание
Part 2 of our Python Text RPG tutorial! We'll be implementing the title screen and explaining the necessary import statements in this video.

In this Python Text RPG series, programmer and software engineer Bryan Tong walks you through a beginner-friendly tutorial on building your personalized command-line-based text role playing game in Python. He walks you through concepts such as for loops, while loops, data structures, dictionaries, maps, and even tricky functions like system sleep for text effects.

Рекомендации по теме
Комментарии
Автор

os.system('clear') on windows is os.system(cls) if anyone is having isues

tobydickenson
Автор

This tutorial is awesome overall but just a minor suggestion is that when you do an input, you can do "option = (">").lower()" which would simply allow you to do "if option == x" instead of "if option.lower() == x" a bunch of times

percypappiono
Автор

Just want to point out something. Then under_score_case is just a convention in Python. It is by no means **required**. Also, Class names are generally UpperCaseCamelCase, not like how "player" is in this (The convention is "class Player(object)", even though "object" is implicitly the super class, "Explicit is better than implicit" -PEP 20)

iviscosity
Автор

great tutorials! thanks for uploading :)
advice for beginners: at 9:17 instead of copying the option code(lines 25 to 30) and pasting it into the loop you can also cut, and paste it as it's only needed inside the loop.

leondost
Автор

Your vids keep getting better! This one was really easy to watch too. Thanks!

notcseliot
Автор

Instead of using *os.system('clear')*, use *os.system('cls' if **os.name** == 'nt' else 'clear')*, this makes it so that it'll check if you're using Windows, but if you're not then it runs the other command, this is the cross-OS friendly method.

ryan-levy
Автор

I know this was made a long time ago, so you may not respond. When you made the help menu, instead of making tons of print statements you could put help into a text file and then use:

with open('help.txt', 'r') as f:
print(f.read())

And that way if you had a help file that was much longer it would simplify your code.

Additionally adding "import platform" to imports and this to the beginning of "title_screen()":

if platform.system() == 'Windows':
os.system('cls')
title_options()
else:
os.system('clear')
title_options()

Will allow people on other OS to use the game.

timreneau
Автор

Thank you so much! I tried to make this game originally with boolean values alone, after realizing that was a mistake I tried to use "defs" (or functions) but the variables didn't connect, so I decided to look this up and I'm so hyped to make my game for real this time. :)

tristangovier
Автор

# THANKS
print ("you are helping everyone whoose viewed this")

frogust
Автор

i take gcse computer science and we have to program a simple game atm. its friday afternoon and the project is supposed to be done by monday. i decided to create dnd in python. very complex. gotta work on it at home and at school. i have 3 days to make a highly advanced algorithm that uses inputs and for loops. it might not be completed. so long as i make the skeleton code i should be ok to begin to add extras. ill update yall if i remember to.

ty for making this its a life saver. im gonna use this as heavy inspitation for my own code :)

SeaGully.
Автор

For making sure the player enters a valid command on the title screen, I would reccomend putting it in a "while True" loop.

Simply put 'while True:' before the input command, and use a 'break' function when the player enters something in the options. If they type something not in the options, don't use the break command and it will loop back.

therightjelly
Автор

Another awesome tutorial. Loved the slow text effect

BrokenShooter
Автор

It always helps to read the code if the code was zoomed in. Nevertheless a very helpful video to get started!

FeverDev
Автор

Thank you for this tutorial.
I really want to make a game just like SanctuaryRPG.

rottingdumpster_
Автор

When i typed it all and double checked it, it said i used tabs and indentation inconsistently
please help

keizercsgo
Автор

thx you helped me understand classes :)

decqyd
Автор

If anyone get any strange error u could try put option=raw_input("> ") instead of just option=input("> "). Make the game more simple I think

thiagovidal
Автор

I'm hitting an error straight away and can't work out what's going wrong. On this piece of code:
class player:
def__init__(self) :
self. name=""

It's giving me an invalid syntax after the double dots after (self). I'm 100% I've typed it out the same as on screen. Help me! 😭

Smartacus
Автор

if it isnt coloured on your screen for whatever reason, follow this:
go to tools, and the first option should say command palette. press on it, and type in "set syntax python" and select the first one. this should make it work

nasus_elyob
Автор

very cool I m gonna try this with my style

AdesyThe
join shbcf.ru