Making count reset for each word
<p>In my spelling game there is a grid that is populated with words that are hidden from the user. The aim of the game is to spell these words with the aid of a sound and a picture. The user spells a word by clicking the relevant letters onto the grid.</p>

<p>If the user gets a word wrong the word will glow red. If this happens 3 times then the user will be given the opportunity to move onto the next word with the aid of a button that will appear on the 3rd incorrect attempt.</p>

<p>At the moment this works but I have just come across an error by which the incorrect count carries over. For example if the user gets 2 incorrect attempts on one word then gets it right it moves on to the next. It will then only take one incorrect answer on that word for the user to be given the move on option. Basically I need a way for the count to reset every time it moves on to the next word.</p>

<p>This code counts the number of wrong attempts and then after 3 makes the button (".minibutton") visible.</p>

<pre><code>    var score = {
    right: 0,
    wrong: 0,
    attempts: 0
};

    score.wrong++;

        if (score.wrong == 3) {

            $(".minibutton").css('visibility', 'visible');
            $('.next').css('visibility', 'visible');
         }
</code></pre>

<p>A fiddle to help - <a href="http://jsfiddle.net/smilburn/7Y7A5/4/">http://jsfiddle.net/smilburn/7Y7A5/4/</a> (Sound warning!)</p>
