sfx-path existence check

This commit is contained in:
Frank DeMarco 2012-12-16 22:41:43 +09:00
parent 5ece5c450f
commit 011187b5e5
3 changed files with 4 additions and 4 deletions

2
README
View File

@ -9,7 +9,7 @@ Example
=======
Save and run the following script to create a project that redraws a square at a
random location every second. This script may also be found in the `sample.py`
random location every second. This script is also written in the `sample.py`
file.
from time import sleep

View File

@ -21,8 +21,9 @@ class Audio(GameChild):
fx = {}
if self.get_configuration().has_option("audio", "sfx-path"):
root = self.get_resource("audio", "sfx-path")
for name in listdir(root):
fx[name.split(".")[0]] = Sound(join(root, name))
if root:
for name in listdir(root):
fx[name.split(".")[0]] = Sound(join(root, name))
self.fx = fx
def mute(self, event):

View File

@ -15,7 +15,6 @@ class Display(GameChild):
def set_screen(self, flags=0):
self.screen = display.set_mode(self.config["dimensions"], flags)
# robot spaceman ninja ranger
def set_caption(self):
display.set_caption(self.config["caption"])