feat: update new asset
This commit is contained in:
parent
ef5c7023ed
commit
e84eb8044d
46
css/game.css
46
css/game.css
@ -1,6 +1,7 @@
|
||||
body {
|
||||
background-image: url('../asset/pic/qinshihuang/background.png');
|
||||
background-repeat: no-repeat;
|
||||
background-color: rgb(0, 136, 109);
|
||||
}
|
||||
#desktop{
|
||||
position: absolute;
|
||||
@ -14,7 +15,7 @@
|
||||
width: 1024px;
|
||||
height: 1024px;
|
||||
top:50px;
|
||||
left: 0px;
|
||||
left: -100px;
|
||||
}
|
||||
#restaurant .dish img {
|
||||
position: absolute;
|
||||
@ -28,7 +29,7 @@
|
||||
position: absolute;
|
||||
width: 800px;
|
||||
height: 800px;
|
||||
z-index: 3;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
#qinshihuang img{ /* 秦始皇 */
|
||||
@ -61,18 +62,23 @@
|
||||
#dialogueBox img{
|
||||
position: absolute;
|
||||
|
||||
width: 512px;
|
||||
height: 670px;
|
||||
width: 800px;
|
||||
height: 800px;
|
||||
top: -100px;
|
||||
left: -100px;
|
||||
display: none;
|
||||
}
|
||||
#dialogueText {
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
top: 170px;
|
||||
left: 100px;
|
||||
width: 340px;
|
||||
height: 128px;
|
||||
font-size: 40px;
|
||||
width: 400px;
|
||||
height: 150px;
|
||||
font-size: 25px;
|
||||
text-align: center; /* 水平居中 */
|
||||
|
||||
}
|
||||
#
|
||||
#customer1 img{ /* 中年男 */
|
||||
display: none;
|
||||
}
|
||||
@ -83,39 +89,51 @@
|
||||
display: none;
|
||||
}
|
||||
#customer2 img{ /* 小女孩 */
|
||||
top:150px !important;
|
||||
display: none;
|
||||
}
|
||||
#customer2-2 img{ /* unhappy小女孩 */
|
||||
top:150px !important;
|
||||
display: none;
|
||||
}
|
||||
#customer2-3 img{ /* angry小女孩 */
|
||||
top:150px !important;
|
||||
display: none;
|
||||
}
|
||||
#customer3 img{ /* 老奶奶 */
|
||||
top:100px !important;
|
||||
display: none;
|
||||
}
|
||||
#customer3-2 img{ /* 老奶奶 */
|
||||
#customer3-2 img{ /* unhappy老奶奶 */
|
||||
top:100px !important;
|
||||
display: none;
|
||||
}
|
||||
#customer3-3 img{ /* 老奶奶 */
|
||||
#customer3-3 img{ /* unhappy老奶奶 */
|
||||
top:100px !important;
|
||||
display: none;
|
||||
}
|
||||
#mapo-tofu img{ /* 麻婆豆腐 */
|
||||
left: 630px;
|
||||
display: none;
|
||||
}
|
||||
#roast-duck img{ /* 烤鸭 */
|
||||
left: 250px;
|
||||
left: 850px;
|
||||
top: 620px !important;
|
||||
width: 340px !important;
|
||||
height: 340px !important;
|
||||
display: none;
|
||||
}
|
||||
#yangzhou-fried-rice img{
|
||||
left: 485px;
|
||||
left: 250px;
|
||||
top: 730px !important;
|
||||
width: 200px !important;
|
||||
height: 200px !important;
|
||||
display: none;
|
||||
}
|
||||
#braised-prawns img{
|
||||
left: 700px;
|
||||
left: 430px;
|
||||
display: none;
|
||||
}
|
||||
#kung-pao-chicken img{
|
||||
left: 900px;
|
||||
display: none;
|
||||
}
|
||||
|
@ -34,6 +34,11 @@
|
||||
<div id="dialogueText" class="dialogueText">
|
||||
|
||||
</div>
|
||||
<div id="hint" class="hint">
|
||||
<img src="asset/pic/qinshihuang/hint_buttom.png" alt="提示">
|
||||
<div id="hintpage" class="hintpage"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="customer1" class="customer">
|
||||
|
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user