def on_update(self, delta_time): self.local_time += delta_time move_gum_wrapper(self.logo_width, self.small_logos_forward, self.small_logos_backward, delta_time) # Logo bounce m = 0.325 bpm = 220 n = 0.3 self.logo.scale = bounce(n, m, bpm, self.window.time) # Splash text typewriter effect if self.egg_roll == 666: self.splash_label.rotation = (random.random() * 10) - 5 else: self.splash_label.text = self.splash_text[:max(0, int((self.local_time - 3) * 20))] # Song name in and out if 3 <= self.local_time <= 5: # constraining the time when we update the position should decrease lag, # even though it's technically unnecessary because the function is clamped self.song_label.x = ease_quadinout(-self.song_label.width, self.song_label.original_x, 3, 5, self.local_time) elif 8 <= self.local_time <= 10: self.song_label.x = ease_quadinout(self.song_label.original_x, -self.song_label.width, 8, 10, self.local_time) if self.hit_start is not None: # Fade music if self.local_time >= self.hit_start + FADE_DELAY: self.window.theme_song.volume = ease_linear(self.volume, self.volume / 2, self.hit_start + FADE_DELAY, self.hit_start + SWITCH_DELAY, self.local_time) # Go to main menu if self.local_time >= self.hit_start + SWITCH_DELAY: self.main_menu_view.setup() self.window.show_view(self.main_menu_view)
def on_update(self, delta_time): super().on_update(delta_time) if self.song: self.lyric_animator.update(self.song.time) move_gum_wrapper(self.logo_width, self.small_logos_forward, self.small_logos_backward, delta_time)
def on_update(self, delta_time): super().on_update(delta_time) move_gum_wrapper(self.logo_width, self.small_logos_forward, self.small_logos_backward, delta_time) self.album_art.bottom = self.album_art.original_bottom + (math.sin(self.local_time * 2) * 25) self.static.bottom = self.album_art.original_bottom + (math.sin(self.local_time * 2) * 25) self.menu.update(self.local_time) self.static.update_animation(delta_time)
def on_update(self, delta_time): super().on_update(delta_time) self.sprite.update_animation(delta_time) st = self.sprite._current_animation_sts[self.sprite._current_animation_index] self.data_label.text = f""" Sprite FPS: {self.fps} Sprite F#: {self.sprite._current_animation_index} X,Y,W,H: {st.x}, {st.y}, {st.width}, {st.height} FX,FY,FW,FH: {st.frame_x}, {st.frame_y}, {st.frame_width}, {st.frame_height}""" move_gum_wrapper(self.logo_width, self.small_logos_forward, self.small_logos_backward, delta_time)
def on_update(self, delta_time): super().on_update(delta_time) if not self.tracks.loaded: return move_gum_wrapper(self.logo_width, self.small_logos_forward, self.small_logos_backward, delta_time) time = f"{int(self.tracks.time // 60)}:{int(self.tracks.time % 60):02}" if self.song_time_text._label.text != time: self.song_time_text._label.text = time if self.score_text._label.text != str(self.engine.score): self.score_text._label.text = str(self.engine.score) if self.judge_text._label.text != self.engine.latest_judgement: self.judge_text._label.text = self.engine.latest_judgement self.get_spotlight_position(self.tracks.time) self.judge_text.y = anim.ease_circout((self.size[1] // 2) + 20, self.size[1] // 2, self.engine.latest_judgement_time, self.engine.latest_judgement_time + 0.25, self.engine.chart_time) if self.engine.accuracy is not None: if self.grade_text._label.text != f"{self.engine.fc_type} | {round(self.engine.accuracy * 100, 2)}% ({self.engine.grade})": self.grade_text._label.text = f"{self.engine.fc_type} | {round(self.engine.accuracy * 100, 2)}% ({self.engine.grade})" if (self.engine.last_p1_note, self.engine.last_note_missed) != (self.player_anim, self.player_anim_missed): # logger.debug(f"animation changed from {(self.engine.last_p1_note, self.engine.last_note_missed)} to {(self.boyfriend_anim, self.boyfriend_anim_missed)}") if self.engine.last_p1_note is None: self.player_sprite.set_animation("BF idle dance") self.player_anim = None else: a = "" match self.engine.last_p1_note: case 0: a = "BF NOTE LEFT" self.player_anim = self.engine.last_p1_note case 1: a = "BF NOTE DOWN" self.player_anim = self.engine.last_p1_note case 2: a = "BF NOTE UP" self.player_anim = self.engine.last_p1_note case 3: a = "BF NOTE RIGHT" self.player_anim = self.engine.last_p1_note if self.engine.last_note_missed: a += " MISS" self.player_anim_missed = True else: self.player_anim_missed = False self.player_sprite.set_animation(a) self.scene.update(self.tracks.time, delta_time)
def on_update(self, delta_time): super().on_update(delta_time) self.highway.update(self.song.time) move_gum_wrapper(self.logo_width, self.small_logos_forward, self.small_logos_backward, delta_time)
def on_update(self, delta_time): super().on_update(delta_time) move_gum_wrapper(self.logo_width, self.small_logos_forward, self.small_logos_backward, delta_time) self.menu.update(self.local_time)