mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
added logic for sounds on play-game
This commit is contained in:
6
luckydiamond/package-lock.json
generated
6
luckydiamond/package-lock.json
generated
@@ -13,6 +13,7 @@
|
|||||||
"@vuelidate/validators": "^2.0.4",
|
"@vuelidate/validators": "^2.0.4",
|
||||||
"bootstrap": "^5.3.2",
|
"bootstrap": "^5.3.2",
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
|
"howler": "^2.2.4",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
"swiper": "^11.0.5",
|
"swiper": "^11.0.5",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
@@ -6967,6 +6968,11 @@
|
|||||||
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
|
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/howler": {
|
||||||
|
"version": "2.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/howler/-/howler-2.2.4.tgz",
|
||||||
|
"integrity": "sha512-iARIBPgcQrwtEr+tALF+rapJ8qSc+Set2GJQl7xT1MQzWaVkFebdJhR3alVlSiUf5U7nAANKuj3aWpwerocD5w=="
|
||||||
|
},
|
||||||
"node_modules/hpack.js": {
|
"node_modules/hpack.js": {
|
||||||
"version": "2.1.6",
|
"version": "2.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz",
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"@vuelidate/validators": "^2.0.4",
|
"@vuelidate/validators": "^2.0.4",
|
||||||
"bootstrap": "^5.3.2",
|
"bootstrap": "^5.3.2",
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
|
"howler": "^2.2.4",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
"swiper": "^11.0.5",
|
"swiper": "^11.0.5",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
|
|||||||
BIN
luckydiamond/public/sounds/correct-click.mp3
Normal file
BIN
luckydiamond/public/sounds/correct-click.mp3
Normal file
Binary file not shown.
BIN
luckydiamond/public/sounds/incorrect-sound.mp3
Normal file
BIN
luckydiamond/public/sounds/incorrect-sound.mp3
Normal file
Binary file not shown.
@@ -144,6 +144,8 @@ import { GetPercentageSteps, GetUserData, ClickCirclePlay, GetWinningAmount } fr
|
|||||||
import { GetCurrentMoney } from "@/assets/js/rest/RestMethods";
|
import { GetCurrentMoney } from "@/assets/js/rest/RestMethods";
|
||||||
import { GetCookie } from "@/assets/js/storage/CookieStorage";
|
import { GetCookie } from "@/assets/js/storage/CookieStorage";
|
||||||
|
|
||||||
|
import { Howl } from 'howler';
|
||||||
|
|
||||||
import { Swiper, SwiperSlide } from 'swiper/vue';
|
import { Swiper, SwiperSlide } from 'swiper/vue';
|
||||||
import 'swiper/css';
|
import 'swiper/css';
|
||||||
import "swiper/css/navigation";
|
import "swiper/css/navigation";
|
||||||
@@ -266,14 +268,26 @@ export default {
|
|||||||
this.gameStart = false
|
this.gameStart = false
|
||||||
this.winningAmount = 0
|
this.winningAmount = 0
|
||||||
this.flippedCards = []
|
this.flippedCards = []
|
||||||
|
const SoundCorrect = new Howl({
|
||||||
|
src: ['/sounds/incorrect-sound.mp3'],
|
||||||
|
volume: 1.0
|
||||||
|
})
|
||||||
|
|
||||||
|
SoundCorrect.play()
|
||||||
|
|
||||||
this.ValidationPlay.endGame = true
|
this.ValidationPlay.endGame = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.ValidationPlay.endGame = false
|
this.ValidationPlay.endGame = false
|
||||||
}, 1200)
|
}, 1200)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
const SoundUncorrect = new Howl({
|
||||||
|
src: ['/sounds/correct-click.mp3'],
|
||||||
|
volume: 1.0
|
||||||
|
})
|
||||||
|
|
||||||
|
SoundUncorrect.play()
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
this.gameStart = false
|
this.gameStart = false
|
||||||
this.offEventPointers = false
|
this.offEventPointers = false
|
||||||
|
|||||||
Reference in New Issue
Block a user