In my writing game there is a grid filled with words. Words are hidden, and the goal of the game is to record a word highlighted with sound and image.
To select a word, click the "Next" button. At the moment, if you pronounce the word correctly, it says βwell doneβ, and you can move on to the next word, but if you pronounce it incorrectly, you should continue to try the word until it is completed.
Since the game is for children, I donβt think this is the best approach, so I would like to make it possible for you to advance after three wrong attempts.
I played with the script so much, trying to set the counters on the wrong attempts, and then activate the button, but cannot make it work. Can someone please help me?
Here is the script for the button
var noExist = $('td[data-word=' + listOfWords[rndWord].name + ']').hasClass('wordglow2'); if (noExist) { $('.minibutton').click(); } else { $('.minibutton').click('disable'); $("#mysoundclip").attr('src', listOfWords[rndWord].audio); audio.play(); $("#mypic").attr('src', listOfWords[rndWord].pic); pic.show(); } });
"wordglow2" is the style used if the word is spelled correctly. Here is a fiddle to help you understand ... http://jsfiddle.net/smilburn/ZAfVZ/4/
source share