diff --git a/src/game.js b/src/game.js index d0464ad..d307f3f 100644 --- a/src/game.js +++ b/src/game.js @@ -1,4 +1,3 @@ -'use strict'; //General var MOBILE_WIDH = 930; var WINDOW_W = $(window).width(); diff --git a/src/game.min.js b/src/game.min.js deleted file mode 100644 index 658b57f..0000000 --- a/src/game.min.js +++ /dev/null @@ -1 +0,0 @@ -function newGame(a){for(word=a[Math.floor(Math.random()*a.length)],incercari=6,charArray1=[],charArray2=[],missArray=[],i=0;i=WINDOW_W?(ion.sound.play("ta_da"),alert("Felicita e tenersi per mano"),void window.location.reload()):(WINDOW_W>MOBILE_WIDH&&$("#gamewon").fadeIn("slow"),$(document).off(),ion.sound.play("ta_da"),$("#gamewon img").click(function(){window.location.reload()}),void $(document).on("keypress",function(a){var r=a.keyCode||a.which;13==r&&window.location.reload()}))}function gameOver(){return MOBILE_WIDH>=WINDOW_W?(ion.sound.play("sad_trombone"),alert("Ai pierdut! CUVANT: "+word),void window.location.reload()):($("#incercari_msg").html("Game Over!"),$("#lose_word").html(word),WINDOW_W>MOBILE_WIDH&&$("#gameover").fadeIn("slow"),$(document).off(),ion.sound.play("sad_trombone"),$("#gameover img").click(function(){window.location.reload()}),void $(document).on("keypress",function(a){var r=a.keyCode||a.which;13==r&&window.location.reload()}))}function check(a){return word.indexOf(a)>-1}function updateLetters(a){var r=missArray.length;$.inArray(a,missArray)>-1||(missArray[r]=a),$(".litere").html(missArray+" ")}function updateArray(a){for(a=a.toLowerCase(),i=0;iSpanzuratoarea created by@Niutenisu

');var listaCuvinte=localStorage.getItem("listaCuvinte");null!=listaCuvinte?($("select[name=lista_cuvinte]").val(listaCuvinte),newGame(eval(listaCuvinte))):newGame(animale_eu),$("select[name=lista_cuvinte]").on("change",function(){localStorage.setItem("listaCuvinte",$(this).val())}).next().click(function(){newGame(eval($(this).prev().val()))}),$("#game").fadeIn("slow")}),$(document).on("keypress",function(a){var r=a.keyCode||a.which,e=String.fromCharCode(r).toLowerCase();ion.sound.play("button_tiny"),$(".litera_msg").fadeIn("slow"),$(".litera").html(e),check(e)?($(".litera_msg2").html("aceasta litera se afla in cuvant."),updateArray(e),$(".word").html(charArray1)):($(".litera_msg2").html("aceasta litera nu se afla in cuvant."),incercari--,incercari>-1&&($("#human").attr("src","./img/"+incercari+".png"),$("#incercari").html(incercari),updateLetters(e),0==incercari&&gameOver())),arraysEqual(charArray1,charArray2)&&gameWon()}); diff --git a/src/index.html b/src/index.html index 0f937c2..ec9d43d 100644 --- a/src/index.html +++ b/src/index.html @@ -24,44 +24,52 @@

Incearca sa ghicesti cuvantul:

-

Introdu aici litera:

+

Introdu aici litera:

+ + + + -

+

- - + - + - + - + - + - + -
+ -
+
-

Incearca sa ghicesti cuvantul:

+

Incearca sa ghicesti cuvantul:

-

Apasa pe o litera de pe tastatura!

+

Apasa pe o litera de pe tastatura!