Skip to content

Commit

Permalink
Efeitos sonoros
Browse files Browse the repository at this point in the history
  • Loading branch information
marizagat committed Jan 25, 2019
1 parent 1adcb8b commit 02d7fd9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
9 changes: 5 additions & 4 deletions js/controle.js
Expand Up @@ -9,6 +9,7 @@

var background
background = document.getElementById("background");
background.loop = true
var origemMenu
var origemDerrota

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion js/eventosclasses.js
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions js/logica.js
Expand Up @@ -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");
Expand All @@ -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);

Expand All @@ -63,7 +61,6 @@ function iniciar()

//Pegamos uma palavra aleatoria


jogo.palavraSorteada = jogo.bd[jogo.bdAux[jogo.sorteio]].palavra;

jogo.aux = "";
Expand Down Expand Up @@ -119,8 +116,6 @@ function update()
jogo.pontosParciais = aux;
jogo.pontos = jogo.pontos + aux;



$('<div>').attr({'id': 'palavraCerta',})
.appendTo(el);

Expand Down Expand Up @@ -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();
}
}

Expand Down
1 change: 0 additions & 1 deletion js/rest.js
@@ -1,4 +1,3 @@

var ranking;

var maquina = 'localhost';
Expand Down
2 changes: 0 additions & 2 deletions js/script.js
Expand Up @@ -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);
Expand Down

0 comments on commit 02d7fd9

Please sign in to comment.