Actually, you would only need 25 varibles.
Create a page where it's just the switch. Then create a 2nd page, where the varible is equal to one. Have the animation be of the yellow rock. Do the same thing, only this time, the rock is brown, and the varible must be 2 or higher. Then, repeat, one varible for each rock. Then, to change the rocks, have it on hero touch, and when he steps on it, add 1 to each varible that corresponds to the rocks you want to change. But yeah, that;s a simple as I can make it.