projects
/
base2-runner.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
189bbe9
)
Music soundtrack fades out at end of game
author
TJ
<git@iam.tj>
Sat, 9 Nov 2013 21:34:26 +0000
(21:34 +0000)
committer
TJ
<git@iam.tj>
Sat, 9 Nov 2013 21:34:26 +0000
(21:34 +0000)
pygame-scroller.py
patch
|
blob
|
history
diff --git
a/pygame-scroller.py
b/pygame-scroller.py
index
3a363b4
..
30c1ae4
100755
(executable)
--- a/
pygame-scroller.py
+++ b/
pygame-scroller.py
@@
-42,6
+42,11
@@
class Channel:
self.channel.queue(sound)
def get_queue(self):
return self.channel.get_queue() if self.channel != None else None
self.channel.queue(sound)
def get_queue(self):
return self.channel.get_queue() if self.channel != None else None
+ def fadeout(self, time):
+ if self.channel == None:
+ pygame.mixer.music.fadeout(time)
+ else:
+ self.channel.fadeout(time)
def play(self, sound, loops=0, maxtime=0, fade_ms=0):
if self.channel != None:
# allow 'sound' to be a path string or an object
def play(self, sound, loops=0, maxtime=0, fade_ms=0):
if self.channel != None:
# allow 'sound' to be a path string or an object
@@
-184,6
+189,7
@@
while (myGame.play):
# volume up
myGame.soundtrack.up()
# volume up
myGame.soundtrack.up()
+myGame.soundtrack.fadeout(10000)
time.sleep(10)
pygame.display.quit()
exit(0)
time.sleep(10)
pygame.display.quit()
exit(0)