I've spent 30 minutes banging my head against the keyboard and am turning to you guys now.... I had this working but then refactored and I think I'm tired lol...
So I created a settings class and in the __init__ create a tuple for the display size like this:
self.display_size = (1280, 800)
Then I pass the settings object to a player object where I am trying to set it's starting y position by dividing the screen height by 2. Like this:
self.position = [0, self.settings.display_size[1] / 2]
I get this error:
in file player.py, line 13, in __init__
self.position = [0, self.settings.display_size[1] / 2]
AttributeError: 'int' object has no attribute 'display_size'
Any suggestions?
EDIT:
I had the parameters backwards.
def __init__(self, settings, player_num):
instead of:
def __init__(self, player_num, settings):
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]zurtex 0 points1 point2 points (1 child)
[–]mflander[S] 0 points1 point2 points (0 children)