From 1ca05734e3e5582e648118509e63eaf0c7790718 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Fri, 17 May 2024 17:55:23 +0200 Subject: [PATCH] Feat : add game join sound --- components/GameBoard.vue | 9 +++++++++ public/sounds/teleport.mp3 | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 public/sounds/teleport.mp3 diff --git a/components/GameBoard.vue b/components/GameBoard.vue index 5638a76..c5aea63 100644 --- a/components/GameBoard.vue +++ b/components/GameBoard.vue @@ -29,6 +29,15 @@ watch( } }) +watch( + () => goStore.current_game?.players, + (newList, oldList) => { + if (!oldList || !newList) { return } + if (newList?.length > oldList.length) { + playSound('/sounds/teleport.mp3') + } + + }) function showLoserScreen() { // playSound('/sounds/ding.mp3') } diff --git a/public/sounds/teleport.mp3 b/public/sounds/teleport.mp3 new file mode 100644 index 0000000..b793faa --- /dev/null +++ b/public/sounds/teleport.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17446b55fcf113bb1250c33ee6173644a80577f0ba523f1e3ca19ae1dcca3d65 +size 47088