Fixed BG sprite glitch. Minor fixes

This commit is contained in:
2021-04-05 21:19:19 +03:00
parent 0ba497db97
commit 6cdb2c61db
10 changed files with 99 additions and 24 deletions
+27
View File
@@ -0,0 +1,27 @@
"""
Background layer entity class
"""
import pygame
from BackgroundLayerFrame import BackgroundLayerFrame
class BackgroundLayer():
def __init__(self, image, mainGameClass, speedMultiplier):
offset = image.get_width()
self.frames = pygame.sprite.Group()
self.frames.add(BackgroundLayerFrame(image, mainGameClass, (0, 0), speedMultiplier))
self.frames.add(BackgroundLayerFrame(image, mainGameClass, (offset, 0), speedMultiplier))
def update(self):
for frame in self.frames:
frame.update()
def draw(self, surface):
self.frames.draw(surface)