feat: rename empire

This commit is contained in:
sangge 2023-12-24 21:41:21 +08:00
parent f6e677e885
commit 604ee009ef

View File

@ -22,10 +22,10 @@ const customers = [
const RandomCustomerIndex = Math.floor(Math.random() * customers.length); const RandomCustomerIndex = Math.floor(Math.random() * customers.length);
const louises = [ const nixones = [
'#louis img', '#nixon img',
'#louis1 img', '#nixon1 img',
'#louis2 img' '#nixon2 img'
] ]
function checkAnswer(dishName){ function checkAnswer(dishName){
@ -53,7 +53,7 @@ function handleClick(dishName) {
console.log("恭喜,你选对了!"); console.log("恭喜,你选对了!");
if (currentIndex == 9){ if (currentIndex == 9){
setTimeout(function() { setTimeout(function() {
window.location.href = 'louiswin.html'; window.location.href = 'nixonwin.html';
}, 2000); }, 2000);
}else{ }else{
@ -61,9 +61,9 @@ function handleClick(dishName) {
hideElement(customers[RandomCustomerIndex][failedTimes]); hideElement(customers[RandomCustomerIndex][failedTimes]);
showElement(customers[RandomCustomerIndex][0]); showElement(customers[RandomCustomerIndex][0]);
// louis safe // nixon safe
hideElement(louises[failedTimes]) hideElement(nixones[failedTimes])
showElement(louises) showElement(nixones)
failedTimes = 0; failedTimes = 0;
@ -84,8 +84,8 @@ function handleClick(dishName) {
hideElement(customers[RandomCustomerIndex][0]) hideElement(customers[RandomCustomerIndex][0])
showElement(customers[RandomCustomerIndex][1]) showElement(customers[RandomCustomerIndex][1])
hideElement(louises[0]) hideElement(nixones[0])
showElement(louises[1]) showElement(nixones[1])
break; break;
case 2: case 2:
hideElement(customers[RandomCustomerIndex][1]) hideElement(customers[RandomCustomerIndex][1])
@ -93,11 +93,11 @@ function handleClick(dishName) {
break; break;
case 3: case 3:
hideElement(louises[1]) hideElement(nixones[1])
showElement(louises[2]) showElement(nixones[2])
// Delay for 2 seconds before redirecting // Delay for 2 seconds before redirecting
setTimeout(function() { setTimeout(function() {
window.location.href = 'louislose.html'; window.location.href = 'nixonlose.html';
}, 2000); }, 2000);
// 这里可以添加结束游戏或其他逻辑 // 这里可以添加结束游戏或其他逻辑
break; break;
@ -168,8 +168,8 @@ document.addEventListener("DOMContentLoaded", function() {
// Show a random customer // Show a random customer
showElement(customers[RandomCustomerIndex][0]); showElement(customers[RandomCustomerIndex][0]);
// Show normal louis // Show normal nixon
showElement('#louis img'); showElement('#nixon img');
// Show hint bottom // Show hint bottom
showElement('#hint img') showElement('#hint img')