Add doc strings

This commit is contained in:
Anthony Samms
2025-10-22 18:34:40 -04:00
parent ba906fa6c4
commit 7e73ee24f1
18 changed files with 787 additions and 241 deletions

View File

@@ -31,17 +31,17 @@ class DonBG1(DonBGBase):
def update(self, current_time_ms: float, is_clear: bool):
super().update(current_time_ms, is_clear)
self.overlay_move.update(current_time_ms)
def draw(self, tex: TextureWrapper):
self._draw_textures(tex, 1.0)
def draw(self, tex: TextureWrapper, y: float=0):
self._draw_textures(tex, 1.0, y)
if self.is_clear:
self._draw_textures(tex, self.clear_fade.attribute)
def _draw_textures(self, tex: TextureWrapper, fade: float):
self._draw_textures(tex, self.clear_fade.attribute, y)
def _draw_textures(self, tex: TextureWrapper, fade: float, y: float):
for i in range(5):
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute)
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=y)
for i in range(6):
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*347)+self.move.attribute*(347/328), y=self.overlay_move.attribute)
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*347)+self.move.attribute*(347/328), y=self.overlay_move.attribute+y)
for i in range(30):
tex.draw_texture(self.name, 'footer', frame=self.is_clear, fade=fade, x=(i*56)+self.move.attribute*((56/328)*3), y=self.overlay_move.attribute)
tex.draw_texture(self.name, 'footer', frame=self.is_clear, fade=fade, x=(i*56)+self.move.attribute*((56/328)*3), y=self.overlay_move.attribute+y)
class DonBG2(DonBGBase):
def __init__(self, tex: TextureWrapper, index: int, player_num: int, path: str):
@@ -50,14 +50,14 @@ class DonBG2(DonBGBase):
def update(self, current_time_ms: float, is_clear: bool):
super().update(current_time_ms, is_clear)
self.overlay_move.update(current_time_ms)
def draw(self, tex: TextureWrapper):
self._draw_textures(tex, 1.0)
def draw(self, tex: TextureWrapper, y: float = 0):
self._draw_textures(tex, 1.0, y)
if self.is_clear:
self._draw_textures(tex, self.clear_fade.attribute)
def _draw_textures(self, tex: TextureWrapper, fade: float):
self._draw_textures(tex, self.clear_fade.attribute, y)
def _draw_textures(self, tex: TextureWrapper, fade: float, y: float):
for i in range(5):
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute)
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=self.overlay_move.attribute)
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=y)
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=self.overlay_move.attribute+y)
class DonBG3(DonBGBase):
def __init__(self, tex: TextureWrapper, index: int, player_num: int, path: str):
@@ -79,17 +79,17 @@ class DonBG3(DonBGBase):
self.overlay_move.update(current_time_ms)
self.overlay_move_2.update(current_time_ms)
def draw(self, tex: TextureWrapper):
self._draw_textures(tex, 1.0)
def draw(self, tex: TextureWrapper, y: float = 0):
self._draw_textures(tex, 1.0, y)
if self.is_clear:
self._draw_textures(tex, self.clear_fade.attribute)
self._draw_textures(tex, self.clear_fade.attribute, y)
def _draw_textures(self, tex: TextureWrapper, fade: float):
def _draw_textures(self, tex: TextureWrapper, fade: float, y: float):
for i in range(10):
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*164)+self.move.attribute)
y = self.bounce_up.attribute - self.bounce_down.attribute + self.overlay_move.attribute + self.overlay_move_2.attribute
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*164)+self.move.attribute, y=y)
y_pos = self.bounce_up.attribute - self.bounce_down.attribute + self.overlay_move.attribute + self.overlay_move_2.attribute
for i in range(6):
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*328)+(self.move.attribute*2), y=y)
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*328)+(self.move.attribute*2), y=y_pos+y)
class DonBG4(DonBGBase):
def __init__(self, tex: TextureWrapper, index: int, player_num: int, path: str):
@@ -98,15 +98,15 @@ class DonBG4(DonBGBase):
def update(self, current_time_ms: float, is_clear: bool):
super().update(current_time_ms, is_clear)
self.overlay_move.update(current_time_ms)
def draw(self, tex: TextureWrapper):
self._draw_textures(tex, 1.0)
def draw(self, tex: TextureWrapper, y: float = 0):
self._draw_textures(tex, 1.0, y)
if self.is_clear:
self._draw_textures(tex, self.clear_fade.attribute)
self._draw_textures(tex, self.clear_fade.attribute, y)
def _draw_textures(self, tex: TextureWrapper, fade: float):
def _draw_textures(self, tex: TextureWrapper, fade: float, y: float):
for i in range(5):
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute)
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=self.overlay_move.attribute)
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=y)
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=self.overlay_move.attribute+y)
class DonBG5(DonBGBase):
def __init__(self, tex: TextureWrapper, index: int, player_num: int, path: str):
@@ -126,16 +126,16 @@ class DonBG5(DonBGBase):
self.bounce_down.restart()
self.adjust.update(current_time_ms)
def draw(self, tex: TextureWrapper):
self._draw_textures(tex, 1.0)
def draw(self, tex: TextureWrapper, y: float = 0):
self._draw_textures(tex, 1.0, y)
if self.is_clear:
self._draw_textures(tex, self.clear_fade.attribute)
self._draw_textures(tex, self.clear_fade.attribute, y)
def _draw_textures(self, tex: TextureWrapper, fade: float):
def _draw_textures(self, tex: TextureWrapper, fade: float, y: float):
for i in range(5):
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute)
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=y)
for i in range(6):
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*368)+(self.move.attribute * ((184/328)*2)), y=self.bounce_up.attribute - self.bounce_down.attribute - self.adjust.attribute)
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*368)+(self.move.attribute * ((184/328)*2)), y=self.bounce_up.attribute - self.bounce_down.attribute - self.adjust.attribute + y)
class DonBG6(DonBGBase):
def __init__(self, tex: TextureWrapper, index: int, player_num: int, path: str):
@@ -144,15 +144,15 @@ class DonBG6(DonBGBase):
def update(self, current_time_ms: float, is_clear: bool):
super().update(current_time_ms, is_clear)
self.overlay_move.update(current_time_ms)
def draw(self, tex: TextureWrapper):
self._draw_textures(tex, 1.0)
def draw(self, tex: TextureWrapper, y: float = 0):
self._draw_textures(tex, 1.0, y)
if self.is_clear:
self._draw_textures(tex, self.clear_fade.attribute)
self._draw_textures(tex, self.clear_fade.attribute, y)
def _draw_textures(self, tex: TextureWrapper, fade: float):
def _draw_textures(self, tex: TextureWrapper, fade: float, y: float):
for i in range(5):
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute)
tex.draw_texture(self.name, 'background', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=y)
for i in range(0, 6, 2):
tex.draw_texture(self.name, 'overlay_1', frame=self.is_clear, fade=fade, x=(i*264) + self.move.attribute*3, y=-self.move.attribute*0.85)
tex.draw_texture(self.name, 'overlay_1', frame=self.is_clear, fade=fade, x=(i*264) + self.move.attribute*3, y=-self.move.attribute*0.85+y)
for i in range(5):
tex.draw_texture(self.name, 'overlay_2', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=self.overlay_move.attribute)
tex.draw_texture(self.name, 'overlay_2', frame=self.is_clear, fade=fade, x=(i*328)+self.move.attribute, y=self.overlay_move.attribute+y)