61
Other Games / Re: The Roguelike Development Megathread
« on: December 22, 2016, 01:38:15 pm »Defining all the monsters and stuff in-program looks quite messy, yes, but the main problem is that when I'm making a custom map or making enemies drop items, I have to define the item again, meaning copypasting, and the list of drops will be the exact same code again, give or take a few things. So it's comparatively inefficient as well.
It's hard to know exactly what's going wrong here, but the fact that you're talking about copy-pasting things like monsters is... concerning. To say the least. Would you be willing to provide a snippet of your code showing the problem?
In general, you'd have something like monsters.py, that defines all your monster classes, and you'd just instantiate one of them whenever you needed one. So, you'd define a rat class, and when you wanted to put a rat in a map you'd just do r1 = monsters.Rat( ... ), where the arguments may (or may not) define things like max HP, current HP, status, etc - if that's how you defined the class.