OK, I did what you said, but it's still not working. This time, it works fine on level one, but on level two and on all of the other nine levels, the hearts just ignore their commands and displays way more hearts than it's supposed to. For example, on level two, it should show only two hearts, but instead, it shows this:
Do I have to use a global variable or something?