feat: add elizabeth
This commit is contained in:
parent
32fe3a193b
commit
3c705124c6
@ -1,5 +1,5 @@
|
|||||||
body {
|
body {
|
||||||
background-image: url('../asset/pic/louis16/LouisXVI_Restaurant.png');
|
background-image: url('../asset/pic/elizabeth/background.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-color: rgb(0, 136, 109);
|
background-color: rgb(0, 136, 109);
|
||||||
}
|
}
|
||||||
@ -36,17 +36,17 @@
|
|||||||
z-index: 4;
|
z-index: 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
#louis img{ /* louis 16 */
|
#elizabeth img{ /* elizabeth */
|
||||||
top: 235px;
|
top: 235px;
|
||||||
left: 1050px;
|
left: 1050px;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#louis1 img{ /* 断头台 */
|
#elizabeth1 img{ /* dying */
|
||||||
top: 235px;
|
top: 235px;
|
||||||
left: 1050px;
|
left: 1050px;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#louis2 img{ /* 死 */
|
#elizabeth2 img{ /* 死 */
|
||||||
top: 235px;
|
top: 235px;
|
||||||
left: 1050px;
|
left: 1050px;
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>路易十六餐厅</title>
|
<title>伊丽莎白餐厅</title>
|
||||||
<link rel="stylesheet" type="text/css" href="css/elizabethgame.css">
|
<link rel="stylesheet" type="text/css" href="css/elizabethgame.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@ -15,18 +15,18 @@
|
|||||||
<!-- 游戏的界面元素 -->
|
<!-- 游戏的界面元素 -->
|
||||||
<div id="restaurant">
|
<div id="restaurant">
|
||||||
<div id="desktop">
|
<div id="desktop">
|
||||||
<img src="asset/pic/louis16/LouisXVI_RestaurantTable.png" alt="desktop">
|
<img src="asset/pic/elizabeth/desk.png" alt="desktop">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- empires elements-->
|
<!-- empires elements-->
|
||||||
<div id="louis" class="empire">
|
<div id="elizabeth" class="empire">
|
||||||
<img src="asset/pic/louis16/LouisXVI_Normal.png" alt="louis16">
|
<img src="asset/pic/elizabeth/Elizabeth_normal.png" alt="elizabeth">
|
||||||
</div>
|
</div>
|
||||||
<div id="louis1" class="empire">
|
<div id="elizabeth1" class="empire">
|
||||||
<img src="asset/pic/louis16/LouisXVI_Dying.png" alt="砍头台">
|
<img src="asset/pic/elizabeth/Elizabeth_dangerous.png" alt="dying">
|
||||||
</div>
|
</div>
|
||||||
<div id="louis2" class="empire">
|
<div id="elizabeth2" class="empire">
|
||||||
<img src="asset/pic/louis16/LouisXVI_Dead.png" alt="死">
|
<img src="asset/pic/elizabeth/Elizabeth_die.png" alt="死">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- customers elements -->
|
<!-- customers elements -->
|
||||||
|
@ -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 elizabethes = [
|
||||||
'#louis img',
|
'#elizabeth img',
|
||||||
'#louis1 img',
|
'#elizabeth1 img',
|
||||||
'#louis2 img'
|
'#elizabeth2 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 = 'elizabethwin.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
|
// elizabeth safe
|
||||||
hideElement(louises[failedTimes])
|
hideElement(elizabethes[failedTimes])
|
||||||
showElement(louises)
|
showElement(elizabethes)
|
||||||
|
|
||||||
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(elizabethes[0])
|
||||||
showElement(louises[1])
|
showElement(elizabethes[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(elizabethes[1])
|
||||||
showElement(louises[2])
|
showElement(elizabethes[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 = 'elizabethlose.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 elizabeth
|
||||||
showElement('#louis img');
|
showElement('#elizabeth img');
|
||||||
|
|
||||||
// Show hint bottom
|
// Show hint bottom
|
||||||
showElement('#hint img')
|
showElement('#hint img')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user