diff --git a/js/controle.js b/js/controle.js index d1b0161..6a82fe1 100644 --- a/js/controle.js +++ b/js/controle.js @@ -9,6 +9,7 @@ var background background = document.getElementById("background"); +background.loop = true var origemMenu var origemDerrota @@ -196,9 +197,9 @@ function destruirCamadaCreditos() function criarCamadaVitoria() { - var x = document.getElementById("vitoria"); + var audio = document.getElementById("vitoria"); setTimeout(function(){ - x.play(); + audio.play(); }, 200); var fase; @@ -241,9 +242,9 @@ function destruirCamadaVitoria() function criarCamadaDerrota() { - var x = document.getElementById("derrota"); + var audio = document.getElementById("derrota"); setTimeout(function(){ - x.play(); + audio.play(); }, 400); origemDerrota = 1 diff --git a/js/eventosclasses.js b/js/eventosclasses.js index 76459eb..a244df4 100644 --- a/js/eventosclasses.js +++ b/js/eventosclasses.js @@ -52,7 +52,7 @@ document.body.onkeyup = function(e) if(keyunicode >= 65 && keyunicode <= 90) { - keyunicode +=32; + keyunicode +=32; } //Se o codigo estiver dentro do alfabeto diff --git a/js/logica.js b/js/logica.js index eb632c6..c590be1 100644 --- a/js/logica.js +++ b/js/logica.js @@ -32,7 +32,6 @@ function iniciar() jogo.falador.setAttribute("style", "display: none;"); $("#camadaJogo").append(jogo.falador); - jogo.dicaNaTela = document.createElement("div"); jogo.dicaNaTela.setAttribute("id", "dicaNaTela"); jogo.dicaNaTela.setAttribute("tabIndex", "1"); @@ -53,7 +52,6 @@ function iniciar() jogo.contribuicaoNaTela.setAttribute("class", "customfont"); jogo.contribuicaoNaTela.innerHTML = "ContribuiĆ§Ć£o de: "+jogo.bd[jogo.bdAux[jogo.sorteio]].contribuicao; $("#camadaJogo").append(jogo.contribuicaoNaTela); - } $("#camadaJogo").append(jogo.dicaNaTela); @@ -63,7 +61,6 @@ function iniciar() //Pegamos uma palavra aleatoria - jogo.palavraSorteada = jogo.bd[jogo.bdAux[jogo.sorteio]].palavra; jogo.aux = ""; @@ -119,8 +116,6 @@ function update() jogo.pontosParciais = aux; jogo.pontos = jogo.pontos + aux; - - $('
').attr({'id': 'palavraCerta',}) .appendTo(el); @@ -225,12 +220,19 @@ function verificarErro(_letra) if(!deuErro) { $("#falador").text("Letra Certa"); + + var audio = document.getElementById("letraCerta"); + audio.currentTime = 0 + audio.play() } if(deuErro) { $("#falador").text("Letra Errada"); jogo.erros++; mudarPersonagem(); + + var audio = document.getElementById("letraErrada"); + audio.play(); } } diff --git a/js/rest.js b/js/rest.js index 35fbba0..1b6a68a 100644 --- a/js/rest.js +++ b/js/rest.js @@ -1,4 +1,3 @@ - var ranking; var maquina = 'localhost'; diff --git a/js/script.js b/js/script.js index 76cbf9e..211e22a 100644 --- a/js/script.js +++ b/js/script.js @@ -28,8 +28,6 @@ css.setAttribute("rel", "stylesheet"); css.setAttribute("href", "css/style.css"); document.head.appendChild(css); - - var script = document.createElement("script"); script.setAttribute("src", "js/jquery-1.7.2.js"); pai.appendChild(script);