From: 711215 <711215@pdsb.net> Date: Wed, 13 Jul 2022 15:20:11 +0000 (-0400) Subject: player grunt sfx X-Git-Url: http://git.skullheadx.com/nixos/static/gitweb.css?a=commitdiff_plain;h=0cf696fe0bb84a85682e5091e6bb2f26df5a0b99;p=Pygame-Jam.git player grunt sfx --- diff --git a/Assets/SFX/Player Grunt.wav b/Assets/SFX/Player Grunt.wav new file mode 100644 index 0000000..b7226a3 Binary files /dev/null and b/Assets/SFX/Player Grunt.wav differ diff --git a/Enemy.py b/Enemy.py index a4d5d25..48eeb32 100644 --- a/Enemy.py +++ b/Enemy.py @@ -22,6 +22,10 @@ class Enemy(Actor): for i in range(attack_gif.n_frames): attack_frames.append(pg.transform.scale(pil_to_game(get_gif_frame(attack_gif, i)), (180, 180))) + #SFX + player_grunt = pg.mixer.Sound("Assets/SFX/Player Grunt.wav") + player_grunt_channel = pg.mixer.Channel(4) + def __init__(self, pos, collision_layer, collision_mask): super().__init__(pos, collision_layer, collision_mask) @@ -57,6 +61,7 @@ class Enemy(Actor): self.current_frame = 0 elif 4 < self.current_frame: target.attack(self, self.weapon, self.direction) + self.player_grunt_channel.play(self.player_grunt) # Deals with collision and applying velocity self.position, self.velocity = self.move_and_collide(self.position.copy(), self.velocity.copy(), delta)