Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Let me add one caveat, when calling the __init__ function of the super class from the sub class, you should use the SuperClass.Function(self, args) format. I'm not super familiar with Python 2, but I think the reason is that at this point the object is not yet fully initialized so you can't call from it yet. I think there is a function called super() that gives access to the base class so you can call it without passing self, something like

# The following would be the first line of weapon class __init__
super().__init__(name,img,value,description,number,stat)

But you need the base class to inherit from object and the one time I tried coding with Python 2 I couldn't get it to work (I was using an unofficial interpreter, so you may get better results).