let arr = ["Добро пожаловать в игру!", "Приветствуем в игре!", "Удачи в игре!", " Хай)))!", "О снова ты! Удачи в игре!", "Ты наверное устал. Отдохни!"]
console.log(arr[Math.floor(Math.random()*5)]);
// confirm("Нажимайте по очереди на кнопку следующий ход и двигайтесь до последней клетки!");
const cnvs = document.getElementById('cnvs');
const ctx = cnvs.getContext("2d");
const ground = new Image; ground.src = "fales/Поле.png";
const f_1 = new Image(); f_1.src = "fales/f_1.png";
const f_2 = new Image(); f_2.src = "fales/f_2.png";
const btn = document.getElementById('sh');
let cube = document.getElementById('cubePoint').innerHTML;
let f_1Cords = {
x: 11,
y: 628
}
let f_2Cords = {
x: 90,
y: 628
}
setInterval(()=>{
ctx.drawImage(ground, 0, 0);
ctx.drawImage(f_1, f_1Cords.x, f_1Cords.y);
ctx.drawImage(f_2, f_2Cords.x, f_2Cords.y)
}, 10);
let point_1 = 0;
let point_2 = 0;
let cubePoint = 0;
let why = 0;
function pointStart(cubePoint, point_1, point_2) {
document.getElementById('cubePoint').innerHTML = '(⓿_⓿)';
setTimeout(()=>{
document.getElementById('cubePoint').innerHTML = Number(cubePoint = Math.floor(Math.random()*6+1));
}, 500);
switch(why) {
case 0: why++; break;
case 1: why--; break;
}
if(why == 1 && cubePoint == 1) {
point_1 += 1;
};
if(why == 1 && cubePoint == 2) {
point_1 += 2;
};
if(why == 1 && cubePoint == 3) {
point_1 += 3;
};
if(why == 1 && cubePoint == 4) {
point_1 += 4;
};
if(why == 1 && cubePoint == 5) {
point_1 += 5;
};
if(why == 1 && cubePoint == 6) {
point_1 += 6;
};
if(why == 0 && cubePoint == 1) {
point_2 += 1;
};
if(why == 0 && cubePoint == 2) {
point_2 += 2;
};
if(why == 0 && cubePoint == 3) {
point_2 += 3;
};
if(why == 0 && cubePoint == 4) {
point_2 += 4;
};
if(why == 0 && cubePoint == 5) {
point_2 += 5;
};
if(why == 0 && cubePoint == 6) {
point_2 += 6;
};
setInterval(()=>{
if(point_1 == 2) {f_1Cords.y = 545};
if(point_1 == 3) {f_1Cords.y = 445};
if(point_1 == 4) {f_1Cords.y = 345};
if(point_1 == 5) {f_1Cords.y = 245};
if(point_1 == 6) {f_1Cords.y = 145};
if(point_1 == 7) {f_1Cords.y = 45};
if(point_1 == 8) {f_1Cords.y = 10; f_1Cords.x = 156}
}, 10); //дальше не доделал
return cubePoint;
}
Я совсем не пойму, что делать? Помогите пожалуйста, нужно в кротчайшие сроки!