feat: finish game
This commit is contained in:
16
js/game.js
16
js/game.js
@@ -35,6 +35,19 @@ function checkAnswer(dishName){
|
||||
return answer == dishName
|
||||
}
|
||||
|
||||
function handleHint(hint) {
|
||||
console.log(hint + " 被点击了!");
|
||||
if (hint == "bottom") {
|
||||
hideElement("#hint img")
|
||||
showElement("#hintpage img")
|
||||
}
|
||||
if (hint == "page") {
|
||||
hideElement("#hintpage img")
|
||||
showElement("#hint img")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function handleClick(dishName) {
|
||||
console.log(dishName + " 被点击了!");
|
||||
if (checkAnswer(dishName)){
|
||||
@@ -150,6 +163,9 @@ document.addEventListener("DOMContentLoaded", function() {
|
||||
// Show normal Qin Shi Huang
|
||||
showElement('#qinshihuang img');
|
||||
|
||||
// Show hint bottom
|
||||
showElement('#hint img')
|
||||
|
||||
// Show first question
|
||||
var randomQuestion = questions[QAlist[currentIndex]];
|
||||
document.getElementById("dialogueText").innerHTML = randomQuestion;
|
||||
|
Reference in New Issue
Block a user