Beispiel #1
0
    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")
Beispiel #2
0
    def jump(self, v=1500):
        self.v = v

        R.play_sound("jump")

        for item in self.items:
            item.on_jump(self)
Beispiel #3
0
    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())
Beispiel #4
0
    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
Beispiel #5
0
    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")
Beispiel #6
0
 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")
Beispiel #7
0
    def on_steped(self, player):
        super().on_steped(player)

        R.play_sound("slime_step")
Beispiel #8
0
 def die(self):
     self.is_touchable = False
     self.is_damage = True
     self.damage_progress = 0.0
     R.play_sound("slime_death")
Beispiel #9
0
 def on_key_down(self, key):
     if key == pygame.K_SPACE:
         R.play_sound("confirm")
         self.start_and_reset_scene("menu")
Beispiel #10
0
 def die(self):
     R.play_sound("player_death")