mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 03:30:13 +01:00
preliminary AI battle support
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -14,6 +14,7 @@ class PlayerNum(IntEnum):
|
||||
P2 = 2
|
||||
TWO_PLAYER = 3
|
||||
DAN = 4
|
||||
AI = 5
|
||||
|
||||
class ScoreMethod():
|
||||
GEN3 = "gen3"
|
||||
|
||||
@@ -58,6 +58,9 @@ class Nameplate:
|
||||
"""
|
||||
tex = global_tex
|
||||
tex.draw_texture('nameplate', 'shadow', x=x, y=y, fade=min(0.5, fade))
|
||||
if self.player_num == PlayerNum.AI:
|
||||
tex.draw_texture('nameplate', 'ai', x=x, y=y)
|
||||
return
|
||||
if self.player_num == 0:
|
||||
frame = 2
|
||||
title_offset = 0
|
||||
|
||||
@@ -297,7 +297,7 @@ class TextureWrapper:
|
||||
else:
|
||||
ray.DrawTexturePro(tex_object.texture, source_rect, dest_rect, origin, rotation, final_color)
|
||||
if tex_object.controllable[index] or controllable:
|
||||
self.control(tex_object)
|
||||
self.control(tex_object, index)
|
||||
|
||||
def draw_texture(self, subset: str, texture: str, color: Color = Color(255, 255, 255, 255), frame: int = 0, scale: float = 1.0, center: bool = False,
|
||||
mirror: str = '', x: float = 0, y: float = 0, x2: float = 0, y2: float = 0,
|
||||
|
||||
Reference in New Issue
Block a user