mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
add dan skin
This commit is contained in:
@@ -18,7 +18,8 @@ class Background:
|
||||
"ANIMAL": libs.bg_collabs.animal.Background,
|
||||
"BUTTOBURST": libs.bg_collabs.buttoburst.Background,
|
||||
"OSHIRI": libs.bg_collabs.oshiri.Background,
|
||||
"IMAS": libs.bg_collabs.imas.Background
|
||||
"IMAS": libs.bg_collabs.imas.Background,
|
||||
"DAN": libs.bg_collabs.dan.Background
|
||||
}
|
||||
def __init__(self, player_num: int, bpm: float, scene_preset: str = ''):
|
||||
"""
|
||||
@@ -91,13 +92,15 @@ class Background:
|
||||
player_num (int): The player number.
|
||||
bad (bool): Whether the chibi is bad.
|
||||
"""
|
||||
self.chibi.add_chibi(player_num, bad)
|
||||
if self.chibi is not None:
|
||||
self.chibi.add_chibi(player_num, bad)
|
||||
|
||||
def add_renda(self):
|
||||
"""
|
||||
Add a renda to the background.
|
||||
"""
|
||||
self.renda.add_renda()
|
||||
if self.renda is not None:
|
||||
self.renda.add_renda()
|
||||
|
||||
def update(self, current_time_ms: float, bpm: float, gauge_1p, gauge_2p = None):
|
||||
"""
|
||||
@@ -135,32 +138,39 @@ class Background:
|
||||
self.fever.update(current_time_ms, bpm)
|
||||
if self.dancer is not None:
|
||||
self.dancer.update(current_time_ms, bpm)
|
||||
self.renda.update(current_time_ms)
|
||||
self.chibi.update(current_time_ms, bpm)
|
||||
if self.renda is not None:
|
||||
self.renda.update(current_time_ms)
|
||||
if self.chibi is not None:
|
||||
self.chibi.update(current_time_ms, bpm)
|
||||
|
||||
def draw(self):
|
||||
"""
|
||||
Draw the background.
|
||||
"""
|
||||
if self.bg_normal is not None:
|
||||
if self.is_clear and not self.bg_fever.transitioned:
|
||||
self.bg_normal.draw(self.tex_wrapper)
|
||||
self.bg_fever.draw(self.tex_wrapper)
|
||||
elif self.is_clear:
|
||||
self.bg_fever.draw(self.tex_wrapper)
|
||||
if self.bg_fever is not None:
|
||||
if self.is_clear and not self.bg_fever.transitioned:
|
||||
self.bg_normal.draw(self.tex_wrapper)
|
||||
self.bg_fever.draw(self.tex_wrapper)
|
||||
elif self.is_clear:
|
||||
self.bg_fever.draw(self.tex_wrapper)
|
||||
else:
|
||||
self.bg_normal.draw(self.tex_wrapper)
|
||||
else:
|
||||
self.bg_normal.draw(self.tex_wrapper)
|
||||
self.don_bg.draw(self.tex_wrapper)
|
||||
if self.don_bg_2 is not None:
|
||||
self.don_bg_2.draw(self.tex_wrapper, y=536)
|
||||
self.renda.draw()
|
||||
if self.renda is not None:
|
||||
self.renda.draw()
|
||||
if self.dancer is not None:
|
||||
self.dancer.draw(self.tex_wrapper)
|
||||
if self.footer is not None:
|
||||
self.footer.draw(self.tex_wrapper)
|
||||
if self.is_rainbow and self.fever is not None:
|
||||
self.fever.draw(self.tex_wrapper)
|
||||
self.chibi.draw()
|
||||
if self.chibi is not None:
|
||||
self.chibi.draw()
|
||||
|
||||
def unload(self):
|
||||
"""
|
||||
|
||||
@@ -3,3 +3,4 @@ from . import animal
|
||||
from . import buttoburst
|
||||
from . import oshiri
|
||||
from . import imas
|
||||
from . import dan
|
||||
|
||||
43
libs/bg_collabs/dan.py
Normal file
43
libs/bg_collabs/dan.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from libs.animation import Animation
|
||||
from libs.bg_objects.bg_normal import BGNormalBase
|
||||
from libs.bg_objects.chibi import ChibiController
|
||||
from libs.bg_objects.don_bg import DonBG6
|
||||
from libs.bg_objects.footer import Footer
|
||||
from libs.texture import TextureWrapper
|
||||
|
||||
class Background:
|
||||
def __init__(self, tex: TextureWrapper, player_num: int, bpm: float):
|
||||
self.tex_wrapper = tex
|
||||
path = 'background/collab/dan'
|
||||
self.max_dancers = 5
|
||||
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
||||
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
||||
self.bg_fever = None
|
||||
self.footer = Footer(self.tex_wrapper, 0, path)
|
||||
self.fever = None
|
||||
self.dancer = None
|
||||
self.renda = None
|
||||
self.chibi = ChibiController(self.tex_wrapper, 2, bpm, path)
|
||||
|
||||
class DonBG(DonBG6):
|
||||
def __init__(self, tex: TextureWrapper, player_num: int, bpm: float, path: str):
|
||||
super().__init__(tex, player_num, bpm, path)
|
||||
self.overlay_move_2 = Animation.create_move(8000, total_distance=-760)
|
||||
self.overlay_move_2.loop = True
|
||||
self.overlay_move_2.start()
|
||||
|
||||
def update(self, current_time_ms: float, is_clear: bool):
|
||||
super().update(current_time_ms, is_clear)
|
||||
self.overlay_move_2.update(current_time_ms)
|
||||
|
||||
def _draw_textures(self, tex: TextureWrapper, fade: float, y: float):
|
||||
tex.draw_texture(self.name, 'background')
|
||||
for i in range(3):
|
||||
tex.draw_texture(self.name, 'bg_overlay', x=(i*464), y=y)
|
||||
for i in range(3):
|
||||
tex.draw_texture(self.name, 'bg_overlay_2', x=(i*760)+(self.overlay_move_2.attribute), y=y)
|
||||
for i in range(0, 6, 2):
|
||||
tex.draw_texture(self.name, 'overlay_1', x=(i*264) + self.move.attribute*3, y=-self.move.attribute*0.85+y)
|
||||
tex.draw_texture(self.name, 'bg_overlay_3')
|
||||
for i in range(5):
|
||||
tex.draw_texture(self.name, 'overlay_2', x=(i*328)+self.move.attribute, y=self.overlay_move.attribute+y)
|
||||
@@ -85,7 +85,7 @@ class Chibi0(BaseChibi):
|
||||
class Chibi2(BaseChibi):
|
||||
def __init__(self, index: int, bpm: float, tex: TextureWrapper, is_2p: bool):
|
||||
super().__init__(index, bpm, tex, is_2p)
|
||||
self.rotate = Animation.create_move(60000 / self.bpm / 2, total_distance=360, reverse_delay=0)
|
||||
self.rotate = Animation.create_move(60000 / self.bpm, total_distance=360)
|
||||
self.rotate.start()
|
||||
|
||||
def update(self, current_time_ms: float):
|
||||
|
||||
Reference in New Issue
Block a user