-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.js
54 lines (49 loc) · 1.93 KB
/
variables.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const whitebtn = document.querySelector('#white');
const blackbtn = document.querySelector('#black');
const friendbtn = document.querySelector('#friend');
const toggleButton = document.querySelector('.toggle-button');
const navbarLinks = document.querySelector('.navbar-links');
const spellbtn = document.querySelector('.spell');
const board = document.querySelector('.main-container');
const body = document.querySelector('body');
let filledcells = [];
let filledBotcells = [];
let validCellsArray = [];
let currentIndex = null;
let memory = null;
let memoryRicochet = null;
let memoryReplace = null;
let htmlMemory = null;
let isBlackTurn = false;
let ispaused = true;
let isreplay = false;
let movesMemory = [];
let isShooting = false;
let currentMove = 0;
const left = document.querySelector('.left');
const right = document.querySelector('.right');
const swap = document.querySelector('.swap');
const pause_resume = document.querySelector('.pause_resume');
const reset = document.querySelector('.reset');
const undo = document.querySelector('#undo');
const redo = document.querySelector('#redo');
const replaybtn = document.querySelector('#replay');
const listSet = document.querySelector('.history');
const dialog= document.querySelector('.popup');
let intervalId = null;
let timeoutId = null;
let whiteCash=0;
let blackCash=0;
const diatext = document.querySelector('.diatext');
let cash1 = document.querySelector('#cash1');
let cash2 = document.querySelector('#cash2');
const warning = document.querySelector('.warning');
const close = document.querySelector('#close');
let bulletaudio = new Audio("/sounds/bullet.wav");
let shootaudio = new Audio("/sounds/bullet-shoot.wav");
let gameoveraudio = new Audio("/sounds/game-over.wav");
let gameover2audio = new Audio("/sounds/game-over-2.wav");
let piecedesaudio = new Audio("/sounds/half-ricochet-destroy.mp3");
toggleButton.addEventListener('click', () => {
navbarLinks.classList.toggle('active');
});