preliminary AI battle support

This commit is contained in:
Yonokid
2025-12-31 00:29:52 -05:00
parent f384de454f
commit ac7c7abf82
8 changed files with 431 additions and 28 deletions

View File

@@ -107,7 +107,7 @@ class Chara2D:
self.current_anim = self.past_anim
self.anims[self.current_anim].restart()
def draw(self, x: float = 0, y: float = 0, mirror=False):
def draw(self, x: float = 0, y: float = 0, mirror=False, scale=1.0):
"""
Draw the character on the screen.
@@ -117,9 +117,9 @@ class Chara2D:
mirror (bool): Whether to mirror the character horizontally.
"""
if self.is_rainbow and self.current_anim not in {'soul_in', 'balloon_pop', 'balloon_popping'}:
self.tex.draw_texture(self.name, self.current_anim + '_max', frame=self.anims[self.current_anim].attribute, x=x, y=y)
self.tex.draw_texture(self.name, self.current_anim + '_max', frame=self.anims[self.current_anim].attribute, x=x, y=y, scale=scale)
else:
if mirror:
self.tex.draw_texture(self.name, self.current_anim, frame=self.anims[self.current_anim].attribute, x=x, y=y, mirror='horizontal')
self.tex.draw_texture(self.name, self.current_anim, frame=self.anims[self.current_anim].attribute, x=x, y=y, mirror='horizontal', scale=scale)
else:
self.tex.draw_texture(self.name, self.current_anim, frame=self.anims[self.current_anim].attribute, x=x, y=y)
self.tex.draw_texture(self.name, self.current_anim, frame=self.anims[self.current_anim].attribute, x=x, y=y, scale=scale)