def __init__(self, screen, music_list, background_image, bounds, title, menu_dictionary, start_selection=0): self.screen = screen self.bounds = bounds self.menu_dictionary = menu_dictionary self.title = title self.music_list = music_list self.background_image = background_image self.cursor = Cursor() pygame.mouse.set_visible(False) self.menu_group = pygame.sprite.Group() self.menu_tooltip_group = pygame.sprite.Group() self.cursor_group = pygame.sprite.Group() self.menu_selection_pointer = [] self.menu_tooltip_pointer = [] self.current_selection = start_selection self.timer = pygame.time.Clock() self.menu_beep_sound = utility.load_sound('menuBeep') self.menu_forward_sound = utility.load_sound('menuForward') self.menu_back_sound = utility.load_sound('menuBack') index = 0 menu_title = text.Text(FONT_PATH, title[1], FONT_COLOR, title[0]) menu_title.position = vector.Vector2d(title[2], title[3]) menu_title.set_alignment(CENTER_MIDDLE) self.menu_group.add(menu_title) for option in menu_dictionary: menu_selection = text.Text(FONT_PATH, 32, FONT_INACTIVE_COLOR, menu_dictionary[option][0], -1, index) menu_selection.set_alignment(CENTER_MIDDLE) menu_selection.position = vector.Vector2d( (((self.bounds[RIGHT] - self.bounds[LEFT]) / 2) + self.bounds[LEFT], ((self.bounds[BOTTOM] - self.bounds[TOP]) / (len(self.menu_dictionary) + 1) * (index + 1)) + self.bounds[TOP])) self.menu_group.add(menu_selection) self.menu_selection_pointer.append(menu_selection) menu_tooltip = text.Text(FONT_PATH, 32, FONT_COLOR, menu_dictionary[option][1]) menu_tooltip.set_alignment(BOTTOM_MIDDLE) menu_tooltip.position = vector.Vector2d( ((SCREEN_WIDTH / 2), SCREEN_HEIGHT)) self.menu_tooltip_group.add(menu_tooltip) self.menu_tooltip_pointer.append(menu_tooltip) index += 1 self.cursor_group.add(self.cursor)
def load_data(): Balloon.pickup_sound = utility.load_sound('pop') Bonus250.master_animation_list.build_animation('Idle', ['balloonblue']) Bonus500.master_animation_list.build_animation('Idle', ['balloongreen']) BonusX2.master_animation_list.build_animation('Idle', ['balloonred']) BonusX2.pickup_sound = utility.load_sound('doublePoints') BonusCombo.master_animation_list.build_animation('Idle', ['balloonyellow']) BonusCombo.pickup_sound = utility.load_sound('combo')
def __init__(self, screen, music_list, background_image, bounds, title, menu_dictionary, start_selection=0): self.screen = screen self.bounds = bounds self.menu_dictionary = menu_dictionary self.title = title self.music_list = music_list self.background_image = background_image self.cursor = Cursor() pygame.mouse.set_visible(False) self.menu_group = pygame.sprite.Group() self.menu_tooltip_group = pygame.sprite.Group() self.cursor_group = pygame.sprite.Group() self.menu_selection_pointer = [] self.menu_tooltip_pointer = [] self.current_selection = start_selection self.timer = pygame.time.Clock() self.menu_beep_sound = utility.load_sound('menuBeep') self.menu_forward_sound = utility.load_sound('menuForward') self.menu_back_sound = utility.load_sound('menuBack') index = 0 menu_title = text.Text(FONT_PATH, title[1], FONT_COLOR, title[0]) menu_title.position = vector.Vector2d(title[2], title[3]) menu_title.set_alignment(CENTER_MIDDLE) self.menu_group.add(menu_title) for option in menu_dictionary: menu_selection = text.Text(FONT_PATH, 32, FONT_INACTIVE_COLOR, menu_dictionary[option][0], -1, index) menu_selection.set_alignment(CENTER_MIDDLE) menu_selection.position = vector.Vector2d((((self.bounds[RIGHT] - self.bounds[LEFT]) / 2) + self.bounds[LEFT], ((self.bounds[BOTTOM]-self.bounds[TOP]) / (len(self.menu_dictionary) + 1) * (index + 1)) + self.bounds[TOP])) self.menu_group.add(menu_selection) self.menu_selection_pointer.append(menu_selection) menu_tooltip = text.Text(FONT_PATH, 32, FONT_COLOR, menu_dictionary[option][1]) menu_tooltip.set_alignment(BOTTOM_MIDDLE) menu_tooltip.position = vector.Vector2d(((SCREEN_WIDTH / 2), SCREEN_HEIGHT)) self.menu_tooltip_group.add(menu_tooltip) self.menu_tooltip_pointer.append(menu_tooltip) index += 1 self.cursor_group.add(self.cursor)
def load_data(): DamageX2.pickup_sound = utility.load_sound('doubleDamage') DamageX2.master_animation_list.build_animation('Idle', ['geemred']) DamageX2.master_animation_list.build_animation('Blink', ['geemred', 'blank']) Nova.pickup_sound = utility.load_sound('nova') Nova.master_animation_list.build_animation('Idle', ['boom']) Nova.master_animation_list.build_animation('Blink', ['boom', 'blank']) Reflect.pickup_sound = utility.load_sound('reflect') Reflect.master_animation_list.build_animation('Idle', ['geemblue']) Reflect.master_animation_list.build_animation('Blink', ['geemblue', 'blank']) DualShot.pickup_sound = utility.load_sound('dualShot') DualShot.master_animation_list.build_animation('Idle', ['geemgreen']) DualShot.master_animation_list.build_animation('Blink', ['geemgreen', 'blank']) FastShot.pickup_sound = utility.load_sound('fastShot') FastShot.master_animation_list.build_animation('Idle', ['geemorange']) FastShot.master_animation_list.build_animation('Blink', ['geemorange', 'blank'])
def load_data(): Player.master_animation_list.build_animation('Idle', ['kuunIdle']) Player.master_animation_list.build_animation('Fire', ['kuunShoot']) Player.master_animation_list.build_animation('HurtIdle', ['kuunIdle', 'blank']) Player.master_animation_list.build_animation('HurtFire', ['kuunShoot', 'blank']) Player.master_animation_list.build_animation('Die', ['kuunDie']) Player.NUM_OW_SOUNDS = 2 #plus one for a total of 3 Player.lose_life_sound.append(utility.load_sound('ow1')) Player.lose_life_sound.append(utility.load_sound('ow2')) Player.lose_life_sound.append(utility.load_sound('ow3')) Player.NUM_FIRE_SOUNDS = 2 #plus one for total of 3 Player.fire_sound.append(utility.load_sound('shot1')) Player.fire_sound.append(utility.load_sound('shot2')) Player.fire_sound.append(utility.load_sound('shot3')) Player.death_sound.append(utility.load_sound('playerDeath1')) Player.death_sound.append(utility.load_sound('playerDeath2')) Player.death_sound.append(utility.load_sound('playerDeath3')) Player.extraLifeSound = utility.load_sound('extraLife')
def load_data(): Hakta.death_sound = utility.load_sound('pop') Hakta.master_animation_list.build_animation('Idle', ['hakta'])
def load_data(): Batto.last_spawn = 0, 0 Batto.death_sound = utility.load_sound('pop') Batto.master_animation_list.build_animation('Idle', ['batto'])
def load_data(): World.bonus_tally_sound = utility.load_sound('bonusTally') World.boss_fight_music = utility.load_sound('bossMusic') World.get_ready_sound = utility.load_sound('getReady')
pygame.mixer.set_reserved(BAAKE_CHANNEL) pygame.mixer.Channel(BAAKE_CHANNEL).set_volume(1) pygame.mixer.set_reserved(BOSS_CHANNEL) pygame.mixer.Channel(BOSS_CHANNEL).set_volume(1) pygame.mixer.set_reserved(PICKUP_CHANNEL) pygame.mixer.Channel(PICKUP_CHANNEL).set_volume(1) except: utility.sound_active = False print('WARNING! - Sound not initialized.') pygame.mouse.set_visible(False) music_list = [ utility.load_sound('menuMusic'), utility.load_sound('music0'), utility.load_sound('music1'), utility.load_sound('music2'), utility.load_sound('bossMusic') ] world.load_data() player.load_data() bullet.load_data() pygame.event.pump() enemies.baake.load_data() balloon.load_data() gem.load_data() pygame.event.pump() enemies.moono.load_data()
def load_data(): Rokubi.death_sound = utility.load_sound('pop') Rokubi.master_animation_list.build_animation('Idle', ['rokubei'])
def load_data(): Moono.death_sound = utility.load_sound('pop') Moono.master_animation_list.build_animation('Idle', ['moono'])
def load_data(): Raayu.death_sound = utility.load_sound('pop') Raayu.master_animation_list.build_animation('Idle', ['raayu'])
def load_data(): BossTut.music = utility.load_sound('bossMusic') BossTut.bullet_sound = utility.load_sound('baakeHit') BossTut.hurt_sound = utility.load_sound('hurtBoss') BossTut.how_to_kill = utility.load_image('howToBoss1') BossTut.master_animation_list.build_animation('idle', ['boss1']) BossTut.master_animation_list.build_animation('hurt', ['boss1', 'boss1', 'boss1_1', 'boss1_1']) BaakeBoss.music = utility.load_sound('bossMusic') BaakeBoss.bullet_sound = utility.load_sound('baakeHit') BaakeBoss.hurt_sound = utility.load_sound('hurtBoss') BaakeBoss.how_to_kill = utility.load_image('howToBoss1') BaakeBoss.master_animation_list.build_animation('idle', ['boss0']) BaakeBoss.master_animation_list.build_animation('hurt', ['boss0', 'boss0', 'boss0_1', 'boss0_1']) MoonoBoss.music = utility.load_sound('bossMusic') MoonoBoss.bullet_sound = utility.load_sound('baakeHit') MoonoBoss.hurt_sound = utility.load_sound('hurtBoss') MoonoBoss.shield_break = utility.load_sound('shieldBreak') MoonoBoss.shield_restore = utility.load_sound('shieldRestore') MoonoBoss.how_to_kill = utility.load_image('howToBoss3') MoonoBoss.master_animation_list.build_animation('idle', ['boss2idle_0', 'boss2idle_1', 'boss2idle_2', 'boss2idle_3', 'boss2idle_4', 'boss2idle_5', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0', 'boss2idle_0']) MoonoBoss.master_animation_list.build_animation('vulnerable', ['boss2v']) MoonoBoss.master_animation_list.build_animation('hurt', ['boss2_1'])
def load_data(): Paajo.death_sound = utility.load_sound('pop') Paajo.master_animation_list.build_animation('Idle', ['paajo'])
def load_data(): Bokko.bullet_sound = utility.load_sound('baakeHit') Bokko.master_animation_list.build_animation('Idle', ['bokko'])