I'm making a game where when on level 1, you must click 1 white cake among a bunch of chocolate ones. There is one. And on level two, you must click two white cakes. And so on. But the code I've done is acting a bit randomly, ie the levels break at a certain point, usually level 7 or 8. And sometimes if it's for example level 4, it might show 3 cakes.
Here is all of the code:
<img src="http://i46.tinypic.com/15r16q1.png" border="0" />
By the way, there is only one layout, Layout 1. Levels are done through the global variable.