From 74bdf41e9d432eafa98444d982188f9e6adf6c57 Mon Sep 17 00:00:00 2001 From: Evan Powell Date: Sat, 12 Sep 2020 16:49:50 -0500 Subject: [PATCH] added the victory sound (#6) --- src/components/TopLevel.component.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/TopLevel.component.js b/src/components/TopLevel.component.js index 1d8b7c2..7b450ea 100644 --- a/src/components/TopLevel.component.js +++ b/src/components/TopLevel.component.js @@ -150,7 +150,7 @@ export default class TopLevelComponent extends Component { this.current_state = game_service.get_game_state() // Called every time the game state is updated - game_service.on_state_change((next_state, was_refresh) => { + game_service.on_state_change( async (next_state, was_refresh) => { this.current_state = next_state this.opponent_rows = game_service.get_current_opponent_state() this.player_rows = game_service.get_current_player_state() @@ -164,6 +164,7 @@ export default class TopLevelComponent extends Component { } if ( next_state === GameState.PlayerVictory ) { + await GameSounds.Victory.play() const [victor_state, loser_state] = game_service.get_player_victory_state() this.player_rows = victor_state this.opponent_rows = loser_state