Basically this breaks down into two problems
- Saving collected golden stars
- Detecting previously collected golden stars
Saving Collected Golden Stars
When a star is collected you need the save some sort of Star ID to a INI/Array/external file. This ID can be anything that uniquely defines the star within that frame. Example of IDs are Fixed Values and Star position (if the star does not move). The specific ID does not matter so long as each ID matches exactly one star.
Detecting Previously Collected Golden Stars
Once you figure out the saving routine, you can easily detect if a star has been collected. At the start of each frame/level examine the INI/Array/external file for entries which match any ID of any star in the current frame. If any match, that star was previously collected and you can do whatever you need to the star