Skip to content

Commit

Permalink
get reset button working
Browse files Browse the repository at this point in the history
  • Loading branch information
rbozek committed Jan 3, 2024
1 parent 226fa98 commit eabcef2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ function renderQuestionCat1() {
})
}

function playerChooseAnswer(){
function playerChooseAnswer(evt){

// console.log(evt.target.textContent);


currentQuesIdx += 1
if (currentQuesIdx >= questionsCat1.length){
gameOverTest()
}
question.textContent = '' // this line isnt needed?
answers.textContent = ''
answers.innerHTML = ''
console.log(currentQuesIdx);
console.log('player choice click works');
renderQuestionCat1()
Expand All @@ -64,9 +68,7 @@ function gameOverTest(){
function init(){
console.log('reset button works');
playerScore = 0
currQuestionIdx = 0
// let indexReset = currQuestionIdx
// indexReset = 0
currentQuesIdx = 0

// quizOver = false
// letPerfectScore = false
Expand Down

0 comments on commit eabcef2

Please sign in to comment.