Update
This commit is contained in:
BIN
uebung10/falsch.mp3
Normal file
BIN
uebung10/falsch.mp3
Normal file
Binary file not shown.
@@ -54,6 +54,8 @@
|
|||||||
answer2.addEventListener('click', answerQuestion);
|
answer2.addEventListener('click', answerQuestion);
|
||||||
|
|
||||||
var startAudio = new Audio('spielstarten.mp3');
|
var startAudio = new Audio('spielstarten.mp3');
|
||||||
|
var richtigAudio = new Audio('richtig.mp3');
|
||||||
|
var falschAudio = new Audio('falsch.mp3');
|
||||||
|
|
||||||
//Start game
|
//Start game
|
||||||
function listener() {
|
function listener() {
|
||||||
@@ -98,10 +100,12 @@ function answerQuestion(event) {
|
|||||||
console.log(target.nodeName);
|
console.log(target.nodeName);
|
||||||
|
|
||||||
if (target.id.substr(-1) == question.solution) {
|
if (target.id.substr(-1) == question.solution) {
|
||||||
|
richtigAudio.play();
|
||||||
console.log("richtig");
|
console.log("richtig");
|
||||||
target.style.backgroundColor = "green";
|
target.style.backgroundColor = "green";
|
||||||
rightAnswers++;
|
rightAnswers++;
|
||||||
} else {
|
} else {
|
||||||
|
falschAudio.play();
|
||||||
target.style.backgroundColor = "red";
|
target.style.backgroundColor = "red";
|
||||||
document.getElementById("answer" + question.solution).style.backgroundColor == "green";
|
document.getElementById("answer" + question.solution).style.backgroundColor == "green";
|
||||||
}
|
}
|
||||||
|
BIN
uebung10/richtig.mp3
Normal file
BIN
uebung10/richtig.mp3
Normal file
Binary file not shown.
Reference in New Issue
Block a user