hi I'm new here on repl.it so please treat me well. now that introductions are out the way could anyone reading this test this prototype rpg I'm making (I don't have a title for it yet) I've been working on it for a short period of time and would like some help from people with better experience. thank you
so far it looks really nice,but you should make the already printed statements disappear.
Also, you could use turtle libraries
I like it! Pretty impressive for a new person! Great work, @squidlit
I code in ruby but here are some suggestions
- There are quite a lot of modes you can play in, such as mage, warrior and jester. You could separate the code into a few files so when you choose your role, the main.py file can offload the work, making each file lighter and easier to code in. For example, look at this project.
- You could also find a more experienced coder on repl.it in the Talk section and set up a multiplayer repl
- Lastly, maybe you could add a UI to this project. It's more complicated but, why not? (I've never done that before)
I really like this project. Good luck!
BTW, try eliminating some of the beginning lines. Python sets any new variable to 0 so you can say
while variable_that_has_not_been_mentioned_before = 0 ...
Forgive my syntax
1) To clear the screen, you can use this snippet of code:
from os import system # For Linux based systems (like repl.it) system("clear") # For Windows based systems system("cls")
Pro Tip: You can execute any console command using
2) For coloured text you can use colored:
from termcolor import colored # You can make a coloured string colorText = colored("MAKE ME SENTIENT", "red") print(colorText) # this will print the coloured string # OR, you can use cprint from termcolor import cprint cprint("MAKE ME SENTIENT", "red") # This will print the same text
for more info check https://pypi.org/project/termcolor/ for all the effects you will ever need.
3)For the typewriter effect, you can use
sys.stdout.write() in combination with a for loop.(Not
print() because it creates a new line every time.)
from sys import stdout from time import sleep x = "string to print" for letter in x: stdout.write(letter) stdout.flush() sleep(0.5) # Or whatever time you need
4) Use classes for monsters.
Upvote if this post helped you :D
if i had any suggestions, it would be to use colors, since it is kind of hard to see what is going on.
here is how i would do it
black = "\033[0;30m"
red = "\033[0;31m"
green = "\033[0;32m"
yellow = "\033[0;33m"
blue = "\033[0;34m"
magenta = "\033[0;35m"
cyan = "\033[0;36m"
white = "\033[0;37m"
bright_black = "\033[0;90m"
bright_red = "\033[0;91m"
bright_green = "\033[0;92m"
bright_yellow = "\033[0;93m"
bright_blue = "\033[0;94m"
bright_magenta = "\033[0;95m"
bright_cyan = "\033[0;96m"
bright_white = "\033[0;97m"
print(red + "hi")
would print out hi, but it would be red
just make sure to give credit to @Bookie0