sfx-path existence check
This commit is contained in:
parent
5ece5c450f
commit
011187b5e5
2
README
2
README
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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"])
|
||||
|
|
Loading…
Reference in New Issue