Game settings change
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
Original
|
||||
</b-radio-button>
|
||||
<b-radio-button v-model="music" native-value="2">
|
||||
Ambiance
|
||||
None
|
||||
</b-radio-button>
|
||||
</b-field>
|
||||
</div>
|
||||
@@ -31,7 +31,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
music: 0
|
||||
music: '2'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -47,7 +47,6 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
music: function (music) {
|
||||
console.log('MUSIC ' + music)
|
||||
sound.stopBackgroundMusic()
|
||||
sound.startBackgroundMusic(music)
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,4 @@
|
||||
const music1 = new Audio(require('@/assets/sound/revengeOfCats.mp3'))
|
||||
const music2 = new Audio(require('@/assets/sound/1992.mp3'))
|
||||
// const motor = new Audio(require('@/assets/sound/motor.mp3'))
|
||||
const explosion = new Audio(require('@/assets/sound/explosion.mp3'))
|
||||
const taunt = new Audio(require('@/assets/sound/tmauvais.mp3'))
|
||||
|
||||
@@ -9,31 +7,18 @@ explosion.volume = 0.2
|
||||
|
||||
music1.loop = true
|
||||
music1.volume = 0.2
|
||||
music2.loop = true
|
||||
music2.volume = 0.2
|
||||
|
||||
export const sound = {
|
||||
startBackgroundMusic (n) {
|
||||
switch (n) {
|
||||
case '1': music1.play(); break
|
||||
case '2': music2.play(); break
|
||||
}
|
||||
},
|
||||
stopBackgroundMusic () {
|
||||
music1.pause()
|
||||
music2.pause()
|
||||
},
|
||||
explosion () {
|
||||
if (Math.floor(Math.random() * Math.floor(10)) === 0) taunt.play()
|
||||
explosion.play()
|
||||
}
|
||||
/*
|
||||
startMotor () {
|
||||
motor.loop = true
|
||||
motor.play()
|
||||
},
|
||||
stopMotor () {
|
||||
motor.pause()
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ export default function createSocketPlugin () {
|
||||
|
||||
connection.onerror = function (error) {
|
||||
console.log('[WS] error ' + error.message)
|
||||
// store.dispatch('game/error', 'Connection problem')
|
||||
Toast.open('Connection problem. Retrying in 10s...')
|
||||
setTimeout(function () {
|
||||
location.reload()
|
||||
|
||||
Reference in New Issue
Block a user