mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 03:30:13 +01:00
halfway through imas collab
This commit is contained in:
@@ -18,6 +18,7 @@ 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
|
||||
}
|
||||
def __init__(self, player_num: int, bpm: float, scene_preset: str = ''):
|
||||
"""
|
||||
|
||||
@@ -2,3 +2,4 @@ from . import a3
|
||||
from . import animal
|
||||
from . import buttoburst
|
||||
from . import oshiri
|
||||
from . import imas
|
||||
|
||||
@@ -16,7 +16,7 @@ class Background:
|
||||
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_normal = BGNormalBase(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)
|
||||
@@ -35,13 +35,6 @@ class DancerGroup(BaseDancerGroup):
|
||||
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
|
||||
|
||||
@@ -15,7 +15,7 @@ class Background:
|
||||
path = 'background/collab/buttoburst'
|
||||
self.max_dancers = 4
|
||||
self.don_bg = DonBG4(self.tex_wrapper, 4, player_num, 'background')
|
||||
self.bg_normal = BGNormal(self.tex_wrapper, 0, path)
|
||||
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
||||
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
||||
self.footer = None
|
||||
self.fever = Fever3(self.tex_wrapper, 0, bpm, path)
|
||||
@@ -34,13 +34,6 @@ class DancerGroup(BaseDancerGroup):
|
||||
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
|
||||
|
||||
49
libs/bg_collabs/imas.py
Normal file
49
libs/bg_collabs/imas.py
Normal file
@@ -0,0 +1,49 @@
|
||||
from libs.animation import Animation
|
||||
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 BaseDancerGroup
|
||||
from libs.bg_objects.fever import BaseFever
|
||||
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 DonBGBase
|
||||
|
||||
|
||||
class Background:
|
||||
def __init__(self, tex: TextureWrapper, player_num: int, bpm: float):
|
||||
self.tex_wrapper = tex
|
||||
path = 'background/collab/imas'
|
||||
self.max_dancers = 5
|
||||
self.don_bg = DonBGBase(self.tex_wrapper, 0, player_num, path)
|
||||
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
||||
self.bg_fever = BGFeverBase(self.tex_wrapper, 0, path)
|
||||
self.footer = Footer(self.tex_wrapper, 0, path)
|
||||
self.fever = Fever(self.tex_wrapper, 0, bpm, path)
|
||||
self.dancer = BaseDancerGroup(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 Fever(BaseFever):
|
||||
def __init__(self, tex: TextureWrapper, player_num: int, bpm: float, path: str):
|
||||
super().__init__(tex, player_num, bpm, path)
|
||||
self.texture_change = Animation.create_texture_change(120000 / bpm, textures=[(0, (120000 / bpm) / 2, 0), ((120000 / bpm) / 2, 120000 / bpm, 1)])
|
||||
self.texture_change.loop = True
|
||||
self.texture_change.start()
|
||||
|
||||
def update(self, current_time_ms: float, bpm: float):
|
||||
super().update(current_time_ms, bpm)
|
||||
self.texture_change.update(current_time_ms)
|
||||
|
||||
def draw(self, tex: TextureWrapper):
|
||||
tex.draw_texture(self.name, 'overlay', y=self.bounce_down.attribute-self.bounce_up.attribute, frame=self.texture_change.attribute)
|
||||
|
||||
class BGNormal(BGNormalBase):
|
||||
def __init__(self, tex: TextureWrapper, index: int, path: str):
|
||||
super().__init__(tex, index, path)
|
||||
|
||||
def update(self, current_time_ms: float, bpm: float):
|
||||
super().update(current_time_ms, bpm)
|
||||
|
||||
def draw(self, tex: TextureWrapper):
|
||||
pass
|
||||
@@ -15,7 +15,7 @@ class Background:
|
||||
path = 'background/collab/oshiri'
|
||||
self.max_dancers = 5
|
||||
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
||||
self.bg_normal = BGNormal(self.tex_wrapper, 0, path)
|
||||
self.bg_normal = BGNormalBase(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)
|
||||
@@ -49,13 +49,6 @@ class DonBG(DonBGBase):
|
||||
for j in range(3):
|
||||
tex.draw_texture(self.name, 'overlay', frame=self.is_clear, fade=fade, x=(i*168)+self.move.attribute, y=y+(j*70))
|
||||
|
||||
class BGNormal(BGNormalBase):
|
||||
def __init__(self, tex: TextureWrapper, index: int, path: str):
|
||||
super().__init__(tex, index, path)
|
||||
|
||||
def draw(self, tex: TextureWrapper):
|
||||
tex.draw_texture(self.name, 'background')
|
||||
|
||||
class BGFever(BGFeverBase):
|
||||
def __init__(self, tex: TextureWrapper, index: int, path: str):
|
||||
super().__init__(tex, index, path)
|
||||
|
||||
@@ -19,6 +19,12 @@ class BGFeverBase:
|
||||
self.name = 'bg_fever_' + str(index)
|
||||
tex.load_zip(path, f'bg_fever/{self.name}')
|
||||
self.transitioned = False
|
||||
def start(self):
|
||||
pass
|
||||
def update(self, current_time_ms: float):
|
||||
pass
|
||||
def draw(self, tex: TextureWrapper):
|
||||
pass
|
||||
|
||||
class BGFever1(BGFeverBase):
|
||||
class Tile:
|
||||
|
||||
@@ -18,6 +18,8 @@ class BGNormalBase:
|
||||
tex.load_zip(path, f'bg_normal/{self.name}')
|
||||
def update(self, current_time_ms: float):
|
||||
pass
|
||||
def draw(self, tex: TextureWrapper):
|
||||
tex.draw_texture(self.name, 'background')
|
||||
|
||||
class BGNormal1(BGNormalBase):
|
||||
def __init__(self, tex: TextureWrapper, index: int, path: str):
|
||||
|
||||
@@ -22,6 +22,10 @@ class DonBGBase:
|
||||
if self.is_clear:
|
||||
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, y=y)
|
||||
|
||||
def update(self, current_time_ms: float, is_clear: bool):
|
||||
if not self.is_clear and is_clear:
|
||||
self.clear_fade.start()
|
||||
|
||||
@@ -34,7 +34,10 @@ class SettingsScreen:
|
||||
global_data.config = self.config
|
||||
audio.close_audio_device()
|
||||
audio.device_type = global_data.config["audio"]["device_type"]
|
||||
audio.target_sample_rate = global_data.config["audio"]["sample_rate"]
|
||||
sample_rate = global_data.config["audio"]["sample_rate"]
|
||||
if sample_rate < 0:
|
||||
sample_rate = 44100
|
||||
audio.target_sample_rate = sample_rate
|
||||
audio.buffer_size = global_data.config["audio"]["buffer_size"]
|
||||
audio.volume_presets = global_data.config["volume"]
|
||||
audio.init_audio_device()
|
||||
|
||||
Reference in New Issue
Block a user