Skip to content

Commit

Permalink
finish fixing timer, update audio.js with final files
Browse files Browse the repository at this point in the history
  • Loading branch information
rbozek committed Jan 4, 2024
1 parent e409550 commit 4e22f12
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
Binary file added assets/audio/pianowrong.wav
Binary file not shown.
1 change: 1 addition & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
body {
background-image: url('../assets/images/tile-orange.jpg');
background-size: cover;
/* background-repeat: no-repeat; */
background-color: rgb(251, 122, 0);
font-family: sans-serif;
display: flex;
Expand Down
13 changes: 7 additions & 6 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ function renderQuestionCat1() {
answers.appendChild(renderedAnswer)
})
}

function renderQuestionCat2() {
rulesBtnDiv.style.display = 'none'
currentCategory = 2
Expand Down Expand Up @@ -151,18 +150,20 @@ function playerChooseAnswer(evt){
function roundOver(){
// console.log('testing gameover state');
stopTimer()
if (playerScore >= 3) {
playerScoreContainer.innerHTML = `Your score is:<br> ${ playerScore } <br> Perfect. You are an evolved human.`
} else if (playerScore < 3 && playerScore > 1) {
playerScoreContainer.innerHTML = `Your score is:<br> ${ playerScore } <br> Nice work. Keep practicing (at life).`
countdown.textContent = ``
if (playerScore >= 5) {
playerScoreContainer.innerHTML = `Your score is:<br> ${ playerScore }<br>Perfect. You are an evolved human.`
} else if (playerScore < 5 && playerScore > 1) {
playerScoreContainer.innerHTML = `Your score is:<br> ${ playerScore }<br>Nice work. Keep practicing (at life).`
} else {
playerScoreContainer.innerHTML = `Your score is:<br> ${ playerScore } <br> No offense but you might be a bad person.`
playerScoreContainer.innerHTML = `Your score is:<br> ${ playerScore }<br>No offense but you might be a bad person.`
}
}

function resetGame(){
rulesBtnDiv.style.display = ''
playerScoreContainer.innerHTML = initialScoreState;
countdown.textContent = ``
question.textContent = '' // this line isnt needed?
answers.innerHTML = ''
currentQuesIdx = 0
Expand Down
8 changes: 7 additions & 1 deletion js/audio.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
let click = new Audio('../assets/audio/click.wav')
let ding = new Audio('../assets/audio/ding.wav')
let sadTrombone = new Audio('../assets/audio/sadtrombone.wav')
let pianoWrong = new Audio('../assets/audio/pianowrong.wav')
let levelSuccess = new Audio('../assets/audio/levelsuccesstrimmed.mp3')
let levelFail = new Audio('../assets/audio/levelfailtrimmed.mp3')

Expand All @@ -16,6 +17,10 @@ function playTrombone() {
sadTrombone.volume = 0.15
sadTrombone.play()
}
function playPianoWrong() {
pianoWrong.volume = 0.15
pianoWrong.play()
}
function playLevelSucceed() {
levelSuccess.volume = 0.15
levelSuccess.play()
Expand All @@ -29,6 +34,7 @@ export {
playClick,
playDing,
playTrombone,
playPianoWrong,
playLevelSucceed,
playLevelFail
}
}
4 changes: 2 additions & 2 deletions js/pseudocode.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
// // -line 99! I think ChatGPT came up with a gurd idear! (saved bookmark)
// // PROBLEM - FIXED!--I have "rulesBtnDiv.innerHTML" inside function ONLY FOR CATEGORY 1 - but for some reason it activates even if i'm using category 2 - im calling cat1() inside playerAnswer too! DAMMIT! how can i get that global? - FIXED!!! conditional

-Check playerScore!! might be a little wonky
// // -Check playerScore!! might be a little wonky

// timer for entire category, not each question
// // timer for entire category, not each question
// ** sounds: sound for button clicks, add sound for playerScore, and diff sound for perfect score -> button to turn off sounds??
// ** images: favicon to page DONE, monk image for top of page before game starts
// color scheme: warm colors
Expand Down

0 comments on commit 4e22f12

Please sign in to comment.