My Pygame Game Engine
1## Imports
2
3import pygame, os
4
5## Class
6
7class image:
8 def __init__(self, game):
9 self.game = game
10
11 ## Loads image from the current active image folder using the current Assetpack
12
13 def load(self, image):
14 if os.path.isfile(os.path.join('src', 'resources', self.game.current_assetpack, 'assets', 'images', image)):
15 return pygame.image.load(os.path.join('src', 'resources', self.game.current_assetpack, 'assets', 'images', image))
16 else:
17 return pygame.image.load(os.path.join('src', 'resources', self.game.current_assetpack, 'assets', 'images', 'error.png'))