added the victory sound (#6)

master
Evan Powell 4 years ago
parent 35845a497a
commit 74bdf41e9d

@ -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

Loading…
Cancel
Save