-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If going to a new area with same music, keep playing
- Loading branch information
1 parent
cce7e1b
commit 0885440
Showing
25 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
import pyglet | ||
|
||
# Music names | ||
# Music sample names | ||
music = {'title':'../music/ending_credits.mp3'} | ||
|
||
class MusicPlayer(pyglet.media.Player): | ||
def __init__(self, name): | ||
# Initialize the Player class | ||
super().__init__() | ||
|
||
# Load the music file | ||
# Load the sample and queue it on our player | ||
source = pyglet.media.load(music[name]) | ||
self.queue(source) | ||
def on_load(self): | ||
self.play() | ||
def on_unload(self): | ||
self.pause() | ||
|
||
# Set our sample name | ||
self.sample_name = name | ||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Background 0 0 ../sprites/backgrounds/title/title.png | ||
MusicPlayer 0 0 title | ||
Text 240 240 [Hello world,12,black] |