I am developing a metroidvania-styled game, and looking for an efficient way to track collected items, and enemies killed.
One time collectibles are easy to handle since you only collect them once, thereby you can have a flag determining whether it has been collected or not. However, remembering a repeating collectible that occurs in large quantities across the game is another matter. If a level/area is containing 256 coins, and you collect 86 of them, then leave the frame; when you return to this frame, how do you account for the correct 86 coins collected, and prevent them from reappearing at their respective positions? The same dilemma also applies to previously killed enemies.
I am assuming an array is the answer here, but I have been unable to make it work properly.
If anyone has an effective solution to this, I would be very thankful for sharing it.