This repository has been archived by the owner on Apr 27, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9170f07
commit c74ebca
Showing
7 changed files
with
74 additions
and
26 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
class SoundManager { | ||
|
||
public static start() { | ||
// make sure volume is set for sounds | ||
_.forIn(Resources, (resource) => { | ||
if (resource instanceof ex.Sound) { | ||
(<ex.Sound>resource).setVolume(1); | ||
} | ||
}); | ||
|
||
Resources.SoundMusic.setVolume(0.05); | ||
Resources.SoundMusic.play(); | ||
} | ||
|
||
public static stop() { | ||
// make sure volume is set for sounds | ||
_.forIn(Resources, (resource) => { | ||
if (resource instanceof ex.Sound) { | ||
(<ex.Sound>resource).setVolume(0); | ||
} | ||
}); | ||
} | ||
|
||
// todo save/restore settings | ||
} |
Binary file not shown.