mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
add animal kaiser collab
This commit is contained in:
@@ -13,7 +13,8 @@ from libs.texture import TextureWrapper
|
|||||||
|
|
||||||
class Background:
|
class Background:
|
||||||
COLLABS = {
|
COLLABS = {
|
||||||
"A3": libs.bg_collabs.a3.A3
|
"A3": libs.bg_collabs.a3.Background,
|
||||||
|
"ANIMAL": libs.bg_collabs.animal.Background
|
||||||
}
|
}
|
||||||
def __init__(self, player_num: int, bpm: float, scene_preset: str = ''):
|
def __init__(self, player_num: int, bpm: float, scene_preset: str = ''):
|
||||||
self.tex_wrapper = TextureWrapper()
|
self.tex_wrapper = TextureWrapper()
|
||||||
@@ -29,7 +30,7 @@ class Background:
|
|||||||
self.renda = RendaController(self.tex_wrapper, random.randint(0, 2))
|
self.renda = RendaController(self.tex_wrapper, random.randint(0, 2))
|
||||||
self.chibi = ChibiController(self.tex_wrapper, random.randint(0, 13), bpm)
|
self.chibi = ChibiController(self.tex_wrapper, random.randint(0, 13), bpm)
|
||||||
else:
|
else:
|
||||||
collab_bg = Background.COLLABS[scene_preset](self.tex_wrapper, bpm)
|
collab_bg = Background.COLLABS[scene_preset](self.tex_wrapper, player_num, bpm)
|
||||||
self.max_dancers = collab_bg.max_dancers
|
self.max_dancers = collab_bg.max_dancers
|
||||||
self.don_bg = collab_bg.don_bg
|
self.don_bg = collab_bg.don_bg
|
||||||
self.bg_normal = collab_bg.bg_normal
|
self.bg_normal = collab_bg.bg_normal
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
from . import a3
|
from . import a3
|
||||||
|
from . import animal
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ from libs.bg_objects.don_bg import DonBGBase
|
|||||||
from libs.bg_objects.renda import RendaController
|
from libs.bg_objects.renda import RendaController
|
||||||
from libs.texture import TextureWrapper
|
from libs.texture import TextureWrapper
|
||||||
|
|
||||||
class A3:
|
class Background:
|
||||||
def __init__(self, tex: TextureWrapper, bpm: float):
|
def __init__(self, tex: TextureWrapper, player_num: int, bpm: float):
|
||||||
self.tex_wrapper = tex
|
self.tex_wrapper = tex
|
||||||
path = 'background/collab/A3'
|
path = 'background/collab/a3'
|
||||||
self.max_dancers = 4
|
self.max_dancers = 4
|
||||||
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
||||||
self.bg_normal = BGNormal(self.tex_wrapper, 0, path)
|
self.bg_normal = BGNormal(self.tex_wrapper, 0, path)
|
||||||
|
|||||||
51
libs/bg_collabs/animal.py
Normal file
51
libs/bg_collabs/animal.py
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import random
|
||||||
|
from libs.bg_objects.bg_fever import BGFeverBase
|
||||||
|
from libs.bg_objects.bg_normal import BGNormalBase
|
||||||
|
from libs.bg_objects.chibi import ChibiController
|
||||||
|
from libs.bg_objects.dancer import BaseDancer, BaseDancerGroup
|
||||||
|
from libs.bg_objects.fever import Fever3
|
||||||
|
from libs.bg_objects.footer import Footer
|
||||||
|
from libs.bg_objects.renda import RendaController
|
||||||
|
from libs.texture import TextureWrapper
|
||||||
|
from libs.bg_objects.don_bg import DonBG4
|
||||||
|
|
||||||
|
|
||||||
|
class Background:
|
||||||
|
def __init__(self, tex: TextureWrapper, player_num: int, bpm: float):
|
||||||
|
self.tex_wrapper = tex
|
||||||
|
path = 'background/collab/animal'
|
||||||
|
self.max_dancers = 5
|
||||||
|
self.don_bg = DonBG4(self.tex_wrapper, 4, player_num, 'background')
|
||||||
|
self.bg_normal = BGNormal(self.tex_wrapper, 0, path)
|
||||||
|
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
||||||
|
self.footer = Footer(self.tex_wrapper, 0, path)
|
||||||
|
self.fever = Fever3(self.tex_wrapper, 0, bpm, path)
|
||||||
|
self.dancer = DancerGroup(self.tex_wrapper, 0, bpm, self.max_dancers, path)
|
||||||
|
self.renda = RendaController(self.tex_wrapper, 0, path)
|
||||||
|
self.chibi = ChibiController(self.tex_wrapper, 0, bpm, path)
|
||||||
|
|
||||||
|
class DancerGroup(BaseDancerGroup):
|
||||||
|
def __init__(self, tex: TextureWrapper, index: int, bpm: float, max_dancers: int, path: str):
|
||||||
|
self.name = 'dancer_' + str(index)
|
||||||
|
self.active_count = 0
|
||||||
|
tex.load_zip(path, f'dancer/{self.name}')
|
||||||
|
self.spawn_positions = [2, 1, 3, 0, 4]
|
||||||
|
self.active_dancers = [None] * max_dancers
|
||||||
|
self.dancers = [BaseDancer(self.name, i, bpm, tex) for i in range(max_dancers)]
|
||||||
|
random.shuffle(self.dancers)
|
||||||
|
self.add_dancer()
|
||||||
|
|
||||||
|
class BGNormal(BGNormalBase):
|
||||||
|
def update(self, current_time_ms: float):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def draw(self, tex: TextureWrapper):
|
||||||
|
tex.draw_texture(self.name, 'background')
|
||||||
|
|
||||||
|
class BGFever(BGFeverBase):
|
||||||
|
def start(self):
|
||||||
|
self.transitioned = True
|
||||||
|
def update(self, current_time_ms: float):
|
||||||
|
pass
|
||||||
|
def draw(self, tex: TextureWrapper):
|
||||||
|
tex.draw_texture(self.name, 'background')
|
||||||
@@ -167,7 +167,7 @@ class BaseDancerGroup():
|
|||||||
total_width = 1280
|
total_width = 1280
|
||||||
num_dancers = len(self.active_dancers)
|
num_dancers = len(self.active_dancers)
|
||||||
|
|
||||||
first_dancer = self.active_dancers[3]
|
first_dancer = next((dancer for dancer in self.active_dancers if dancer is not None), None)
|
||||||
if first_dancer is None:
|
if first_dancer is None:
|
||||||
return
|
return
|
||||||
dancer_width = tex.textures[self.name][str(first_dancer.index) + '_loop'].width
|
dancer_width = tex.textures[self.name][str(first_dancer.index) + '_loop'].width
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ class Fever:
|
|||||||
return selected_obj(tex, index, bpm)
|
return selected_obj(tex, index, bpm)
|
||||||
|
|
||||||
class BaseFever:
|
class BaseFever:
|
||||||
def __init__(self, tex: TextureWrapper, index: int, bpm: float):
|
def __init__(self, tex: TextureWrapper, index: int, bpm: float, path: str = 'background'):
|
||||||
self.name = 'fever_' + str(index)
|
self.name = 'fever_' + str(index)
|
||||||
tex.load_zip('background/regular', f'fever/{self.name}')
|
tex.load_zip(path, f'fever/{self.name}')
|
||||||
self.bounce_up = Animation.create_move((60000 / bpm) / 2, total_distance=50, ease_out='quadratic')
|
self.bounce_up = Animation.create_move((60000 / bpm) / 2, total_distance=50, ease_out='quadratic')
|
||||||
self.bounce_down = Animation.create_move((60000 / bpm) / 2, total_distance=50, ease_in='quadratic', delay=self.bounce_up.duration)
|
self.bounce_down = Animation.create_move((60000 / bpm) / 2, total_distance=50, ease_in='quadratic', delay=self.bounce_up.duration)
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
from libs.texture import TextureWrapper
|
from libs.texture import TextureWrapper
|
||||||
|
|
||||||
class Footer:
|
class Footer:
|
||||||
def __init__(self, tex: TextureWrapper, index: int):
|
def __init__(self, tex: TextureWrapper, index: int, path: str = 'background'):
|
||||||
self.index = index
|
self.index = index
|
||||||
if self.index == -1:
|
if self.index == -1:
|
||||||
return
|
return
|
||||||
tex.load_zip('background/regular', 'footer')
|
tex.load_zip(path, 'footer')
|
||||||
def draw(self, tex: TextureWrapper):
|
def draw(self, tex: TextureWrapper):
|
||||||
if self.index == -1:
|
if self.index == -1:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user