mover init in MovingEffect

This commit is contained in:
Patrick Moessler 2023-02-24 17:20:51 +01:00
parent 851cba85cb
commit 54b825c7cb
8 changed files with 2 additions and 7 deletions

View file

@ -44,7 +44,6 @@ class BouncingSpot(MovingEffect):
*groups *groups
) )
self.bounds = bounds self.bounds = bounds
next(self.mover)
self.update(is_beat=False) self.update(is_beat=False)
def update(self, *args: Any, **kwargs: Any) -> None: def update(self, *args: Any, **kwargs: Any) -> None:

View file

@ -109,7 +109,7 @@ class CrazyPolys(Effect):
self.color if isinstance(self.color, pg.Color) else next(self.color), self.color if isinstance(self.color, pg.Color) else next(self.color),
self.cursor, self.cursor,
new_cursor, new_cursor,
width=10, width=30,
) )
self.cursor = new_cursor self.cursor = new_cursor

View file

@ -26,3 +26,4 @@ class MovingEffect(Effect):
) -> None: ) -> None:
super().__init__(image, rect, *groups) super().__init__(image, rect, *groups)
self.mover = mover or transform_static(rect.center) self.mover = mover or transform_static(rect.center)
next(self.mover)

View file

@ -55,7 +55,6 @@ class Moonflower(MovingEffect):
*groups, *groups,
) )
self.bounds = bounds self.bounds = bounds
next(self.mover)
self.o_color = ( self.o_color = (
self.colors[0] self.colors[0]
if isinstance(self.colors[0], pg.Color) if isinstance(self.colors[0], pg.Color)

View file

@ -30,7 +30,6 @@ class MovingWave(MovingEffect):
self.wave_height = wave_height or bounds.height self.wave_height = wave_height or bounds.height
self.bounds = bounds self.bounds = bounds
self.scroll_speed = scroll_speed self.scroll_speed = scroll_speed
next(self.mover)
self.rainbow = pg.Surface((bounds.width, self.wave_height)) self.rainbow = pg.Surface((bounds.width, self.wave_height))
rainbow_surface(self.rainbow, "h", hue, color_inc) rainbow_surface(self.rainbow, "h", hue, color_inc)

View file

@ -29,7 +29,6 @@ class RainbowWave(MovingEffect):
self.wave_height = wave_height or bounds.height self.wave_height = wave_height or bounds.height
self.bounds = bounds self.bounds = bounds
self.scroll_speed = scroll_speed self.scroll_speed = scroll_speed
next(self.mover)
self.rainbow = pg.Surface((bounds.width, self.wave_height)) self.rainbow = pg.Surface((bounds.width, self.wave_height))
rainbow_surface(self.rainbow, "h", hue, color_inc) rainbow_surface(self.rainbow, "h", hue, color_inc)

View file

@ -24,7 +24,6 @@ class ScanReticle(MovingEffect):
image.fill(Colors.Black) image.fill(Colors.Black)
image.set_colorkey(Colors.Black) image.set_colorkey(Colors.Black)
super().__init__(image, bounds, mover, *groups) super().__init__(image, bounds, mover, *groups)
next(self.mover)
self.update(is_beat=False) self.update(is_beat=False)
def update(self, *args: Any, **kwargs: Any) -> None: def update(self, *args: Any, **kwargs: Any) -> None:

View file

@ -60,7 +60,6 @@ class Spiro(MovingEffect):
*groups, *groups,
) )
self.bounds = bounds self.bounds = bounds
next(self.mover)
self.cursor = self.calc_pos() self.cursor = self.calc_pos()
self.update(is_beat=False) self.update(is_beat=False)