I have two different files like this:
file name Game.py
from objects import *
...
player = Player()
self.screen.blit(player.draw[0], player.draw[1])
...
and
file name Player.py
class Player
def __init__(self)
player = pygame.Rect(0, 0, Tilewidth, Tileheight)
player_image = pygame.image.load('media/player.jpg')
player_stretch_image = pygame.transform.scale(player_image, (Tilewidth, Tileheight))
...
def draw
array = [player_stretch_image, player]
return array
And the folders looks like this
objects/
__init__.py
player.py
Game.py
This doesn't work and I don't know why. I want to use some of the variables in the other file without using "import everything".
Is there any alternative way to make variable global using methods or should I make a third file containing all the variables and then importing them into the files?
I'm still pretty new to Python so I don't really know the way to solve this problem.