-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchoose.js
32 lines (25 loc) · 801 Bytes
/
choose.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const shapeone =document.getElementById('shapeone');
const shapetwo =document.getElementById('shapetwo');
//here we are making variable check which changes when we click on options
//this check get updated in localstorage and then we get redirected to game page
var check=true;
console.log('hi')
// for shapeone
shapeone.addEventListener('click',()=>{
check=true;
console.log(check)
localStorage.setItem('check',check)
location.href='game.html'
})
// for shapetwo
shapetwo.addEventListener('click',()=>{
check=false;
console.log(check)
localStorage.setItem('check',check)
location.href='game.html'
})
// catching the audio and playing it on "onload"
const backsoundss = new Audio('./Sound_Source/backgroundsound.mp3')
window.onload=()=>{
backsoundss.play()
}