Memory Game Part 4. The State Machine or Algorithm for sprites is built using sprite variables COLOR and the Costume (yes, the costume name can act as a variable, and actually it is a part of the sprite’s state), as well as the global variable 'now-in-game', which is changed by the clicked sprites.