Closed dis446 closed 8 years ago
This is causing major issues, since the class init constructor used some global variables to determine some stuff. i.e. if ""len(people)==0:""" then it is assumed that the human being created is the player.
Why don't you simply instance Human and assign to a player variable at game creation?
"player = Human(attributes, more attributes)"
Then you can easily refer to the player any time you want, simply "player.method" or "player.attribute"
The reliance on globals means they are permeated in the code. Until a large refactor is done to assign them to all to a class, there will be all sorts of headaches with any organizational attempts, including simply separating files.
That's genius! So I should just keep the player seperate from all the others. Up till now, the player was the first entity in the 'people' list. Great idea!
In the class files, I can't refer to variables defined in the main file. So I have to two options.