def update(): global current_game_mode global current_song_path if (current_game_mode != gamestate.mode): new_music_path = get_music_path() if new_music_path != current_song_path: pygame.mixer.music.fadeout(1000) pygame.mixer.music.load(new_music_path) pygame.mixer.music.set_volume(settingsdata.get_music_volume()) pygame.mixer.music.play(-1) current_song_path = new_music_path current_game_mode = gamestate.mode
def load(): global exit_button global exit_indicator global loaded global sound_label global sound_control global music_label global music_control exit_button = ExitButton() exit_indicator = False loaded = True #Create control labels and controls sound_label_position = (20,20) sound_label = Label( sound_label_position, 'Effects Volume', (255,255,255), 40 ) sound_control = VolumeControl() sound_control_position = ( sound_label_position[0], sound_label_position[1] + sound_label.height + 20 ) sound_control.create_children() sound_control.set_layout_data(sound_control_position, 300) sound_control.set_scroll_percent(settingsdata.get_sound_volume()) music_label_position = sound_control_position = ( sound_control.position[0], sound_control.position[1] + sound_control.height + 40 ) music_label = Label( music_label_position, 'Music Volume', (255,255,255), 40 ) music_control = VolumeControl() music_control.create_children() music_control_position = ( music_label_position[0], music_label_position[1] + music_label.height + 20 ) music_control.set_layout_data(music_control_position, 300) music_control.set_scroll_percent(settingsdata.get_music_volume())
def init(): pygame.mixer.music.load(wait_music_path) pygame.mixer.music.set_volume(settingsdata.get_music_volume()) pygame.mixer.music.play(-1) current_game_mode = gamestate.mode current_song_path = wait_music_path