Share your repls and programming experiences

← Back to all posts

NEW UPDATE: Traders are here! (full changelog at the bottom)

I've created a game called TextRPG. It's a roguelike, turn-based dungeon crawler, with infinite randomly generated floors. This game is still in the early stages (this is the first "playable" update), so the interface is a bit unpolished. It would be great if people could report bugs, and stay tuned for the next updates! (btw if u wanna report an error/crash please include the error message it makes it so much easier for me to track down said error with the output)

DISCLAIMER: The save system doesn't seem to work here. If you want to save your games, please fork this code into your own repl and run from there.

If you want to report any problems, ask any questions, or simply just wanna chat about the future of the game, feel free to join my discord server: It would be greatly appreciated!

Important Info

Terms of use: You are allowed to use this code for personal use only, that means that you can modify the code all you want, but you are not allowed to distribute it either commercially or non-commercially. This is because I want to release this as a fully fledged game in the future.


It seems that the interface of the game is more complicated than I thought!
I guess I'll describe how it works.
The dungeon is made of a series of floors, which are generated with rooms every time you descend down the steps.
There are 5 different types of rooms:

  • U: This is a staircase going up. Use the "Continue" option while in this room to go up the stairs (you can't go up if you're on floor one!)
  • D: This is a staircase, you guessed it, going down! Works similarly to the "U" stairs. You can still go down the stairs even if you haven't explored the entire floor.
  • F: This is a "fight" room. Here you will find an enemy to fight, and enemy difficulty is based on your current floor.
  • L: This is a loot chest! You will always get one food item from the chest and a 1/3 chance of getting a weapon. The loot of lowest quality has the highest chance of dropping, while high quality loot is quite rare!
  • T: This is the "trader" room. Traders will either be a grocer or blacksmith. You can buy food from the grocer or buy weapons and repair your weapons at the blacksmith!
  • Traversing through the rooms is quite easy! When you have the chance, choose the "Continue" option, and you will be shown a map of your floor. Choose the options to move in the four directions. On the map, each letter represents a room. A room of colour orange/yellow means it is unexplored. Green is explored, and red is where you are currently at.
    Every 10 floors, the size of the floors increases and the quality of loot improves!
    Have fun grinding infinitely!

Early Access Update 1 Changelog:

  • Traders have been added! A trader will be either a grocer or a blacksmith. You can buy food from the grocer. You can buy weapons and repair your weapons at the blacksmith. Each trader will have a range of stock to sell!
  • A bunch more content has been added! Grind for more weapons, eat a wider range of food, and face more enemies! Check the code for all the additions! Thanks to @EdmundNewman for helping me out with this.
  • A bug has been fixed where the game could crash while moving floors beyond floor 9
  • Fixed a bug where the options list would disappear after eating while fighting an enemy
  • Fixed a bug where player position would not reset after death
  • Some QoL additions: Health now shows on top of eat screen, Current floor is now shown in stats, Current enemy info is shown at the top of the fight options screen
  • Your gold count is now halved upon death (still slightly buggy :/)
  • Escape chance is now 25% instead of 50%, and when you escape from an enemy, you will have to fight it again if you re-enter the room
    I can confirm that the next update will be centred around the introduction of armour, inventory management, and bosses. Hopefully a new save system as well, so it will work on this post!

just a suggestion, you should make a new data save for each player because I just logged into someone else's game and had all of their stuff


@JonahElias yeah this is made to be a game installed on your local machine... it doesnt quite like it when j put it on repl. I'll see what i can do in the next update!!


@bryancrisso It's a really good game btw


@bryancrisso Perhaps you should consider using the database for these SaveGame purposes. And I'm sure it goes without saying that prior to play, users should fork it into their own
Otherwise, good job!


@JonahElias I keep on going into someone's named "asd" game.


This is sadly better than my ad infinitum...

Its rly good!


Wow this is cool. I'm working on a similar game.


@hello4691 Tried it out! Very, very cool. Traveled the full 1000 miles. I liked the mage/magician appearing, and the options were good. I thought the bottle showed up too many times - but maybe that was just for me? I also thought the protagonist is kinda a bad dude lol, making trouble everywhere he goes (as those were the options). Good game!~


@novelboy Thanks :). The reason the bottle scenario came up so many times was because I used multiple of the same scenario. The potions gave different effects. I got kinda lazy after that and didn't add anymore scenarios.


@hello4691 I have tried your game, it is nice
I have a suggestion: you could've allowed increasing the stamina more than 100
you could've added 'save' option
I have even travelled 1000 steps also

that's it,
waiting for your game to be download...


very pog


i love your text rpg series! plz post more updates asap!


my name is now SAVED DO NOT WORK HERE (lol)


Noice, glad to see trader's here


Mysql might be a potential way for you to get save files to work.


Can you add a way to sell stuff to the trader?




Good Job, one thing tho. When I pressed continue a game it gave me a random persons game


This game is AWESOME!!
I love this game and I hope you create more games like this and you publish it soon so that I can access it from my device.
waiting to download Text RPG...


When trying to go from floor 12 to 13, I got the following error.

Traceback (most recent call last):
File "", line 661, in <module>
game = Game()
File "", line 581, in init
File "", line 382, in mainMenu
File "", line 398, in intro
File "", line 428, in pause
File "", line 481, in floorMovement
File "", line 599, in createFloor
floorArray = self.populateFloor(floorArray, floor)
File "", line 646, in populateFloor
j.loot = [random.choice(eligibleFood), random.choice(eligibleWeapon)]
File "/usr/lib/python3.8/", line 290, in choice
raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence

I also never got a weapon from a chest. Could there be an issue with the weapons list? Perhaps especially for floor 13?


@MegaEmailman the error you got should be fixed now. as for the weapons, it's a 1/3 chance to get a weapon from a chest, so you're probably getting really unlucky




For your bat stew, you can use the random module's randint to choose a random number in some range. Use an if else conditional, so that if the random number is like 5 or something, the health you gain is negative, hence you take damage. Else, you gain 20 health.


@AtharvGoel it's a bit more complicated than that, but good idea nevertheless! the comment that says "dk how to implement" is from my friend, who does most of the content creation!




Im not too good at coding but would you be cool if I tried to make it online? and like gave friends the script so we could play together, ill credit you of course.


@LukeShomper go ahead! I'd love to see what you can come up with. I'm thinking about including multiplayer myself later on, but now i want to focus on fleshing out the singleplayer experience. Personally I want to give the game a visual experience before adding multiplayer.


@bryancrisso Yeah, I realized how work in progress it is, I might wait a while.


@bryancrisso So what does the self thing do?


@JBYT27 when you are working with classes, self attributes the variable to the current class


oh, ok. Thx @bryancrisso


Small problem, the game doesn’t save my name after taking a break. It changed to “asd.”


Just realized that it signed into someone else’s game like @JonahElias said.


wow cool


i made a game like this but in pygame. probably won't ever upload it because it's probably trash. a quick question: how did you get things to save? that's one of my limitations right now, it has to be played in one session.


@pleasestop u can use the python "pickle" module to save data


Really Cool, but I have a bug to report

When you choose to eat, and after you eat an item the entire interface, ends and only says: What is you choice.


@DobbyK yeah that's a weird bug. It will still just take options from the battle options while not showing the menu.


@bryancrisso I think I found the problem but it might be wrong (Under the function 'eat'):

After it actually gets the eating done, and improves your health it breaks and returns to here: (Under the Function "Encounter"):

I'm not sure where it goes after finishing "" but I think this may be the problem.


@DobbyK theres nothing wrong with the eat function, it just doesn't show the options screen after eating (because it clears screen after eating). It's a really easy fix...


@bryancrisso Oh, I just think too much hard on everything lol.






Wow this is really cool.


The save system is sad... I have the same problem with the .dat files to..... (This is in this )
Also you could even make this like a full game you can move around, i made a maze game here:
Using these physics you could maybe make events, like a Q is an event, and if you move into it it triggers something

Also if you want to do anything with this i can help


@Muffinlavania i mean, the save system was never made for repl, it works perfectly fine on a local installation. I'm prototyping ways of using the repl database for saving data, for this post.
Your maze prototype is a good idea, but I definitely have different priorities for this. Anyways, as the saying goes, don't fix what ain't broke.
I'm totally fine on this project, I have like 4 friends already working with me on it, although I do most of the programming, and a couple of them create all the content.


@Muffinlavania what is a dat file?


@ZDev1 it's just a file type used to store data


@bryancrisso oh amazing
Is there a tutorial about how to use it?


@ZDev1 search up "python pickle module"


@bryancrisso oh gud
Can I use it with Nodejs?


for me, the game crashes when I try to go down to floor 7 or 8


@WilliamRV could you share the error message? would help a lot when trying to fix the error!


wow! very cool!


It is pretty good, but I have one little suggestion. When you go downstairs, you gain a floor. When you go upstairs, you lose a floor. Why is that? I think it should be flipped.


@elizurfk Well, if you think about a classic dungeon, you would start at the top, and explore downwards, right? So this is what happens. We start at the top and you go downwards, and since the floors are technically infinitely generated, it's just a lot easier to get bigger floor numbers the more you go down (it helps with the generation algorithm, it's just a lot simpler)


@bryancrisso Yeah, but why would the floors get bigger if you are going down?


Ummm dude I played for 20 minutes straight and on floor 10 I was going to floor 11 and this happened: It had errors from multiple lines and my thing just crashed


@elizurfk uhoh, tysm for reporting the bug! I haven't tested beyond floor 10 because, well, I though it would work just fine! I'll try to replicate the bug and attempt to fix it within the next few hours.