From 604ee009efedfc5b1431baf3b696c41b0545f092 Mon Sep 17 00:00:00 2001 From: sangge <2251250136@qq.com> Date: Sun, 24 Dec 2023 21:41:21 +0800 Subject: [PATCH] feat: rename empire --- js/nixongame.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/js/nixongame.js b/js/nixongame.js index 71c7a59..7f2c4fe 100644 --- a/js/nixongame.js +++ b/js/nixongame.js @@ -22,10 +22,10 @@ const customers = [ const RandomCustomerIndex = Math.floor(Math.random() * customers.length); -const louises = [ - '#louis img', - '#louis1 img', - '#louis2 img' +const nixones = [ + '#nixon img', + '#nixon1 img', + '#nixon2 img' ] function checkAnswer(dishName){ @@ -53,7 +53,7 @@ function handleClick(dishName) { console.log("恭喜,你选对了!"); if (currentIndex == 9){ setTimeout(function() { - window.location.href = 'louiswin.html'; + window.location.href = 'nixonwin.html'; }, 2000); }else{ @@ -61,9 +61,9 @@ function handleClick(dishName) { hideElement(customers[RandomCustomerIndex][failedTimes]); showElement(customers[RandomCustomerIndex][0]); - // louis safe - hideElement(louises[failedTimes]) - showElement(louises) + // nixon safe + hideElement(nixones[failedTimes]) + showElement(nixones) failedTimes = 0; @@ -84,8 +84,8 @@ function handleClick(dishName) { hideElement(customers[RandomCustomerIndex][0]) showElement(customers[RandomCustomerIndex][1]) - hideElement(louises[0]) - showElement(louises[1]) + hideElement(nixones[0]) + showElement(nixones[1]) break; case 2: hideElement(customers[RandomCustomerIndex][1]) @@ -93,11 +93,11 @@ function handleClick(dishName) { break; case 3: - hideElement(louises[1]) - showElement(louises[2]) + hideElement(nixones[1]) + showElement(nixones[2]) // Delay for 2 seconds before redirecting setTimeout(function() { - window.location.href = 'louislose.html'; + window.location.href = 'nixonlose.html'; }, 2000); // 这里可以添加结束游戏或其他逻辑 break; @@ -168,8 +168,8 @@ document.addEventListener("DOMContentLoaded", function() { // Show a random customer showElement(customers[RandomCustomerIndex][0]); - // Show normal louis - showElement('#louis img'); + // Show normal nixon + showElement('#nixon img'); // Show hint bottom showElement('#hint img')