i'm sure it's a simple thing for you, but don't find how to.
Have a common caracter class:
Code: Select all
class Characters(object):
def __init__(self, id, name, strength):
self.id = id
self.name = name
self.strength = strength
For Enemies, I init Strength with a value passed when create class, but for the Hero, Strength is an automatic random value.
So do I have to remove Strength from my common class and create 2 sub classes, or is there a way to implement 2 ways of intialize the same attribute ?
Waouh, I read my question and I'm so sorry for your brain !!!!