I'm not even sure how to title this but I am working on an answer choosing project. One sprite has multiple frames, each representing a different possible answer.
There is a function that spawns 3 instances every x seconds and randomly selects a unique frame for each instance such that there are no duplicates via an array. After the function is called, an event picks a random instance from the 3 newly created instances and selects one of them to be the answer by setting a boolean on the sprite instance to true.
What I'd like to do is take the answer instance and save it's current frame and tally how many times it was picked throughout the runtime so that once a limit of x has been hit, that answer (frame) can no longer be picked by the function choosing which unique frames to select while picking the 3 instances.
I can't seem to wrap my head around how to go about this. If I pop or delete parts of an array the places shift and i can't keep an accurate tally, on top of that I am dealing with two separate arrays which need to talk to each other somehow.
Looking for suggestions as to a better way to go about this