Remembering collected items and/or enemies killed
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.
Best regards,
Tobias Edvardsen
1 Attachment(s)
FixedValue Array 2nd Example
Since Fixed Values are only unique to each frame. Adding the frame to the Y dimension when an object is collected/destroyed would work if you want to only use one array. I made an updated example that includes 3 frames to demonstrate.