Skip to content

Commit cd23056

Browse files
authored
Merge pull request #40 from BaileyBrightman/templates/pixi-sound-hook-additions
Templates/pixi sound hook additions
2 parents 17796cb + b53b858 commit cd23056

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/game.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,26 @@ export class Game
4040
// in a full game this should be handled gracefully.
4141
PIXI.loader.resources['bounce'].sound.volume = value;
4242
});
43+
44+
this.app.state.musicVolume.subscribe(result =>
45+
{
46+
console.log('musicVolume: ', result);
47+
});
48+
49+
this.app.state.voVolume.subscribe(result =>
50+
{
51+
console.log('voVolume: ', result);
52+
});
53+
54+
this.app.state.captionsMuted.subscribe(result =>
55+
{
56+
console.log('captionsMuted: ', result);
57+
});
4358

4459
// add a extra state property for storying the current scene. Whenever the scene is changed, this class
4560
// will swap out the container attached to the stage
4661
this.app.state.scene = new Property(null);
47-
this.app.state.scene.subscribe(this.onChangeScene.bind(this));
62+
this.app.state.scene.subscribe(this.onChangeScene.bind(this));
4863

4964
// wait for the app to be ready, then set the new scene
5065
this.app.state.ready.subscribe(() =>

0 commit comments

Comments
 (0)