Updated cheat system. Code rework

This commit is contained in:
2021-04-06 10:15:10 +03:00
parent bf9208577b
commit 29d5676947
9 changed files with 265 additions and 103 deletions
+13 -5
View File
@@ -11,11 +11,19 @@ from BackgroundLayer import BackgroundLayer
class Background():
imgDir = os.path.join(os.path.dirname(__file__), 'data')
backgroundImage = pygame.image.load(os.path.join(imgDir, 'background.png'))#.convert()
backgroundImage = pygame.image.load(
os.path.join(imgDir, 'background.png')
)#.convert()
backgroundImages = (
pygame.transform.scale(backgroundImage.subsurface((0, 0, 800, 150)), (3200, 600)),
pygame.transform.scale(backgroundImage.subsurface((0, 150, 800, 150)), (3200, 600)),
pygame.transform.scale(backgroundImage.subsurface((0, 300, 800, 150)), (3200, 600)),
pygame.transform.scale(
backgroundImage.subsurface((0, 0, 800, 150)), (3200, 600)
),
pygame.transform.scale(
backgroundImage.subsurface((0, 150, 800, 150)), (3200, 600)
),
pygame.transform.scale(
backgroundImage.subsurface((0, 300, 800, 150)), (3200, 600)
),
)
for image in backgroundImages:
image.set_colorkey((255,0,255))
@@ -24,7 +32,7 @@ class Background():
pygame.sprite.Sprite.__init__(self)
self.layers = (
BackgroundLayer(Background.backgroundImages[0], mainGameClass, 0.25),
BackgroundLayer(Background.backgroundImages[0], mainGameClass, 0.2),
BackgroundLayer(Background.backgroundImages[1], mainGameClass, 0.5),
BackgroundLayer(Background.backgroundImages[2], mainGameClass, 1),
)