- Code: Select all
if __name__ == '__main__':
os.environ['SDL_VIDEO_CENTERED'] = '1'
screen = pg.display.set_mode((640,480))
PLAYER_RIGHT_IMG = pg.image.load('player_right.png').convert()
PLAYER_LEFT_IMG = pg.image.load('player_left.png').convert()
ENEMY_LIST = [pg.image.load('enemy1.png').convert(),
Is this ok? There are only a few images at the moment but by the time I'm done there will be more than double that. Will this cause any harm to my game, like slow down the fps or anything? Is there a better way of doing this?
Grateful as always
EDIT- I've just put my player images into a list and now I set the colorkey in the player class, the same thing that I do with the enemies. Don't really know why I didn't do that before. I still would like to know the rules on global constants and variables though