I’m very new to programming and to python.
I am making a fight simulator, and now that I have completed making a defender that is not very smart, I am trying to build an AI that can try and interpret how to defend.
I need to get some variables from one of my classes (attacker) into my other class (smart defender), I was told by one of my instructors that importing a class into another class is not a good way to go about programming my code.
Is there a way for me to get the variables from my attacker class into my smart defender class without importing the attacker class to it?
I appreciate input! 🙂
I’m very new to programming and to python. I am making a fight simulator,
Share
“Importing” the class may very well be a good idea, depending on what “importing” means. However, in Python you don’t need to do any importing to pass data.
The defender class can simply access the attacker class like any object.
etc. So you don’t need to do anything special, really.