def trigger(self, env, player): x = player.get_position().x x = x if player.direction == 0 else x + 60 y = player.get_position().y + 30 env.add_bullet(BBWaveBullet(env, (x, y), 90, speed=2000)) R.play_sound("wave_gun")
def jump(self, v=1500): self.v = v R.play_sound("jump") for item in self.items: item.on_jump(self)
def active(self, player, sound=True): if sound: R.play_sound("get_item") player.add_item(self) self.is_touchable = False self.is_visible = False self.environment.counter.inc_item_active(self.get_name())
def update(self, delta): self.progress += delta number = 3 - int(self.progress) if self.number != number and number > 0: R.play_sound("count") self.number = number
def trigger(self, env, player): x = player.get_position().x x = x if player.direction == 0 else x + 60 y = player.get_position().y + 30 env.add_bullet(BBBullet(env, (x, y), 90)) env.add_bullet(BBBullet(env, (x, y), 70)) env.add_bullet(BBBullet(env, (x, y), 110)) R.play_sound("shotgun")
def on_key_down(self, key): if key == pygame.K_DOWN: R.play_sound("select") self.selector.next() if key == pygame.K_UP: R.play_sound("select") self.selector.prev() if key == pygame.K_SPACE or key == pygame.K_RETURN: R.play_sound("confirm") self.select_stage(self.selector.get_selected_stage()) if key == pygame.K_BACKSPACE: R.play_sound("go_back") self.start_and_reset_scene("home")
def on_steped(self, player): super().on_steped(player) R.play_sound("slime_step")
def die(self): self.is_touchable = False self.is_damage = True self.damage_progress = 0.0 R.play_sound("slime_death")
def on_key_down(self, key): if key == pygame.K_SPACE: R.play_sound("confirm") self.start_and_reset_scene("menu")
def die(self): R.play_sound("player_death")