pybeamshow/effects/effect.py
2023-02-22 22:55:11 +01:00

23 lines
590 B
Python

import pygame as pg
from util.transform import Mover
class Effect(pg.sprite.Sprite):
def __init__(
self, image: pg.Surface, rect: pg.Rect, *groups: pg.sprite.Group
) -> None:
super().__init__(*groups)
self.rect = rect
self.image = image
def draw(self, surface: pg.Surface):
surface.blit(self.image, self.rect)
class MovingEffect(Effect):
def __init__(
self, image: pg.Surface, rect: pg.Rect, mover: Mover, *groups: pg.sprite.Group
) -> None:
super().__init__(image, rect, *groups)
self.mover = mover