Ticket #250 (closed enhancement: fixed)
Play random music
| Reported by: | qubodup | Owned by: | parpg |
|---|---|---|---|
| Priority: | major | Milestone: | Techdemo 2 |
| Component: | scripts | Version: | trunk |
| Keywords: | random, audio, shuffle | Cc: | |
| Time spent: | 1d | Time remaining: | 1d |
| Time planned: | 1d |
Description
To display more of the available media, music tracks should be picked randomly for playback.
This can be done by replacing
self.sounds.playMusic("/music/preciouswasteland.ogg")
from scripts/world.py with
self.sounds.playMusic(random.choice(glob.glob(os.path.join("music", "*.ogg"))))
and adding
import random import glob import os
to the file
Sorry for this ... patch form
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
