Hi. You may remember me from such topics as 'Help, I don't know how to make gravity' or 'Help. jumping does not work.'
Today I am asking about the title. In my game, I have it set up so you go from one screen (a world) to the other (a different world) by hitting a certain part in the boundary of the border of the world. And, using this, you can also go back a screen, so you can backtrack and such. It's meant to be an exploration platformer I guess. My problem is, I want to have there be a certain amount of coins you need to collect before you unlock the area that leads to the end of the game. To do this, I want to be able to track if a player has gotten a coin, and if they have, do not spawn that coin if they re-enter that screen. But I do not know how to track that. I've tried using boolean's in a superclass, with all the other worlds as subclasses, but that didn't seem to work. I think it perhaps will have something to do with the score class, but I haven't been able to wrap my head around that.
TL;DR How do I keep track of booleans when new worlds are created.
I can upload a scenario at request, can't ATM.

