You give the box an instance variable, and say box on collision with enemy subtract 1 from box.variable. As for the colour, the logic could change depending if it is 34 different colours or just alternating between 2 colours for example. You could add 34 frames to the box animation and set the box frame to box.variable so they match, i.e. when box is 34, it shows frame 34 of the animation.