@@ -229,11 +229,11 @@ def __init__(self):
229229 self .shoot_timer = 0
230230
231231 # Load sounds
232- # self.collect_coin_sound = arcade.load_sound(":resources:sounds/coin1.wav")
233- # self.jump_sound = arcade.load_sound(":resources:sounds/jump1.wav")
234- # self.gameover_sound = arcade.load_sound(":resources:sounds/gameover1.wav")
235- # self.shoot_sound = arcade.load_sound(":resources:sounds/hurt5.wav")
236- # self.hit_sound = arcade.load_sound(":resources:sounds/hit5.wav")
232+ self .collect_coin_sound = arcade .load_sound (":resources:sounds/coin1.wav" )
233+ self .jump_sound = arcade .load_sound (":resources:sounds/jump1.wav" )
234+ self .gameover_sound = arcade .load_sound (":resources:sounds/gameover1.wav" )
235+ self .shoot_sound = arcade .load_sound (":resources:sounds/hurt5.wav" )
236+ self .hit_sound = arcade .load_sound (":resources:sounds/hit5.wav" )
237237
238238 def setup (self ):
239239 """Set up the game here. Call this function to restart the game."""
@@ -364,7 +364,7 @@ def on_update(self, delta_time):
364364
365365 if self .can_shoot :
366366 if self .shoot_pressed :
367- # arcade.play_sound(self.shoot_sound)
367+ arcade .play_sound (self .shoot_sound )
368368 bullet = arcade .Sprite (
369369 ":resources:images/space_shooter/laserBlue01.png" ,
370370 scaling = 0.8 ,
@@ -422,7 +422,7 @@ def on_update(self, delta_time):
422422 collision .remove_from_sprite_lists ()
423423 self .score += 150
424424
425- # arcade.play_sound(self.hit_sound)
425+ arcade .play_sound (self .hit_sound )
426426
427427 return
428428
@@ -438,14 +438,14 @@ def on_update(self, delta_time):
438438
439439 for collision in player_collision_list :
440440 if self .scene ["Enemies" ] in collision .sprite_lists :
441- # arcade.play_sound(self.gameover_sound)
441+ arcade .play_sound (self .gameover_sound )
442442 game_over = GameOverView ()
443443 self .window .show_view (game_over )
444444 return
445445 else :
446446 # Our collision is a coin, remove it
447447 collision .remove_from_sprite_lists ()
448- # arcade.play_sound(self.collect_coin_sound)
448+ arcade .play_sound (self .collect_coin_sound )
449449 self .score += 75
450450 self .score_text .text = f"Score: { self .score } "
451451
@@ -464,7 +464,7 @@ def process_keychange(self):
464464 self .player_sprite .change_y = PLAYER_MOVEMENT_SPEED
465465 elif self .physics_engine .can_jump (y_distance = 10 ):
466466 self .player_sprite .change_y = PLAYER_JUMP_SPEED
467- # arcade.play_sound(self.jump_sound)
467+ arcade .play_sound (self .jump_sound )
468468 elif self .down_pressed and not self .up_pressed :
469469 if self .physics_engine .is_on_ladder ():
470470 self .player_sprite .change_y = - PLAYER_MOVEMENT_SPEED
0 commit comments