From acf8d58bfa95dced85d8206e7fa62cdba4e0b0e7 Mon Sep 17 00:00:00 2001 From: Storm dragon Date: Sun, 20 Mar 2016 21:34:30 -0400 Subject: [PATCH] soundData is not defined? But it is... --- pybottle/bottle-blaster.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pybottle/bottle-blaster.py b/pybottle/bottle-blaster.py index 5dd47bc..5d27cf5 100755 --- a/pybottle/bottle-blaster.py +++ b/pybottle/bottle-blaster.py @@ -5,8 +5,6 @@ from storm_games import * initialize_gui("Bottle Blaster") -# load sound files -bottle = pygame.mixer.Sound("sounds/bottle.ogg") # loop forever (until a break occurs) while True: @@ -14,9 +12,9 @@ while True: event = pygame.event.wait() # if the event is about a keyboard button that have been pressed... if event.type == pygame.KEYDOWN: - bottle.play(-1) + soundData["bottle"].play(-1) if event.type == pygame.KEYUP: - bottle.stop() + soundData["bottle"].stop() # and if the button is the "q" letter or the "escape" key... if event.key == pygame.K_ESCAPE: # ... then exit from the while loop