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 {
|
body {
|
||||||
background-image: url('../asset/pic/qinshihuang/background.png');
|
background-image: url('../asset/pic/qinshihuang/background.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
background-color: rgb(0, 136, 109);
|
||||||
}
|
}
|
||||||
#desktop{
|
#desktop{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -14,7 +15,7 @@
|
|||||||
width: 1024px;
|
width: 1024px;
|
||||||
height: 1024px;
|
height: 1024px;
|
||||||
top:50px;
|
top:50px;
|
||||||
left: 0px;
|
left: -100px;
|
||||||
}
|
}
|
||||||
#restaurant .dish img {
|
#restaurant .dish img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -28,7 +29,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
width: 800px;
|
width: 800px;
|
||||||
height: 800px;
|
height: 800px;
|
||||||
z-index: 3;
|
z-index: 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
#qinshihuang img{ /* 秦始皇 */
|
#qinshihuang img{ /* 秦始皇 */
|
||||||
@ -61,18 +62,23 @@
|
|||||||
#dialogueBox img{
|
#dialogueBox img{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 670px;
|
height: 800px;
|
||||||
|
top: -100px;
|
||||||
|
left: -100px;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#dialogueText {
|
#dialogueText {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 200px;
|
top: 170px;
|
||||||
left: 100px;
|
left: 100px;
|
||||||
width: 340px;
|
width: 400px;
|
||||||
height: 128px;
|
height: 150px;
|
||||||
font-size: 40px;
|
font-size: 25px;
|
||||||
|
text-align: center; /* 水平居中 */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#
|
||||||
#customer1 img{ /* 中年男 */
|
#customer1 img{ /* 中年男 */
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -83,39 +89,51 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#customer2 img{ /* 小女孩 */
|
#customer2 img{ /* 小女孩 */
|
||||||
|
top:150px !important;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#customer2-2 img{ /* unhappy小女孩 */
|
#customer2-2 img{ /* unhappy小女孩 */
|
||||||
|
top:150px !important;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#customer2-3 img{ /* angry小女孩 */
|
#customer2-3 img{ /* angry小女孩 */
|
||||||
|
top:150px !important;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#customer3 img{ /* 老奶奶 */
|
#customer3 img{ /* 老奶奶 */
|
||||||
|
top:100px !important;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#customer3-2 img{ /* 老奶奶 */
|
#customer3-2 img{ /* unhappy老奶奶 */
|
||||||
|
top:100px !important;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#customer3-3 img{ /* 老奶奶 */
|
#customer3-3 img{ /* unhappy老奶奶 */
|
||||||
|
top:100px !important;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#mapo-tofu img{ /* 麻婆豆腐 */
|
#mapo-tofu img{ /* 麻婆豆腐 */
|
||||||
|
left: 630px;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#roast-duck img{ /* 烤鸭 */
|
#roast-duck img{ /* 烤鸭 */
|
||||||
left: 250px;
|
left: 850px;
|
||||||
|
top: 620px !important;
|
||||||
|
width: 340px !important;
|
||||||
|
height: 340px !important;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#yangzhou-fried-rice img{
|
#yangzhou-fried-rice img{
|
||||||
left: 485px;
|
left: 250px;
|
||||||
|
top: 730px !important;
|
||||||
|
width: 200px !important;
|
||||||
|
height: 200px !important;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#braised-prawns img{
|
#braised-prawns img{
|
||||||
left: 700px;
|
left: 430px;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#kung-pao-chicken img{
|
#kung-pao-chicken img{
|
||||||
left: 900px;
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,11 @@
|
|||||||
<div id="dialogueText" class="dialogueText">
|
<div id="dialogueText" class="dialogueText">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div id="hint" class="hint">
|
||||||
|
<img src="asset/pic/qinshihuang/hint_buttom.png" alt="提示">
|
||||||
|
<div id="hintpage" class="hintpage"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="customer1" class="customer">
|
<div id="customer1" class="customer">
|
||||||
|
32
js/game.js
32
js/game.js
@ -42,10 +42,16 @@ function handleClick(dishName) {
|
|||||||
console.log("恭喜,你选对了!");
|
console.log("恭喜,你选对了!");
|
||||||
if (currentIndex == 9){
|
if (currentIndex == 9){
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
window.location.href = 'gameover.html';
|
window.location.href = 'win.html';
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
// customer calm down
|
||||||
|
hideElement(customers[RandomCustomerIndex][failedTimes]);
|
||||||
|
failedTimes = 0;
|
||||||
|
showElement(customers[RandomCustomerIndex][0]);
|
||||||
|
|
||||||
|
// display next question
|
||||||
currentIndex = currentIndex + 1
|
currentIndex = currentIndex + 1
|
||||||
var nextQuestion = questions[QAlist[currentIndex]];
|
var nextQuestion = questions[QAlist[currentIndex]];
|
||||||
document.getElementById("dialogueText").innerHTML = nextQuestion;
|
document.getElementById("dialogueText").innerHTML = nextQuestion;
|
||||||
@ -55,7 +61,7 @@ function handleClick(dishName) {
|
|||||||
} else {
|
} else {
|
||||||
// 错误答案的处理逻辑
|
// 错误答案的处理逻辑
|
||||||
console.log("不幸,这不是正确答案。");
|
console.log("不幸,这不是正确答案。");
|
||||||
failedTimes = failedTimes + 1
|
failedTimes = failedTimes + 1;
|
||||||
switch (failedTimes) {
|
switch (failedTimes) {
|
||||||
case 1:
|
case 1:
|
||||||
hideElement(customers[RandomCustomerIndex][0])
|
hideElement(customers[RandomCustomerIndex][0])
|
||||||
@ -70,7 +76,7 @@ function handleClick(dishName) {
|
|||||||
showElement(qinshihuangs[RandomQinShiHuangIndex])
|
showElement(qinshihuangs[RandomQinShiHuangIndex])
|
||||||
// Delay for 2 seconds before redirecting
|
// Delay for 2 seconds before redirecting
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
window.location.href = 'gameover.html';
|
window.location.href = 'lose.html';
|
||||||
}, 2000);
|
}, 2000);
|
||||||
// 这里可以添加结束游戏或其他逻辑
|
// 这里可以添加结束游戏或其他逻辑
|
||||||
break;
|
break;
|
||||||
@ -84,16 +90,16 @@ var failedTimes = 0
|
|||||||
|
|
||||||
// Questions list
|
// Questions list
|
||||||
var questions = [
|
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
|
// Answers list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user