feat: update new asset
This commit is contained in:
34
js/game.js
34
js/game.js
@@ -42,10 +42,16 @@ function handleClick(dishName) {
|
||||
console.log("恭喜,你选对了!");
|
||||
if (currentIndex == 9){
|
||||
setTimeout(function() {
|
||||
window.location.href = 'gameover.html';
|
||||
window.location.href = 'win.html';
|
||||
}, 2000);
|
||||
|
||||
}else{
|
||||
// customer calm down
|
||||
hideElement(customers[RandomCustomerIndex][failedTimes]);
|
||||
failedTimes = 0;
|
||||
showElement(customers[RandomCustomerIndex][0]);
|
||||
|
||||
// display next question
|
||||
currentIndex = currentIndex + 1
|
||||
var nextQuestion = questions[QAlist[currentIndex]];
|
||||
document.getElementById("dialogueText").innerHTML = nextQuestion;
|
||||
@@ -55,7 +61,7 @@ function handleClick(dishName) {
|
||||
} else {
|
||||
// 错误答案的处理逻辑
|
||||
console.log("不幸,这不是正确答案。");
|
||||
failedTimes = failedTimes + 1
|
||||
failedTimes = failedTimes + 1;
|
||||
switch (failedTimes) {
|
||||
case 1:
|
||||
hideElement(customers[RandomCustomerIndex][0])
|
||||
@@ -70,30 +76,30 @@ function handleClick(dishName) {
|
||||
showElement(qinshihuangs[RandomQinShiHuangIndex])
|
||||
// Delay for 2 seconds before redirecting
|
||||
setTimeout(function() {
|
||||
window.location.href = 'gameover.html';
|
||||
window.location.href = 'lose.html';
|
||||
}, 2000);
|
||||
// 这里可以添加结束游戏或其他逻辑
|
||||
break;
|
||||
default:
|
||||
console.log("失败次数:" + failedTimes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var failedTimes = 0
|
||||
|
||||
// Questions list
|
||||
var questions = [
|
||||
"如何建立统一的度量衡体系以加强中央集权?",
|
||||
"如何制定合理的税收政策来增强国库?",
|
||||
"如何组织和动员资源建造长城以防御外敌?",
|
||||
"如何执行禁止私人持有武器的政策?",
|
||||
"如何推广统一的书写系统来加强文化统一?",
|
||||
"如何合理征召士兵并保持军队的高效运作?",
|
||||
"如何处理与儒家思想相关的政治异见?",
|
||||
"如何加强皇帝的集权制度?",
|
||||
"如何建立和维护一个有效的道路交通网络?",
|
||||
"如何处理与周边国家的外交关系?"
|
||||
"How to establish a unified system of metrics to strengthen centralised power?",
|
||||
"How to formulate a reasonable tax policy to strengthen the national treasury?",
|
||||
"How to organise and mobilise resources for the construction of the Great Wall to defend against foreign enemies?",
|
||||
"How to enforce the policy of prohibiting private ownership of weapons?",
|
||||
"How to promote a uniform writing system to strengthen cultural unity?",
|
||||
"How to recruit soldiers wisely and keep the army running efficiently?",
|
||||
"How to deal with political dissent arising from different ideas?",
|
||||
"How to strengthen the centralised power system of the emperor?",
|
||||
"How to establish and maintain an effective road transport network?",
|
||||
"How to handle diplomatic relations with neighbouring countries?"
|
||||
];
|
||||
|
||||
// Answers list
|
||||
|
||||
Reference in New Issue
Block a user